diff --git a/README.md b/README.md index e9b35f4c..fa0599dc 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,13 @@ If you are using Maven, add this to your pom.xml file: If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-networkconnectivity:0.3.1' +compile 'com.google.cloud:google-cloud-networkconnectivity:0.3.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-networkconnectivity" % "0.3.1" +libraryDependencies += "com.google.cloud" % "google-cloud-networkconnectivity" % "0.3.2" ``` ## Authentication diff --git a/google-cloud-networkconnectivity-bom/pom.xml b/google-cloud-networkconnectivity-bom/pom.xml index cc0c6b04..bc194ea5 100644 --- a/google-cloud-networkconnectivity-bom/pom.xml +++ b/google-cloud-networkconnectivity-bom/pom.xml @@ -63,11 +63,21 @@ grpc-google-cloud-networkconnectivity-v1alpha1 0.3.3-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-networkconnectivity-v1 + 0.3.3-SNAPSHOT + com.google.api.grpc proto-google-cloud-networkconnectivity-v1alpha1 0.3.3-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-networkconnectivity-v1 + 0.3.3-SNAPSHOT + diff --git a/google-cloud-networkconnectivity/pom.xml b/google-cloud-networkconnectivity/pom.xml index c9d66100..a3f39312 100644 --- a/google-cloud-networkconnectivity/pom.xml +++ b/google-cloud-networkconnectivity/pom.xml @@ -42,6 +42,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-networkconnectivity-v1 + com.google.api.grpc proto-google-cloud-networkconnectivity-v1alpha1 @@ -76,6 +80,11 @@ grpc-google-cloud-networkconnectivity-v1alpha1 test + + com.google.api.grpc + grpc-google-cloud-networkconnectivity-v1 + test + com.google.api diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/HubServiceClient.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/HubServiceClient.java new file mode 100644 index 00000000..507cb25d --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/HubServiceClient.java @@ -0,0 +1,1738 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +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.HubServiceStub; +import com.google.cloud.networkconnectivity.v1.stub.HubServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Network Connectivity Center is a hub-and-spoke abstraction for network + * connectivity management in Google Cloud. It reduces operational complexity through a simple, + * centralized connectivity management model. + * + *

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
+ * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+ *   HubName name = HubName.of("[PROJECT]", "[HUB]");
+ *   Hub response = hubServiceClient.getHub(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the HubServiceClient 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 HubServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * HubServiceSettings hubServiceSettings =
+ *     HubServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * HubServiceClient hubServiceClient = HubServiceClient.create(hubServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * HubServiceSettings hubServiceSettings =
+ *     HubServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * HubServiceClient hubServiceClient = HubServiceClient.create(hubServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class HubServiceClient implements BackgroundResource { + private final HubServiceSettings settings; + private final HubServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of HubServiceClient with default settings. */ + public static final HubServiceClient create() throws IOException { + return create(HubServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of HubServiceClient, 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 HubServiceClient create(HubServiceSettings settings) throws IOException { + return new HubServiceClient(settings); + } + + /** + * Constructs an instance of HubServiceClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(HubServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final HubServiceClient create(HubServiceStub stub) { + return new HubServiceClient(stub); + } + + /** + * Constructs an instance of HubServiceClient, 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 HubServiceClient(HubServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((HubServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected HubServiceClient(HubServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final HubServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HubServiceStub 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 hubs in a given project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Hub element : hubServiceClient.listHubs(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 ListHubsPagedResponse listHubs(LocationName parent) { + ListHubsRequest request = + ListHubsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listHubs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists hubs in a given project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Hub element : hubServiceClient.listHubs(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 ListHubsPagedResponse listHubs(String parent) { + ListHubsRequest request = ListHubsRequest.newBuilder().setParent(parent).build(); + return listHubs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists hubs in a given project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   ListHubsRequest request =
+   *       ListHubsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Hub element : hubServiceClient.listHubs(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 ListHubsPagedResponse listHubs(ListHubsRequest request) { + return listHubsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists hubs in a given project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   ListHubsRequest request =
+   *       ListHubsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.listHubsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Hub element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listHubsPagedCallable() { + return stub.listHubsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists hubs in a given project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   ListHubsRequest request =
+   *       ListHubsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListHubsResponse response = hubServiceClient.listHubsCallable().call(request);
+   *     for (Hub element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listHubsCallable() { + return stub.listHubsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   HubName name = HubName.of("[PROJECT]", "[HUB]");
+   *   Hub response = hubServiceClient.getHub(name);
+   * }
+   * }
+ * + * @param name Required. The name of the hub resource to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Hub getHub(HubName name) { + GetHubRequest request = + GetHubRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getHub(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String name = HubName.of("[PROJECT]", "[HUB]").toString();
+   *   Hub response = hubServiceClient.getHub(name);
+   * }
+   * }
+ * + * @param name Required. The name of the hub resource to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Hub getHub(String name) { + GetHubRequest request = GetHubRequest.newBuilder().setName(name).build(); + return getHub(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   GetHubRequest request =
+   *       GetHubRequest.newBuilder().setName(HubName.of("[PROJECT]", "[HUB]").toString()).build();
+   *   Hub response = hubServiceClient.getHub(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 Hub getHub(GetHubRequest request) { + return getHubCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   GetHubRequest request =
+   *       GetHubRequest.newBuilder().setName(HubName.of("[PROJECT]", "[HUB]").toString()).build();
+   *   ApiFuture future = hubServiceClient.getHubCallable().futureCall(request);
+   *   // Do something.
+   *   Hub response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getHubCallable() { + return stub.getHubCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new hub in the specified project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Hub hub = Hub.newBuilder().build();
+   *   String hubId = "hubId99628272";
+   *   Hub response = hubServiceClient.createHubAsync(parent, hub, hubId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource. + * @param hub Required. The initial values for a new hub. + * @param hubId Optional. A unique identifier for the hub. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createHubAsync( + LocationName parent, Hub hub, String hubId) { + CreateHubRequest request = + CreateHubRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setHub(hub) + .setHubId(hubId) + .build(); + return createHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new hub in the specified project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Hub hub = Hub.newBuilder().build();
+   *   String hubId = "hubId99628272";
+   *   Hub response = hubServiceClient.createHubAsync(parent, hub, hubId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource. + * @param hub Required. The initial values for a new hub. + * @param hubId Optional. A unique identifier for the hub. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createHubAsync( + String parent, Hub hub, String hubId) { + CreateHubRequest request = + CreateHubRequest.newBuilder().setParent(parent).setHub(hub).setHubId(hubId).build(); + return createHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new hub in the specified project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   CreateHubRequest request =
+   *       CreateHubRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setHubId("hubId99628272")
+   *           .setHub(Hub.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Hub response = hubServiceClient.createHubAsync(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 createHubAsync(CreateHubRequest request) { + return createHubOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new hub in the specified project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   CreateHubRequest request =
+   *       CreateHubRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setHubId("hubId99628272")
+   *           .setHub(Hub.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       hubServiceClient.createHubOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Hub response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createHubOperationCallable() { + return stub.createHubOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new hub in the specified project. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   CreateHubRequest request =
+   *       CreateHubRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setHubId("hubId99628272")
+   *           .setHub(Hub.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.createHubCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createHubCallable() { + return stub.createHubCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the description and/or labels of the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   Hub hub = Hub.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Hub response = hubServiceClient.updateHubAsync(hub, updateMask).get();
+   * }
+   * }
+ * + * @param hub Required. The state that the hub should be in after the update. + * @param updateMask Optional. In the case of an update to an existing hub, field mask is used to + * specify the fields to be overwritten. The fields specified in the update_mask are relative + * to the resource, not the full request. A field is overwritten if it is in the mask. If the + * user does not provide a mask, then all fields are overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateHubAsync( + Hub hub, FieldMask updateMask) { + UpdateHubRequest request = + UpdateHubRequest.newBuilder().setHub(hub).setUpdateMask(updateMask).build(); + return updateHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the description and/or labels of the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   UpdateHubRequest request =
+   *       UpdateHubRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setHub(Hub.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Hub response = hubServiceClient.updateHubAsync(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 updateHubAsync(UpdateHubRequest request) { + return updateHubOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the description and/or labels of the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   UpdateHubRequest request =
+   *       UpdateHubRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setHub(Hub.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       hubServiceClient.updateHubOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Hub response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateHubOperationCallable() { + return stub.updateHubOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the description and/or labels of the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   UpdateHubRequest request =
+   *       UpdateHubRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setHub(Hub.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.updateHubCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateHubCallable() { + return stub.updateHubCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   HubName name = HubName.of("[PROJECT]", "[HUB]");
+   *   hubServiceClient.deleteHubAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the hub to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteHubAsync(HubName name) { + DeleteHubRequest request = + DeleteHubRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String name = HubName.of("[PROJECT]", "[HUB]").toString();
+   *   hubServiceClient.deleteHubAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the hub to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteHubAsync(String name) { + DeleteHubRequest request = DeleteHubRequest.newBuilder().setName(name).build(); + return deleteHubAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   DeleteHubRequest request =
+   *       DeleteHubRequest.newBuilder()
+   *           .setName(HubName.of("[PROJECT]", "[HUB]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   hubServiceClient.deleteHubAsync(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 deleteHubAsync(DeleteHubRequest request) { + return deleteHubOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   DeleteHubRequest request =
+   *       DeleteHubRequest.newBuilder()
+   *           .setName(HubName.of("[PROJECT]", "[HUB]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       hubServiceClient.deleteHubOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteHubOperationCallable() { + return stub.deleteHubOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified hub. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   DeleteHubRequest request =
+   *       DeleteHubRequest.newBuilder()
+   *           .setName(HubName.of("[PROJECT]", "[HUB]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.deleteHubCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteHubCallable() { + return stub.deleteHubCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the spokes in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Spoke element : hubServiceClient.listSpokes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSpokesPagedResponse listSpokes(LocationName parent) { + ListSpokesRequest request = + ListSpokesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSpokes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the spokes in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Spoke element : hubServiceClient.listSpokes(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSpokesPagedResponse listSpokes(String parent) { + ListSpokesRequest request = ListSpokesRequest.newBuilder().setParent(parent).build(); + return listSpokes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the spokes in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   ListSpokesRequest request =
+   *       ListSpokesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Spoke element : hubServiceClient.listSpokes(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 ListSpokesPagedResponse listSpokes(ListSpokesRequest request) { + return listSpokesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the spokes in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   ListSpokesRequest request =
+   *       ListSpokesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.listSpokesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Spoke element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSpokesPagedCallable() { + return stub.listSpokesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the spokes in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   ListSpokesRequest request =
+   *       ListSpokesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListSpokesResponse response = hubServiceClient.listSpokesCallable().call(request);
+   *     for (Spoke element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSpokesCallable() { + return stub.listSpokesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
+   *   Spoke response = hubServiceClient.getSpoke(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spoke resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spoke getSpoke(SpokeName name) { + GetSpokeRequest request = + GetSpokeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSpoke(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
+   *   Spoke response = hubServiceClient.getSpoke(name);
+   * }
+   * }
+ * + * @param name Required. The name of the spoke resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Spoke getSpoke(String name) { + GetSpokeRequest request = GetSpokeRequest.newBuilder().setName(name).build(); + return getSpoke(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   GetSpokeRequest request =
+   *       GetSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .build();
+   *   Spoke response = hubServiceClient.getSpoke(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 Spoke getSpoke(GetSpokeRequest request) { + return getSpokeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   GetSpokeRequest request =
+   *       GetSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .build();
+   *   ApiFuture future = hubServiceClient.getSpokeCallable().futureCall(request);
+   *   // Do something.
+   *   Spoke response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSpokeCallable() { + return stub.getSpokeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a spoke in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Spoke spoke = Spoke.newBuilder().build();
+   *   String spokeId = "spokeId-1998996281";
+   *   Spoke response = hubServiceClient.createSpokeAsync(parent, spoke, spokeId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource. + * @param spoke Required. The initial values for a new spoke. + * @param spokeId Optional. Unique id for the spoke to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSpokeAsync( + LocationName parent, Spoke spoke, String spokeId) { + CreateSpokeRequest request = + CreateSpokeRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSpoke(spoke) + .setSpokeId(spokeId) + .build(); + return createSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a spoke in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Spoke spoke = Spoke.newBuilder().build();
+   *   String spokeId = "spokeId-1998996281";
+   *   Spoke response = hubServiceClient.createSpokeAsync(parent, spoke, spokeId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource. + * @param spoke Required. The initial values for a new spoke. + * @param spokeId Optional. Unique id for the spoke to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSpokeAsync( + String parent, Spoke spoke, String spokeId) { + CreateSpokeRequest request = + CreateSpokeRequest.newBuilder() + .setParent(parent) + .setSpoke(spoke) + .setSpokeId(spokeId) + .build(); + return createSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a spoke in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   CreateSpokeRequest request =
+   *       CreateSpokeRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setSpokeId("spokeId-1998996281")
+   *           .setSpoke(Spoke.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Spoke response = hubServiceClient.createSpokeAsync(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 createSpokeAsync( + CreateSpokeRequest request) { + return createSpokeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a spoke in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   CreateSpokeRequest request =
+   *       CreateSpokeRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setSpokeId("spokeId-1998996281")
+   *           .setSpoke(Spoke.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       hubServiceClient.createSpokeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Spoke response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createSpokeOperationCallable() { + return stub.createSpokeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a spoke in the specified project and location. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   CreateSpokeRequest request =
+   *       CreateSpokeRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setSpokeId("spokeId-1998996281")
+   *           .setSpoke(Spoke.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.createSpokeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createSpokeCallable() { + return stub.createSpokeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   Spoke spoke = Spoke.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Spoke response = hubServiceClient.updateSpokeAsync(spoke, updateMask).get();
+   * }
+   * }
+ * + * @param spoke Required. The state that the spoke should be in after the update. + * @param updateMask Optional. In the case of an update to an existing spoke, field mask is used + * to specify the fields to be overwritten. The fields specified in the update_mask are + * relative to the resource, not the full request. A field is overwritten if it is in the + * mask. If the user does not provide a mask, then all fields are overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateSpokeAsync( + Spoke spoke, FieldMask updateMask) { + UpdateSpokeRequest request = + UpdateSpokeRequest.newBuilder().setSpoke(spoke).setUpdateMask(updateMask).build(); + return updateSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   UpdateSpokeRequest request =
+   *       UpdateSpokeRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setSpoke(Spoke.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Spoke response = hubServiceClient.updateSpokeAsync(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 updateSpokeAsync( + UpdateSpokeRequest request) { + return updateSpokeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   UpdateSpokeRequest request =
+   *       UpdateSpokeRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setSpoke(Spoke.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       hubServiceClient.updateSpokeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Spoke response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateSpokeOperationCallable() { + return stub.updateSpokeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   UpdateSpokeRequest request =
+   *       UpdateSpokeRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setSpoke(Spoke.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.updateSpokeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSpokeCallable() { + return stub.updateSpokeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deactivates the specified spoke. Deactivating keeps the spoke information for future + * re-activation, but disconnects the Google Cloud network from non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
+   *   Spoke response = hubServiceClient.deactivateSpokeAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the spoke to deactivate. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deactivateSpokeAsync(SpokeName name) { + DeactivateSpokeRequest request = + DeactivateSpokeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deactivateSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deactivates the specified spoke. Deactivating keeps the spoke information for future + * re-activation, but disconnects the Google Cloud network from non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
+   *   Spoke response = hubServiceClient.deactivateSpokeAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the spoke to deactivate. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deactivateSpokeAsync(String name) { + DeactivateSpokeRequest request = DeactivateSpokeRequest.newBuilder().setName(name).build(); + return deactivateSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deactivates the specified spoke. Deactivating keeps the spoke information for future + * re-activation, but disconnects the Google Cloud network from non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   DeactivateSpokeRequest request =
+   *       DeactivateSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Spoke response = hubServiceClient.deactivateSpokeAsync(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 deactivateSpokeAsync( + DeactivateSpokeRequest request) { + return deactivateSpokeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deactivates the specified spoke. Deactivating keeps the spoke information for future + * re-activation, but disconnects the Google Cloud network from non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   DeactivateSpokeRequest request =
+   *       DeactivateSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       hubServiceClient.deactivateSpokeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Spoke response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deactivateSpokeOperationCallable() { + return stub.deactivateSpokeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deactivates the specified spoke. Deactivating keeps the spoke information for future + * re-activation, but disconnects the Google Cloud network from non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   DeactivateSpokeRequest request =
+   *       DeactivateSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.deactivateSpokeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deactivateSpokeCallable() { + return stub.deactivateSpokeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Activates the specified spoke. Activating reconnects the Google Cloud network with the + * non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
+   *   Spoke response = hubServiceClient.activateSpokeAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the spoke to activate. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture activateSpokeAsync(SpokeName name) { + ActivateSpokeRequest request = + ActivateSpokeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return activateSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Activates the specified spoke. Activating reconnects the Google Cloud network with the + * non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
+   *   Spoke response = hubServiceClient.activateSpokeAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the spoke to activate. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture activateSpokeAsync(String name) { + ActivateSpokeRequest request = ActivateSpokeRequest.newBuilder().setName(name).build(); + return activateSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Activates the specified spoke. Activating reconnects the Google Cloud network with the + * non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   ActivateSpokeRequest request =
+   *       ActivateSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Spoke response = hubServiceClient.activateSpokeAsync(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 activateSpokeAsync( + ActivateSpokeRequest request) { + return activateSpokeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Activates the specified spoke. Activating reconnects the Google Cloud network with the + * non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   ActivateSpokeRequest request =
+   *       ActivateSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       hubServiceClient.activateSpokeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Spoke response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + activateSpokeOperationCallable() { + return stub.activateSpokeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Activates the specified spoke. Activating reconnects the Google Cloud network with the + * non-Google-Cloud network. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   ActivateSpokeRequest request =
+   *       ActivateSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.activateSpokeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable activateSpokeCallable() { + return stub.activateSpokeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
+   *   hubServiceClient.deleteSpokeAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the spoke to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSpokeAsync(SpokeName name) { + DeleteSpokeRequest request = + DeleteSpokeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   String name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
+   *   hubServiceClient.deleteSpokeAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the spoke to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSpokeAsync(String name) { + DeleteSpokeRequest request = DeleteSpokeRequest.newBuilder().setName(name).build(); + return deleteSpokeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   DeleteSpokeRequest request =
+   *       DeleteSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   hubServiceClient.deleteSpokeAsync(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 deleteSpokeAsync( + DeleteSpokeRequest request) { + return deleteSpokeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   DeleteSpokeRequest request =
+   *       DeleteSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       hubServiceClient.deleteSpokeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteSpokeOperationCallable() { + return stub.deleteSpokeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified spoke. + * + *

Sample code: + * + *

{@code
+   * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+   *   DeleteSpokeRequest request =
+   *       DeleteSpokeRequest.newBuilder()
+   *           .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = hubServiceClient.deleteSpokeCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSpokeCallable() { + return stub.deleteSpokeCallable(); + } + + @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 ListHubsPagedResponse + extends AbstractPagedListResponse< + ListHubsRequest, ListHubsResponse, Hub, ListHubsPage, ListHubsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListHubsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListHubsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListHubsPagedResponse(ListHubsPage page) { + super(page, ListHubsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListHubsPage + extends AbstractPage { + + private ListHubsPage( + PageContext context, ListHubsResponse response) { + super(context, response); + } + + private static ListHubsPage createEmptyPage() { + return new ListHubsPage(null, null); + } + + @Override + protected ListHubsPage createPage( + PageContext context, ListHubsResponse response) { + return new ListHubsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListHubsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListHubsRequest, ListHubsResponse, Hub, ListHubsPage, ListHubsFixedSizeCollection> { + + private ListHubsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListHubsFixedSizeCollection createEmptyCollection() { + return new ListHubsFixedSizeCollection(null, 0); + } + + @Override + protected ListHubsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListHubsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSpokesPagedResponse + extends AbstractPagedListResponse< + ListSpokesRequest, + ListSpokesResponse, + Spoke, + ListSpokesPage, + ListSpokesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSpokesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListSpokesPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListSpokesPagedResponse(ListSpokesPage page) { + super(page, ListSpokesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSpokesPage + extends AbstractPage { + + private ListSpokesPage( + PageContext context, + ListSpokesResponse response) { + super(context, response); + } + + private static ListSpokesPage createEmptyPage() { + return new ListSpokesPage(null, null); + } + + @Override + protected ListSpokesPage createPage( + PageContext context, + ListSpokesResponse response) { + return new ListSpokesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSpokesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSpokesRequest, + ListSpokesResponse, + Spoke, + ListSpokesPage, + ListSpokesFixedSizeCollection> { + + private ListSpokesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSpokesFixedSizeCollection createEmptyCollection() { + return new ListSpokesFixedSizeCollection(null, 0); + } + + @Override + protected ListSpokesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSpokesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/HubServiceSettings.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/HubServiceSettings.java new file mode 100644 index 00000000..798c1e4c --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/HubServiceSettings.java @@ -0,0 +1,397 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1; + +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListSpokesPagedResponse; + +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.HubServiceStubSettings; +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 HubServiceClient}. + * + *

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 getHub to 30 seconds: + * + *

{@code
+ * HubServiceSettings.Builder hubServiceSettingsBuilder = HubServiceSettings.newBuilder();
+ * hubServiceSettingsBuilder
+ *     .getHubSettings()
+ *     .setRetrySettings(
+ *         hubServiceSettingsBuilder
+ *             .getHubSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * HubServiceSettings hubServiceSettings = hubServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class HubServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listHubs. */ + public PagedCallSettings + listHubsSettings() { + return ((HubServiceStubSettings) getStubSettings()).listHubsSettings(); + } + + /** Returns the object with the settings used for calls to getHub. */ + public UnaryCallSettings getHubSettings() { + return ((HubServiceStubSettings) getStubSettings()).getHubSettings(); + } + + /** Returns the object with the settings used for calls to createHub. */ + public UnaryCallSettings createHubSettings() { + return ((HubServiceStubSettings) getStubSettings()).createHubSettings(); + } + + /** Returns the object with the settings used for calls to createHub. */ + public OperationCallSettings + createHubOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).createHubOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateHub. */ + public UnaryCallSettings updateHubSettings() { + return ((HubServiceStubSettings) getStubSettings()).updateHubSettings(); + } + + /** Returns the object with the settings used for calls to updateHub. */ + public OperationCallSettings + updateHubOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).updateHubOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteHub. */ + public UnaryCallSettings deleteHubSettings() { + return ((HubServiceStubSettings) getStubSettings()).deleteHubSettings(); + } + + /** Returns the object with the settings used for calls to deleteHub. */ + public OperationCallSettings + deleteHubOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).deleteHubOperationSettings(); + } + + /** Returns the object with the settings used for calls to listSpokes. */ + public PagedCallSettings + listSpokesSettings() { + return ((HubServiceStubSettings) getStubSettings()).listSpokesSettings(); + } + + /** Returns the object with the settings used for calls to getSpoke. */ + public UnaryCallSettings getSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).getSpokeSettings(); + } + + /** Returns the object with the settings used for calls to createSpoke. */ + public UnaryCallSettings createSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).createSpokeSettings(); + } + + /** Returns the object with the settings used for calls to createSpoke. */ + public OperationCallSettings + createSpokeOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).createSpokeOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateSpoke. */ + public UnaryCallSettings updateSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).updateSpokeSettings(); + } + + /** Returns the object with the settings used for calls to updateSpoke. */ + public OperationCallSettings + updateSpokeOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).updateSpokeOperationSettings(); + } + + /** Returns the object with the settings used for calls to deactivateSpoke. */ + public UnaryCallSettings deactivateSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).deactivateSpokeSettings(); + } + + /** Returns the object with the settings used for calls to deactivateSpoke. */ + public OperationCallSettings + deactivateSpokeOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).deactivateSpokeOperationSettings(); + } + + /** Returns the object with the settings used for calls to activateSpoke. */ + public UnaryCallSettings activateSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).activateSpokeSettings(); + } + + /** Returns the object with the settings used for calls to activateSpoke. */ + public OperationCallSettings + activateSpokeOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).activateSpokeOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteSpoke. */ + public UnaryCallSettings deleteSpokeSettings() { + return ((HubServiceStubSettings) getStubSettings()).deleteSpokeSettings(); + } + + /** Returns the object with the settings used for calls to deleteSpoke. */ + public OperationCallSettings + deleteSpokeOperationSettings() { + return ((HubServiceStubSettings) getStubSettings()).deleteSpokeOperationSettings(); + } + + public static final HubServiceSettings create(HubServiceStubSettings stub) throws IOException { + return new HubServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return HubServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return HubServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return HubServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return HubServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return HubServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return HubServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return HubServiceStubSettings.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 HubServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for HubServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(HubServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(HubServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(HubServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(HubServiceStubSettings.newBuilder()); + } + + public HubServiceStubSettings.Builder getStubSettingsBuilder() { + return ((HubServiceStubSettings.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 listHubs. */ + public PagedCallSettings.Builder + listHubsSettings() { + return getStubSettingsBuilder().listHubsSettings(); + } + + /** Returns the builder for the settings used for calls to getHub. */ + public UnaryCallSettings.Builder getHubSettings() { + return getStubSettingsBuilder().getHubSettings(); + } + + /** Returns the builder for the settings used for calls to createHub. */ + public UnaryCallSettings.Builder createHubSettings() { + return getStubSettingsBuilder().createHubSettings(); + } + + /** Returns the builder for the settings used for calls to createHub. */ + public OperationCallSettings.Builder + createHubOperationSettings() { + return getStubSettingsBuilder().createHubOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateHub. */ + public UnaryCallSettings.Builder updateHubSettings() { + return getStubSettingsBuilder().updateHubSettings(); + } + + /** Returns the builder for the settings used for calls to updateHub. */ + public OperationCallSettings.Builder + updateHubOperationSettings() { + return getStubSettingsBuilder().updateHubOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteHub. */ + public UnaryCallSettings.Builder deleteHubSettings() { + return getStubSettingsBuilder().deleteHubSettings(); + } + + /** Returns the builder for the settings used for calls to deleteHub. */ + public OperationCallSettings.Builder + deleteHubOperationSettings() { + return getStubSettingsBuilder().deleteHubOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listSpokes. */ + public PagedCallSettings.Builder + listSpokesSettings() { + return getStubSettingsBuilder().listSpokesSettings(); + } + + /** Returns the builder for the settings used for calls to getSpoke. */ + public UnaryCallSettings.Builder getSpokeSettings() { + return getStubSettingsBuilder().getSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to createSpoke. */ + public UnaryCallSettings.Builder createSpokeSettings() { + return getStubSettingsBuilder().createSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to createSpoke. */ + public OperationCallSettings.Builder + createSpokeOperationSettings() { + return getStubSettingsBuilder().createSpokeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateSpoke. */ + public UnaryCallSettings.Builder updateSpokeSettings() { + return getStubSettingsBuilder().updateSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to updateSpoke. */ + public OperationCallSettings.Builder + updateSpokeOperationSettings() { + return getStubSettingsBuilder().updateSpokeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deactivateSpoke. */ + public UnaryCallSettings.Builder deactivateSpokeSettings() { + return getStubSettingsBuilder().deactivateSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to deactivateSpoke. */ + public OperationCallSettings.Builder + deactivateSpokeOperationSettings() { + return getStubSettingsBuilder().deactivateSpokeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to activateSpoke. */ + public UnaryCallSettings.Builder activateSpokeSettings() { + return getStubSettingsBuilder().activateSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to activateSpoke. */ + public OperationCallSettings.Builder + activateSpokeOperationSettings() { + return getStubSettingsBuilder().activateSpokeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSpoke. */ + public UnaryCallSettings.Builder deleteSpokeSettings() { + return getStubSettingsBuilder().deleteSpokeSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSpoke. */ + public OperationCallSettings.Builder + deleteSpokeOperationSettings() { + return getStubSettingsBuilder().deleteSpokeOperationSettings(); + } + + @Override + public HubServiceSettings build() throws IOException { + return new HubServiceSettings(this); + } + } +} diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/gapic_metadata.json b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/gapic_metadata.json new file mode 100644 index 00000000..e67aa4c4 --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/gapic_metadata.json @@ -0,0 +1,54 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.networkconnectivity.v1", + "libraryPackage": "com.google.cloud.networkconnectivity.v1", + "services": { + "HubService": { + "clients": { + "grpc": { + "libraryClient": "HubServiceClient", + "rpcs": { + "ActivateSpoke": { + "methods": ["activateSpokeAsync", "activateSpokeAsync", "activateSpokeAsync", "activateSpokeOperationCallable", "activateSpokeCallable"] + }, + "CreateHub": { + "methods": ["createHubAsync", "createHubAsync", "createHubAsync", "createHubOperationCallable", "createHubCallable"] + }, + "CreateSpoke": { + "methods": ["createSpokeAsync", "createSpokeAsync", "createSpokeAsync", "createSpokeOperationCallable", "createSpokeCallable"] + }, + "DeactivateSpoke": { + "methods": ["deactivateSpokeAsync", "deactivateSpokeAsync", "deactivateSpokeAsync", "deactivateSpokeOperationCallable", "deactivateSpokeCallable"] + }, + "DeleteHub": { + "methods": ["deleteHubAsync", "deleteHubAsync", "deleteHubAsync", "deleteHubOperationCallable", "deleteHubCallable"] + }, + "DeleteSpoke": { + "methods": ["deleteSpokeAsync", "deleteSpokeAsync", "deleteSpokeAsync", "deleteSpokeOperationCallable", "deleteSpokeCallable"] + }, + "GetHub": { + "methods": ["getHub", "getHub", "getHub", "getHubCallable"] + }, + "GetSpoke": { + "methods": ["getSpoke", "getSpoke", "getSpoke", "getSpokeCallable"] + }, + "ListHubs": { + "methods": ["listHubs", "listHubs", "listHubs", "listHubsPagedCallable", "listHubsCallable"] + }, + "ListSpokes": { + "methods": ["listSpokes", "listSpokes", "listSpokes", "listSpokesPagedCallable", "listSpokesCallable"] + }, + "UpdateHub": { + "methods": ["updateHubAsync", "updateHubAsync", "updateHubOperationCallable", "updateHubCallable"] + }, + "UpdateSpoke": { + "methods": ["updateSpokeAsync", "updateSpokeAsync", "updateSpokeOperationCallable", "updateSpokeCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/package-info.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/package-info.java new file mode 100644 index 00000000..e28e0c7d --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/package-info.java @@ -0,0 +1,38 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= HubServiceClient ======================= + * + *

Service Description: Network Connectivity Center is a hub-and-spoke abstraction for network + * connectivity management in Google Cloud. It reduces operational complexity through a simple, + * centralized connectivity management model. + * + *

Sample for HubServiceClient: + * + *

{@code
+ * try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
+ *   HubName name = HubName.of("[PROJECT]", "[HUB]");
+ *   Hub response = hubServiceClient.getHub(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.networkconnectivity.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcHubServiceCallableFactory.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcHubServiceCallableFactory.java new file mode 100644 index 00000000..8ee01f16 --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcHubServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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 HubService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcHubServiceCallableFactory 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/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcHubServiceStub.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcHubServiceStub.java new file mode 100644 index 00000000..60e388c5 --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcHubServiceStub.java @@ -0,0 +1,610 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1.stub; + +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListSpokesPagedResponse; + +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.ActivateSpokeRequest; +import com.google.cloud.networkconnectivity.v1.CreateHubRequest; +import com.google.cloud.networkconnectivity.v1.CreateSpokeRequest; +import com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest; +import com.google.cloud.networkconnectivity.v1.DeleteHubRequest; +import com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest; +import com.google.cloud.networkconnectivity.v1.GetHubRequest; +import com.google.cloud.networkconnectivity.v1.GetSpokeRequest; +import com.google.cloud.networkconnectivity.v1.Hub; +import com.google.cloud.networkconnectivity.v1.ListHubsRequest; +import com.google.cloud.networkconnectivity.v1.ListHubsResponse; +import com.google.cloud.networkconnectivity.v1.ListSpokesRequest; +import com.google.cloud.networkconnectivity.v1.ListSpokesResponse; +import com.google.cloud.networkconnectivity.v1.OperationMetadata; +import com.google.cloud.networkconnectivity.v1.Spoke; +import com.google.cloud.networkconnectivity.v1.UpdateHubRequest; +import com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest; +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 HubService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcHubServiceStub extends HubServiceStub { + private static final MethodDescriptor + listHubsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/ListHubs") + .setRequestMarshaller(ProtoUtils.marshaller(ListHubsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListHubsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getHubMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/GetHub") + .setRequestMarshaller(ProtoUtils.marshaller(GetHubRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Hub.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createHubMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/CreateHub") + .setRequestMarshaller(ProtoUtils.marshaller(CreateHubRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateHubMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/UpdateHub") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateHubRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteHubMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/DeleteHub") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteHubRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listSpokesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/ListSpokes") + .setRequestMarshaller(ProtoUtils.marshaller(ListSpokesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListSpokesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/GetSpoke") + .setRequestMarshaller(ProtoUtils.marshaller(GetSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Spoke.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/CreateSpoke") + .setRequestMarshaller(ProtoUtils.marshaller(CreateSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/UpdateSpoke") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deactivateSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/DeactivateSpoke") + .setRequestMarshaller( + ProtoUtils.marshaller(DeactivateSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + activateSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/ActivateSpoke") + .setRequestMarshaller( + ProtoUtils.marshaller(ActivateSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteSpokeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.networkconnectivity.v1.HubService/DeleteSpoke") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSpokeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable listHubsCallable; + private final UnaryCallable listHubsPagedCallable; + private final UnaryCallable getHubCallable; + private final UnaryCallable createHubCallable; + private final OperationCallable + createHubOperationCallable; + private final UnaryCallable updateHubCallable; + private final OperationCallable + updateHubOperationCallable; + private final UnaryCallable deleteHubCallable; + private final OperationCallable + deleteHubOperationCallable; + private final UnaryCallable listSpokesCallable; + private final UnaryCallable listSpokesPagedCallable; + private final UnaryCallable getSpokeCallable; + private final UnaryCallable createSpokeCallable; + private final OperationCallable + createSpokeOperationCallable; + private final UnaryCallable updateSpokeCallable; + private final OperationCallable + updateSpokeOperationCallable; + private final UnaryCallable deactivateSpokeCallable; + private final OperationCallable + deactivateSpokeOperationCallable; + private final UnaryCallable activateSpokeCallable; + private final OperationCallable + activateSpokeOperationCallable; + private final UnaryCallable deleteSpokeCallable; + private final OperationCallable + deleteSpokeOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcHubServiceStub create(HubServiceStubSettings settings) + throws IOException { + return new GrpcHubServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcHubServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcHubServiceStub(HubServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcHubServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcHubServiceStub( + HubServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcHubServiceStub, 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 GrpcHubServiceStub(HubServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcHubServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcHubServiceStub, 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 GrpcHubServiceStub( + HubServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listHubsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listHubsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getHubTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getHubMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createHubTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createHubMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateHubTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateHubMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("hub.name", String.valueOf(request.getHub().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteHubTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteHubMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listSpokesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSpokesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSpokeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSpokeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSpokeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("spoke.name", String.valueOf(request.getSpoke().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deactivateSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deactivateSpokeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings activateSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(activateSpokeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteSpokeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSpokeMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.listHubsCallable = + callableFactory.createUnaryCallable( + listHubsTransportSettings, settings.listHubsSettings(), clientContext); + this.listHubsPagedCallable = + callableFactory.createPagedCallable( + listHubsTransportSettings, settings.listHubsSettings(), clientContext); + this.getHubCallable = + callableFactory.createUnaryCallable( + getHubTransportSettings, settings.getHubSettings(), clientContext); + this.createHubCallable = + callableFactory.createUnaryCallable( + createHubTransportSettings, settings.createHubSettings(), clientContext); + this.createHubOperationCallable = + callableFactory.createOperationCallable( + createHubTransportSettings, + settings.createHubOperationSettings(), + clientContext, + operationsStub); + this.updateHubCallable = + callableFactory.createUnaryCallable( + updateHubTransportSettings, settings.updateHubSettings(), clientContext); + this.updateHubOperationCallable = + callableFactory.createOperationCallable( + updateHubTransportSettings, + settings.updateHubOperationSettings(), + clientContext, + operationsStub); + this.deleteHubCallable = + callableFactory.createUnaryCallable( + deleteHubTransportSettings, settings.deleteHubSettings(), clientContext); + this.deleteHubOperationCallable = + callableFactory.createOperationCallable( + deleteHubTransportSettings, + settings.deleteHubOperationSettings(), + clientContext, + operationsStub); + this.listSpokesCallable = + callableFactory.createUnaryCallable( + listSpokesTransportSettings, settings.listSpokesSettings(), clientContext); + this.listSpokesPagedCallable = + callableFactory.createPagedCallable( + listSpokesTransportSettings, settings.listSpokesSettings(), clientContext); + this.getSpokeCallable = + callableFactory.createUnaryCallable( + getSpokeTransportSettings, settings.getSpokeSettings(), clientContext); + this.createSpokeCallable = + callableFactory.createUnaryCallable( + createSpokeTransportSettings, settings.createSpokeSettings(), clientContext); + this.createSpokeOperationCallable = + callableFactory.createOperationCallable( + createSpokeTransportSettings, + settings.createSpokeOperationSettings(), + clientContext, + operationsStub); + this.updateSpokeCallable = + callableFactory.createUnaryCallable( + updateSpokeTransportSettings, settings.updateSpokeSettings(), clientContext); + this.updateSpokeOperationCallable = + callableFactory.createOperationCallable( + updateSpokeTransportSettings, + settings.updateSpokeOperationSettings(), + clientContext, + operationsStub); + this.deactivateSpokeCallable = + callableFactory.createUnaryCallable( + deactivateSpokeTransportSettings, settings.deactivateSpokeSettings(), clientContext); + this.deactivateSpokeOperationCallable = + callableFactory.createOperationCallable( + deactivateSpokeTransportSettings, + settings.deactivateSpokeOperationSettings(), + clientContext, + operationsStub); + this.activateSpokeCallable = + callableFactory.createUnaryCallable( + activateSpokeTransportSettings, settings.activateSpokeSettings(), clientContext); + this.activateSpokeOperationCallable = + callableFactory.createOperationCallable( + activateSpokeTransportSettings, + settings.activateSpokeOperationSettings(), + clientContext, + operationsStub); + this.deleteSpokeCallable = + callableFactory.createUnaryCallable( + deleteSpokeTransportSettings, settings.deleteSpokeSettings(), clientContext); + this.deleteSpokeOperationCallable = + callableFactory.createOperationCallable( + deleteSpokeTransportSettings, + settings.deleteSpokeOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listHubsCallable() { + return listHubsCallable; + } + + @Override + public UnaryCallable listHubsPagedCallable() { + return listHubsPagedCallable; + } + + @Override + public UnaryCallable getHubCallable() { + return getHubCallable; + } + + @Override + public UnaryCallable createHubCallable() { + return createHubCallable; + } + + @Override + public OperationCallable createHubOperationCallable() { + return createHubOperationCallable; + } + + @Override + public UnaryCallable updateHubCallable() { + return updateHubCallable; + } + + @Override + public OperationCallable updateHubOperationCallable() { + return updateHubOperationCallable; + } + + @Override + public UnaryCallable deleteHubCallable() { + return deleteHubCallable; + } + + @Override + public OperationCallable + deleteHubOperationCallable() { + return deleteHubOperationCallable; + } + + @Override + public UnaryCallable listSpokesCallable() { + return listSpokesCallable; + } + + @Override + public UnaryCallable listSpokesPagedCallable() { + return listSpokesPagedCallable; + } + + @Override + public UnaryCallable getSpokeCallable() { + return getSpokeCallable; + } + + @Override + public UnaryCallable createSpokeCallable() { + return createSpokeCallable; + } + + @Override + public OperationCallable + createSpokeOperationCallable() { + return createSpokeOperationCallable; + } + + @Override + public UnaryCallable updateSpokeCallable() { + return updateSpokeCallable; + } + + @Override + public OperationCallable + updateSpokeOperationCallable() { + return updateSpokeOperationCallable; + } + + @Override + public UnaryCallable deactivateSpokeCallable() { + return deactivateSpokeCallable; + } + + @Override + public OperationCallable + deactivateSpokeOperationCallable() { + return deactivateSpokeOperationCallable; + } + + @Override + public UnaryCallable activateSpokeCallable() { + return activateSpokeCallable; + } + + @Override + public OperationCallable + activateSpokeOperationCallable() { + return activateSpokeOperationCallable; + } + + @Override + public UnaryCallable deleteSpokeCallable() { + return deleteSpokeCallable; + } + + @Override + public OperationCallable + deleteSpokeOperationCallable() { + return deleteSpokeOperationCallable; + } + + @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/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/HubServiceStub.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/HubServiceStub.java new file mode 100644 index 00000000..860d4c79 --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/HubServiceStub.java @@ -0,0 +1,156 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1.stub; + +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListSpokesPagedResponse; + +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.ActivateSpokeRequest; +import com.google.cloud.networkconnectivity.v1.CreateHubRequest; +import com.google.cloud.networkconnectivity.v1.CreateSpokeRequest; +import com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest; +import com.google.cloud.networkconnectivity.v1.DeleteHubRequest; +import com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest; +import com.google.cloud.networkconnectivity.v1.GetHubRequest; +import com.google.cloud.networkconnectivity.v1.GetSpokeRequest; +import com.google.cloud.networkconnectivity.v1.Hub; +import com.google.cloud.networkconnectivity.v1.ListHubsRequest; +import com.google.cloud.networkconnectivity.v1.ListHubsResponse; +import com.google.cloud.networkconnectivity.v1.ListSpokesRequest; +import com.google.cloud.networkconnectivity.v1.ListSpokesResponse; +import com.google.cloud.networkconnectivity.v1.OperationMetadata; +import com.google.cloud.networkconnectivity.v1.Spoke; +import com.google.cloud.networkconnectivity.v1.UpdateHubRequest; +import com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest; +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 HubService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class HubServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable listHubsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listHubsPagedCallable()"); + } + + public UnaryCallable listHubsCallable() { + throw new UnsupportedOperationException("Not implemented: listHubsCallable()"); + } + + public UnaryCallable getHubCallable() { + throw new UnsupportedOperationException("Not implemented: getHubCallable()"); + } + + public OperationCallable createHubOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createHubOperationCallable()"); + } + + public UnaryCallable createHubCallable() { + throw new UnsupportedOperationException("Not implemented: createHubCallable()"); + } + + public OperationCallable updateHubOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateHubOperationCallable()"); + } + + public UnaryCallable updateHubCallable() { + throw new UnsupportedOperationException("Not implemented: updateHubCallable()"); + } + + public OperationCallable + deleteHubOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteHubOperationCallable()"); + } + + public UnaryCallable deleteHubCallable() { + throw new UnsupportedOperationException("Not implemented: deleteHubCallable()"); + } + + public UnaryCallable listSpokesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSpokesPagedCallable()"); + } + + public UnaryCallable listSpokesCallable() { + throw new UnsupportedOperationException("Not implemented: listSpokesCallable()"); + } + + public UnaryCallable getSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: getSpokeCallable()"); + } + + public OperationCallable + createSpokeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createSpokeOperationCallable()"); + } + + public UnaryCallable createSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: createSpokeCallable()"); + } + + public OperationCallable + updateSpokeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateSpokeOperationCallable()"); + } + + public UnaryCallable updateSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: updateSpokeCallable()"); + } + + public OperationCallable + deactivateSpokeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deactivateSpokeOperationCallable()"); + } + + public UnaryCallable deactivateSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: deactivateSpokeCallable()"); + } + + public OperationCallable + activateSpokeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: activateSpokeOperationCallable()"); + } + + public UnaryCallable activateSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: activateSpokeCallable()"); + } + + public OperationCallable + deleteSpokeOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSpokeOperationCallable()"); + } + + public UnaryCallable deleteSpokeCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSpokeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/HubServiceStubSettings.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/HubServiceStubSettings.java new file mode 100644 index 00000000..06882de2 --- /dev/null +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/HubServiceStubSettings.java @@ -0,0 +1,1025 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1.stub; + +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListSpokesPagedResponse; + +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.ActivateSpokeRequest; +import com.google.cloud.networkconnectivity.v1.CreateHubRequest; +import com.google.cloud.networkconnectivity.v1.CreateSpokeRequest; +import com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest; +import com.google.cloud.networkconnectivity.v1.DeleteHubRequest; +import com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest; +import com.google.cloud.networkconnectivity.v1.GetHubRequest; +import com.google.cloud.networkconnectivity.v1.GetSpokeRequest; +import com.google.cloud.networkconnectivity.v1.Hub; +import com.google.cloud.networkconnectivity.v1.ListHubsRequest; +import com.google.cloud.networkconnectivity.v1.ListHubsResponse; +import com.google.cloud.networkconnectivity.v1.ListSpokesRequest; +import com.google.cloud.networkconnectivity.v1.ListSpokesResponse; +import com.google.cloud.networkconnectivity.v1.OperationMetadata; +import com.google.cloud.networkconnectivity.v1.Spoke; +import com.google.cloud.networkconnectivity.v1.UpdateHubRequest; +import com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest; +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 HubServiceStub}. + * + *

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 getHub to 30 seconds: + * + *

{@code
+ * HubServiceStubSettings.Builder hubServiceSettingsBuilder = HubServiceStubSettings.newBuilder();
+ * hubServiceSettingsBuilder
+ *     .getHubSettings()
+ *     .setRetrySettings(
+ *         hubServiceSettingsBuilder
+ *             .getHubSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * HubServiceStubSettings hubServiceSettings = hubServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class HubServiceStubSettings 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 + listHubsSettings; + private final UnaryCallSettings getHubSettings; + private final UnaryCallSettings createHubSettings; + private final OperationCallSettings + createHubOperationSettings; + private final UnaryCallSettings updateHubSettings; + private final OperationCallSettings + updateHubOperationSettings; + private final UnaryCallSettings deleteHubSettings; + private final OperationCallSettings + deleteHubOperationSettings; + private final PagedCallSettings + listSpokesSettings; + private final UnaryCallSettings getSpokeSettings; + private final UnaryCallSettings createSpokeSettings; + private final OperationCallSettings + createSpokeOperationSettings; + private final UnaryCallSettings updateSpokeSettings; + private final OperationCallSettings + updateSpokeOperationSettings; + private final UnaryCallSettings deactivateSpokeSettings; + private final OperationCallSettings + deactivateSpokeOperationSettings; + private final UnaryCallSettings activateSpokeSettings; + private final OperationCallSettings + activateSpokeOperationSettings; + private final UnaryCallSettings deleteSpokeSettings; + private final OperationCallSettings + deleteSpokeOperationSettings; + + private static final PagedListDescriptor + LIST_HUBS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListHubsRequest injectToken(ListHubsRequest payload, String token) { + return ListHubsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListHubsRequest injectPageSize(ListHubsRequest payload, int pageSize) { + return ListHubsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListHubsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListHubsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListHubsResponse payload) { + return payload.getHubsList() == null + ? ImmutableList.of() + : payload.getHubsList(); + } + }; + + private static final PagedListDescriptor + LIST_SPOKES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSpokesRequest injectToken(ListSpokesRequest payload, String token) { + return ListSpokesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSpokesRequest injectPageSize(ListSpokesRequest payload, int pageSize) { + return ListSpokesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSpokesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSpokesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSpokesResponse payload) { + return payload.getSpokesList() == null + ? ImmutableList.of() + : payload.getSpokesList(); + } + }; + + private static final PagedListResponseFactory< + ListHubsRequest, ListHubsResponse, ListHubsPagedResponse> + LIST_HUBS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListHubsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_HUBS_PAGE_STR_DESC, request, context); + return ListHubsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSpokesRequest, ListSpokesResponse, ListSpokesPagedResponse> + LIST_SPOKES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSpokesRequest, ListSpokesResponse, ListSpokesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSpokesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SPOKES_PAGE_STR_DESC, request, context); + return ListSpokesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listHubs. */ + public PagedCallSettings + listHubsSettings() { + return listHubsSettings; + } + + /** Returns the object with the settings used for calls to getHub. */ + public UnaryCallSettings getHubSettings() { + return getHubSettings; + } + + /** Returns the object with the settings used for calls to createHub. */ + public UnaryCallSettings createHubSettings() { + return createHubSettings; + } + + /** Returns the object with the settings used for calls to createHub. */ + public OperationCallSettings + createHubOperationSettings() { + return createHubOperationSettings; + } + + /** Returns the object with the settings used for calls to updateHub. */ + public UnaryCallSettings updateHubSettings() { + return updateHubSettings; + } + + /** Returns the object with the settings used for calls to updateHub. */ + public OperationCallSettings + updateHubOperationSettings() { + return updateHubOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteHub. */ + public UnaryCallSettings deleteHubSettings() { + return deleteHubSettings; + } + + /** Returns the object with the settings used for calls to deleteHub. */ + public OperationCallSettings + deleteHubOperationSettings() { + return deleteHubOperationSettings; + } + + /** Returns the object with the settings used for calls to listSpokes. */ + public PagedCallSettings + listSpokesSettings() { + return listSpokesSettings; + } + + /** Returns the object with the settings used for calls to getSpoke. */ + public UnaryCallSettings getSpokeSettings() { + return getSpokeSettings; + } + + /** Returns the object with the settings used for calls to createSpoke. */ + public UnaryCallSettings createSpokeSettings() { + return createSpokeSettings; + } + + /** Returns the object with the settings used for calls to createSpoke. */ + public OperationCallSettings + createSpokeOperationSettings() { + return createSpokeOperationSettings; + } + + /** Returns the object with the settings used for calls to updateSpoke. */ + public UnaryCallSettings updateSpokeSettings() { + return updateSpokeSettings; + } + + /** Returns the object with the settings used for calls to updateSpoke. */ + public OperationCallSettings + updateSpokeOperationSettings() { + return updateSpokeOperationSettings; + } + + /** Returns the object with the settings used for calls to deactivateSpoke. */ + public UnaryCallSettings deactivateSpokeSettings() { + return deactivateSpokeSettings; + } + + /** Returns the object with the settings used for calls to deactivateSpoke. */ + public OperationCallSettings + deactivateSpokeOperationSettings() { + return deactivateSpokeOperationSettings; + } + + /** Returns the object with the settings used for calls to activateSpoke. */ + public UnaryCallSettings activateSpokeSettings() { + return activateSpokeSettings; + } + + /** Returns the object with the settings used for calls to activateSpoke. */ + public OperationCallSettings + activateSpokeOperationSettings() { + return activateSpokeOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteSpoke. */ + public UnaryCallSettings deleteSpokeSettings() { + return deleteSpokeSettings; + } + + /** Returns the object with the settings used for calls to deleteSpoke. */ + public OperationCallSettings + deleteSpokeOperationSettings() { + return deleteSpokeOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public HubServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcHubServiceStub.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); + } + + /** 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(HubServiceStubSettings.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 HubServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listHubsSettings = settingsBuilder.listHubsSettings().build(); + getHubSettings = settingsBuilder.getHubSettings().build(); + createHubSettings = settingsBuilder.createHubSettings().build(); + createHubOperationSettings = settingsBuilder.createHubOperationSettings().build(); + updateHubSettings = settingsBuilder.updateHubSettings().build(); + updateHubOperationSettings = settingsBuilder.updateHubOperationSettings().build(); + deleteHubSettings = settingsBuilder.deleteHubSettings().build(); + deleteHubOperationSettings = settingsBuilder.deleteHubOperationSettings().build(); + listSpokesSettings = settingsBuilder.listSpokesSettings().build(); + getSpokeSettings = settingsBuilder.getSpokeSettings().build(); + createSpokeSettings = settingsBuilder.createSpokeSettings().build(); + createSpokeOperationSettings = settingsBuilder.createSpokeOperationSettings().build(); + updateSpokeSettings = settingsBuilder.updateSpokeSettings().build(); + updateSpokeOperationSettings = settingsBuilder.updateSpokeOperationSettings().build(); + deactivateSpokeSettings = settingsBuilder.deactivateSpokeSettings().build(); + deactivateSpokeOperationSettings = settingsBuilder.deactivateSpokeOperationSettings().build(); + activateSpokeSettings = settingsBuilder.activateSpokeSettings().build(); + activateSpokeOperationSettings = settingsBuilder.activateSpokeOperationSettings().build(); + deleteSpokeSettings = settingsBuilder.deleteSpokeSettings().build(); + deleteSpokeOperationSettings = settingsBuilder.deleteSpokeOperationSettings().build(); + } + + /** Builder for HubServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListHubsRequest, ListHubsResponse, ListHubsPagedResponse> + listHubsSettings; + private final UnaryCallSettings.Builder getHubSettings; + private final UnaryCallSettings.Builder createHubSettings; + private final OperationCallSettings.Builder + createHubOperationSettings; + private final UnaryCallSettings.Builder updateHubSettings; + private final OperationCallSettings.Builder + updateHubOperationSettings; + private final UnaryCallSettings.Builder deleteHubSettings; + private final OperationCallSettings.Builder + deleteHubOperationSettings; + private final PagedCallSettings.Builder< + ListSpokesRequest, ListSpokesResponse, ListSpokesPagedResponse> + listSpokesSettings; + private final UnaryCallSettings.Builder getSpokeSettings; + private final UnaryCallSettings.Builder createSpokeSettings; + private final OperationCallSettings.Builder + createSpokeOperationSettings; + private final UnaryCallSettings.Builder updateSpokeSettings; + private final OperationCallSettings.Builder + updateSpokeOperationSettings; + private final UnaryCallSettings.Builder + deactivateSpokeSettings; + private final OperationCallSettings.Builder + deactivateSpokeOperationSettings; + private final UnaryCallSettings.Builder activateSpokeSettings; + private final OperationCallSettings.Builder + activateSpokeOperationSettings; + private final UnaryCallSettings.Builder deleteSpokeSettings; + private final OperationCallSettings.Builder + deleteSpokeOperationSettings; + 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); + + listHubsSettings = PagedCallSettings.newBuilder(LIST_HUBS_PAGE_STR_FACT); + getHubSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createHubSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createHubOperationSettings = OperationCallSettings.newBuilder(); + updateHubSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateHubOperationSettings = OperationCallSettings.newBuilder(); + deleteHubSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteHubOperationSettings = OperationCallSettings.newBuilder(); + listSpokesSettings = PagedCallSettings.newBuilder(LIST_SPOKES_PAGE_STR_FACT); + getSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSpokeOperationSettings = OperationCallSettings.newBuilder(); + updateSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSpokeOperationSettings = OperationCallSettings.newBuilder(); + deactivateSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deactivateSpokeOperationSettings = OperationCallSettings.newBuilder(); + activateSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + activateSpokeOperationSettings = OperationCallSettings.newBuilder(); + deleteSpokeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSpokeOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listHubsSettings, + getHubSettings, + createHubSettings, + updateHubSettings, + deleteHubSettings, + listSpokesSettings, + getSpokeSettings, + createSpokeSettings, + updateSpokeSettings, + deactivateSpokeSettings, + activateSpokeSettings, + deleteSpokeSettings); + initDefaults(this); + } + + protected Builder(HubServiceStubSettings settings) { + super(settings); + + listHubsSettings = settings.listHubsSettings.toBuilder(); + getHubSettings = settings.getHubSettings.toBuilder(); + createHubSettings = settings.createHubSettings.toBuilder(); + createHubOperationSettings = settings.createHubOperationSettings.toBuilder(); + updateHubSettings = settings.updateHubSettings.toBuilder(); + updateHubOperationSettings = settings.updateHubOperationSettings.toBuilder(); + deleteHubSettings = settings.deleteHubSettings.toBuilder(); + deleteHubOperationSettings = settings.deleteHubOperationSettings.toBuilder(); + listSpokesSettings = settings.listSpokesSettings.toBuilder(); + getSpokeSettings = settings.getSpokeSettings.toBuilder(); + createSpokeSettings = settings.createSpokeSettings.toBuilder(); + createSpokeOperationSettings = settings.createSpokeOperationSettings.toBuilder(); + updateSpokeSettings = settings.updateSpokeSettings.toBuilder(); + updateSpokeOperationSettings = settings.updateSpokeOperationSettings.toBuilder(); + deactivateSpokeSettings = settings.deactivateSpokeSettings.toBuilder(); + deactivateSpokeOperationSettings = settings.deactivateSpokeOperationSettings.toBuilder(); + activateSpokeSettings = settings.activateSpokeSettings.toBuilder(); + activateSpokeOperationSettings = settings.activateSpokeOperationSettings.toBuilder(); + deleteSpokeSettings = settings.deleteSpokeSettings.toBuilder(); + deleteSpokeOperationSettings = settings.deleteSpokeOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listHubsSettings, + getHubSettings, + createHubSettings, + updateHubSettings, + deleteHubSettings, + listSpokesSettings, + getSpokeSettings, + createSpokeSettings, + updateSpokeSettings, + deactivateSpokeSettings, + activateSpokeSettings, + deleteSpokeSettings); + } + + 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 + .listHubsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getHubSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createHubSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateHubSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteHubSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listSpokesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deactivateSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .activateSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteSpokeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createHubOperationSettings() + .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(Hub.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 + .updateHubOperationSettings() + .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(Hub.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 + .deleteHubOperationSettings() + .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())); + + builder + .createSpokeOperationSettings() + .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(Spoke.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 + .updateSpokeOperationSettings() + .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(Spoke.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 + .deactivateSpokeOperationSettings() + .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(Spoke.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 + .activateSpokeOperationSettings() + .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(Spoke.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 + .deleteSpokeOperationSettings() + .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 listHubs. */ + public PagedCallSettings.Builder + listHubsSettings() { + return listHubsSettings; + } + + /** Returns the builder for the settings used for calls to getHub. */ + public UnaryCallSettings.Builder getHubSettings() { + return getHubSettings; + } + + /** Returns the builder for the settings used for calls to createHub. */ + public UnaryCallSettings.Builder createHubSettings() { + return createHubSettings; + } + + /** Returns the builder for the settings used for calls to createHub. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createHubOperationSettings() { + return createHubOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateHub. */ + public UnaryCallSettings.Builder updateHubSettings() { + return updateHubSettings; + } + + /** Returns the builder for the settings used for calls to updateHub. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateHubOperationSettings() { + return updateHubOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteHub. */ + public UnaryCallSettings.Builder deleteHubSettings() { + return deleteHubSettings; + } + + /** Returns the builder for the settings used for calls to deleteHub. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteHubOperationSettings() { + return deleteHubOperationSettings; + } + + /** Returns the builder for the settings used for calls to listSpokes. */ + public PagedCallSettings.Builder + listSpokesSettings() { + return listSpokesSettings; + } + + /** Returns the builder for the settings used for calls to getSpoke. */ + public UnaryCallSettings.Builder getSpokeSettings() { + return getSpokeSettings; + } + + /** Returns the builder for the settings used for calls to createSpoke. */ + public UnaryCallSettings.Builder createSpokeSettings() { + return createSpokeSettings; + } + + /** Returns the builder for the settings used for calls to createSpoke. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createSpokeOperationSettings() { + return createSpokeOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateSpoke. */ + public UnaryCallSettings.Builder updateSpokeSettings() { + return updateSpokeSettings; + } + + /** Returns the builder for the settings used for calls to updateSpoke. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateSpokeOperationSettings() { + return updateSpokeOperationSettings; + } + + /** Returns the builder for the settings used for calls to deactivateSpoke. */ + public UnaryCallSettings.Builder deactivateSpokeSettings() { + return deactivateSpokeSettings; + } + + /** Returns the builder for the settings used for calls to deactivateSpoke. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deactivateSpokeOperationSettings() { + return deactivateSpokeOperationSettings; + } + + /** Returns the builder for the settings used for calls to activateSpoke. */ + public UnaryCallSettings.Builder activateSpokeSettings() { + return activateSpokeSettings; + } + + /** Returns the builder for the settings used for calls to activateSpoke. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + activateSpokeOperationSettings() { + return activateSpokeOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteSpoke. */ + public UnaryCallSettings.Builder deleteSpokeSettings() { + return deleteSpokeSettings; + } + + /** Returns the builder for the settings used for calls to deleteSpoke. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteSpokeOperationSettings() { + return deleteSpokeOperationSettings; + } + + @Override + public HubServiceStubSettings build() throws IOException { + return new HubServiceStubSettings(this); + } + } +} diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClient.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClient.java index 66b544db..18e3a85f 100644 --- a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClient.java +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceClient.java @@ -16,7 +16,6 @@ package com.google.cloud.networkconnectivity.v1alpha1; -import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; @@ -1370,14 +1369,7 @@ public static ApiFuture createAsync( ApiFuture futurePage = ListHubsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListHubsPagedResponse apply(ListHubsPage input) { - return new ListHubsPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); + futurePage, input -> new ListHubsPagedResponse(input), MoreExecutors.directExecutor()); } private ListHubsPagedResponse(ListHubsPage page) { @@ -1444,14 +1436,7 @@ public static ApiFuture createAsync( ApiFuture futurePage = ListSpokesPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListSpokesPagedResponse apply(ListSpokesPage input) { - return new ListSpokesPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); + futurePage, input -> new ListSpokesPagedResponse(input), MoreExecutors.directExecutor()); } private ListSpokesPagedResponse(ListSpokesPage page) { diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceSettings.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceSettings.java index 0eabc635..a2d35ac8 100644 --- a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceSettings.java +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/HubServiceSettings.java @@ -246,14 +246,13 @@ public HubServiceStubSettings.Builder getStubSettingsBuilder() { return ((HubServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceStub.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceStub.java index e92e7ad8..048e6c3e 100644 --- a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceStub.java +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/GrpcHubServiceStub.java @@ -26,7 +26,6 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.networkconnectivity.v1alpha1.CreateHubRequest; import com.google.cloud.networkconnectivity.v1alpha1.CreateSpokeRequest; @@ -50,7 +49,6 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -216,130 +214,100 @@ protected GrpcHubServiceStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(listHubsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListHubsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings getHubTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getHubMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetHubRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings createHubTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createHubMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateHubRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings updateHubTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateHubMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateHubRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("hub.name", String.valueOf(request.getHub().getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("hub.name", String.valueOf(request.getHub().getName())); + return params.build(); }) .build(); GrpcCallSettings deleteHubTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteHubMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteHubRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings listSpokesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSpokesMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListSpokesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings getSpokeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getSpokeMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetSpokeRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings createSpokeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createSpokeMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateSpokeRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings updateSpokeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateSpokeMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateSpokeRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("spoke.name", String.valueOf(request.getSpoke().getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("spoke.name", String.valueOf(request.getSpoke().getName())); + return params.build(); }) .build(); GrpcCallSettings deleteSpokeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSpokeMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteSpokeRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); @@ -520,7 +488,13 @@ public UnaryCallable deleteSpokeCallable() { @Override public final void close() { - shutdown(); + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } } @Override diff --git a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStubSettings.java b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStubSettings.java index 769eac75..4260743a 100644 --- a/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStubSettings.java +++ b/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/stub/HubServiceStubSettings.java @@ -766,14 +766,13 @@ private static Builder initDefaults(Builder builder) { return builder; } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } diff --git a/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/HubServiceClientTest.java b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/HubServiceClientTest.java new file mode 100644 index 00000000..63ee2fb9 --- /dev/null +++ b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/HubServiceClientTest.java @@ -0,0 +1,1195 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1; + +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListHubsPagedResponse; +import static com.google.cloud.networkconnectivity.v1.HubServiceClient.ListSpokesPagedResponse; + +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.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +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 HubServiceClientTest { + private static MockHubService mockHubService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private HubServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockHubService = new MockHubService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockHubService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + HubServiceSettings settings = + HubServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = HubServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listHubsTest() throws Exception { + Hub responsesElement = Hub.newBuilder().build(); + ListHubsResponse expectedResponse = + ListHubsResponse.newBuilder() + .setNextPageToken("") + .addAllHubs(Arrays.asList(responsesElement)) + .build(); + mockHubService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListHubsPagedResponse pagedListResponse = client.listHubs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getHubsList().get(0), resources.get(0)); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListHubsRequest actualRequest = ((ListHubsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listHubsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listHubs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listHubsTest2() throws Exception { + Hub responsesElement = Hub.newBuilder().build(); + ListHubsResponse expectedResponse = + ListHubsResponse.newBuilder() + .setNextPageToken("") + .addAllHubs(Arrays.asList(responsesElement)) + .build(); + mockHubService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListHubsPagedResponse pagedListResponse = client.listHubs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getHubsList().get(0), resources.get(0)); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListHubsRequest actualRequest = ((ListHubsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listHubsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listHubs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getHubTest() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + mockHubService.addResponse(expectedResponse); + + HubName name = HubName.of("[PROJECT]", "[HUB]"); + + Hub actualResponse = client.getHub(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetHubRequest actualRequest = ((GetHubRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getHubExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + HubName name = HubName.of("[PROJECT]", "[HUB]"); + client.getHub(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getHubTest2() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + mockHubService.addResponse(expectedResponse); + + String name = "name3373707"; + + Hub actualResponse = client.getHub(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetHubRequest actualRequest = ((GetHubRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getHubExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.getHub(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createHubTest() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Hub hub = Hub.newBuilder().build(); + String hubId = "hubId99628272"; + + Hub actualResponse = client.createHubAsync(parent, hub, hubId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateHubRequest actualRequest = ((CreateHubRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(hub, actualRequest.getHub()); + Assert.assertEquals(hubId, actualRequest.getHubId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createHubExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Hub hub = Hub.newBuilder().build(); + String hubId = "hubId99628272"; + client.createHubAsync(parent, hub, hubId).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 createHubTest2() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Hub hub = Hub.newBuilder().build(); + String hubId = "hubId99628272"; + + Hub actualResponse = client.createHubAsync(parent, hub, hubId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateHubRequest actualRequest = ((CreateHubRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(hub, actualRequest.getHub()); + Assert.assertEquals(hubId, actualRequest.getHubId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createHubExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String parent = "parent-995424086"; + Hub hub = Hub.newBuilder().build(); + String hubId = "hubId99628272"; + client.createHubAsync(parent, hub, hubId).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 updateHubTest() throws Exception { + Hub expectedResponse = + Hub.newBuilder() + .setName(HubName.of("[PROJECT]", "[HUB]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + Hub hub = Hub.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Hub actualResponse = client.updateHubAsync(hub, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateHubRequest actualRequest = ((UpdateHubRequest) actualRequests.get(0)); + + Assert.assertEquals(hub, actualRequest.getHub()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateHubExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + Hub hub = Hub.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateHubAsync(hub, updateMask).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 deleteHubTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + HubName name = HubName.of("[PROJECT]", "[HUB]"); + + client.deleteHubAsync(name).get(); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteHubRequest actualRequest = ((DeleteHubRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteHubExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + HubName name = HubName.of("[PROJECT]", "[HUB]"); + client.deleteHubAsync(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 deleteHubTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteHubTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteHubAsync(name).get(); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteHubRequest actualRequest = ((DeleteHubRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteHubExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.deleteHubAsync(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 listSpokesTest() throws Exception { + Spoke responsesElement = Spoke.newBuilder().build(); + ListSpokesResponse expectedResponse = + ListSpokesResponse.newBuilder() + .setNextPageToken("") + .addAllSpokes(Arrays.asList(responsesElement)) + .build(); + mockHubService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListSpokesPagedResponse pagedListResponse = client.listSpokes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpokesList().get(0), resources.get(0)); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSpokesRequest actualRequest = ((ListSpokesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSpokesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listSpokes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSpokesTest2() throws Exception { + Spoke responsesElement = Spoke.newBuilder().build(); + ListSpokesResponse expectedResponse = + ListSpokesResponse.newBuilder() + .setNextPageToken("") + .addAllSpokes(Arrays.asList(responsesElement)) + .build(); + mockHubService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSpokesPagedResponse pagedListResponse = client.listSpokes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSpokesList().get(0), resources.get(0)); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSpokesRequest actualRequest = ((ListSpokesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSpokesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSpokes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpokeTest() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .setLinkedVpnTunnels(LinkedVpnTunnels.newBuilder().build()) + .setLinkedInterconnectAttachments(LinkedInterconnectAttachments.newBuilder().build()) + .setLinkedRouterApplianceInstances(LinkedRouterApplianceInstances.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + mockHubService.addResponse(expectedResponse); + + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + + Spoke actualResponse = client.getSpoke(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpokeRequest actualRequest = ((GetSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + client.getSpoke(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSpokeTest2() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .setLinkedVpnTunnels(LinkedVpnTunnels.newBuilder().build()) + .setLinkedInterconnectAttachments(LinkedInterconnectAttachments.newBuilder().build()) + .setLinkedRouterApplianceInstances(LinkedRouterApplianceInstances.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + mockHubService.addResponse(expectedResponse); + + String name = "name3373707"; + + Spoke actualResponse = client.getSpoke(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSpokeRequest actualRequest = ((GetSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSpokeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.getSpoke(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSpokeTest() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .setLinkedVpnTunnels(LinkedVpnTunnels.newBuilder().build()) + .setLinkedInterconnectAttachments(LinkedInterconnectAttachments.newBuilder().build()) + .setLinkedRouterApplianceInstances(LinkedRouterApplianceInstances.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Spoke spoke = Spoke.newBuilder().build(); + String spokeId = "spokeId-1998996281"; + + Spoke actualResponse = client.createSpokeAsync(parent, spoke, spokeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSpokeRequest actualRequest = ((CreateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(spoke, actualRequest.getSpoke()); + Assert.assertEquals(spokeId, actualRequest.getSpokeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Spoke spoke = Spoke.newBuilder().build(); + String spokeId = "spokeId-1998996281"; + client.createSpokeAsync(parent, spoke, spokeId).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 createSpokeTest2() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .setLinkedVpnTunnels(LinkedVpnTunnels.newBuilder().build()) + .setLinkedInterconnectAttachments(LinkedInterconnectAttachments.newBuilder().build()) + .setLinkedRouterApplianceInstances(LinkedRouterApplianceInstances.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Spoke spoke = Spoke.newBuilder().build(); + String spokeId = "spokeId-1998996281"; + + Spoke actualResponse = client.createSpokeAsync(parent, spoke, spokeId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSpokeRequest actualRequest = ((CreateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(spoke, actualRequest.getSpoke()); + Assert.assertEquals(spokeId, actualRequest.getSpokeId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSpokeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String parent = "parent-995424086"; + Spoke spoke = Spoke.newBuilder().build(); + String spokeId = "spokeId-1998996281"; + client.createSpokeAsync(parent, spoke, spokeId).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 updateSpokeTest() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .setLinkedVpnTunnels(LinkedVpnTunnels.newBuilder().build()) + .setLinkedInterconnectAttachments(LinkedInterconnectAttachments.newBuilder().build()) + .setLinkedRouterApplianceInstances(LinkedRouterApplianceInstances.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + Spoke spoke = Spoke.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Spoke actualResponse = client.updateSpokeAsync(spoke, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSpokeRequest actualRequest = ((UpdateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(spoke, actualRequest.getSpoke()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + Spoke spoke = Spoke.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSpokeAsync(spoke, updateMask).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 deactivateSpokeTest() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .setLinkedVpnTunnels(LinkedVpnTunnels.newBuilder().build()) + .setLinkedInterconnectAttachments(LinkedInterconnectAttachments.newBuilder().build()) + .setLinkedRouterApplianceInstances(LinkedRouterApplianceInstances.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deactivateSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + + Spoke actualResponse = client.deactivateSpokeAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeactivateSpokeRequest actualRequest = ((DeactivateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deactivateSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + client.deactivateSpokeAsync(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 deactivateSpokeTest2() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .setLinkedVpnTunnels(LinkedVpnTunnels.newBuilder().build()) + .setLinkedInterconnectAttachments(LinkedInterconnectAttachments.newBuilder().build()) + .setLinkedRouterApplianceInstances(LinkedRouterApplianceInstances.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deactivateSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String name = "name3373707"; + + Spoke actualResponse = client.deactivateSpokeAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeactivateSpokeRequest actualRequest = ((DeactivateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deactivateSpokeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.deactivateSpokeAsync(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 activateSpokeTest() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .setLinkedVpnTunnels(LinkedVpnTunnels.newBuilder().build()) + .setLinkedInterconnectAttachments(LinkedInterconnectAttachments.newBuilder().build()) + .setLinkedRouterApplianceInstances(LinkedRouterApplianceInstances.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("activateSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + + Spoke actualResponse = client.activateSpokeAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ActivateSpokeRequest actualRequest = ((ActivateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void activateSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + client.activateSpokeAsync(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 activateSpokeTest2() throws Exception { + Spoke expectedResponse = + Spoke.newBuilder() + .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setHub(HubName.of("[PROJECT]", "[HUB]").toString()) + .setLinkedVpnTunnels(LinkedVpnTunnels.newBuilder().build()) + .setLinkedInterconnectAttachments(LinkedInterconnectAttachments.newBuilder().build()) + .setLinkedRouterApplianceInstances(LinkedRouterApplianceInstances.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setState(State.forNumber(0)) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("activateSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String name = "name3373707"; + + Spoke actualResponse = client.activateSpokeAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ActivateSpokeRequest actualRequest = ((ActivateSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void activateSpokeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.activateSpokeAsync(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 deleteSpokeTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + + client.deleteSpokeAsync(name).get(); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSpokeRequest actualRequest = ((DeleteSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSpokeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]"); + client.deleteSpokeAsync(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 deleteSpokeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSpokeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockHubService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteSpokeAsync(name).get(); + + List actualRequests = mockHubService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSpokeRequest actualRequest = ((DeleteSpokeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSpokeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockHubService.addException(exception); + + try { + String name = "name3373707"; + client.deleteSpokeAsync(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/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockHubService.java b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockHubService.java new file mode 100644 index 00000000..87afd72b --- /dev/null +++ b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockHubService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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 MockHubService implements MockGrpcService { + private final MockHubServiceImpl serviceImpl; + + public MockHubService() { + serviceImpl = new MockHubServiceImpl(); + } + + @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/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockHubServiceImpl.java b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockHubServiceImpl.java new file mode 100644 index 00000000..00d0c367 --- /dev/null +++ b/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockHubServiceImpl.java @@ -0,0 +1,304 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.networkconnectivity.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.networkconnectivity.v1.HubServiceGrpc.HubServiceImplBase; +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 MockHubServiceImpl extends HubServiceImplBase { + private List requests; + private Queue responses; + + public MockHubServiceImpl() { + 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 listHubs(ListHubsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListHubsResponse) { + requests.add(request); + responseObserver.onNext(((ListHubsResponse) 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 ListHubs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListHubsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getHub(GetHubRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Hub) { + requests.add(request); + responseObserver.onNext(((Hub) 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 GetHub, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Hub.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createHub(CreateHubRequest 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 CreateHub, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateHub(UpdateHubRequest 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 UpdateHub, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteHub(DeleteHubRequest 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 DeleteHub, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSpokes( + ListSpokesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSpokesResponse) { + requests.add(request); + responseObserver.onNext(((ListSpokesResponse) 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 ListSpokes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSpokesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSpoke(GetSpokeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Spoke) { + requests.add(request); + responseObserver.onNext(((Spoke) 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 GetSpoke, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Spoke.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSpoke(CreateSpokeRequest 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 CreateSpoke, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSpoke(UpdateSpokeRequest 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 UpdateSpoke, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deactivateSpoke( + DeactivateSpokeRequest 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 DeactivateSpoke, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void activateSpoke( + ActivateSpokeRequest 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 ActivateSpoke, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSpoke(DeleteSpokeRequest 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 DeleteSpoke, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-networkconnectivity-v1/pom.xml b/grpc-google-cloud-networkconnectivity-v1/pom.xml new file mode 100644 index 00000000..83744db1 --- /dev/null +++ b/grpc-google-cloud-networkconnectivity-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-networkconnectivity-v1 + 0.3.3-SNAPSHOT + grpc-google-cloud-networkconnectivity-v1 + GRPC library for google-cloud-networkconnectivity + + com.google.cloud + google-cloud-networkconnectivity-parent + 0.3.3-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-networkconnectivity-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubServiceGrpc.java b/grpc-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubServiceGrpc.java new file mode 100644 index 00000000..8f0b2846 --- /dev/null +++ b/grpc-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubServiceGrpc.java @@ -0,0 +1,1628 @@ +/* + * 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; + +/** + * + * + *
+ * Network Connectivity Center is a hub-and-spoke abstraction for network
+ * connectivity management in Google Cloud. It reduces operational complexity
+ * through a simple, centralized connectivity management model.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/networkconnectivity/v1/hub.proto") +public final class HubServiceGrpc { + + private HubServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.networkconnectivity.v1.HubService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.ListHubsRequest, + com.google.cloud.networkconnectivity.v1.ListHubsResponse> + getListHubsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListHubs", + requestType = com.google.cloud.networkconnectivity.v1.ListHubsRequest.class, + responseType = com.google.cloud.networkconnectivity.v1.ListHubsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.ListHubsRequest, + com.google.cloud.networkconnectivity.v1.ListHubsResponse> + getListHubsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.ListHubsRequest, + com.google.cloud.networkconnectivity.v1.ListHubsResponse> + getListHubsMethod; + if ((getListHubsMethod = HubServiceGrpc.getListHubsMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getListHubsMethod = HubServiceGrpc.getListHubsMethod) == null) { + HubServiceGrpc.getListHubsMethod = + getListHubsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListHubs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.ListHubsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.ListHubsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("ListHubs")) + .build(); + } + } + } + return getListHubsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.GetHubRequest, + com.google.cloud.networkconnectivity.v1.Hub> + getGetHubMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetHub", + requestType = com.google.cloud.networkconnectivity.v1.GetHubRequest.class, + responseType = com.google.cloud.networkconnectivity.v1.Hub.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.GetHubRequest, + com.google.cloud.networkconnectivity.v1.Hub> + getGetHubMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.GetHubRequest, + com.google.cloud.networkconnectivity.v1.Hub> + getGetHubMethod; + if ((getGetHubMethod = HubServiceGrpc.getGetHubMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getGetHubMethod = HubServiceGrpc.getGetHubMethod) == null) { + HubServiceGrpc.getGetHubMethod = + getGetHubMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetHub")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.GetHubRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("GetHub")) + .build(); + } + } + } + return getGetHubMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.CreateHubRequest, + com.google.longrunning.Operation> + getCreateHubMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateHub", + requestType = com.google.cloud.networkconnectivity.v1.CreateHubRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.CreateHubRequest, + com.google.longrunning.Operation> + getCreateHubMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.CreateHubRequest, + com.google.longrunning.Operation> + getCreateHubMethod; + if ((getCreateHubMethod = HubServiceGrpc.getCreateHubMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getCreateHubMethod = HubServiceGrpc.getCreateHubMethod) == null) { + HubServiceGrpc.getCreateHubMethod = + getCreateHubMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateHub")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.CreateHubRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("CreateHub")) + .build(); + } + } + } + return getCreateHubMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.UpdateHubRequest, + com.google.longrunning.Operation> + getUpdateHubMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateHub", + requestType = com.google.cloud.networkconnectivity.v1.UpdateHubRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.UpdateHubRequest, + com.google.longrunning.Operation> + getUpdateHubMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.UpdateHubRequest, + com.google.longrunning.Operation> + getUpdateHubMethod; + if ((getUpdateHubMethod = HubServiceGrpc.getUpdateHubMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getUpdateHubMethod = HubServiceGrpc.getUpdateHubMethod) == null) { + HubServiceGrpc.getUpdateHubMethod = + getUpdateHubMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateHub")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.UpdateHubRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("UpdateHub")) + .build(); + } + } + } + return getUpdateHubMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.DeleteHubRequest, + com.google.longrunning.Operation> + getDeleteHubMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteHub", + requestType = com.google.cloud.networkconnectivity.v1.DeleteHubRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.DeleteHubRequest, + com.google.longrunning.Operation> + getDeleteHubMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.DeleteHubRequest, + com.google.longrunning.Operation> + getDeleteHubMethod; + if ((getDeleteHubMethod = HubServiceGrpc.getDeleteHubMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getDeleteHubMethod = HubServiceGrpc.getDeleteHubMethod) == null) { + HubServiceGrpc.getDeleteHubMethod = + getDeleteHubMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteHub")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.DeleteHubRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("DeleteHub")) + .build(); + } + } + } + return getDeleteHubMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.ListSpokesRequest, + com.google.cloud.networkconnectivity.v1.ListSpokesResponse> + getListSpokesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSpokes", + requestType = com.google.cloud.networkconnectivity.v1.ListSpokesRequest.class, + responseType = com.google.cloud.networkconnectivity.v1.ListSpokesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.ListSpokesRequest, + com.google.cloud.networkconnectivity.v1.ListSpokesResponse> + getListSpokesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.ListSpokesRequest, + com.google.cloud.networkconnectivity.v1.ListSpokesResponse> + getListSpokesMethod; + if ((getListSpokesMethod = HubServiceGrpc.getListSpokesMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getListSpokesMethod = HubServiceGrpc.getListSpokesMethod) == null) { + HubServiceGrpc.getListSpokesMethod = + getListSpokesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSpokes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.ListSpokesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.ListSpokesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("ListSpokes")) + .build(); + } + } + } + return getListSpokesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.GetSpokeRequest, + com.google.cloud.networkconnectivity.v1.Spoke> + getGetSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSpoke", + requestType = com.google.cloud.networkconnectivity.v1.GetSpokeRequest.class, + responseType = com.google.cloud.networkconnectivity.v1.Spoke.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.GetSpokeRequest, + com.google.cloud.networkconnectivity.v1.Spoke> + getGetSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.GetSpokeRequest, + com.google.cloud.networkconnectivity.v1.Spoke> + getGetSpokeMethod; + if ((getGetSpokeMethod = HubServiceGrpc.getGetSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getGetSpokeMethod = HubServiceGrpc.getGetSpokeMethod) == null) { + HubServiceGrpc.getGetSpokeMethod = + getGetSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.GetSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("GetSpoke")) + .build(); + } + } + } + return getGetSpokeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest, + com.google.longrunning.Operation> + getCreateSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSpoke", + requestType = com.google.cloud.networkconnectivity.v1.CreateSpokeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest, + com.google.longrunning.Operation> + getCreateSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest, + com.google.longrunning.Operation> + getCreateSpokeMethod; + if ((getCreateSpokeMethod = HubServiceGrpc.getCreateSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getCreateSpokeMethod = HubServiceGrpc.getCreateSpokeMethod) == null) { + HubServiceGrpc.getCreateSpokeMethod = + getCreateSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("CreateSpoke")) + .build(); + } + } + } + return getCreateSpokeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest, + com.google.longrunning.Operation> + getUpdateSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSpoke", + requestType = com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest, + com.google.longrunning.Operation> + getUpdateSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest, + com.google.longrunning.Operation> + getUpdateSpokeMethod; + if ((getUpdateSpokeMethod = HubServiceGrpc.getUpdateSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getUpdateSpokeMethod = HubServiceGrpc.getUpdateSpokeMethod) == null) { + HubServiceGrpc.getUpdateSpokeMethod = + getUpdateSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("UpdateSpoke")) + .build(); + } + } + } + return getUpdateSpokeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest, + com.google.longrunning.Operation> + getDeactivateSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeactivateSpoke", + requestType = com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest, + com.google.longrunning.Operation> + getDeactivateSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest, + com.google.longrunning.Operation> + getDeactivateSpokeMethod; + if ((getDeactivateSpokeMethod = HubServiceGrpc.getDeactivateSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getDeactivateSpokeMethod = HubServiceGrpc.getDeactivateSpokeMethod) == null) { + HubServiceGrpc.getDeactivateSpokeMethod = + getDeactivateSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeactivateSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new HubServiceMethodDescriptorSupplier("DeactivateSpoke")) + .build(); + } + } + } + return getDeactivateSpokeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest, + com.google.longrunning.Operation> + getActivateSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ActivateSpoke", + requestType = com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest, + com.google.longrunning.Operation> + getActivateSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest, + com.google.longrunning.Operation> + getActivateSpokeMethod; + if ((getActivateSpokeMethod = HubServiceGrpc.getActivateSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getActivateSpokeMethod = HubServiceGrpc.getActivateSpokeMethod) == null) { + HubServiceGrpc.getActivateSpokeMethod = + getActivateSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ActivateSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("ActivateSpoke")) + .build(); + } + } + } + return getActivateSpokeMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest, + com.google.longrunning.Operation> + getDeleteSpokeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSpoke", + requestType = com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest, + com.google.longrunning.Operation> + getDeleteSpokeMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest, + com.google.longrunning.Operation> + getDeleteSpokeMethod; + if ((getDeleteSpokeMethod = HubServiceGrpc.getDeleteSpokeMethod) == null) { + synchronized (HubServiceGrpc.class) { + if ((getDeleteSpokeMethod = HubServiceGrpc.getDeleteSpokeMethod) == null) { + HubServiceGrpc.getDeleteSpokeMethod = + getDeleteSpokeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSpoke")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new HubServiceMethodDescriptorSupplier("DeleteSpoke")) + .build(); + } + } + } + return getDeleteSpokeMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static HubServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public HubServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceStub(channel, callOptions); + } + }; + return HubServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static HubServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public HubServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceBlockingStub(channel, callOptions); + } + }; + return HubServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static HubServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public HubServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceFutureStub(channel, callOptions); + } + }; + return HubServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Network Connectivity Center is a hub-and-spoke abstraction for network
+   * connectivity management in Google Cloud. It reduces operational complexity
+   * through a simple, centralized connectivity management model.
+   * 
+ */ + public abstract static class HubServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists hubs in a given project.
+     * 
+ */ + public void listHubs( + com.google.cloud.networkconnectivity.v1.ListHubsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListHubsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details about the specified hub.
+     * 
+ */ + public void getHub( + com.google.cloud.networkconnectivity.v1.GetHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetHubMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new hub in the specified project.
+     * 
+ */ + public void createHub( + com.google.cloud.networkconnectivity.v1.CreateHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateHubMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the description and/or labels of the specified hub.
+     * 
+ */ + public void updateHub( + com.google.cloud.networkconnectivity.v1.UpdateHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateHubMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified hub.
+     * 
+ */ + public void deleteHub( + com.google.cloud.networkconnectivity.v1.DeleteHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteHubMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the spokes in the specified project and location.
+     * 
+ */ + public void listSpokes( + com.google.cloud.networkconnectivity.v1.ListSpokesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSpokesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details about the specified spoke.
+     * 
+ */ + public void getSpoke( + com.google.cloud.networkconnectivity.v1.GetSpokeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSpokeMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a spoke in the specified project and location.
+     * 
+ */ + public void createSpoke( + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSpokeMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of the specified spoke.
+     * 
+ */ + public void updateSpoke( + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateSpokeMethod(), responseObserver); + } + + /** + * + * + *
+     * Deactivates the specified spoke. Deactivating keeps the spoke information
+     * for future re-activation, but disconnects the Google Cloud network from
+     * non-Google-Cloud network.
+     * 
+ */ + public void deactivateSpoke( + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeactivateSpokeMethod(), responseObserver); + } + + /** + * + * + *
+     * Activates the specified spoke. Activating reconnects the Google Cloud
+     * network with the non-Google-Cloud network.
+     * 
+ */ + public void activateSpoke( + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getActivateSpokeMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified spoke.
+     * 
+ */ + public void deleteSpoke( + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSpokeMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListHubsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.ListHubsRequest, + com.google.cloud.networkconnectivity.v1.ListHubsResponse>( + this, METHODID_LIST_HUBS))) + .addMethod( + getGetHubMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.GetHubRequest, + com.google.cloud.networkconnectivity.v1.Hub>(this, METHODID_GET_HUB))) + .addMethod( + getCreateHubMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.CreateHubRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_HUB))) + .addMethod( + getUpdateHubMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.UpdateHubRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_HUB))) + .addMethod( + getDeleteHubMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.DeleteHubRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_HUB))) + .addMethod( + getListSpokesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.ListSpokesRequest, + com.google.cloud.networkconnectivity.v1.ListSpokesResponse>( + this, METHODID_LIST_SPOKES))) + .addMethod( + getGetSpokeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.GetSpokeRequest, + com.google.cloud.networkconnectivity.v1.Spoke>(this, METHODID_GET_SPOKE))) + .addMethod( + getCreateSpokeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SPOKE))) + .addMethod( + getUpdateSpokeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_SPOKE))) + .addMethod( + getDeactivateSpokeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest, + com.google.longrunning.Operation>(this, METHODID_DEACTIVATE_SPOKE))) + .addMethod( + getActivateSpokeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest, + com.google.longrunning.Operation>(this, METHODID_ACTIVATE_SPOKE))) + .addMethod( + getDeleteSpokeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_SPOKE))) + .build(); + } + } + + /** + * + * + *
+   * Network Connectivity Center is a hub-and-spoke abstraction for network
+   * connectivity management in Google Cloud. It reduces operational complexity
+   * through a simple, centralized connectivity management model.
+   * 
+ */ + public static final class HubServiceStub extends io.grpc.stub.AbstractAsyncStub { + private HubServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HubServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists hubs in a given project.
+     * 
+ */ + public void listHubs( + com.google.cloud.networkconnectivity.v1.ListHubsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListHubsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets details about the specified hub.
+     * 
+ */ + public void getHub( + com.google.cloud.networkconnectivity.v1.GetHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetHubMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new hub in the specified project.
+     * 
+ */ + public void createHub( + com.google.cloud.networkconnectivity.v1.CreateHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateHubMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates the description and/or labels of the specified hub.
+     * 
+ */ + public void updateHub( + com.google.cloud.networkconnectivity.v1.UpdateHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateHubMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes the specified hub.
+     * 
+ */ + public void deleteHub( + com.google.cloud.networkconnectivity.v1.DeleteHubRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteHubMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists the spokes in the specified project and location.
+     * 
+ */ + public void listSpokes( + com.google.cloud.networkconnectivity.v1.ListSpokesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSpokesMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets details about the specified spoke.
+     * 
+ */ + public void getSpoke( + com.google.cloud.networkconnectivity.v1.GetSpokeRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSpokeMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a spoke in the specified project and location.
+     * 
+ */ + public void createSpoke( + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSpokeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of the specified spoke.
+     * 
+ */ + public void updateSpoke( + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSpokeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deactivates the specified spoke. Deactivating keeps the spoke information
+     * for future re-activation, but disconnects the Google Cloud network from
+     * non-Google-Cloud network.
+     * 
+ */ + public void deactivateSpoke( + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeactivateSpokeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Activates the specified spoke. Activating reconnects the Google Cloud
+     * network with the non-Google-Cloud network.
+     * 
+ */ + public void activateSpoke( + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getActivateSpokeMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified spoke.
+     * 
+ */ + public void deleteSpoke( + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSpokeMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Network Connectivity Center is a hub-and-spoke abstraction for network
+   * connectivity management in Google Cloud. It reduces operational complexity
+   * through a simple, centralized connectivity management model.
+   * 
+ */ + public static final class HubServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private HubServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HubServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists hubs in a given project.
+     * 
+ */ + public com.google.cloud.networkconnectivity.v1.ListHubsResponse listHubs( + com.google.cloud.networkconnectivity.v1.ListHubsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListHubsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details about the specified hub.
+     * 
+ */ + public com.google.cloud.networkconnectivity.v1.Hub getHub( + com.google.cloud.networkconnectivity.v1.GetHubRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetHubMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new hub in the specified project.
+     * 
+ */ + public com.google.longrunning.Operation createHub( + com.google.cloud.networkconnectivity.v1.CreateHubRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateHubMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the description and/or labels of the specified hub.
+     * 
+ */ + public com.google.longrunning.Operation updateHub( + com.google.cloud.networkconnectivity.v1.UpdateHubRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateHubMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified hub.
+     * 
+ */ + public com.google.longrunning.Operation deleteHub( + com.google.cloud.networkconnectivity.v1.DeleteHubRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteHubMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the spokes in the specified project and location.
+     * 
+ */ + public com.google.cloud.networkconnectivity.v1.ListSpokesResponse listSpokes( + com.google.cloud.networkconnectivity.v1.ListSpokesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSpokesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details about the specified spoke.
+     * 
+ */ + public com.google.cloud.networkconnectivity.v1.Spoke getSpoke( + com.google.cloud.networkconnectivity.v1.GetSpokeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSpokeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a spoke in the specified project and location.
+     * 
+ */ + public com.google.longrunning.Operation createSpoke( + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSpokeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of the specified spoke.
+     * 
+ */ + public com.google.longrunning.Operation updateSpoke( + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSpokeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deactivates the specified spoke. Deactivating keeps the spoke information
+     * for future re-activation, but disconnects the Google Cloud network from
+     * non-Google-Cloud network.
+     * 
+ */ + public com.google.longrunning.Operation deactivateSpoke( + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeactivateSpokeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Activates the specified spoke. Activating reconnects the Google Cloud
+     * network with the non-Google-Cloud network.
+     * 
+ */ + public com.google.longrunning.Operation activateSpoke( + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getActivateSpokeMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified spoke.
+     * 
+ */ + public com.google.longrunning.Operation deleteSpoke( + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSpokeMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Network Connectivity Center is a hub-and-spoke abstraction for network
+   * connectivity management in Google Cloud. It reduces operational complexity
+   * through a simple, centralized connectivity management model.
+   * 
+ */ + public static final class HubServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private HubServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HubServiceFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HubServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists hubs in a given project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networkconnectivity.v1.ListHubsResponse> + listHubs(com.google.cloud.networkconnectivity.v1.ListHubsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListHubsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details about the specified hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networkconnectivity.v1.Hub> + getHub(com.google.cloud.networkconnectivity.v1.GetHubRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetHubMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new hub in the specified project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createHub(com.google.cloud.networkconnectivity.v1.CreateHubRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateHubMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the description and/or labels of the specified hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateHub(com.google.cloud.networkconnectivity.v1.UpdateHubRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateHubMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified hub.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteHub(com.google.cloud.networkconnectivity.v1.DeleteHubRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteHubMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the spokes in the specified project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networkconnectivity.v1.ListSpokesResponse> + listSpokes(com.google.cloud.networkconnectivity.v1.ListSpokesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSpokesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details about the specified spoke.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.networkconnectivity.v1.Spoke> + getSpoke(com.google.cloud.networkconnectivity.v1.GetSpokeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSpokeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a spoke in the specified project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSpoke(com.google.cloud.networkconnectivity.v1.CreateSpokeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSpokeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of the specified spoke.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateSpoke(com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSpokeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deactivates the specified spoke. Deactivating keeps the spoke information
+     * for future re-activation, but disconnects the Google Cloud network from
+     * non-Google-Cloud network.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deactivateSpoke(com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeactivateSpokeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Activates the specified spoke. Activating reconnects the Google Cloud
+     * network with the non-Google-Cloud network.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + activateSpoke(com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getActivateSpokeMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified spoke.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSpoke(com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSpokeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_HUBS = 0; + private static final int METHODID_GET_HUB = 1; + private static final int METHODID_CREATE_HUB = 2; + private static final int METHODID_UPDATE_HUB = 3; + private static final int METHODID_DELETE_HUB = 4; + private static final int METHODID_LIST_SPOKES = 5; + private static final int METHODID_GET_SPOKE = 6; + private static final int METHODID_CREATE_SPOKE = 7; + private static final int METHODID_UPDATE_SPOKE = 8; + private static final int METHODID_DEACTIVATE_SPOKE = 9; + private static final int METHODID_ACTIVATE_SPOKE = 10; + private static final int METHODID_DELETE_SPOKE = 11; + + 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 HubServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(HubServiceImplBase 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_HUBS: + serviceImpl.listHubs( + (com.google.cloud.networkconnectivity.v1.ListHubsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.networkconnectivity.v1.ListHubsResponse>) + responseObserver); + break; + case METHODID_GET_HUB: + serviceImpl.getHub( + (com.google.cloud.networkconnectivity.v1.GetHubRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_HUB: + serviceImpl.createHub( + (com.google.cloud.networkconnectivity.v1.CreateHubRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_HUB: + serviceImpl.updateHub( + (com.google.cloud.networkconnectivity.v1.UpdateHubRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_HUB: + serviceImpl.deleteHub( + (com.google.cloud.networkconnectivity.v1.DeleteHubRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SPOKES: + serviceImpl.listSpokes( + (com.google.cloud.networkconnectivity.v1.ListSpokesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.networkconnectivity.v1.ListSpokesResponse>) + responseObserver); + break; + case METHODID_GET_SPOKE: + serviceImpl.getSpoke( + (com.google.cloud.networkconnectivity.v1.GetSpokeRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_SPOKE: + serviceImpl.createSpoke( + (com.google.cloud.networkconnectivity.v1.CreateSpokeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SPOKE: + serviceImpl.updateSpoke( + (com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEACTIVATE_SPOKE: + serviceImpl.deactivateSpoke( + (com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ACTIVATE_SPOKE: + serviceImpl.activateSpoke( + (com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SPOKE: + serviceImpl.deleteSpoke( + (com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest) 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 HubServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + HubServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("HubService"); + } + } + + private static final class HubServiceFileDescriptorSupplier + extends HubServiceBaseDescriptorSupplier { + HubServiceFileDescriptorSupplier() {} + } + + private static final class HubServiceMethodDescriptorSupplier + extends HubServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + HubServiceMethodDescriptorSupplier(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 (HubServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new HubServiceFileDescriptorSupplier()) + .addMethod(getListHubsMethod()) + .addMethod(getGetHubMethod()) + .addMethod(getCreateHubMethod()) + .addMethod(getUpdateHubMethod()) + .addMethod(getDeleteHubMethod()) + .addMethod(getListSpokesMethod()) + .addMethod(getGetSpokeMethod()) + .addMethod(getCreateSpokeMethod()) + .addMethod(getUpdateSpokeMethod()) + .addMethod(getDeactivateSpokeMethod()) + .addMethod(getActivateSpokeMethod()) + .addMethod(getDeleteSpokeMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 8663c59b..f283cf55 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,16 @@ google-cloud-networkconnectivity 0.3.3-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-networkconnectivity-v1 + 0.3.3-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-networkconnectivity-v1 + 0.3.3-SNAPSHOT + com.google.api.grpc proto-google-cloud-networkconnectivity-v1alpha1 @@ -104,7 +114,9 @@ google-cloud-networkconnectivity grpc-google-cloud-networkconnectivity-v1alpha1 + grpc-google-cloud-networkconnectivity-v1 proto-google-cloud-networkconnectivity-v1alpha1 + proto-google-cloud-networkconnectivity-v1 google-cloud-networkconnectivity-bom diff --git a/proto-google-cloud-networkconnectivity-v1/clirr-ignored-differences.xml b/proto-google-cloud-networkconnectivity-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..51a24032 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/networkconnectivity/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/networkconnectivity/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/networkconnectivity/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-networkconnectivity-v1/pom.xml b/proto-google-cloud-networkconnectivity-v1/pom.xml new file mode 100644 index 00000000..6229d7ee --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-networkconnectivity-v1 + 0.3.3-SNAPSHOT + proto-google-cloud-networkconnectivity-v1 + Proto library for google-cloud-networkconnectivity + + com.google.cloud + google-cloud-networkconnectivity-parent + 0.3.3-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ActivateSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ActivateSpokeRequest.java new file mode 100644 index 00000000..ee3a9075 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ActivateSpokeRequest.java @@ -0,0 +1,910 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * The request for [HubService.ActivateSpoke][google.cloud.networkconnectivity.v1.HubService.ActivateSpoke].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ActivateSpokeRequest} + */ +public final class ActivateSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.ActivateSpokeRequest) + ActivateSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ActivateSpokeRequest.newBuilder() to construct. + private ActivateSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ActivateSpokeRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ActivateSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ActivateSpokeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ActivateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ActivateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the spoke to activate.
+   * 
+ * + * + * 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. The name of the spoke to activate.
+   * 
+ * + * + * 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; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + size += unknownFields.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.ActivateSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest other = + (com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest 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.ActivateSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest 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.ActivateSpokeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest 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.ActivateSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest 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.ActivateSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest 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.ActivateSpokeRequest 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.ActivateSpokeRequest 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.ActivateSpokeRequest 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; + } + /** + * + * + *
+   * The request for [HubService.ActivateSpoke][google.cloud.networkconnectivity.v1.HubService.ActivateSpoke].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ActivateSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.ActivateSpokeRequest) + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ActivateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ActivateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ActivateSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest build() { + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest result = + new com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.ActivateSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the spoke to activate.
+     * 
+ * + * + * 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. The name of the spoke to activate.
+     * 
+ * + * + * 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. The name of the spoke to activate.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spoke to activate.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spoke to activate.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + 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.ActivateSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.ActivateSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.ActivateSpokeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ActivateSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ActivateSpokeRequest(input, extensionRegistry); + } + }; + + 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.ActivateSpokeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ActivateSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ActivateSpokeRequestOrBuilder.java new file mode 100644 index 00000000..8451bec6 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ActivateSpokeRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface ActivateSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.ActivateSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the spoke to activate.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the spoke to activate.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CommonProto.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CommonProto.java new file mode 100644 index 00000000..ccde21f6 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CommonProto.java @@ -0,0 +1,95 @@ +/* + * 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/common.proto + +package com.google.cloud.networkconnectivity.v1; + +public final class CommonProto { + private CommonProto() {} + + 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_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/networkconnectivity/v1/co" + + "mmon.proto\022#google.cloud.networkconnecti" + + "vity.v1\032\037google/api/field_behavior.proto" + + "\032\037google/protobuf/timestamp.proto\032\034googl" + + "e/api/annotations.proto\"\200\002\n\021OperationMet" + + "adata\0224\n\013create_time\030\001 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\003\022\023\n\006target" + + "\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016status" + + "_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_cancell" + + "ation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB\003\340" + + "A\003B\205\002\n\'com.google.cloud.networkconnectiv" + + "ity.v1B\013CommonProtoP\001ZVgoogle.golang.org" + + "/genproto/googleapis/cloud/networkconnec" + + "tivity/v1;networkconnectivity\252\002#Google.C" + + "loud.NetworkConnectivity.V1\312\002#Google\\Clo" + + "ud\\NetworkConnectivity\\V1\352\002&Google::Clou" + + "d::NetworkConnectivity::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_networkconnectivity_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_networkconnectivity_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_networkconnectivity_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateHubRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateHubRequest.java new file mode 100644 index 00000000..bf5bf35c --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateHubRequest.java @@ -0,0 +1,1385 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * Request for [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.CreateHubRequest} + */ +public final class CreateHubRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.CreateHubRequest) + CreateHubRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateHubRequest.newBuilder() to construct. + private CreateHubRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateHubRequest() { + parent_ = ""; + hubId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateHubRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateHubRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + hubId_ = s; + break; + } + case 26: + { + com.google.cloud.networkconnectivity.v1.Hub.Builder subBuilder = null; + if (hub_ != null) { + subBuilder = hub_.toBuilder(); + } + hub_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1.Hub.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(hub_); + hub_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.CreateHubRequest.class, + com.google.cloud.networkconnectivity.v1.CreateHubRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource.
+   * 
+ * + * + * 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.
+   * 
+ * + * + * 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 HUB_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object hubId_; + /** + * + * + *
+   * Optional. A unique identifier for the hub.
+   * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The hubId. + */ + @java.lang.Override + public java.lang.String getHubId() { + java.lang.Object ref = hubId_; + 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(); + hubId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A unique identifier for the hub.
+   * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for hubId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHubIdBytes() { + java.lang.Object ref = hubId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hubId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HUB_FIELD_NUMBER = 3; + private com.google.cloud.networkconnectivity.v1.Hub hub_; + /** + * + * + *
+   * Required. The initial values for a new hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + @java.lang.Override + public boolean hasHub() { + return hub_ != null; + } + /** + * + * + *
+   * Required. The initial values for a new hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Hub getHub() { + return hub_ == null ? com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance() : hub_; + } + /** + * + * + *
+   * Required. The initial values for a new hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.HubOrBuilder getHubOrBuilder() { + return getHub(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getHubIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, hubId_); + } + if (hub_ != null) { + output.writeMessage(3, getHub()); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getHubIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, hubId_); + } + if (hub_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getHub()); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + size += unknownFields.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.CreateHubRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.CreateHubRequest other = + (com.google.cloud.networkconnectivity.v1.CreateHubRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getHubId().equals(other.getHubId())) return false; + if (hasHub() != other.hasHub()) return false; + if (hasHub()) { + if (!getHub().equals(other.getHub())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + HUB_ID_FIELD_NUMBER; + hash = (53 * hash) + getHubId().hashCode(); + if (hasHub()) { + hash = (37 * hash) + HUB_FIELD_NUMBER; + hash = (53 * hash) + getHub().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.CreateHubRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.CreateHubRequest 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.CreateHubRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.CreateHubRequest 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.CreateHubRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.CreateHubRequest 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.CreateHubRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.CreateHubRequest 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.CreateHubRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.CreateHubRequest 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.CreateHubRequest 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.CreateHubRequest 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.CreateHubRequest 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 [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.CreateHubRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.CreateHubRequest) + com.google.cloud.networkconnectivity.v1.CreateHubRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.CreateHubRequest.class, + com.google.cloud.networkconnectivity.v1.CreateHubRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.CreateHubRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + hubId_ = ""; + + if (hubBuilder_ == null) { + hub_ = null; + } else { + hub_ = null; + hubBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateHubRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.CreateHubRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.CreateHubRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.CreateHubRequest build() { + com.google.cloud.networkconnectivity.v1.CreateHubRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.CreateHubRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.CreateHubRequest result = + new com.google.cloud.networkconnectivity.v1.CreateHubRequest(this); + result.parent_ = parent_; + result.hubId_ = hubId_; + if (hubBuilder_ == null) { + result.hub_ = hub_; + } else { + result.hub_ = hubBuilder_.build(); + } + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.CreateHubRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.CreateHubRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.CreateHubRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.CreateHubRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getHubId().isEmpty()) { + hubId_ = other.hubId_; + onChanged(); + } + if (other.hasHub()) { + mergeHub(other.getHub()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.CreateHubRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.CreateHubRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + + private java.lang.Object hubId_ = ""; + /** + * + * + *
+     * Optional. A unique identifier for the hub.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The hubId. + */ + public java.lang.String getHubId() { + java.lang.Object ref = hubId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hubId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for the hub.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for hubId. + */ + public com.google.protobuf.ByteString getHubIdBytes() { + java.lang.Object ref = hubId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hubId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for the hub.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The hubId to set. + * @return This builder for chaining. + */ + public Builder setHubId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + hubId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for the hub.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearHubId() { + + hubId_ = getDefaultInstance().getHubId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for the hub.
+     * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for hubId to set. + * @return This builder for chaining. + */ + public Builder setHubIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + hubId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.networkconnectivity.v1.Hub hub_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Hub, + com.google.cloud.networkconnectivity.v1.Hub.Builder, + com.google.cloud.networkconnectivity.v1.HubOrBuilder> + hubBuilder_; + /** + * + * + *
+     * Required. The initial values for a new hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + public boolean hasHub() { + return hubBuilder_ != null || hub_ != null; + } + /** + * + * + *
+     * Required. The initial values for a new hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + public com.google.cloud.networkconnectivity.v1.Hub getHub() { + if (hubBuilder_ == null) { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance() + : hub_; + } else { + return hubBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The initial values for a new hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHub(com.google.cloud.networkconnectivity.v1.Hub value) { + if (hubBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hub_ = value; + onChanged(); + } else { + hubBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The initial values for a new hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHub(com.google.cloud.networkconnectivity.v1.Hub.Builder builderForValue) { + if (hubBuilder_ == null) { + hub_ = builderForValue.build(); + onChanged(); + } else { + hubBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The initial values for a new hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeHub(com.google.cloud.networkconnectivity.v1.Hub value) { + if (hubBuilder_ == null) { + if (hub_ != null) { + hub_ = + com.google.cloud.networkconnectivity.v1.Hub.newBuilder(hub_) + .mergeFrom(value) + .buildPartial(); + } else { + hub_ = value; + } + onChanged(); + } else { + hubBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The initial values for a new hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearHub() { + if (hubBuilder_ == null) { + hub_ = null; + onChanged(); + } else { + hub_ = null; + hubBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The initial values for a new hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1.Hub.Builder getHubBuilder() { + + onChanged(); + return getHubFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The initial values for a new hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1.HubOrBuilder getHubOrBuilder() { + if (hubBuilder_ != null) { + return hubBuilder_.getMessageOrBuilder(); + } else { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance() + : hub_; + } + } + /** + * + * + *
+     * Required. The initial values for a new hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Hub, + com.google.cloud.networkconnectivity.v1.Hub.Builder, + com.google.cloud.networkconnectivity.v1.HubOrBuilder> + getHubFieldBuilder() { + if (hubBuilder_ == null) { + hubBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Hub, + com.google.cloud.networkconnectivity.v1.Hub.Builder, + com.google.cloud.networkconnectivity.v1.HubOrBuilder>( + getHub(), getParentForChildren(), isClean()); + hub_ = null; + } + return hubBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + 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.CreateHubRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.CreateHubRequest) + private static final com.google.cloud.networkconnectivity.v1.CreateHubRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.CreateHubRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.CreateHubRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateHubRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateHubRequest(input, extensionRegistry); + } + }; + + 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.CreateHubRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateHubRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateHubRequestOrBuilder.java new file mode 100644 index 00000000..6cf036b9 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateHubRequestOrBuilder.java @@ -0,0 +1,167 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface CreateHubRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.CreateHubRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. A unique identifier for the hub.
+   * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The hubId. + */ + java.lang.String getHubId(); + /** + * + * + *
+   * Optional. A unique identifier for the hub.
+   * 
+ * + * string hub_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for hubId. + */ + com.google.protobuf.ByteString getHubIdBytes(); + + /** + * + * + *
+   * Required. The initial values for a new hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + boolean hasHub(); + /** + * + * + *
+   * Required. The initial values for a new hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + com.google.cloud.networkconnectivity.v1.Hub getHub(); + /** + * + * + *
+   * Required. The initial values for a new hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networkconnectivity.v1.HubOrBuilder getHubOrBuilder(); + + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateSpokeRequest.java new file mode 100644 index 00000000..954ebf72 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateSpokeRequest.java @@ -0,0 +1,1387 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * The request for [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.CreateSpokeRequest} + */ +public final class CreateSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.CreateSpokeRequest) + CreateSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSpokeRequest.newBuilder() to construct. + private CreateSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSpokeRequest() { + parent_ = ""; + spokeId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateSpokeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + spokeId_ = s; + break; + } + case 26: + { + com.google.cloud.networkconnectivity.v1.Spoke.Builder subBuilder = null; + if (spoke_ != null) { + subBuilder = spoke_.toBuilder(); + } + spoke_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1.Spoke.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(spoke_); + spoke_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource.
+   * 
+ * + * + * 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.
+   * 
+ * + * + * 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 SPOKE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object spokeId_; + /** + * + * + *
+   * Optional. Unique id for the spoke to create.
+   * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spokeId. + */ + @java.lang.Override + public java.lang.String getSpokeId() { + java.lang.Object ref = spokeId_; + 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(); + spokeId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Unique id for the spoke to create.
+   * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for spokeId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSpokeIdBytes() { + java.lang.Object ref = spokeId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spokeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SPOKE_FIELD_NUMBER = 3; + private com.google.cloud.networkconnectivity.v1.Spoke spoke_; + /** + * + * + *
+   * Required. The initial values for a new spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + @java.lang.Override + public boolean hasSpoke() { + return spoke_ != null; + } + /** + * + * + *
+   * Required. The initial values for a new spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Spoke getSpoke() { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance() + : spoke_; + } + /** + * + * + *
+   * Required. The initial values for a new spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.SpokeOrBuilder getSpokeOrBuilder() { + return getSpoke(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getSpokeIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, spokeId_); + } + if (spoke_ != null) { + output.writeMessage(3, getSpoke()); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getSpokeIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, spokeId_); + } + if (spoke_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSpoke()); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + size += unknownFields.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.CreateSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest other = + (com.google.cloud.networkconnectivity.v1.CreateSpokeRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getSpokeId().equals(other.getSpokeId())) return false; + if (hasSpoke() != other.hasSpoke()) return false; + if (hasSpoke()) { + if (!getSpoke().equals(other.getSpoke())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + SPOKE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSpokeId().hashCode(); + if (hasSpoke()) { + hash = (37 * hash) + SPOKE_FIELD_NUMBER; + hash = (53 * hash) + getSpoke().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.CreateSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.CreateSpokeRequest 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.CreateSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.CreateSpokeRequest 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.CreateSpokeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.CreateSpokeRequest 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.CreateSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.CreateSpokeRequest 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.CreateSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.CreateSpokeRequest 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.CreateSpokeRequest 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.CreateSpokeRequest 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.CreateSpokeRequest 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; + } + /** + * + * + *
+   * The request for [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.CreateSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.CreateSpokeRequest) + com.google.cloud.networkconnectivity.v1.CreateSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.CreateSpokeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + spokeId_ = ""; + + if (spokeBuilder_ == null) { + spoke_ = null; + } else { + spoke_ = null; + spokeBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_CreateSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.CreateSpokeRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.CreateSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.CreateSpokeRequest build() { + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.CreateSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest result = + new com.google.cloud.networkconnectivity.v1.CreateSpokeRequest(this); + result.parent_ = parent_; + result.spokeId_ = spokeId_; + if (spokeBuilder_ == null) { + result.spoke_ = spoke_; + } else { + result.spoke_ = spokeBuilder_.build(); + } + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.CreateSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.CreateSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.CreateSpokeRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.CreateSpokeRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getSpokeId().isEmpty()) { + spokeId_ = other.spokeId_; + onChanged(); + } + if (other.hasSpoke()) { + mergeSpoke(other.getSpoke()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.CreateSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.CreateSpokeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + + private java.lang.Object spokeId_ = ""; + /** + * + * + *
+     * Optional. Unique id for the spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spokeId. + */ + public java.lang.String getSpokeId() { + java.lang.Object ref = spokeId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spokeId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Unique id for the spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for spokeId. + */ + public com.google.protobuf.ByteString getSpokeIdBytes() { + java.lang.Object ref = spokeId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spokeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Unique id for the spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The spokeId to set. + * @return This builder for chaining. + */ + public Builder setSpokeId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + spokeId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique id for the spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSpokeId() { + + spokeId_ = getDefaultInstance().getSpokeId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Unique id for the spoke to create.
+     * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for spokeId to set. + * @return This builder for chaining. + */ + public Builder setSpokeIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + spokeId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.networkconnectivity.v1.Spoke spoke_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Spoke, + com.google.cloud.networkconnectivity.v1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder> + spokeBuilder_; + /** + * + * + *
+     * Required. The initial values for a new spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + public boolean hasSpoke() { + return spokeBuilder_ != null || spoke_ != null; + } + /** + * + * + *
+     * Required. The initial values for a new spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + public com.google.cloud.networkconnectivity.v1.Spoke getSpoke() { + if (spokeBuilder_ == null) { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance() + : spoke_; + } else { + return spokeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The initial values for a new spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpoke(com.google.cloud.networkconnectivity.v1.Spoke value) { + if (spokeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spoke_ = value; + onChanged(); + } else { + spokeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The initial values for a new spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpoke(com.google.cloud.networkconnectivity.v1.Spoke.Builder builderForValue) { + if (spokeBuilder_ == null) { + spoke_ = builderForValue.build(); + onChanged(); + } else { + spokeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The initial values for a new spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSpoke(com.google.cloud.networkconnectivity.v1.Spoke value) { + if (spokeBuilder_ == null) { + if (spoke_ != null) { + spoke_ = + com.google.cloud.networkconnectivity.v1.Spoke.newBuilder(spoke_) + .mergeFrom(value) + .buildPartial(); + } else { + spoke_ = value; + } + onChanged(); + } else { + spokeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The initial values for a new spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSpoke() { + if (spokeBuilder_ == null) { + spoke_ = null; + onChanged(); + } else { + spoke_ = null; + spokeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The initial values for a new spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1.Spoke.Builder getSpokeBuilder() { + + onChanged(); + return getSpokeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The initial values for a new spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1.SpokeOrBuilder getSpokeOrBuilder() { + if (spokeBuilder_ != null) { + return spokeBuilder_.getMessageOrBuilder(); + } else { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance() + : spoke_; + } + } + /** + * + * + *
+     * Required. The initial values for a new spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Spoke, + com.google.cloud.networkconnectivity.v1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder> + getSpokeFieldBuilder() { + if (spokeBuilder_ == null) { + spokeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Spoke, + com.google.cloud.networkconnectivity.v1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder>( + getSpoke(), getParentForChildren(), isClean()); + spoke_ = null; + } + return spokeBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + 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.CreateSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.CreateSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1.CreateSpokeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.CreateSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.CreateSpokeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSpokeRequest(input, extensionRegistry); + } + }; + + 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.CreateSpokeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateSpokeRequestOrBuilder.java new file mode 100644 index 00000000..4530a0ce --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreateSpokeRequestOrBuilder.java @@ -0,0 +1,167 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface CreateSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.CreateSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource.
+   * 
+ * + * + * 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 spoke to create.
+   * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spokeId. + */ + java.lang.String getSpokeId(); + /** + * + * + *
+   * Optional. Unique id for the spoke to create.
+   * 
+ * + * string spoke_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for spokeId. + */ + com.google.protobuf.ByteString getSpokeIdBytes(); + + /** + * + * + *
+   * Required. The initial values for a new spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + boolean hasSpoke(); + /** + * + * + *
+   * Required. The initial values for a new spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + com.google.cloud.networkconnectivity.v1.Spoke getSpoke(); + /** + * + * + *
+   * Required. The initial values for a new spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder getSpokeOrBuilder(); + + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeactivateSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeactivateSpokeRequest.java new file mode 100644 index 00000000..bc1a0c09 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeactivateSpokeRequest.java @@ -0,0 +1,913 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * The request for [HubService.DeactivateSpoke][google.cloud.networkconnectivity.v1.HubService.DeactivateSpoke].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.DeactivateSpokeRequest} + */ +public final class DeactivateSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.DeactivateSpokeRequest) + DeactivateSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeactivateSpokeRequest.newBuilder() to construct. + private DeactivateSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeactivateSpokeRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeactivateSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeactivateSpokeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeactivateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeactivateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the spoke to deactivate.
+   * 
+ * + * + * 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. The name of the spoke to deactivate.
+   * 
+ * + * + * 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; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + size += unknownFields.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.DeactivateSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest other = + (com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest 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.DeactivateSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest 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.DeactivateSpokeRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest 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.DeactivateSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest 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.DeactivateSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest 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.DeactivateSpokeRequest 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.DeactivateSpokeRequest 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.DeactivateSpokeRequest 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; + } + /** + * + * + *
+   * The request for [HubService.DeactivateSpoke][google.cloud.networkconnectivity.v1.HubService.DeactivateSpoke].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.DeactivateSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.DeactivateSpokeRequest) + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeactivateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeactivateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeactivateSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest build() { + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest result = + new com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.DeactivateSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest other) { + if (other + == com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the spoke to deactivate.
+     * 
+ * + * + * 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. The name of the spoke to deactivate.
+     * 
+ * + * + * 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. The name of the spoke to deactivate.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spoke to deactivate.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spoke to deactivate.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + 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.DeactivateSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.DeactivateSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.DeactivateSpokeRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeactivateSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeactivateSpokeRequest(input, extensionRegistry); + } + }; + + 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.DeactivateSpokeRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeactivateSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeactivateSpokeRequestOrBuilder.java new file mode 100644 index 00000000..3a7718f3 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeactivateSpokeRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface DeactivateSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.DeactivateSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the spoke to deactivate.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the spoke to deactivate.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteHubRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteHubRequest.java new file mode 100644 index 00000000..dd8a3738 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteHubRequest.java @@ -0,0 +1,907 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * The request for [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.DeleteHubRequest} + */ +public final class DeleteHubRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.DeleteHubRequest) + DeleteHubRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteHubRequest.newBuilder() to construct. + private DeleteHubRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteHubRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteHubRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteHubRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.DeleteHubRequest.class, + com.google.cloud.networkconnectivity.v1.DeleteHubRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the hub 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. The name of the hub 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; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + size += unknownFields.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.DeleteHubRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.DeleteHubRequest other = + (com.google.cloud.networkconnectivity.v1.DeleteHubRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.DeleteHubRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteHubRequest 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.DeleteHubRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteHubRequest 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.DeleteHubRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteHubRequest 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.DeleteHubRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteHubRequest 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.DeleteHubRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteHubRequest 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.DeleteHubRequest 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.DeleteHubRequest 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.DeleteHubRequest 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; + } + /** + * + * + *
+   * The request for [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.DeleteHubRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.DeleteHubRequest) + com.google.cloud.networkconnectivity.v1.DeleteHubRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.DeleteHubRequest.class, + com.google.cloud.networkconnectivity.v1.DeleteHubRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.DeleteHubRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteHubRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.DeleteHubRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.DeleteHubRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.DeleteHubRequest build() { + com.google.cloud.networkconnectivity.v1.DeleteHubRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.DeleteHubRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.DeleteHubRequest result = + new com.google.cloud.networkconnectivity.v1.DeleteHubRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.DeleteHubRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.DeleteHubRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.DeleteHubRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.DeleteHubRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.DeleteHubRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.DeleteHubRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the hub 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. The name of the hub 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. The name of the hub 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the hub 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the hub 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; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + 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.DeleteHubRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.DeleteHubRequest) + private static final com.google.cloud.networkconnectivity.v1.DeleteHubRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.DeleteHubRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteHubRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteHubRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteHubRequest(input, extensionRegistry); + } + }; + + 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.DeleteHubRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteHubRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteHubRequestOrBuilder.java new file mode 100644 index 00000000..8fab3d44 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteHubRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface DeleteHubRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.DeleteHubRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the hub to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the hub 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteSpokeRequest.java new file mode 100644 index 00000000..cab73339 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteSpokeRequest.java @@ -0,0 +1,907 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * The request for [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.DeleteSpokeRequest} + */ +public final class DeleteSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.DeleteSpokeRequest) + DeleteSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSpokeRequest.newBuilder() to construct. + private DeleteSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSpokeRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteSpokeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the spoke 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. The name of the spoke 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; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); + } + size += unknownFields.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.DeleteSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest other = + (com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest 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.DeleteSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest 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.DeleteSpokeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest 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.DeleteSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest 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.DeleteSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest 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.DeleteSpokeRequest 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.DeleteSpokeRequest 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.DeleteSpokeRequest 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; + } + /** + * + * + *
+   * The request for [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.DeleteSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.DeleteSpokeRequest) + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_DeleteSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest build() { + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest result = + new com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest(this); + result.name_ = name_; + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.DeleteSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the spoke 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. The name of the spoke 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. The name of the spoke 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spoke 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spoke 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; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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; + 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.DeleteSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.DeleteSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteSpokeRequest(input, extensionRegistry); + } + }; + + 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.DeleteSpokeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteSpokeRequestOrBuilder.java new file mode 100644 index 00000000..96cfe5f6 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeleteSpokeRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface DeleteSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.DeleteSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the spoke to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the spoke 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetHubRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetHubRequest.java new file mode 100644 index 00000000..f8ced56e --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetHubRequest.java @@ -0,0 +1,651 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * Request for [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.GetHubRequest} + */ +public final class GetHubRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.GetHubRequest) + GetHubRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetHubRequest.newBuilder() to construct. + private GetHubRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetHubRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetHubRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetHubRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.GetHubRequest.class, + com.google.cloud.networkconnectivity.v1.GetHubRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the hub 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. The name of the hub 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.GetHubRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.GetHubRequest other = + (com.google.cloud.networkconnectivity.v1.GetHubRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.GetHubRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.GetHubRequest 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.GetHubRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.GetHubRequest 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.GetHubRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.GetHubRequest 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.GetHubRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.GetHubRequest 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.GetHubRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.GetHubRequest 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.GetHubRequest 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.GetHubRequest 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.GetHubRequest 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 [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.GetHubRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.GetHubRequest) + com.google.cloud.networkconnectivity.v1.GetHubRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.GetHubRequest.class, + com.google.cloud.networkconnectivity.v1.GetHubRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.GetHubRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetHubRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.GetHubRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.GetHubRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.GetHubRequest build() { + com.google.cloud.networkconnectivity.v1.GetHubRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.GetHubRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.GetHubRequest result = + new com.google.cloud.networkconnectivity.v1.GetHubRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.GetHubRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.GetHubRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.GetHubRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.GetHubRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.GetHubRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.GetHubRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the hub 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. The name of the hub 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. The name of the hub 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the hub 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(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the hub 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; + 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.GetHubRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.GetHubRequest) + private static final com.google.cloud.networkconnectivity.v1.GetHubRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.GetHubRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.GetHubRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetHubRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetHubRequest(input, extensionRegistry); + } + }; + + 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.GetHubRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetHubRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetHubRequestOrBuilder.java new file mode 100644 index 00000000..8ab3d81a --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetHubRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface GetHubRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.GetHubRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the hub resource to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the hub 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetSpokeRequest.java new file mode 100644 index 00000000..fc7508d6 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetSpokeRequest.java @@ -0,0 +1,651 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * The request for [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.GetSpokeRequest} + */ +public final class GetSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.GetSpokeRequest) + GetSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSpokeRequest.newBuilder() to construct. + private GetSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSpokeRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetSpokeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.GetSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.GetSpokeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the spoke resource.
+   * 
+ * + * + * 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. The name of the spoke resource.
+   * 
+ * + * + * 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.GetSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.GetSpokeRequest other = + (com.google.cloud.networkconnectivity.v1.GetSpokeRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.GetSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.GetSpokeRequest 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.GetSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.GetSpokeRequest 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.GetSpokeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.GetSpokeRequest 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.GetSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.GetSpokeRequest 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.GetSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.GetSpokeRequest 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.GetSpokeRequest 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.GetSpokeRequest 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.GetSpokeRequest 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; + } + /** + * + * + *
+   * The request for [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.GetSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.GetSpokeRequest) + com.google.cloud.networkconnectivity.v1.GetSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.GetSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.GetSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.GetSpokeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_GetSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.GetSpokeRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.GetSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.GetSpokeRequest build() { + com.google.cloud.networkconnectivity.v1.GetSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.GetSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.GetSpokeRequest result = + new com.google.cloud.networkconnectivity.v1.GetSpokeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.GetSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.GetSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.GetSpokeRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.GetSpokeRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.GetSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.GetSpokeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the spoke resource.
+     * 
+ * + * + * 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. The name of the spoke resource.
+     * 
+ * + * + * 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. The name of the spoke resource.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spoke resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the spoke resource.
+     * 
+ * + * + * 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; + 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.GetSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.GetSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1.GetSpokeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.GetSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.GetSpokeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSpokeRequest(input, extensionRegistry); + } + }; + + 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.GetSpokeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetSpokeRequestOrBuilder.java new file mode 100644 index 00000000..dda46174 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetSpokeRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface GetSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.GetSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the spoke resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the spoke resource.
+   * 
+ * + * + * 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/Hub.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/Hub.java new file mode 100644 index 00000000..cd8dad7a --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/Hub.java @@ -0,0 +1,2120 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * A hub is essentially a collection of spokes. A single hub can contain spokes
+ * from multiple regions. However, all of a hub's spokes must be associated with
+ * resources that reside in the same VPC network.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.Hub} + */ +public final class Hub extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.Hub) + HubOrBuilder { + private static final long serialVersionUID = 0L; + // Use Hub.newBuilder() to construct. + private Hub(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Hub() { + name_ = ""; + description_ = ""; + uniqueId_ = ""; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Hub(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Hub( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + uniqueId_ = s; + break; + } + case 72: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Hub_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.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Hub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.Hub.class, + com.google.cloud.networkconnectivity.v1.Hub.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The name of the hub. Hub names must be unique. They use the
+   * following form:
+   *     `projects/{project_number}/locations/global/hubs/{hub_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. The name of the hub. Hub names must be unique. They use the
+   * following form:
+   *     `projects/{project_number}/locations/global/hubs/{hub_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. The time the hub 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. The time the hub 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. The time the hub was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time the hub was last 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. The time the hub was last 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. The time the hub was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Hub_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + 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(); + } + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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; + private volatile java.lang.Object description_; + /** + * + * + *
+   * An optional description of the hub.
+   * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+   * An optional description of the hub.
+   * 
+ * + * string description = 5; + * + * @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 UNIQUE_ID_FIELD_NUMBER = 8; + private volatile java.lang.Object uniqueId_; + /** + * + * + *
+   * Output only. The Google-generated UUID for the hub. This value is unique across all hub
+   * resources. If a hub is deleted and another with the same name is created,
+   * the new hub is assigned a different unique_id.
+   * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + @java.lang.Override + public java.lang.String getUniqueId() { + java.lang.Object ref = uniqueId_; + 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(); + uniqueId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The Google-generated UUID for the hub. This value is unique across all hub
+   * resources. If a hub is deleted and another with the same name is created,
+   * the new hub is assigned a different unique_id.
+   * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUniqueIdBytes() { + java.lang.Object ref = uniqueId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uniqueId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 9; + private int state_; + /** + * + * + *
+   * Output only. The current lifecycle state of this hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current lifecycle state of this hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.networkconnectivity.v1.State result = + com.google.cloud.networkconnectivity.v1.State.valueOf(state_); + return result == null ? com.google.cloud.networkconnectivity.v1.State.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 (!getNameBytes().isEmpty()) { + 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 (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + if (!getUniqueIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, uniqueId_); + } + if (state_ != com.google.cloud.networkconnectivity.v1.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(9, state_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + 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 (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + if (!getUniqueIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, uniqueId_); + } + if (state_ != com.google.cloud.networkconnectivity.v1.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, state_); + } + size += unknownFields.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.Hub)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.Hub other = + (com.google.cloud.networkconnectivity.v1.Hub) 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 (!getUniqueId().equals(other.getUniqueId())) return false; + if (state_ != other.state_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + UNIQUE_ID_FIELD_NUMBER; + hash = (53 * hash) + getUniqueId().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.Hub parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.Hub 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.Hub parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.Hub 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.Hub parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.Hub 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.Hub parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.Hub 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.Hub parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.Hub 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.Hub 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.Hub 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.Hub 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; + } + /** + * + * + *
+   * A hub is essentially a collection of spokes. A single hub can contain spokes
+   * from multiple regions. However, all of a hub's spokes must be associated with
+   * resources that reside in the same VPC network.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.Hub} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.Hub) + com.google.cloud.networkconnectivity.v1.HubOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Hub_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.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Hub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.Hub.class, + com.google.cloud.networkconnectivity.v1.Hub.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.Hub.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + description_ = ""; + + uniqueId_ = ""; + + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Hub_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Hub getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Hub build() { + com.google.cloud.networkconnectivity.v1.Hub result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Hub buildPartial() { + com.google.cloud.networkconnectivity.v1.Hub result = + new com.google.cloud.networkconnectivity.v1.Hub(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.description_ = description_; + result.uniqueId_ = uniqueId_; + result.state_ = state_; + onBuilt(); + return result; + } + + @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.Hub) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.Hub) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.Hub other) { + if (other == com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getUniqueId().isEmpty()) { + uniqueId_ = other.uniqueId_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.Hub parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.networkconnectivity.v1.Hub) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The name of the hub. Hub names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/global/hubs/{hub_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. The name of the hub. Hub names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/global/hubs/{hub_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. The name of the hub. Hub names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/global/hubs/{hub_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; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of the hub. Hub names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/global/hubs/{hub_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of the hub. Hub names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/global/hubs/{hub_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; + 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. The time the hub 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 createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time the hub 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. The time the hub 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; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the hub 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(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the hub 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 (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the hub was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the hub was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the hub 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. The time the hub 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. The time the hub was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The time the hub was last 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. The time the hub was last 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; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the hub was last 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(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the hub was last 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 (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the hub was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the hub was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the hub was last 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. The time the hub was last 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() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * An optional description of the hub.
+     * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * An optional description of the hub.
+     * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * An optional description of the hub.
+     * 
+ * + * string description = 5; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * An optional description of the hub.
+     * 
+ * + * string description = 5; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * An optional description of the hub.
+     * 
+ * + * string description = 5; + * + * @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; + onChanged(); + return this; + } + + private java.lang.Object uniqueId_ = ""; + /** + * + * + *
+     * Output only. The Google-generated UUID for the hub. This value is unique across all hub
+     * resources. If a hub is deleted and another with the same name is created,
+     * the new hub is assigned a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + public java.lang.String getUniqueId() { + java.lang.Object ref = uniqueId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uniqueId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The Google-generated UUID for the hub. This value is unique across all hub
+     * resources. If a hub is deleted and another with the same name is created,
+     * the new hub is assigned a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + public com.google.protobuf.ByteString getUniqueIdBytes() { + java.lang.Object ref = uniqueId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uniqueId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The Google-generated UUID for the hub. This value is unique across all hub
+     * resources. If a hub is deleted and another with the same name is created,
+     * the new hub is assigned a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uniqueId to set. + * @return This builder for chaining. + */ + public Builder setUniqueId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uniqueId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Google-generated UUID for the hub. This value is unique across all hub
+     * resources. If a hub is deleted and another with the same name is created,
+     * the new hub is assigned a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUniqueId() { + + uniqueId_ = getDefaultInstance().getUniqueId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Google-generated UUID for the hub. This value is unique across all hub
+     * resources. If a hub is deleted and another with the same name is created,
+     * the new hub is assigned a different unique_id.
+     * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uniqueId to set. + * @return This builder for chaining. + */ + public Builder setUniqueIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uniqueId_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current lifecycle state of this hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current lifecycle state of this hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current lifecycle state of this hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.networkconnectivity.v1.State result = + com.google.cloud.networkconnectivity.v1.State.valueOf(state_); + return result == null ? com.google.cloud.networkconnectivity.v1.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current lifecycle state of this hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.networkconnectivity.v1.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current lifecycle state of this hub.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 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.Hub) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.Hub) + private static final com.google.cloud.networkconnectivity.v1.Hub DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.Hub(); + } + + public static com.google.cloud.networkconnectivity.v1.Hub getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Hub parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Hub(input, extensionRegistry); + } + }; + + 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.Hub getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubName.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubName.java new file mode 100644 index 00000000..df6797bf --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.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 HubName implements ResourceName { + private static final PathTemplate PROJECT_HUB = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/global/hubs/{hub}"); + private volatile Map fieldValuesMap; + private final String project; + private final String hub; + + @Deprecated + protected HubName() { + project = null; + hub = null; + } + + private HubName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + hub = Preconditions.checkNotNull(builder.getHub()); + } + + public String getProject() { + return project; + } + + public String getHub() { + return hub; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static HubName of(String project, String hub) { + return newBuilder().setProject(project).setHub(hub).build(); + } + + public static String format(String project, String hub) { + return newBuilder().setProject(project).setHub(hub).build().toString(); + } + + public static HubName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_HUB.validatedMatch( + formattedString, "HubName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("hub")); + } + + 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 (HubName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_HUB.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 (hub != null) { + fieldMapBuilder.put("hub", hub); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_HUB.instantiate("project", project, "hub", hub); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + HubName that = ((HubName) o); + return Objects.equals(this.project, that.project) && Objects.equals(this.hub, that.hub); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(hub); + return h; + } + + /** Builder for projects/{project}/locations/global/hubs/{hub}. */ + public static class Builder { + private String project; + private String hub; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getHub() { + return hub; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setHub(String hub) { + this.hub = hub; + return this; + } + + private Builder(HubName hubName) { + this.project = hubName.project; + this.hub = hubName.hub; + } + + public HubName build() { + return new HubName(this); + } + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubOrBuilder.java new file mode 100644 index 00000000..ff51804d --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubOrBuilder.java @@ -0,0 +1,277 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface HubOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.Hub) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The name of the hub. Hub names must be unique. They use the
+   * following form:
+   *     `projects/{project_number}/locations/global/hubs/{hub_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The name of the hub. Hub names must be unique. They use the
+   * following form:
+   *     `projects/{project_number}/locations/global/hubs/{hub_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The time the hub 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. The time the hub was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the hub was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the hub was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time the hub was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time the hub was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * An optional description of the hub.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * An optional description of the hub.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The Google-generated UUID for the hub. This value is unique across all hub
+   * resources. If a hub is deleted and another with the same name is created,
+   * the new hub is assigned a different unique_id.
+   * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + java.lang.String getUniqueId(); + /** + * + * + *
+   * Output only. The Google-generated UUID for the hub. This value is unique across all hub
+   * resources. If a hub is deleted and another with the same name is created,
+   * the new hub is assigned a different unique_id.
+   * 
+ * + * string unique_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + com.google.protobuf.ByteString getUniqueIdBytes(); + + /** + * + * + *
+   * Output only. The current lifecycle state of this hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current lifecycle state of this hub.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.networkconnectivity.v1.State getState(); +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubProto.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubProto.java new file mode 100644 index 00000000..f026b372 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/HubProto.java @@ -0,0 +1,532 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public final class HubProto { + private HubProto() {} + + 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_Hub_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_Hub_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_Hub_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_Hub_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_Spoke_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_Spoke_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_Spoke_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_Spoke_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_ListHubsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_ListHubsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_ListHubsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_ListHubsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_GetHubRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_GetHubRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_CreateHubRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_CreateHubRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_UpdateHubRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_UpdateHubRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_DeleteHubRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_DeleteHubRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_ListSpokesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_ListSpokesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_ListSpokesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_ListSpokesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_GetSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_GetSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_CreateSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_CreateSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_UpdateSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_UpdateSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_DeleteSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_DeleteSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_DeactivateSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_DeactivateSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_ActivateSpokeRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_ActivateSpokeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_LinkedVpnTunnels_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_LinkedVpnTunnels_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_LinkedInterconnectAttachments_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_LinkedInterconnectAttachments_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_LinkedRouterApplianceInstances_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_LinkedRouterApplianceInstances_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_networkconnectivity_v1_RouterApplianceInstance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_networkconnectivity_v1_RouterApplianceInstance_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/hu" + + "b.proto\022#google.cloud.networkconnectivit" + + "y.v1\032\034google/api/annotations.proto\032\027goog" + + "le/api/client.proto\032\037google/api/field_be" + + "havior.proto\032\031google/api/resource.proto\032" + + "#google/longrunning/operations.proto\032 go" + + "ogle/protobuf/field_mask.proto\032\037google/p" + + "rotobuf/timestamp.proto\"\303\003\n\003Hub\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\013update_time\030" + + "\003 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022D" + + "\n\006labels\030\004 \003(\01324.google.cloud.networkcon" + + "nectivity.v1.Hub.LabelsEntry\022\023\n\013descript" + + "ion\030\005 \001(\t\022\026\n\tunique_id\030\010 \001(\tB\003\340A\003\022>\n\005sta" + + "te\030\t \001(\0162*.google.cloud.networkconnectiv" + + "ity.v1.StateB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:[\352AX\n&networkco" + + "nnectivity.googleapis.com/Hub\022.projects/" + + "{project}/locations/global/hubs/{hub}\"\276\006" + + "\n\005Spoke\022\021\n\004name\030\001 \001(\tB\003\340A\005\0224\n\013create_tim" + + "e\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\0224\n\013update_time\030\003 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\022F\n\006labels\030\004 \003(\01326.google." + + "cloud.networkconnectivity.v1.Spoke.Label" + + "sEntry\022\023\n\013description\030\005 \001(\t\022;\n\003hub\030\006 \001(\t" + + "B.\340A\005\372A(\n&networkconnectivity.googleapis" + + ".com/Hub\022Q\n\022linked_vpn_tunnels\030\021 \001(\01325.g" + + "oogle.cloud.networkconnectivity.v1.Linke" + + "dVpnTunnels\022k\n\037linked_interconnect_attac" + + "hments\030\022 \001(\0132B.google.cloud.networkconne" + + "ctivity.v1.LinkedInterconnectAttachments" + + "\022n\n!linked_router_appliance_instances\030\023 " + + "\001(\0132C.google.cloud.networkconnectivity.v" + + "1.LinkedRouterApplianceInstances\022\026\n\tuniq" + + "ue_id\030\013 \001(\tB\003\340A\003\022>\n\005state\030\017 \001(\0162*.google" + + ".cloud.networkconnectivity.v1.StateB\003\340A\003" + + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001:e\352Ab\n(networkconnectivity.google" + + "apis.com/Spoke\0226projects/{project}/locat" + + "ions/{location}/spokes/{spoke}\"\225\001\n\017ListH" + + "ubsRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!loca" + + "tions.googleapis.com/Location\022\021\n\tpage_si" + + "ze\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\"x\n\020ListHubsRespon" + + "se\0226\n\004hubs\030\001 \003(\0132(.google.cloud.networkc" + + "onnectivity.v1.Hub\022\027\n\017next_page_token\030\002 " + + "\001(\t\022\023\n\013unreachable\030\003 \003(\t\"M\n\rGetHubReques" + + "t\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&networkconnecti" + + "vity.googleapis.com/Hub\"\267\001\n\020CreateHubReq" + + "uest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations." + + "googleapis.com/Location\022\023\n\006hub_id\030\002 \001(\tB" + + "\003\340A\001\022:\n\003hub\030\003 \001(\0132(.google.cloud.network" + + "connectivity.v1.HubB\003\340A\002\022\027\n\nrequest_id\030\004" + + " \001(\tB\003\340A\001\"\235\001\n\020UpdateHubRequest\0224\n\013update" + + "_mask\030\001 \001(\0132\032.google.protobuf.FieldMaskB" + + "\003\340A\001\022:\n\003hub\030\002 \001(\0132(.google.cloud.network" + + "connectivity.v1.HubB\003\340A\002\022\027\n\nrequest_id\030\003" + + " \001(\tB\003\340A\001\"i\n\020DeleteHubRequest\022<\n\004name\030\001 " + + "\001(\tB.\340A\002\372A(\n&networkconnectivity.googlea" + + "pis.com/Hub\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\"\227\001\n" + + "\021ListSpokesRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372" + + "A#\n!locations.googleapis.com/Location\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006" + + "filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"~\n\022ListSp" + + "okesResponse\022:\n\006spokes\030\001 \003(\0132*.google.cl" + + "oud.networkconnectivity.v1.Spoke\022\027\n\017next" + + "_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"Q" + + "\n\017GetSpokeRequest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n" + + "(networkconnectivity.googleapis.com/Spok" + + "e\"\277\001\n\022CreateSpokeRequest\0229\n\006parent\030\001 \001(\t" + + "B)\340A\002\372A#\n!locations.googleapis.com/Locat" + + "ion\022\025\n\010spoke_id\030\002 \001(\tB\003\340A\001\022>\n\005spoke\030\003 \001(" + + "\0132*.google.cloud.networkconnectivity.v1." + + "SpokeB\003\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"\243\001\n\022" + + "UpdateSpokeRequest\0224\n\013update_mask\030\001 \001(\0132" + + "\032.google.protobuf.FieldMaskB\003\340A\001\022>\n\005spok" + + "e\030\002 \001(\0132*.google.cloud.networkconnectivi" + + "ty.v1.SpokeB\003\340A\002\022\027\n\nrequest_id\030\003 \001(\tB\003\340A" + + "\001\"m\n\022DeleteSpokeRequest\022>\n\004name\030\001 \001(\tB0\340" + + "A\002\372A*\n(networkconnectivity.googleapis.co" + + "m/Spoke\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\"q\n\026Deac" + + "tivateSpokeRequest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*" + + "\n(networkconnectivity.googleapis.com/Spo" + + "ke\022\027\n\nrequest_id\030\002 \001(\tB\003\340A\001\"o\n\024ActivateS" + + "pokeRequest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(netwo" + + "rkconnectivity.googleapis.com/Spoke\022\027\n\nr" + + "equest_id\030\002 \001(\tB\003\340A\001\"k\n\020LinkedVpnTunnels" + + "\0223\n\004uris\030\001 \003(\tB%\372A\"\n compute.googleapis." + + "com/VpnTunnel\022\"\n\032site_to_site_data_trans" + + "fer\030\002 \001(\010\"\205\001\n\035LinkedInterconnectAttachme" + + "nts\022@\n\004uris\030\001 \003(\tB2\372A/\n-compute.googleap" + + "is.com/InterconnectAttachment\022\"\n\032site_to" + + "_site_data_transfer\030\002 \001(\010\"\225\001\n\036LinkedRout" + + "erApplianceInstances\022O\n\tinstances\030\001 \003(\0132" + + "<.google.cloud.networkconnectivity.v1.Ro" + + "uterApplianceInstance\022\"\n\032site_to_site_da" + + "ta_transfer\030\002 \001(\010\"l\n\027RouterApplianceInst" + + "ance\022=\n\017virtual_machine\030\001 \001(\tB$\372A!\n\037comp" + + "ute.googleapis.com/Instance\022\022\n\nip_addres" + + "s\030\003 \001(\t*F\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022" + + "\014\n\010CREATING\020\001\022\n\n\006ACTIVE\020\002\022\014\n\010DELETING\020\0032" + + "\303\023\n\nHubService\022\267\001\n\010ListHubs\0224.google.clo" + + "ud.networkconnectivity.v1.ListHubsReques" + + "t\0325.google.cloud.networkconnectivity.v1." + + "ListHubsResponse\">\202\323\344\223\002/\022-/v1/{parent=pr" + + "ojects/*/locations/global}/hubs\332A\006parent" + + "\022\244\001\n\006GetHub\0222.google.cloud.networkconnec" + + "tivity.v1.GetHubRequest\032(.google.cloud.n" + + "etworkconnectivity.v1.Hub\"<\202\323\344\223\002/\022-/v1/{" + + "name=projects/*/locations/global/hubs/*}" + + "\332A\004name\022\314\001\n\tCreateHub\0225.google.cloud.net" + + "workconnectivity.v1.CreateHubRequest\032\035.g" + + "oogle.longrunning.Operation\"i\202\323\344\223\0024\"-/v1" + + "/{parent=projects/*/locations/global}/hu" + + "bs:\003hub\332A\021parent,hub,hub_id\312A\030\n\003Hub\022\021Ope" + + "rationMetadata\022\316\001\n\tUpdateHub\0225.google.cl" + + "oud.networkconnectivity.v1.UpdateHubRequ" + + "est\032\035.google.longrunning.Operation\"k\202\323\344\223" + + "\002821/v1/{hub.name=projects/*/locations/g" + + "lobal/hubs/*}:\003hub\332A\017hub,update_mask\312A\030\n" + + "\003Hub\022\021OperationMetadata\022\314\001\n\tDeleteHub\0225." + + "google.cloud.networkconnectivity.v1.Dele" + + "teHubRequest\032\035.google.longrunning.Operat" + + "ion\"i\202\323\344\223\002/*-/v1/{name=projects/*/locati" + + "ons/global/hubs/*}\332A\004name\312A*\n\025google.pro" + + "tobuf.Empty\022\021OperationMetadata\022\272\001\n\nListS" + + "pokes\0226.google.cloud.networkconnectivity" + + ".v1.ListSpokesRequest\0327.google.cloud.net" + + "workconnectivity.v1.ListSpokesResponse\";" + + "\202\323\344\223\002,\022*/v1/{parent=projects/*/locations" + + "/*}/spokes\332A\006parent\022\247\001\n\010GetSpoke\0224.googl" + + "e.cloud.networkconnectivity.v1.GetSpokeR" + + "equest\032*.google.cloud.networkconnectivit" + + "y.v1.Spoke\"9\202\323\344\223\002,\022*/v1/{name=projects/*" + + "/locations/*/spokes/*}\332A\004name\022\325\001\n\013Create" + + "Spoke\0227.google.cloud.networkconnectivity" + + ".v1.CreateSpokeRequest\032\035.google.longrunn" + + "ing.Operation\"n\202\323\344\223\0023\"*/v1/{parent=proje" + + "cts/*/locations/*}/spokes:\005spoke\332A\025paren" + + "t,spoke,spoke_id\312A\032\n\005Spoke\022\021OperationMet" + + "adata\022\327\001\n\013UpdateSpoke\0227.google.cloud.net" + + "workconnectivity.v1.UpdateSpokeRequest\032\035" + + ".google.longrunning.Operation\"p\202\323\344\223\002920/" + + "v1/{spoke.name=projects/*/locations/*/sp" + + "okes/*}:\005spoke\332A\021spoke,update_mask\312A\032\n\005S" + + "poke\022\021OperationMetadata\022\323\001\n\017DeactivateSp" + + "oke\022;.google.cloud.networkconnectivity.v" + + "1.DeactivateSpokeRequest\032\035.google.longru" + + "nning.Operation\"d\202\323\344\223\002:\"5/v1/{name=proje" + + "cts/*/locations/*/spokes/*}:deactivate:\001" + + "*\332A\004name\312A\032\n\005Spoke\022\021OperationMetadata\022\315\001" + + "\n\rActivateSpoke\0229.google.cloud.networkco" + + "nnectivity.v1.ActivateSpokeRequest\032\035.goo" + + "gle.longrunning.Operation\"b\202\323\344\223\0028\"3/v1/{" + + "name=projects/*/locations/*/spokes/*}:ac" + + "tivate:\001*\332A\004name\312A\032\n\005Spoke\022\021OperationMet" + + "adata\022\315\001\n\013DeleteSpoke\0227.google.cloud.net" + + "workconnectivity.v1.DeleteSpokeRequest\032\035" + + ".google.longrunning.Operation\"f\202\323\344\223\002,**/" + + "v1/{name=projects/*/locations/*/spokes/*" + + "}\332A\004name\312A*\n\025google.protobuf.Empty\022\021Oper" + + "ationMetadata\032V\312A\"networkconnectivity.go" + + "ogleapis.com\322A.https://www.googleapis.co" + + "m/auth/cloud-platformB\221\005\n\'com.google.clo" + + "ud.networkconnectivity.v1B\010HubProtoP\001ZVg" + + "oogle.golang.org/genproto/googleapis/clo" + + "ud/networkconnectivity/v1;networkconnect" + + "ivity\252\002#Google.Cloud.NetworkConnectivity" + + ".V1\312\002#Google\\Cloud\\NetworkConnectivity\\V" + + "1\352\002&Google::Cloud::NetworkConnectivity::" + + "V1\352A`\n compute.googleapis.com/VpnTunnel\022" + + " + * A collection of VLAN attachment resources. These resources should + * be redundant attachments that all advertise the same prefixes to Google + * Cloud. Alternatively, in active/passive configurations, all attachments + * should be capable of advertising the same prefixes. + * + * + * Protobuf type {@code google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} + */ +public final class LinkedInterconnectAttachments extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments) + LinkedInterconnectAttachmentsOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkedInterconnectAttachments.newBuilder() to construct. + private LinkedInterconnectAttachments(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LinkedInterconnectAttachments() { + uris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LinkedInterconnectAttachments(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LinkedInterconnectAttachments( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + uris_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + uris_.add(s); + break; + } + case 16: + { + siteToSiteDataTransfer_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + uris_ = uris_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedInterconnectAttachments_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedInterconnectAttachments_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.class, + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.Builder.class); + } + + public static final int URIS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList uris_; + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + return uris_; + } + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.getByteString(index); + } + + public static final int SITE_TO_SITE_DATA_TRANSFER_FIELD_NUMBER = 2; + private boolean siteToSiteDataTransfer_; + /** + * + * + *
+   * A value that controls whether site-to-site data transfer is enabled for
+   * these resources. If true, routes are propagated between the spoke
+   * associated with these resources and other spokes in the hub that have data
+   * transfer enabled. If false, the spoke associated with these resources
+   * provides connectivity only between the external site and Google Cloud. In
+   * regions where data transfer is unsupported, you cannot set this field
+   * to true.
+   * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return The siteToSiteDataTransfer. + */ + @java.lang.Override + public boolean getSiteToSiteDataTransfer() { + return siteToSiteDataTransfer_; + } + + 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 < uris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uris_.getRaw(i)); + } + if (siteToSiteDataTransfer_ != false) { + output.writeBool(2, siteToSiteDataTransfer_); + } + unknownFields.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 < uris_.size(); i++) { + dataSize += computeStringSizeNoTag(uris_.getRaw(i)); + } + size += dataSize; + size += 1 * getUrisList().size(); + } + if (siteToSiteDataTransfer_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, siteToSiteDataTransfer_); + } + size += unknownFields.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.LinkedInterconnectAttachments)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments other = + (com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments) obj; + + if (!getUrisList().equals(other.getUrisList())) return false; + if (getSiteToSiteDataTransfer() != other.getSiteToSiteDataTransfer()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUrisCount() > 0) { + hash = (37 * hash) + URIS_FIELD_NUMBER; + hash = (53 * hash) + getUrisList().hashCode(); + } + hash = (37 * hash) + SITE_TO_SITE_DATA_TRANSFER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSiteToSiteDataTransfer()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments 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.LinkedInterconnectAttachments parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments 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.LinkedInterconnectAttachments parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments 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.LinkedInterconnectAttachments parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments 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.LinkedInterconnectAttachments + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + 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.LinkedInterconnectAttachments 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.LinkedInterconnectAttachments 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.LinkedInterconnectAttachments 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; + } + /** + * + * + *
+   * A collection of VLAN attachment resources. These resources should
+   * be redundant attachments that all advertise the same prefixes to Google
+   * Cloud. Alternatively, in active/passive configurations, all attachments
+   * should be capable of advertising the same prefixes.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments) + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachmentsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedInterconnectAttachments_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedInterconnectAttachments_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.class, + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.Builder.class); + } + + // Construct using + // com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + siteToSiteDataTransfer_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedInterconnectAttachments_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments build() { + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments buildPartial() { + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments result = + new com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + uris_ = uris_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.uris_ = uris_; + result.siteToSiteDataTransfer_ = siteToSiteDataTransfer_; + onBuilt(); + return result; + } + + @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.LinkedInterconnectAttachments) { + return mergeFrom( + (com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments other) { + if (other + == com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + .getDefaultInstance()) return this; + if (!other.uris_.isEmpty()) { + if (uris_.isEmpty()) { + uris_ = other.uris_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUrisIsMutable(); + uris_.addAll(other.uris_); + } + onChanged(); + } + if (other.getSiteToSiteDataTransfer() != false) { + setSiteToSiteDataTransfer(other.getSiteToSiteDataTransfer()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList uris_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUrisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + uris_ = new com.google.protobuf.LazyStringArrayList(uris_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + return uris_.getUnmodifiableView(); + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.getByteString(index); + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index to set the value at. + * @param value The uris to set. + * @return This builder for chaining. + */ + public Builder setUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The uris to add. + * @return This builder for chaining. + */ + public Builder addUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param values The uris to add. + * @return This builder for chaining. + */ + public Builder addAllUris(java.lang.Iterable values) { + ensureUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, uris_); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearUris() { + uris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked interconnect attachment resources
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes of the uris to add. + * @return This builder for chaining. + */ + public Builder addUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUrisIsMutable(); + uris_.add(value); + onChanged(); + return this; + } + + private boolean siteToSiteDataTransfer_; + /** + * + * + *
+     * A value that controls whether site-to-site data transfer is enabled for
+     * these resources. If true, routes are propagated between the spoke
+     * associated with these resources and other spokes in the hub that have data
+     * transfer enabled. If false, the spoke associated with these resources
+     * provides connectivity only between the external site and Google Cloud. In
+     * regions where data transfer is unsupported, you cannot set this field
+     * to true.
+     * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return The siteToSiteDataTransfer. + */ + @java.lang.Override + public boolean getSiteToSiteDataTransfer() { + return siteToSiteDataTransfer_; + } + /** + * + * + *
+     * A value that controls whether site-to-site data transfer is enabled for
+     * these resources. If true, routes are propagated between the spoke
+     * associated with these resources and other spokes in the hub that have data
+     * transfer enabled. If false, the spoke associated with these resources
+     * provides connectivity only between the external site and Google Cloud. In
+     * regions where data transfer is unsupported, you cannot set this field
+     * to true.
+     * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @param value The siteToSiteDataTransfer to set. + * @return This builder for chaining. + */ + public Builder setSiteToSiteDataTransfer(boolean value) { + + siteToSiteDataTransfer_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A value that controls whether site-to-site data transfer is enabled for
+     * these resources. If true, routes are propagated between the spoke
+     * associated with these resources and other spokes in the hub that have data
+     * transfer enabled. If false, the spoke associated with these resources
+     * provides connectivity only between the external site and Google Cloud. In
+     * regions where data transfer is unsupported, you cannot set this field
+     * to true.
+     * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return This builder for chaining. + */ + public Builder clearSiteToSiteDataTransfer() { + + siteToSiteDataTransfer_ = false; + 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.LinkedInterconnectAttachments) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments) + private static final com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments(); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkedInterconnectAttachments parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkedInterconnectAttachments(input, extensionRegistry); + } + }; + + 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.LinkedInterconnectAttachments + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedInterconnectAttachmentsOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedInterconnectAttachmentsOrBuilder.java new file mode 100644 index 00000000..cd9d2411 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedInterconnectAttachmentsOrBuilder.java @@ -0,0 +1,95 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface LinkedInterconnectAttachmentsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the uris. + */ + java.util.List getUrisList(); + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of uris. + */ + int getUrisCount(); + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + java.lang.String getUris(int index); + /** + * + * + *
+   * The URIs of linked interconnect attachment resources
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + com.google.protobuf.ByteString getUrisBytes(int index); + + /** + * + * + *
+   * A value that controls whether site-to-site data transfer is enabled for
+   * these resources. If true, routes are propagated between the spoke
+   * associated with these resources and other spokes in the hub that have data
+   * transfer enabled. If false, the spoke associated with these resources
+   * provides connectivity only between the external site and Google Cloud. In
+   * regions where data transfer is unsupported, you cannot set this field
+   * to true.
+   * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return The siteToSiteDataTransfer. + */ + boolean getSiteToSiteDataTransfer(); +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedRouterApplianceInstances.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedRouterApplianceInstances.java new file mode 100644 index 00000000..9adc7a80 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedRouterApplianceInstances.java @@ -0,0 +1,1130 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * A collection of router appliance instances. If you have multiple router
+ * appliance instances connected to the same site, they should all be attached
+ * to the same spoke.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} + */ +public final class LinkedRouterApplianceInstances extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances) + LinkedRouterApplianceInstancesOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkedRouterApplianceInstances.newBuilder() to construct. + private LinkedRouterApplianceInstances( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LinkedRouterApplianceInstances() { + instances_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LinkedRouterApplianceInstances(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LinkedRouterApplianceInstances( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + instances_ = + new java.util.ArrayList< + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance>(); + mutable_bitField0_ |= 0x00000001; + } + instances_.add( + input.readMessage( + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.parser(), + extensionRegistry)); + break; + } + case 16: + { + siteToSiteDataTransfer_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedRouterApplianceInstances_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedRouterApplianceInstances_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.class, + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + private java.util.List + instances_; + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + @java.lang.Override + public java.util.List + getInstancesList() { + return instances_; + } + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.networkconnectivity.v1.RouterApplianceInstanceOrBuilder> + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstanceOrBuilder + getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int SITE_TO_SITE_DATA_TRANSFER_FIELD_NUMBER = 2; + private boolean siteToSiteDataTransfer_; + /** + * + * + *
+   * A value that controls whether site-to-site data transfer is enabled for
+   * these resources. If true, routes are propagated between the spoke
+   * associated with these resources and other spokes in the hub that have data
+   * transfer enabled. If false, the spoke associated with these resources
+   * provides connectivity only between the external site and Google Cloud. In
+   * regions where data transfer is unsupported, you cannot set this field
+   * to true.
+   * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return The siteToSiteDataTransfer. + */ + @java.lang.Override + public boolean getSiteToSiteDataTransfer() { + return siteToSiteDataTransfer_; + } + + 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 < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + if (siteToSiteDataTransfer_ != false) { + output.writeBool(2, siteToSiteDataTransfer_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.get(i)); + } + if (siteToSiteDataTransfer_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, siteToSiteDataTransfer_); + } + size += unknownFields.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.LinkedRouterApplianceInstances)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances other = + (com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances) obj; + + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (getSiteToSiteDataTransfer() != other.getSiteToSiteDataTransfer()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (37 * hash) + SITE_TO_SITE_DATA_TRANSFER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSiteToSiteDataTransfer()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances 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.LinkedRouterApplianceInstances parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances 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.LinkedRouterApplianceInstances parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances 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.LinkedRouterApplianceInstances parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances 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.LinkedRouterApplianceInstances + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + 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.LinkedRouterApplianceInstances 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.LinkedRouterApplianceInstances 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.LinkedRouterApplianceInstances 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; + } + /** + * + * + *
+   * A collection of router appliance instances. If you have multiple router
+   * appliance instances connected to the same site, they should all be attached
+   * to the same spoke.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances) + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstancesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedRouterApplianceInstances_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedRouterApplianceInstances_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.class, + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.Builder.class); + } + + // Construct using + // com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstancesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + instancesBuilder_.clear(); + } + siteToSiteDataTransfer_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedRouterApplianceInstances_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances build() { + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances buildPartial() { + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances result = + new com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances(this); + int from_bitField0_ = bitField0_; + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + result.siteToSiteDataTransfer_ = siteToSiteDataTransfer_; + onBuilt(); + return result; + } + + @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.LinkedRouterApplianceInstances) { + return mergeFrom( + (com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances other) { + if (other + == com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + .getDefaultInstance()) return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (other.getSiteToSiteDataTransfer() != false) { + setSiteToSiteDataTransfer(other.getSiteToSiteDataTransfer()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + instances_ = java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = + new java.util.ArrayList< + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance>(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public java.util.List + getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public Builder setInstances( + int index, com.google.cloud.networkconnectivity.v1.RouterApplianceInstance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public Builder setInstances( + int index, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public Builder addInstances( + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public Builder addInstances( + int index, com.google.cloud.networkconnectivity.v1.RouterApplianceInstance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public Builder addInstances( + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public Builder addInstances( + int index, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public Builder addAllInstances( + java.lang.Iterable< + ? extends com.google.cloud.networkconnectivity.v1.RouterApplianceInstance> + values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder + getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstanceOrBuilder + getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.networkconnectivity.v1.RouterApplianceInstanceOrBuilder> + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder + addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder( + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.getDefaultInstance()); + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder + addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder( + index, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.getDefaultInstance()); + } + /** + * + * + *
+     * The list of router appliance instances.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private boolean siteToSiteDataTransfer_; + /** + * + * + *
+     * A value that controls whether site-to-site data transfer is enabled for
+     * these resources. If true, routes are propagated between the spoke
+     * associated with these resources and other spokes in the hub that have data
+     * transfer enabled. If false, the spoke associated with these resources
+     * provides connectivity only between the external site and Google Cloud. In
+     * regions where data transfer is unsupported, you cannot set this field
+     * to true.
+     * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return The siteToSiteDataTransfer. + */ + @java.lang.Override + public boolean getSiteToSiteDataTransfer() { + return siteToSiteDataTransfer_; + } + /** + * + * + *
+     * A value that controls whether site-to-site data transfer is enabled for
+     * these resources. If true, routes are propagated between the spoke
+     * associated with these resources and other spokes in the hub that have data
+     * transfer enabled. If false, the spoke associated with these resources
+     * provides connectivity only between the external site and Google Cloud. In
+     * regions where data transfer is unsupported, you cannot set this field
+     * to true.
+     * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @param value The siteToSiteDataTransfer to set. + * @return This builder for chaining. + */ + public Builder setSiteToSiteDataTransfer(boolean value) { + + siteToSiteDataTransfer_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A value that controls whether site-to-site data transfer is enabled for
+     * these resources. If true, routes are propagated between the spoke
+     * associated with these resources and other spokes in the hub that have data
+     * transfer enabled. If false, the spoke associated with these resources
+     * provides connectivity only between the external site and Google Cloud. In
+     * regions where data transfer is unsupported, you cannot set this field
+     * to true.
+     * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return This builder for chaining. + */ + public Builder clearSiteToSiteDataTransfer() { + + siteToSiteDataTransfer_ = false; + 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.LinkedRouterApplianceInstances) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances) + private static final com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances(); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkedRouterApplianceInstances parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkedRouterApplianceInstances(input, extensionRegistry); + } + }; + + 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.LinkedRouterApplianceInstances + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedRouterApplianceInstancesOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedRouterApplianceInstancesOrBuilder.java new file mode 100644 index 00000000..07060373 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedRouterApplianceInstancesOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface LinkedRouterApplianceInstancesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + java.util.List + getInstancesList(); + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance getInstances(int index); + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + int getInstancesCount(); + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * The list of router appliance instances.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.RouterApplianceInstance instances = 1; + * + */ + com.google.cloud.networkconnectivity.v1.RouterApplianceInstanceOrBuilder getInstancesOrBuilder( + int index); + + /** + * + * + *
+   * A value that controls whether site-to-site data transfer is enabled for
+   * these resources. If true, routes are propagated between the spoke
+   * associated with these resources and other spokes in the hub that have data
+   * transfer enabled. If false, the spoke associated with these resources
+   * provides connectivity only between the external site and Google Cloud. In
+   * regions where data transfer is unsupported, you cannot set this field
+   * to true.
+   * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return The siteToSiteDataTransfer. + */ + boolean getSiteToSiteDataTransfer(); +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedVpnTunnels.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedVpnTunnels.java new file mode 100644 index 00000000..5f4fbafe --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedVpnTunnels.java @@ -0,0 +1,858 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * A collection of Cloud VPN tunnel resources. These resources should be
+ * redundant HA VPN tunnels that all advertise the same prefixes to Google
+ * Cloud. Alternatively, in a passive/active configuration, all tunnels
+ * should be capable of advertising the same prefixes.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.LinkedVpnTunnels} + */ +public final class LinkedVpnTunnels extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.LinkedVpnTunnels) + LinkedVpnTunnelsOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkedVpnTunnels.newBuilder() to construct. + private LinkedVpnTunnels(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LinkedVpnTunnels() { + uris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LinkedVpnTunnels(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LinkedVpnTunnels( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + uris_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + uris_.add(s); + break; + } + case 16: + { + siteToSiteDataTransfer_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + uris_ = uris_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedVpnTunnels_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedVpnTunnels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.class, + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.Builder.class); + } + + public static final int URIS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList uris_; + /** + * + * + *
+   * The URIs of linked VPN tunnel resources.
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + return uris_; + } + /** + * + * + *
+   * The URIs of linked VPN tunnel resources.
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+   * The URIs of linked VPN tunnel resources.
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+   * The URIs of linked VPN tunnel resources.
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.getByteString(index); + } + + public static final int SITE_TO_SITE_DATA_TRANSFER_FIELD_NUMBER = 2; + private boolean siteToSiteDataTransfer_; + /** + * + * + *
+   * A value that controls whether site-to-site data transfer is enabled for
+   * these resources. If true, routes are propagated between the spoke
+   * associated with these resources and other spokes in the hub that have data
+   * transfer enabled. If false, the spoke associated with these resources
+   * provides connectivity only between the external site and Google Cloud. In
+   * regions where data transfer is unsupported, you cannot set this field
+   * to true.
+   * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return The siteToSiteDataTransfer. + */ + @java.lang.Override + public boolean getSiteToSiteDataTransfer() { + return siteToSiteDataTransfer_; + } + + 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 < uris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uris_.getRaw(i)); + } + if (siteToSiteDataTransfer_ != false) { + output.writeBool(2, siteToSiteDataTransfer_); + } + unknownFields.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 < uris_.size(); i++) { + dataSize += computeStringSizeNoTag(uris_.getRaw(i)); + } + size += dataSize; + size += 1 * getUrisList().size(); + } + if (siteToSiteDataTransfer_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, siteToSiteDataTransfer_); + } + size += unknownFields.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.LinkedVpnTunnels)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels other = + (com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels) obj; + + if (!getUrisList().equals(other.getUrisList())) return false; + if (getSiteToSiteDataTransfer() != other.getSiteToSiteDataTransfer()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUrisCount() > 0) { + hash = (37 * hash) + URIS_FIELD_NUMBER; + hash = (53 * hash) + getUrisList().hashCode(); + } + hash = (37 * hash) + SITE_TO_SITE_DATA_TRANSFER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSiteToSiteDataTransfer()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels 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.LinkedVpnTunnels parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels 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.LinkedVpnTunnels parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels 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.LinkedVpnTunnels parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels 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.LinkedVpnTunnels parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels 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.LinkedVpnTunnels 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.LinkedVpnTunnels 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.LinkedVpnTunnels 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; + } + /** + * + * + *
+   * A collection of Cloud VPN tunnel resources. These resources should be
+   * redundant HA VPN tunnels that all advertise the same prefixes to Google
+   * Cloud. Alternatively, in a passive/active configuration, all tunnels
+   * should be capable of advertising the same prefixes.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.LinkedVpnTunnels} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.LinkedVpnTunnels) + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnelsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedVpnTunnels_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedVpnTunnels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.class, + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + siteToSiteDataTransfer_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_LinkedVpnTunnels_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels build() { + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels buildPartial() { + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels result = + new com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + uris_ = uris_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.uris_ = uris_; + result.siteToSiteDataTransfer_ = siteToSiteDataTransfer_; + onBuilt(); + return result; + } + + @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.LinkedVpnTunnels) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels other) { + if (other == com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.getDefaultInstance()) + return this; + if (!other.uris_.isEmpty()) { + if (uris_.isEmpty()) { + uris_ = other.uris_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUrisIsMutable(); + uris_.addAll(other.uris_); + } + onChanged(); + } + if (other.getSiteToSiteDataTransfer() != false) { + setSiteToSiteDataTransfer(other.getSiteToSiteDataTransfer()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList uris_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUrisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + uris_ = new com.google.protobuf.LazyStringArrayList(uris_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources.
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + return uris_.getUnmodifiableView(); + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources.
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources.
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources.
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.getByteString(index); + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources.
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index to set the value at. + * @param value The uris to set. + * @return This builder for chaining. + */ + public Builder setUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources.
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The uris to add. + * @return This builder for chaining. + */ + public Builder addUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources.
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param values The uris to add. + * @return This builder for chaining. + */ + public Builder addAllUris(java.lang.Iterable values) { + ensureUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, uris_); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources.
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearUris() { + uris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The URIs of linked VPN tunnel resources.
+     * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes of the uris to add. + * @return This builder for chaining. + */ + public Builder addUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUrisIsMutable(); + uris_.add(value); + onChanged(); + return this; + } + + private boolean siteToSiteDataTransfer_; + /** + * + * + *
+     * A value that controls whether site-to-site data transfer is enabled for
+     * these resources. If true, routes are propagated between the spoke
+     * associated with these resources and other spokes in the hub that have data
+     * transfer enabled. If false, the spoke associated with these resources
+     * provides connectivity only between the external site and Google Cloud. In
+     * regions where data transfer is unsupported, you cannot set this field
+     * to true.
+     * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return The siteToSiteDataTransfer. + */ + @java.lang.Override + public boolean getSiteToSiteDataTransfer() { + return siteToSiteDataTransfer_; + } + /** + * + * + *
+     * A value that controls whether site-to-site data transfer is enabled for
+     * these resources. If true, routes are propagated between the spoke
+     * associated with these resources and other spokes in the hub that have data
+     * transfer enabled. If false, the spoke associated with these resources
+     * provides connectivity only between the external site and Google Cloud. In
+     * regions where data transfer is unsupported, you cannot set this field
+     * to true.
+     * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @param value The siteToSiteDataTransfer to set. + * @return This builder for chaining. + */ + public Builder setSiteToSiteDataTransfer(boolean value) { + + siteToSiteDataTransfer_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A value that controls whether site-to-site data transfer is enabled for
+     * these resources. If true, routes are propagated between the spoke
+     * associated with these resources and other spokes in the hub that have data
+     * transfer enabled. If false, the spoke associated with these resources
+     * provides connectivity only between the external site and Google Cloud. In
+     * regions where data transfer is unsupported, you cannot set this field
+     * to true.
+     * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return This builder for chaining. + */ + public Builder clearSiteToSiteDataTransfer() { + + siteToSiteDataTransfer_ = false; + 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.LinkedVpnTunnels) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.LinkedVpnTunnels) + private static final com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels(); + } + + public static com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkedVpnTunnels parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkedVpnTunnels(input, extensionRegistry); + } + }; + + 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.LinkedVpnTunnels getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedVpnTunnelsOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedVpnTunnelsOrBuilder.java new file mode 100644 index 00000000..8f66f05c --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LinkedVpnTunnelsOrBuilder.java @@ -0,0 +1,95 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface LinkedVpnTunnelsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.LinkedVpnTunnels) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The URIs of linked VPN tunnel resources.
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return A list containing the uris. + */ + java.util.List getUrisList(); + /** + * + * + *
+   * The URIs of linked VPN tunnel resources.
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @return The count of uris. + */ + int getUrisCount(); + /** + * + * + *
+   * The URIs of linked VPN tunnel resources.
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + java.lang.String getUris(int index); + /** + * + * + *
+   * The URIs of linked VPN tunnel resources.
+   * 
+ * + * repeated string uris = 1 [(.google.api.resource_reference) = { ... } + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + com.google.protobuf.ByteString getUrisBytes(int index); + + /** + * + * + *
+   * A value that controls whether site-to-site data transfer is enabled for
+   * these resources. If true, routes are propagated between the spoke
+   * associated with these resources and other spokes in the hub that have data
+   * transfer enabled. If false, the spoke associated with these resources
+   * provides connectivity only between the external site and Google Cloud. In
+   * regions where data transfer is unsupported, you cannot set this field
+   * to true.
+   * 
+ * + * bool site_to_site_data_transfer = 2; + * + * @return The siteToSiteDataTransfer. + */ + boolean getSiteToSiteDataTransfer(); +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsRequest.java new file mode 100644 index 00000000..537a662b --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsRequest.java @@ -0,0 +1,1278 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * Request for [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ListHubsRequest} + */ +public final class ListHubsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.ListHubsRequest) + ListHubsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListHubsRequest.newBuilder() to construct. + private ListHubsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListHubsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListHubsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListHubsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ListHubsRequest.class, + com.google.cloud.networkconnectivity.v1.ListHubsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + 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_; + /** + * + * + *
+   * 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; + 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; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * An 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; + } + } + /** + * + * + *
+   * An 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; + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.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.ListHubsRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.ListHubsRequest other = + (com.google.cloud.networkconnectivity.v1.ListHubsRequest) 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 (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsRequest 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.ListHubsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsRequest 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.ListHubsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsRequest 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.ListHubsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsRequest 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.ListHubsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsRequest 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.ListHubsRequest 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.ListHubsRequest 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.ListHubsRequest 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 [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ListHubsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.ListHubsRequest) + com.google.cloud.networkconnectivity.v1.ListHubsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ListHubsRequest.class, + com.google.cloud.networkconnectivity.v1.ListHubsRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.ListHubsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListHubsRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.ListHubsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListHubsRequest build() { + com.google.cloud.networkconnectivity.v1.ListHubsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListHubsRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.ListHubsRequest result = + new com.google.cloud.networkconnectivity.v1.ListHubsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @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.ListHubsRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.ListHubsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.ListHubsRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.ListHubsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.ListHubsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.ListHubsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + 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; + 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(); + 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; + 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; + 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() { + + 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; + onChanged(); + return this; + } + /** + * + * + *
+     * The page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + 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; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * An 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; + } + } + /** + * + * + *
+     * An 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; + } + } + /** + * + * + *
+     * An 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; + onChanged(); + return this; + } + /** + * + * + *
+     * An expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * An 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; + 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; + 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(); + 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; + 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.ListHubsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.ListHubsRequest) + private static final com.google.cloud.networkconnectivity.v1.ListHubsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.ListHubsRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListHubsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListHubsRequest(input, extensionRegistry); + } + }; + + 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.ListHubsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsRequestOrBuilder.java new file mode 100644 index 00000000..0a8b42a0 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface ListHubsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.ListHubsRequest) + 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(); + + /** + * + * + *
+   * An expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * An 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsResponse.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsResponse.java new file mode 100644 index 00000000..df0fda9e --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsResponse.java @@ -0,0 +1,1412 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * Response for [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ListHubsResponse} + */ +public final class ListHubsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.ListHubsResponse) + ListHubsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListHubsResponse.newBuilder() to construct. + private ListHubsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListHubsResponse() { + hubs_ = 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 ListHubsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListHubsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + hubs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + hubs_.add( + input.readMessage( + com.google.cloud.networkconnectivity.v1.Hub.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + hubs_ = java.util.Collections.unmodifiableList(hubs_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ListHubsResponse.class, + com.google.cloud.networkconnectivity.v1.ListHubsResponse.Builder.class); + } + + public static final int HUBS_FIELD_NUMBER = 1; + private java.util.List hubs_; + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + @java.lang.Override + public java.util.List getHubsList() { + return hubs_; + } + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + @java.lang.Override + public java.util.List + getHubsOrBuilderList() { + return hubs_; + } + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + @java.lang.Override + public int getHubsCount() { + return hubs_.size(); + } + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Hub getHubs(int index) { + return hubs_.get(index); + } + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.HubOrBuilder getHubsOrBuilder(int index) { + return hubs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + 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; + 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 < hubs_.size(); i++) { + output.writeMessage(1, hubs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < hubs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, hubs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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 += unknownFields.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.ListHubsResponse)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.ListHubsResponse other = + (com.google.cloud.networkconnectivity.v1.ListHubsResponse) obj; + + if (!getHubsList().equals(other.getHubsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getHubsCount() > 0) { + hash = (37 * hash) + HUBS_FIELD_NUMBER; + hash = (53 * hash) + getHubsList().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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsResponse 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.ListHubsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsResponse 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.ListHubsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsResponse 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.ListHubsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsResponse 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.ListHubsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsResponse 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.ListHubsResponse 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.ListHubsResponse 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.ListHubsResponse 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 [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ListHubsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.ListHubsResponse) + com.google.cloud.networkconnectivity.v1.ListHubsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ListHubsResponse.class, + com.google.cloud.networkconnectivity.v1.ListHubsResponse.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.ListHubsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getHubsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (hubsBuilder_ == null) { + hubs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + hubsBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListHubsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListHubsResponse getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.ListHubsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListHubsResponse build() { + com.google.cloud.networkconnectivity.v1.ListHubsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListHubsResponse buildPartial() { + com.google.cloud.networkconnectivity.v1.ListHubsResponse result = + new com.google.cloud.networkconnectivity.v1.ListHubsResponse(this); + int from_bitField0_ = bitField0_; + if (hubsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + hubs_ = java.util.Collections.unmodifiableList(hubs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.hubs_ = hubs_; + } else { + result.hubs_ = hubsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @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.ListHubsResponse) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.ListHubsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.ListHubsResponse other) { + if (other == com.google.cloud.networkconnectivity.v1.ListHubsResponse.getDefaultInstance()) + return this; + if (hubsBuilder_ == null) { + if (!other.hubs_.isEmpty()) { + if (hubs_.isEmpty()) { + hubs_ = other.hubs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureHubsIsMutable(); + hubs_.addAll(other.hubs_); + } + onChanged(); + } + } else { + if (!other.hubs_.isEmpty()) { + if (hubsBuilder_.isEmpty()) { + hubsBuilder_.dispose(); + hubsBuilder_ = null; + hubs_ = other.hubs_; + bitField0_ = (bitField0_ & ~0x00000001); + hubsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHubsFieldBuilder() + : null; + } else { + hubsBuilder_.addAllMessages(other.hubs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.ListHubsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.ListHubsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List hubs_ = + java.util.Collections.emptyList(); + + private void ensureHubsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + hubs_ = new java.util.ArrayList(hubs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Hub, + com.google.cloud.networkconnectivity.v1.Hub.Builder, + com.google.cloud.networkconnectivity.v1.HubOrBuilder> + hubsBuilder_; + + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public java.util.List getHubsList() { + if (hubsBuilder_ == null) { + return java.util.Collections.unmodifiableList(hubs_); + } else { + return hubsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public int getHubsCount() { + if (hubsBuilder_ == null) { + return hubs_.size(); + } else { + return hubsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1.Hub getHubs(int index) { + if (hubsBuilder_ == null) { + return hubs_.get(index); + } else { + return hubsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public Builder setHubs(int index, com.google.cloud.networkconnectivity.v1.Hub value) { + if (hubsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHubsIsMutable(); + hubs_.set(index, value); + onChanged(); + } else { + hubsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public Builder setHubs( + int index, com.google.cloud.networkconnectivity.v1.Hub.Builder builderForValue) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + hubs_.set(index, builderForValue.build()); + onChanged(); + } else { + hubsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public Builder addHubs(com.google.cloud.networkconnectivity.v1.Hub value) { + if (hubsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHubsIsMutable(); + hubs_.add(value); + onChanged(); + } else { + hubsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public Builder addHubs(int index, com.google.cloud.networkconnectivity.v1.Hub value) { + if (hubsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHubsIsMutable(); + hubs_.add(index, value); + onChanged(); + } else { + hubsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public Builder addHubs(com.google.cloud.networkconnectivity.v1.Hub.Builder builderForValue) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + hubs_.add(builderForValue.build()); + onChanged(); + } else { + hubsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public Builder addHubs( + int index, com.google.cloud.networkconnectivity.v1.Hub.Builder builderForValue) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + hubs_.add(index, builderForValue.build()); + onChanged(); + } else { + hubsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public Builder addAllHubs( + java.lang.Iterable values) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, hubs_); + onChanged(); + } else { + hubsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public Builder clearHubs() { + if (hubsBuilder_ == null) { + hubs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + hubsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public Builder removeHubs(int index) { + if (hubsBuilder_ == null) { + ensureHubsIsMutable(); + hubs_.remove(index); + onChanged(); + } else { + hubsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1.Hub.Builder getHubsBuilder(int index) { + return getHubsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1.HubOrBuilder getHubsOrBuilder(int index) { + if (hubsBuilder_ == null) { + return hubs_.get(index); + } else { + return hubsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public java.util.List + getHubsOrBuilderList() { + if (hubsBuilder_ != null) { + return hubsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(hubs_); + } + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1.Hub.Builder addHubsBuilder() { + return getHubsFieldBuilder() + .addBuilder(com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance()); + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public com.google.cloud.networkconnectivity.v1.Hub.Builder addHubsBuilder(int index) { + return getHubsFieldBuilder() + .addBuilder(index, com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance()); + } + /** + * + * + *
+     * The requested hubs.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + public java.util.List + getHubsBuilderList() { + return getHubsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Hub, + com.google.cloud.networkconnectivity.v1.Hub.Builder, + com.google.cloud.networkconnectivity.v1.HubOrBuilder> + getHubsFieldBuilder() { + if (hubsBuilder_ == null) { + hubsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Hub, + com.google.cloud.networkconnectivity.v1.Hub.Builder, + com.google.cloud.networkconnectivity.v1.HubOrBuilder>( + hubs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + hubs_ = null; + } + return hubsBuilder_; + } + + 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; + 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(); + 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; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * 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_ & ~0x00000002); + 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.ListHubsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.ListHubsResponse) + private static final com.google.cloud.networkconnectivity.v1.ListHubsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.ListHubsResponse(); + } + + public static com.google.cloud.networkconnectivity.v1.ListHubsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListHubsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListHubsResponse(input, extensionRegistry); + } + }; + + 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.ListHubsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsResponseOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsResponseOrBuilder.java new file mode 100644 index 00000000..b161d9b8 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListHubsResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface ListHubsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.ListHubsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + java.util.List getHubsList(); + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + com.google.cloud.networkconnectivity.v1.Hub getHubs(int index); + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + int getHubsCount(); + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + java.util.List + getHubsOrBuilderList(); + /** + * + * + *
+   * The requested hubs.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Hub hubs = 1; + */ + com.google.cloud.networkconnectivity.v1.HubOrBuilder getHubsOrBuilder(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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesRequest.java new file mode 100644 index 00000000..be08707a --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesRequest.java @@ -0,0 +1,1278 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * The request for [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ListSpokesRequest} + */ +public final class ListSpokesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.ListSpokesRequest) + ListSpokesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSpokesRequest.newBuilder() to construct. + private ListSpokesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSpokesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSpokesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSpokesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ListSpokesRequest.class, + com.google.cloud.networkconnectivity.v1.ListSpokesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource.
+   * 
+ * + * + * 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.
+   * 
+ * + * + * 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_; + /** + * + * + *
+   * 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; + 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; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * An 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; + } + } + /** + * + * + *
+   * An 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; + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.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.ListSpokesRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.ListSpokesRequest other = + (com.google.cloud.networkconnectivity.v1.ListSpokesRequest) 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 (!unknownFields.equals(other.unknownFields)) 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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesRequest 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.ListSpokesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesRequest 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.ListSpokesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesRequest 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.ListSpokesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesRequest 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.ListSpokesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesRequest 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.ListSpokesRequest 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.ListSpokesRequest 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.ListSpokesRequest 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; + } + /** + * + * + *
+   * The request for [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ListSpokesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.ListSpokesRequest) + com.google.cloud.networkconnectivity.v1.ListSpokesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ListSpokesRequest.class, + com.google.cloud.networkconnectivity.v1.ListSpokesRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.ListSpokesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListSpokesRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.ListSpokesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListSpokesRequest build() { + com.google.cloud.networkconnectivity.v1.ListSpokesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListSpokesRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.ListSpokesRequest result = + new com.google.cloud.networkconnectivity.v1.ListSpokesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @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.ListSpokesRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.ListSpokesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.ListSpokesRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.ListSpokesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.ListSpokesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.ListSpokesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource.
+     * 
+ * + * + * 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; + 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; + 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() { + + 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; + onChanged(); + return this; + } + /** + * + * + *
+     * The page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + 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; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * An 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; + } + } + /** + * + * + *
+     * An 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; + } + } + /** + * + * + *
+     * An 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; + onChanged(); + return this; + } + /** + * + * + *
+     * An expression that filters the results listed in the response.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * An 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; + 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; + 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(); + 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; + 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.ListSpokesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.ListSpokesRequest) + private static final com.google.cloud.networkconnectivity.v1.ListSpokesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.ListSpokesRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSpokesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSpokesRequest(input, extensionRegistry); + } + }; + + 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.ListSpokesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesRequestOrBuilder.java new file mode 100644 index 00000000..6d50170b --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface ListSpokesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.ListSpokesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource.
+   * 
+ * + * + * 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(); + + /** + * + * + *
+   * An expression that filters the results listed in the response.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * An 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/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesResponse.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesResponse.java new file mode 100644 index 00000000..eb898718 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesResponse.java @@ -0,0 +1,1413 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * The response for [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ListSpokesResponse} + */ +public final class ListSpokesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.ListSpokesResponse) + ListSpokesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSpokesResponse.newBuilder() to construct. + private ListSpokesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSpokesResponse() { + spokes_ = 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 ListSpokesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSpokesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + spokes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + spokes_.add( + input.readMessage( + com.google.cloud.networkconnectivity.v1.Spoke.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + spokes_ = java.util.Collections.unmodifiableList(spokes_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ListSpokesResponse.class, + com.google.cloud.networkconnectivity.v1.ListSpokesResponse.Builder.class); + } + + public static final int SPOKES_FIELD_NUMBER = 1; + private java.util.List spokes_; + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + @java.lang.Override + public java.util.List getSpokesList() { + return spokes_; + } + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + @java.lang.Override + public java.util.List + getSpokesOrBuilderList() { + return spokes_; + } + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + @java.lang.Override + public int getSpokesCount() { + return spokes_.size(); + } + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Spoke getSpokes(int index) { + return spokes_.get(index); + } + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.SpokeOrBuilder getSpokesOrBuilder(int index) { + return spokes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + 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; + 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 < spokes_.size(); i++) { + output.writeMessage(1, spokes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < spokes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, spokes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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 += unknownFields.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.ListSpokesResponse)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.ListSpokesResponse other = + (com.google.cloud.networkconnectivity.v1.ListSpokesResponse) obj; + + if (!getSpokesList().equals(other.getSpokesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSpokesCount() > 0) { + hash = (37 * hash) + SPOKES_FIELD_NUMBER; + hash = (53 * hash) + getSpokesList().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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesResponse 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.ListSpokesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesResponse 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.ListSpokesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesResponse 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.ListSpokesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesResponse 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.ListSpokesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesResponse 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.ListSpokesResponse 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.ListSpokesResponse 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.ListSpokesResponse 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; + } + /** + * + * + *
+   * The response for [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.ListSpokesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.ListSpokesResponse) + com.google.cloud.networkconnectivity.v1.ListSpokesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.ListSpokesResponse.class, + com.google.cloud.networkconnectivity.v1.ListSpokesResponse.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.ListSpokesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSpokesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (spokesBuilder_ == null) { + spokes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + spokesBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_ListSpokesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListSpokesResponse getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.ListSpokesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListSpokesResponse build() { + com.google.cloud.networkconnectivity.v1.ListSpokesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.ListSpokesResponse buildPartial() { + com.google.cloud.networkconnectivity.v1.ListSpokesResponse result = + new com.google.cloud.networkconnectivity.v1.ListSpokesResponse(this); + int from_bitField0_ = bitField0_; + if (spokesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + spokes_ = java.util.Collections.unmodifiableList(spokes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.spokes_ = spokes_; + } else { + result.spokes_ = spokesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @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.ListSpokesResponse) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.ListSpokesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.ListSpokesResponse other) { + if (other == com.google.cloud.networkconnectivity.v1.ListSpokesResponse.getDefaultInstance()) + return this; + if (spokesBuilder_ == null) { + if (!other.spokes_.isEmpty()) { + if (spokes_.isEmpty()) { + spokes_ = other.spokes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSpokesIsMutable(); + spokes_.addAll(other.spokes_); + } + onChanged(); + } + } else { + if (!other.spokes_.isEmpty()) { + if (spokesBuilder_.isEmpty()) { + spokesBuilder_.dispose(); + spokesBuilder_ = null; + spokes_ = other.spokes_; + bitField0_ = (bitField0_ & ~0x00000001); + spokesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSpokesFieldBuilder() + : null; + } else { + spokesBuilder_.addAllMessages(other.spokes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.ListSpokesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.ListSpokesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List spokes_ = + java.util.Collections.emptyList(); + + private void ensureSpokesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + spokes_ = new java.util.ArrayList(spokes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Spoke, + com.google.cloud.networkconnectivity.v1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder> + spokesBuilder_; + + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public java.util.List getSpokesList() { + if (spokesBuilder_ == null) { + return java.util.Collections.unmodifiableList(spokes_); + } else { + return spokesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public int getSpokesCount() { + if (spokesBuilder_ == null) { + return spokes_.size(); + } else { + return spokesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1.Spoke getSpokes(int index) { + if (spokesBuilder_ == null) { + return spokes_.get(index); + } else { + return spokesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public Builder setSpokes(int index, com.google.cloud.networkconnectivity.v1.Spoke value) { + if (spokesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpokesIsMutable(); + spokes_.set(index, value); + onChanged(); + } else { + spokesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public Builder setSpokes( + int index, com.google.cloud.networkconnectivity.v1.Spoke.Builder builderForValue) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + spokes_.set(index, builderForValue.build()); + onChanged(); + } else { + spokesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public Builder addSpokes(com.google.cloud.networkconnectivity.v1.Spoke value) { + if (spokesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpokesIsMutable(); + spokes_.add(value); + onChanged(); + } else { + spokesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public Builder addSpokes(int index, com.google.cloud.networkconnectivity.v1.Spoke value) { + if (spokesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpokesIsMutable(); + spokes_.add(index, value); + onChanged(); + } else { + spokesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public Builder addSpokes( + com.google.cloud.networkconnectivity.v1.Spoke.Builder builderForValue) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + spokes_.add(builderForValue.build()); + onChanged(); + } else { + spokesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public Builder addSpokes( + int index, com.google.cloud.networkconnectivity.v1.Spoke.Builder builderForValue) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + spokes_.add(index, builderForValue.build()); + onChanged(); + } else { + spokesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public Builder addAllSpokes( + java.lang.Iterable values) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, spokes_); + onChanged(); + } else { + spokesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public Builder clearSpokes() { + if (spokesBuilder_ == null) { + spokes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + spokesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public Builder removeSpokes(int index) { + if (spokesBuilder_ == null) { + ensureSpokesIsMutable(); + spokes_.remove(index); + onChanged(); + } else { + spokesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1.Spoke.Builder getSpokesBuilder(int index) { + return getSpokesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1.SpokeOrBuilder getSpokesOrBuilder(int index) { + if (spokesBuilder_ == null) { + return spokes_.get(index); + } else { + return spokesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public java.util.List + getSpokesOrBuilderList() { + if (spokesBuilder_ != null) { + return spokesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(spokes_); + } + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1.Spoke.Builder addSpokesBuilder() { + return getSpokesFieldBuilder() + .addBuilder(com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance()); + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public com.google.cloud.networkconnectivity.v1.Spoke.Builder addSpokesBuilder(int index) { + return getSpokesFieldBuilder() + .addBuilder(index, com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance()); + } + /** + * + * + *
+     * The requested spokes.
+     * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + public java.util.List + getSpokesBuilderList() { + return getSpokesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Spoke, + com.google.cloud.networkconnectivity.v1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder> + getSpokesFieldBuilder() { + if (spokesBuilder_ == null) { + spokesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Spoke, + com.google.cloud.networkconnectivity.v1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder>( + spokes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + spokes_ = null; + } + return spokesBuilder_; + } + + 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; + 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(); + 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; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * 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_ & ~0x00000002); + 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.ListSpokesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.ListSpokesResponse) + private static final com.google.cloud.networkconnectivity.v1.ListSpokesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.ListSpokesResponse(); + } + + public static com.google.cloud.networkconnectivity.v1.ListSpokesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSpokesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSpokesResponse(input, extensionRegistry); + } + }; + + 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.ListSpokesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesResponseOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesResponseOrBuilder.java new file mode 100644 index 00000000..212e8ce0 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListSpokesResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface ListSpokesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.ListSpokesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + java.util.List getSpokesList(); + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + com.google.cloud.networkconnectivity.v1.Spoke getSpokes(int index); + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + int getSpokesCount(); + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + java.util.List + getSpokesOrBuilderList(); + /** + * + * + *
+   * The requested spokes.
+   * 
+ * + * repeated .google.cloud.networkconnectivity.v1.Spoke spokes = 1; + */ + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder getSpokesOrBuilder(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/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InstanceName.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LocationName.java similarity index 55% rename from proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InstanceName.java rename to proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LocationName.java index 8d8bc308..8be28737 100644 --- a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InstanceName.java +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/LocationName.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.networkconnectivity.v1alpha1; +package com.google.cloud.networkconnectivity.v1; import com.google.api.pathtemplate.PathTemplate; import com.google.api.resourcenames.ResourceName; @@ -28,37 +28,30 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS. @Generated("by gapic-generator-java") -public class InstanceName implements ResourceName { - private static final PathTemplate PROJECT_ZONE_INSTANCE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{instance}"); +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); private volatile Map fieldValuesMap; private final String project; - private final String zone; - private final String instance; + private final String location; @Deprecated - protected InstanceName() { + protected LocationName() { project = null; - zone = null; - instance = null; + location = null; } - private InstanceName(Builder builder) { + private LocationName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); - zone = Preconditions.checkNotNull(builder.getZone()); - instance = Preconditions.checkNotNull(builder.getInstance()); + location = Preconditions.checkNotNull(builder.getLocation()); } public String getProject() { return project; } - public String getZone() { - return zone; - } - - public String getInstance() { - return instance; + public String getLocation() { + return location; } public static Builder newBuilder() { @@ -69,35 +62,35 @@ public Builder toBuilder() { return new Builder(this); } - public static InstanceName of(String project, String zone, String instance) { - return newBuilder().setProject(project).setZone(zone).setInstance(instance).build(); + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); } - public static String format(String project, String zone, String instance) { - return newBuilder().setProject(project).setZone(zone).setInstance(instance).build().toString(); + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); } - public static InstanceName parse(String formattedString) { + public static LocationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } Map matchMap = - PROJECT_ZONE_INSTANCE.validatedMatch( - formattedString, "InstanceName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("zone"), matchMap.get("instance")); + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); } - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); + 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) { + public static List toStringList(List values) { List list = new ArrayList<>(values.size()); - for (InstanceName value : values) { + for (LocationName value : values) { if (value == null) { list.add(""); } else { @@ -108,7 +101,7 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PROJECT_ZONE_INSTANCE.matches(formattedString); + return PROJECT_LOCATION.matches(formattedString); } @Override @@ -120,11 +113,8 @@ public Map getFieldValuesMap() { if (project != null) { fieldMapBuilder.put("project", project); } - if (zone != null) { - fieldMapBuilder.put("zone", zone); - } - if (instance != null) { - fieldMapBuilder.put("instance", instance); + if (location != null) { + fieldMapBuilder.put("location", location); } fieldValuesMap = fieldMapBuilder.build(); } @@ -139,8 +129,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PROJECT_ZONE_INSTANCE.instantiate( - "project", project, "zone", zone, "instance", instance); + return PROJECT_LOCATION.instantiate("project", project, "location", location); } @Override @@ -149,10 +138,9 @@ public boolean equals(Object o) { return true; } if (o != null || getClass() == o.getClass()) { - InstanceName that = ((InstanceName) o); + LocationName that = ((LocationName) o); return Objects.equals(this.project, that.project) - && Objects.equals(this.zone, that.zone) - && Objects.equals(this.instance, that.instance); + && Objects.equals(this.location, that.location); } return false; } @@ -163,17 +151,14 @@ public int hashCode() { h *= 1000003; h ^= Objects.hashCode(project); h *= 1000003; - h ^= Objects.hashCode(zone); - h *= 1000003; - h ^= Objects.hashCode(instance); + h ^= Objects.hashCode(location); return h; } - /** Builder for projects/{project}/zones/{zone}/instances/{instance}. */ + /** Builder for projects/{project}/locations/{location}. */ public static class Builder { private String project; - private String zone; - private String instance; + private String location; protected Builder() {} @@ -181,12 +166,8 @@ public String getProject() { return project; } - public String getZone() { - return zone; - } - - public String getInstance() { - return instance; + public String getLocation() { + return location; } public Builder setProject(String project) { @@ -194,24 +175,18 @@ public Builder setProject(String project) { return this; } - public Builder setZone(String zone) { - this.zone = zone; - return this; - } - - public Builder setInstance(String instance) { - this.instance = instance; + public Builder setLocation(String location) { + this.location = location; return this; } - private Builder(InstanceName instanceName) { - this.project = instanceName.project; - this.zone = instanceName.zone; - this.instance = instanceName.instance; + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; } - public InstanceName build() { - return new InstanceName(this); + public LocationName build() { + return new LocationName(this); } } } diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/OperationMetadata.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/OperationMetadata.java new file mode 100644 index 00000000..05c4df9c --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/OperationMetadata.java @@ -0,0 +1,1849 @@ +/* + * 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/common.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusMessage_ = s; + break; + } + case 48: + { + requestedCancellation_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.OperationMetadata.class, + com.google.cloud.networkconnectivity.v1.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + private volatile java.lang.Object statusMessage_; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!getVerbBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!getStatusMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!getApiVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!getVerbBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!getStatusMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!getApiVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += unknownFields.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.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.OperationMetadata other = + (com.google.cloud.networkconnectivity.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.OperationMetadata 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.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.OperationMetadata 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.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.OperationMetadata 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.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.OperationMetadata 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.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.OperationMetadata 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.OperationMetadata 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.OperationMetadata 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.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.OperationMetadata) + com.google.cloud.networkconnectivity.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.OperationMetadata.class, + com.google.cloud.networkconnectivity.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusMessage_ = ""; + + requestedCancellation_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.CommonProto + .internal_static_google_cloud_networkconnectivity_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.OperationMetadata build() { + com.google.cloud.networkconnectivity.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.OperationMetadata buildPartial() { + com.google.cloud.networkconnectivity.v1.OperationMetadata result = + new com.google.cloud.networkconnectivity.v1.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusMessage_ = statusMessage_; + result.requestedCancellation_ = requestedCancellation_; + result.apiVersion_ = apiVersion_; + onBuilt(); + return result; + } + + @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.OperationMetadata) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.OperationMetadata other) { + if (other == com.google.cloud.networkconnectivity.v1.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_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> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + + statusMessage_ = getDefaultInstance().getStatusMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusMessage_ = value; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = 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.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.OperationMetadata) + private static final com.google.cloud.networkconnectivity.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.OperationMetadata(); + } + + public static com.google.cloud.networkconnectivity.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + 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.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/OperationMetadataOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..4b315277 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,217 @@ +/* + * 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/common.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/RouterApplianceInstance.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/RouterApplianceInstance.java new file mode 100644 index 00000000..ee7089eb --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/RouterApplianceInstance.java @@ -0,0 +1,829 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * A router appliance instance is a Compute Engine virtual machine (VM) instance
+ * that acts as a BGP speaker. A router appliance instance is specified by the
+ * URI of the VM and the internal IP address of one of the VM's network
+ * interfaces.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.RouterApplianceInstance} + */ +public final class RouterApplianceInstance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.RouterApplianceInstance) + RouterApplianceInstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use RouterApplianceInstance.newBuilder() to construct. + private RouterApplianceInstance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RouterApplianceInstance() { + virtualMachine_ = ""; + ipAddress_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RouterApplianceInstance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RouterApplianceInstance( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + virtualMachine_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + ipAddress_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_RouterApplianceInstance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_RouterApplianceInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.class, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder.class); + } + + public static final int VIRTUAL_MACHINE_FIELD_NUMBER = 1; + private volatile java.lang.Object virtualMachine_; + /** + * + * + *
+   * The URI of the VM.
+   * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The virtualMachine. + */ + @java.lang.Override + public java.lang.String getVirtualMachine() { + java.lang.Object ref = virtualMachine_; + 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(); + virtualMachine_ = s; + return s; + } + } + /** + * + * + *
+   * The URI of the VM.
+   * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for virtualMachine. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVirtualMachineBytes() { + java.lang.Object ref = virtualMachine_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + virtualMachine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_ADDRESS_FIELD_NUMBER = 3; + private volatile java.lang.Object ipAddress_; + /** + * + * + *
+   * The IP address on the VM to use for peering.
+   * 
+ * + * string ip_address = 3; + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + 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(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * The IP address on the VM to use for peering.
+   * 
+ * + * string ip_address = 3; + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = 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 (!getVirtualMachineBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, virtualMachine_); + } + if (!getIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ipAddress_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getVirtualMachineBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, virtualMachine_); + } + if (!getIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ipAddress_); + } + size += unknownFields.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.RouterApplianceInstance)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance other = + (com.google.cloud.networkconnectivity.v1.RouterApplianceInstance) obj; + + if (!getVirtualMachine().equals(other.getVirtualMachine())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + VIRTUAL_MACHINE_FIELD_NUMBER; + hash = (53 * hash) + getVirtualMachine().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.RouterApplianceInstance parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.RouterApplianceInstance 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.RouterApplianceInstance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.RouterApplianceInstance 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.RouterApplianceInstance parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.RouterApplianceInstance 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.RouterApplianceInstance parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.RouterApplianceInstance 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.RouterApplianceInstance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.RouterApplianceInstance 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.RouterApplianceInstance 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.RouterApplianceInstance 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.RouterApplianceInstance 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; + } + /** + * + * + *
+   * A router appliance instance is a Compute Engine virtual machine (VM) instance
+   * that acts as a BGP speaker. A router appliance instance is specified by the
+   * URI of the VM and the internal IP address of one of the VM's network
+   * interfaces.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.RouterApplianceInstance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.RouterApplianceInstance) + com.google.cloud.networkconnectivity.v1.RouterApplianceInstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_RouterApplianceInstance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_RouterApplianceInstance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.class, + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + virtualMachine_ = ""; + + ipAddress_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_RouterApplianceInstance_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstance + getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstance build() { + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.RouterApplianceInstance buildPartial() { + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance result = + new com.google.cloud.networkconnectivity.v1.RouterApplianceInstance(this); + result.virtualMachine_ = virtualMachine_; + result.ipAddress_ = ipAddress_; + onBuilt(); + return result; + } + + @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.RouterApplianceInstance) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.RouterApplianceInstance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance other) { + if (other + == com.google.cloud.networkconnectivity.v1.RouterApplianceInstance.getDefaultInstance()) + return this; + if (!other.getVirtualMachine().isEmpty()) { + virtualMachine_ = other.virtualMachine_; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.RouterApplianceInstance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.RouterApplianceInstance) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object virtualMachine_ = ""; + /** + * + * + *
+     * The URI of the VM.
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The virtualMachine. + */ + public java.lang.String getVirtualMachine() { + java.lang.Object ref = virtualMachine_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + virtualMachine_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI of the VM.
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for virtualMachine. + */ + public com.google.protobuf.ByteString getVirtualMachineBytes() { + java.lang.Object ref = virtualMachine_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + virtualMachine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI of the VM.
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The virtualMachine to set. + * @return This builder for chaining. + */ + public Builder setVirtualMachine(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + virtualMachine_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of the VM.
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearVirtualMachine() { + + virtualMachine_ = getDefaultInstance().getVirtualMachine(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of the VM.
+     * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for virtualMachine to set. + * @return This builder for chaining. + */ + public Builder setVirtualMachineBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + virtualMachine_ = value; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * The IP address on the VM to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The IP address on the VM to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The IP address on the VM to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ipAddress_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address on the VM to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + + ipAddress_ = getDefaultInstance().getIpAddress(); + onChanged(); + return this; + } + /** + * + * + *
+     * The IP address on the VM to use for peering.
+     * 
+ * + * string ip_address = 3; + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ipAddress_ = 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.RouterApplianceInstance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.RouterApplianceInstance) + private static final com.google.cloud.networkconnectivity.v1.RouterApplianceInstance + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.RouterApplianceInstance(); + } + + public static com.google.cloud.networkconnectivity.v1.RouterApplianceInstance + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RouterApplianceInstance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RouterApplianceInstance(input, extensionRegistry); + } + }; + + 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.RouterApplianceInstance + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/RouterApplianceInstanceOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/RouterApplianceInstanceOrBuilder.java new file mode 100644 index 00000000..e9f532da --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/RouterApplianceInstanceOrBuilder.java @@ -0,0 +1,75 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface RouterApplianceInstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.RouterApplianceInstance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The URI of the VM.
+   * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The virtualMachine. + */ + java.lang.String getVirtualMachine(); + /** + * + * + *
+   * The URI of the VM.
+   * 
+ * + * string virtual_machine = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for virtualMachine. + */ + com.google.protobuf.ByteString getVirtualMachineBytes(); + + /** + * + * + *
+   * The IP address on the VM to use for peering.
+   * 
+ * + * string ip_address = 3; + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * The IP address on the VM to use for peering.
+   * 
+ * + * string ip_address = 3; + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/Spoke.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/Spoke.java new file mode 100644 index 00000000..284a7694 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/Spoke.java @@ -0,0 +1,3252 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * A spoke represents a connection between your Google Cloud network resources
+ * and a non-Google-Cloud network.
+ * When you create a spoke, you associate it with a hub. You must also identify
+ * a value for exactly one of the following fields:
+ * * linked_vpn_tunnels
+ * * linked_interconnect_attachments
+ * * linked_router_appliance_instances
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.Spoke} + */ +public final class Spoke extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.Spoke) + SpokeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Spoke.newBuilder() to construct. + private Spoke(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Spoke() { + name_ = ""; + description_ = ""; + hub_ = ""; + uniqueId_ = ""; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Spoke(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Spoke( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + 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(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + hub_ = s; + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + uniqueId_ = s; + break; + } + case 120: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 138: + { + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.Builder subBuilder = null; + if (linkedVpnTunnels_ != null) { + subBuilder = linkedVpnTunnels_.toBuilder(); + } + linkedVpnTunnels_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(linkedVpnTunnels_); + linkedVpnTunnels_ = subBuilder.buildPartial(); + } + + break; + } + case 146: + { + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.Builder + subBuilder = null; + if (linkedInterconnectAttachments_ != null) { + subBuilder = linkedInterconnectAttachments_.toBuilder(); + } + linkedInterconnectAttachments_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(linkedInterconnectAttachments_); + linkedInterconnectAttachments_ = subBuilder.buildPartial(); + } + + break; + } + case 154: + { + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.Builder + subBuilder = null; + if (linkedRouterApplianceInstances_ != null) { + subBuilder = linkedRouterApplianceInstances_.toBuilder(); + } + linkedRouterApplianceInstances_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(linkedRouterApplianceInstances_); + linkedRouterApplianceInstances_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Spoke_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.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Spoke_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.Spoke.class, + com.google.cloud.networkconnectivity.v1.Spoke.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The name of the spoke. Spoke names must be unique. They use the
+   * following form:
+   *     `projects/{project_number}/locations/{region}/spokes/{spoke_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. The name of the spoke. Spoke names must be unique. They use the
+   * following form:
+   *     `projects/{project_number}/locations/{region}/spokes/{spoke_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. The time the spoke 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. The time the spoke 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. The time the spoke was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time the spoke was last 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. The time the spoke was last 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. The time the spoke was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Spoke_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + 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(); + } + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + 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; + private volatile java.lang.Object description_; + /** + * + * + *
+   * An optional description of the spoke.
+   * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+   * An optional description of the spoke.
+   * 
+ * + * string description = 5; + * + * @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 HUB_FIELD_NUMBER = 6; + private volatile java.lang.Object hub_; + /** + * + * + *
+   * Immutable. The URI of the hub that this spoke is attached to.
+   * 
+ * + * + * string hub = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The hub. + */ + @java.lang.Override + public java.lang.String getHub() { + java.lang.Object ref = hub_; + 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(); + hub_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The URI of the hub that this spoke is attached to.
+   * 
+ * + * + * string hub = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for hub. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHubBytes() { + java.lang.Object ref = hub_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hub_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINKED_VPN_TUNNELS_FIELD_NUMBER = 17; + private com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels linkedVpnTunnels_; + /** + * + * + *
+   * VPN tunnels that are associated with the spoke.
+   * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + * + * @return Whether the linkedVpnTunnels field is set. + */ + @java.lang.Override + public boolean hasLinkedVpnTunnels() { + return linkedVpnTunnels_ != null; + } + /** + * + * + *
+   * VPN tunnels that are associated with the spoke.
+   * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + * + * @return The linkedVpnTunnels. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels getLinkedVpnTunnels() { + return linkedVpnTunnels_ == null + ? com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.getDefaultInstance() + : linkedVpnTunnels_; + } + /** + * + * + *
+   * VPN tunnels that are associated with the spoke.
+   * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedVpnTunnelsOrBuilder + getLinkedVpnTunnelsOrBuilder() { + return getLinkedVpnTunnels(); + } + + public static final int LINKED_INTERCONNECT_ATTACHMENTS_FIELD_NUMBER = 18; + private com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + linkedInterconnectAttachments_; + /** + * + * + *
+   * VLAN attachments that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + * + * @return Whether the linkedInterconnectAttachments field is set. + */ + @java.lang.Override + public boolean hasLinkedInterconnectAttachments() { + return linkedInterconnectAttachments_ != null; + } + /** + * + * + *
+   * VLAN attachments that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + * + * @return The linkedInterconnectAttachments. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + getLinkedInterconnectAttachments() { + return linkedInterconnectAttachments_ == null + ? com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.getDefaultInstance() + : linkedInterconnectAttachments_; + } + /** + * + * + *
+   * VLAN attachments that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachmentsOrBuilder + getLinkedInterconnectAttachmentsOrBuilder() { + return getLinkedInterconnectAttachments(); + } + + public static final int LINKED_ROUTER_APPLIANCE_INSTANCES_FIELD_NUMBER = 19; + private com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + linkedRouterApplianceInstances_; + /** + * + * + *
+   * Router appliance instances that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + * + * @return Whether the linkedRouterApplianceInstances field is set. + */ + @java.lang.Override + public boolean hasLinkedRouterApplianceInstances() { + return linkedRouterApplianceInstances_ != null; + } + /** + * + * + *
+   * Router appliance instances that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + * + * @return The linkedRouterApplianceInstances. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + getLinkedRouterApplianceInstances() { + return linkedRouterApplianceInstances_ == null + ? com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + .getDefaultInstance() + : linkedRouterApplianceInstances_; + } + /** + * + * + *
+   * Router appliance instances that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstancesOrBuilder + getLinkedRouterApplianceInstancesOrBuilder() { + return getLinkedRouterApplianceInstances(); + } + + public static final int UNIQUE_ID_FIELD_NUMBER = 11; + private volatile java.lang.Object uniqueId_; + /** + * + * + *
+   * Output only. The Google-generated UUID for the spoke. This value is unique across all
+   * spoke resources. If a spoke is deleted and another with the same name is
+   * created, the new spoke is assigned a different unique_id.
+   * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + @java.lang.Override + public java.lang.String getUniqueId() { + java.lang.Object ref = uniqueId_; + 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(); + uniqueId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The Google-generated UUID for the spoke. This value is unique across all
+   * spoke resources. If a spoke is deleted and another with the same name is
+   * created, the new spoke is assigned a different unique_id.
+   * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUniqueIdBytes() { + java.lang.Object ref = uniqueId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uniqueId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 15; + private int state_; + /** + * + * + *
+   * Output only. The current lifecycle state of this spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The current lifecycle state of this spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.networkconnectivity.v1.State result = + com.google.cloud.networkconnectivity.v1.State.valueOf(state_); + return result == null ? com.google.cloud.networkconnectivity.v1.State.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 (!getNameBytes().isEmpty()) { + 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 (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + if (!getHubBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, hub_); + } + if (!getUniqueIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, uniqueId_); + } + if (state_ != com.google.cloud.networkconnectivity.v1.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(15, state_); + } + if (linkedVpnTunnels_ != null) { + output.writeMessage(17, getLinkedVpnTunnels()); + } + if (linkedInterconnectAttachments_ != null) { + output.writeMessage(18, getLinkedInterconnectAttachments()); + } + if (linkedRouterApplianceInstances_ != null) { + output.writeMessage(19, getLinkedRouterApplianceInstances()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + 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 (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + if (!getHubBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, hub_); + } + if (!getUniqueIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, uniqueId_); + } + if (state_ != com.google.cloud.networkconnectivity.v1.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(15, state_); + } + if (linkedVpnTunnels_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getLinkedVpnTunnels()); + } + if (linkedInterconnectAttachments_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 18, getLinkedInterconnectAttachments()); + } + if (linkedRouterApplianceInstances_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 19, getLinkedRouterApplianceInstances()); + } + size += unknownFields.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.Spoke)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.Spoke other = + (com.google.cloud.networkconnectivity.v1.Spoke) 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 (!getHub().equals(other.getHub())) return false; + if (hasLinkedVpnTunnels() != other.hasLinkedVpnTunnels()) return false; + if (hasLinkedVpnTunnels()) { + if (!getLinkedVpnTunnels().equals(other.getLinkedVpnTunnels())) return false; + } + if (hasLinkedInterconnectAttachments() != other.hasLinkedInterconnectAttachments()) + return false; + if (hasLinkedInterconnectAttachments()) { + if (!getLinkedInterconnectAttachments().equals(other.getLinkedInterconnectAttachments())) + return false; + } + if (hasLinkedRouterApplianceInstances() != other.hasLinkedRouterApplianceInstances()) + return false; + if (hasLinkedRouterApplianceInstances()) { + if (!getLinkedRouterApplianceInstances().equals(other.getLinkedRouterApplianceInstances())) + return false; + } + if (!getUniqueId().equals(other.getUniqueId())) return false; + if (state_ != other.state_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + HUB_FIELD_NUMBER; + hash = (53 * hash) + getHub().hashCode(); + if (hasLinkedVpnTunnels()) { + hash = (37 * hash) + LINKED_VPN_TUNNELS_FIELD_NUMBER; + hash = (53 * hash) + getLinkedVpnTunnels().hashCode(); + } + if (hasLinkedInterconnectAttachments()) { + hash = (37 * hash) + LINKED_INTERCONNECT_ATTACHMENTS_FIELD_NUMBER; + hash = (53 * hash) + getLinkedInterconnectAttachments().hashCode(); + } + if (hasLinkedRouterApplianceInstances()) { + hash = (37 * hash) + LINKED_ROUTER_APPLIANCE_INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getLinkedRouterApplianceInstances().hashCode(); + } + hash = (37 * hash) + UNIQUE_ID_FIELD_NUMBER; + hash = (53 * hash) + getUniqueId().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.Spoke parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.Spoke 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.Spoke parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.Spoke 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.Spoke parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.Spoke 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.Spoke parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.Spoke 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.Spoke parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.Spoke 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.Spoke 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.Spoke 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.Spoke 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; + } + /** + * + * + *
+   * A spoke represents a connection between your Google Cloud network resources
+   * and a non-Google-Cloud network.
+   * When you create a spoke, you associate it with a hub. You must also identify
+   * a value for exactly one of the following fields:
+   * * linked_vpn_tunnels
+   * * linked_interconnect_attachments
+   * * linked_router_appliance_instances
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.Spoke} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.Spoke) + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Spoke_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.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Spoke_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.Spoke.class, + com.google.cloud.networkconnectivity.v1.Spoke.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.Spoke.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + description_ = ""; + + hub_ = ""; + + if (linkedVpnTunnelsBuilder_ == null) { + linkedVpnTunnels_ = null; + } else { + linkedVpnTunnels_ = null; + linkedVpnTunnelsBuilder_ = null; + } + if (linkedInterconnectAttachmentsBuilder_ == null) { + linkedInterconnectAttachments_ = null; + } else { + linkedInterconnectAttachments_ = null; + linkedInterconnectAttachmentsBuilder_ = null; + } + if (linkedRouterApplianceInstancesBuilder_ == null) { + linkedRouterApplianceInstances_ = null; + } else { + linkedRouterApplianceInstances_ = null; + linkedRouterApplianceInstancesBuilder_ = null; + } + uniqueId_ = ""; + + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_Spoke_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Spoke getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Spoke build() { + com.google.cloud.networkconnectivity.v1.Spoke result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Spoke buildPartial() { + com.google.cloud.networkconnectivity.v1.Spoke result = + new com.google.cloud.networkconnectivity.v1.Spoke(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.description_ = description_; + result.hub_ = hub_; + if (linkedVpnTunnelsBuilder_ == null) { + result.linkedVpnTunnels_ = linkedVpnTunnels_; + } else { + result.linkedVpnTunnels_ = linkedVpnTunnelsBuilder_.build(); + } + if (linkedInterconnectAttachmentsBuilder_ == null) { + result.linkedInterconnectAttachments_ = linkedInterconnectAttachments_; + } else { + result.linkedInterconnectAttachments_ = linkedInterconnectAttachmentsBuilder_.build(); + } + if (linkedRouterApplianceInstancesBuilder_ == null) { + result.linkedRouterApplianceInstances_ = linkedRouterApplianceInstances_; + } else { + result.linkedRouterApplianceInstances_ = linkedRouterApplianceInstancesBuilder_.build(); + } + result.uniqueId_ = uniqueId_; + result.state_ = state_; + onBuilt(); + return result; + } + + @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.Spoke) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.Spoke) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.Spoke other) { + if (other == com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getHub().isEmpty()) { + hub_ = other.hub_; + onChanged(); + } + if (other.hasLinkedVpnTunnels()) { + mergeLinkedVpnTunnels(other.getLinkedVpnTunnels()); + } + if (other.hasLinkedInterconnectAttachments()) { + mergeLinkedInterconnectAttachments(other.getLinkedInterconnectAttachments()); + } + if (other.hasLinkedRouterApplianceInstances()) { + mergeLinkedRouterApplianceInstances(other.getLinkedRouterApplianceInstances()); + } + if (!other.getUniqueId().isEmpty()) { + uniqueId_ = other.uniqueId_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.Spoke parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.networkconnectivity.v1.Spoke) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The name of the spoke. Spoke names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/{region}/spokes/{spoke_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. The name of the spoke. Spoke names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/{region}/spokes/{spoke_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. The name of the spoke. Spoke names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/{region}/spokes/{spoke_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; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of the spoke. Spoke names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of the spoke. Spoke names must be unique. They use the
+     * following form:
+     *     `projects/{project_number}/locations/{region}/spokes/{spoke_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; + 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. The time the spoke 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 createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time the spoke 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. The time the spoke 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; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the spoke 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(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the spoke 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 (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the spoke was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the spoke was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the spoke 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. The time the spoke 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. The time the spoke was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The time the spoke was last 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. The time the spoke was last 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; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the spoke was last 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(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the spoke was last 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 (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the spoke was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the spoke was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the spoke was last 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. The time the spoke was last 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() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional labels in key:value format. For more information about labels, see
+     * [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * An optional description of the spoke.
+     * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * An optional description of the spoke.
+     * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * An optional description of the spoke.
+     * 
+ * + * string description = 5; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * An optional description of the spoke.
+     * 
+ * + * string description = 5; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * An optional description of the spoke.
+     * 
+ * + * string description = 5; + * + * @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; + onChanged(); + return this; + } + + private java.lang.Object hub_ = ""; + /** + * + * + *
+     * Immutable. The URI of the hub that this spoke is attached to.
+     * 
+ * + * + * string hub = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The hub. + */ + public java.lang.String getHub() { + java.lang.Object ref = hub_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hub_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The URI of the hub that this spoke is attached to.
+     * 
+ * + * + * string hub = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for hub. + */ + public com.google.protobuf.ByteString getHubBytes() { + java.lang.Object ref = hub_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hub_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The URI of the hub that this spoke is attached to.
+     * 
+ * + * + * string hub = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The hub to set. + * @return This builder for chaining. + */ + public Builder setHub(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + hub_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The URI of the hub that this spoke is attached to.
+     * 
+ * + * + * string hub = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearHub() { + + hub_ = getDefaultInstance().getHub(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The URI of the hub that this spoke is attached to.
+     * 
+ * + * + * string hub = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for hub to set. + * @return This builder for chaining. + */ + public Builder setHubBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + hub_ = value; + onChanged(); + return this; + } + + private com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels linkedVpnTunnels_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels, + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.Builder, + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnelsOrBuilder> + linkedVpnTunnelsBuilder_; + /** + * + * + *
+     * VPN tunnels that are associated with the spoke.
+     * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + * + * @return Whether the linkedVpnTunnels field is set. + */ + public boolean hasLinkedVpnTunnels() { + return linkedVpnTunnelsBuilder_ != null || linkedVpnTunnels_ != null; + } + /** + * + * + *
+     * VPN tunnels that are associated with the spoke.
+     * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + * + * @return The linkedVpnTunnels. + */ + public com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels getLinkedVpnTunnels() { + if (linkedVpnTunnelsBuilder_ == null) { + return linkedVpnTunnels_ == null + ? com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.getDefaultInstance() + : linkedVpnTunnels_; + } else { + return linkedVpnTunnelsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * VPN tunnels that are associated with the spoke.
+     * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + */ + public Builder setLinkedVpnTunnels( + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels value) { + if (linkedVpnTunnelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + linkedVpnTunnels_ = value; + onChanged(); + } else { + linkedVpnTunnelsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * VPN tunnels that are associated with the spoke.
+     * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + */ + public Builder setLinkedVpnTunnels( + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.Builder builderForValue) { + if (linkedVpnTunnelsBuilder_ == null) { + linkedVpnTunnels_ = builderForValue.build(); + onChanged(); + } else { + linkedVpnTunnelsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * VPN tunnels that are associated with the spoke.
+     * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + */ + public Builder mergeLinkedVpnTunnels( + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels value) { + if (linkedVpnTunnelsBuilder_ == null) { + if (linkedVpnTunnels_ != null) { + linkedVpnTunnels_ = + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.newBuilder(linkedVpnTunnels_) + .mergeFrom(value) + .buildPartial(); + } else { + linkedVpnTunnels_ = value; + } + onChanged(); + } else { + linkedVpnTunnelsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * VPN tunnels that are associated with the spoke.
+     * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + */ + public Builder clearLinkedVpnTunnels() { + if (linkedVpnTunnelsBuilder_ == null) { + linkedVpnTunnels_ = null; + onChanged(); + } else { + linkedVpnTunnels_ = null; + linkedVpnTunnelsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * VPN tunnels that are associated with the spoke.
+     * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + */ + public com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.Builder + getLinkedVpnTunnelsBuilder() { + + onChanged(); + return getLinkedVpnTunnelsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * VPN tunnels that are associated with the spoke.
+     * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + */ + public com.google.cloud.networkconnectivity.v1.LinkedVpnTunnelsOrBuilder + getLinkedVpnTunnelsOrBuilder() { + if (linkedVpnTunnelsBuilder_ != null) { + return linkedVpnTunnelsBuilder_.getMessageOrBuilder(); + } else { + return linkedVpnTunnels_ == null + ? com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.getDefaultInstance() + : linkedVpnTunnels_; + } + } + /** + * + * + *
+     * VPN tunnels that are associated with the spoke.
+     * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels, + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.Builder, + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnelsOrBuilder> + getLinkedVpnTunnelsFieldBuilder() { + if (linkedVpnTunnelsBuilder_ == null) { + linkedVpnTunnelsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels, + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.Builder, + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnelsOrBuilder>( + getLinkedVpnTunnels(), getParentForChildren(), isClean()); + linkedVpnTunnels_ = null; + } + return linkedVpnTunnelsBuilder_; + } + + private com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + linkedInterconnectAttachments_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments, + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.Builder, + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachmentsOrBuilder> + linkedInterconnectAttachmentsBuilder_; + /** + * + * + *
+     * VLAN attachments that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + * + * @return Whether the linkedInterconnectAttachments field is set. + */ + public boolean hasLinkedInterconnectAttachments() { + return linkedInterconnectAttachmentsBuilder_ != null + || linkedInterconnectAttachments_ != null; + } + /** + * + * + *
+     * VLAN attachments that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + * + * @return The linkedInterconnectAttachments. + */ + public com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + getLinkedInterconnectAttachments() { + if (linkedInterconnectAttachmentsBuilder_ == null) { + return linkedInterconnectAttachments_ == null + ? com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + .getDefaultInstance() + : linkedInterconnectAttachments_; + } else { + return linkedInterconnectAttachmentsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * VLAN attachments that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + */ + public Builder setLinkedInterconnectAttachments( + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments value) { + if (linkedInterconnectAttachmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + linkedInterconnectAttachments_ = value; + onChanged(); + } else { + linkedInterconnectAttachmentsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * VLAN attachments that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + */ + public Builder setLinkedInterconnectAttachments( + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.Builder + builderForValue) { + if (linkedInterconnectAttachmentsBuilder_ == null) { + linkedInterconnectAttachments_ = builderForValue.build(); + onChanged(); + } else { + linkedInterconnectAttachmentsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * VLAN attachments that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + */ + public Builder mergeLinkedInterconnectAttachments( + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments value) { + if (linkedInterconnectAttachmentsBuilder_ == null) { + if (linkedInterconnectAttachments_ != null) { + linkedInterconnectAttachments_ = + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.newBuilder( + linkedInterconnectAttachments_) + .mergeFrom(value) + .buildPartial(); + } else { + linkedInterconnectAttachments_ = value; + } + onChanged(); + } else { + linkedInterconnectAttachmentsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * VLAN attachments that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + */ + public Builder clearLinkedInterconnectAttachments() { + if (linkedInterconnectAttachmentsBuilder_ == null) { + linkedInterconnectAttachments_ = null; + onChanged(); + } else { + linkedInterconnectAttachments_ = null; + linkedInterconnectAttachmentsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * VLAN attachments that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + */ + public com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.Builder + getLinkedInterconnectAttachmentsBuilder() { + + onChanged(); + return getLinkedInterconnectAttachmentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * VLAN attachments that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + */ + public com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachmentsOrBuilder + getLinkedInterconnectAttachmentsOrBuilder() { + if (linkedInterconnectAttachmentsBuilder_ != null) { + return linkedInterconnectAttachmentsBuilder_.getMessageOrBuilder(); + } else { + return linkedInterconnectAttachments_ == null + ? com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + .getDefaultInstance() + : linkedInterconnectAttachments_; + } + } + /** + * + * + *
+     * VLAN attachments that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments, + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.Builder, + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachmentsOrBuilder> + getLinkedInterconnectAttachmentsFieldBuilder() { + if (linkedInterconnectAttachmentsBuilder_ == null) { + linkedInterconnectAttachmentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments, + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.Builder, + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachmentsOrBuilder>( + getLinkedInterconnectAttachments(), getParentForChildren(), isClean()); + linkedInterconnectAttachments_ = null; + } + return linkedInterconnectAttachmentsBuilder_; + } + + private com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + linkedRouterApplianceInstances_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances, + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.Builder, + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstancesOrBuilder> + linkedRouterApplianceInstancesBuilder_; + /** + * + * + *
+     * Router appliance instances that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + * + * @return Whether the linkedRouterApplianceInstances field is set. + */ + public boolean hasLinkedRouterApplianceInstances() { + return linkedRouterApplianceInstancesBuilder_ != null + || linkedRouterApplianceInstances_ != null; + } + /** + * + * + *
+     * Router appliance instances that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + * + * @return The linkedRouterApplianceInstances. + */ + public com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + getLinkedRouterApplianceInstances() { + if (linkedRouterApplianceInstancesBuilder_ == null) { + return linkedRouterApplianceInstances_ == null + ? com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + .getDefaultInstance() + : linkedRouterApplianceInstances_; + } else { + return linkedRouterApplianceInstancesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Router appliance instances that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + */ + public Builder setLinkedRouterApplianceInstances( + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances value) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + linkedRouterApplianceInstances_ = value; + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Router appliance instances that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + */ + public Builder setLinkedRouterApplianceInstances( + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.Builder + builderForValue) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + linkedRouterApplianceInstances_ = builderForValue.build(); + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Router appliance instances that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + */ + public Builder mergeLinkedRouterApplianceInstances( + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances value) { + if (linkedRouterApplianceInstancesBuilder_ == null) { + if (linkedRouterApplianceInstances_ != null) { + linkedRouterApplianceInstances_ = + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.newBuilder( + linkedRouterApplianceInstances_) + .mergeFrom(value) + .buildPartial(); + } else { + linkedRouterApplianceInstances_ = value; + } + onChanged(); + } else { + linkedRouterApplianceInstancesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Router appliance instances that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + */ + public Builder clearLinkedRouterApplianceInstances() { + if (linkedRouterApplianceInstancesBuilder_ == null) { + linkedRouterApplianceInstances_ = null; + onChanged(); + } else { + linkedRouterApplianceInstances_ = null; + linkedRouterApplianceInstancesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Router appliance instances that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + */ + public com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.Builder + getLinkedRouterApplianceInstancesBuilder() { + + onChanged(); + return getLinkedRouterApplianceInstancesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Router appliance instances that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + */ + public com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstancesOrBuilder + getLinkedRouterApplianceInstancesOrBuilder() { + if (linkedRouterApplianceInstancesBuilder_ != null) { + return linkedRouterApplianceInstancesBuilder_.getMessageOrBuilder(); + } else { + return linkedRouterApplianceInstances_ == null + ? com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + .getDefaultInstance() + : linkedRouterApplianceInstances_; + } + } + /** + * + * + *
+     * Router appliance instances that are associated with the spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances, + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.Builder, + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstancesOrBuilder> + getLinkedRouterApplianceInstancesFieldBuilder() { + if (linkedRouterApplianceInstancesBuilder_ == null) { + linkedRouterApplianceInstancesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances, + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.Builder, + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstancesOrBuilder>( + getLinkedRouterApplianceInstances(), getParentForChildren(), isClean()); + linkedRouterApplianceInstances_ = null; + } + return linkedRouterApplianceInstancesBuilder_; + } + + private java.lang.Object uniqueId_ = ""; + /** + * + * + *
+     * Output only. The Google-generated UUID for the spoke. This value is unique across all
+     * spoke resources. If a spoke is deleted and another with the same name is
+     * created, the new spoke is assigned a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + public java.lang.String getUniqueId() { + java.lang.Object ref = uniqueId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uniqueId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The Google-generated UUID for the spoke. This value is unique across all
+     * spoke resources. If a spoke is deleted and another with the same name is
+     * created, the new spoke is assigned a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + public com.google.protobuf.ByteString getUniqueIdBytes() { + java.lang.Object ref = uniqueId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uniqueId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The Google-generated UUID for the spoke. This value is unique across all
+     * spoke resources. If a spoke is deleted and another with the same name is
+     * created, the new spoke is assigned a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uniqueId to set. + * @return This builder for chaining. + */ + public Builder setUniqueId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uniqueId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Google-generated UUID for the spoke. This value is unique across all
+     * spoke resources. If a spoke is deleted and another with the same name is
+     * created, the new spoke is assigned a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUniqueId() { + + uniqueId_ = getDefaultInstance().getUniqueId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Google-generated UUID for the spoke. This value is unique across all
+     * spoke resources. If a spoke is deleted and another with the same name is
+     * created, the new spoke is assigned a different unique_id.
+     * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uniqueId to set. + * @return This builder for chaining. + */ + public Builder setUniqueIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uniqueId_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current lifecycle state of this spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The current lifecycle state of this spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current lifecycle state of this spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.networkconnectivity.v1.State result = + com.google.cloud.networkconnectivity.v1.State.valueOf(state_); + return result == null ? com.google.cloud.networkconnectivity.v1.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current lifecycle state of this spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.networkconnectivity.v1.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current lifecycle state of this spoke.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 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.Spoke) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.Spoke) + private static final com.google.cloud.networkconnectivity.v1.Spoke DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.Spoke(); + } + + public static com.google.cloud.networkconnectivity.v1.Spoke getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Spoke parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Spoke(input, extensionRegistry); + } + }; + + 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.Spoke getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/VpnTunnelName.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/SpokeName.java similarity index 54% rename from proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/VpnTunnelName.java rename to proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/SpokeName.java index 5e7c3ec1..dbfed3b1 100644 --- a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/VpnTunnelName.java +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/SpokeName.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.networkconnectivity.v1alpha1; +package com.google.cloud.networkconnectivity.v1; import com.google.api.pathtemplate.PathTemplate; import com.google.api.resourcenames.ResourceName; @@ -28,38 +28,38 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS. @Generated("by gapic-generator-java") -public class VpnTunnelName implements ResourceName { - private static final PathTemplate PROJECT_REGION_RESOURCE_ID = +public class SpokeName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_SPOKE = PathTemplate.createWithoutUrlEncoding( - "projects/{project}/regions/{region}/vpnTunnels/{resource_id}"); + "projects/{project}/locations/{location}/spokes/{spoke}"); private volatile Map fieldValuesMap; private final String project; - private final String region; - private final String resourceId; + private final String location; + private final String spoke; @Deprecated - protected VpnTunnelName() { + protected SpokeName() { project = null; - region = null; - resourceId = null; + location = null; + spoke = null; } - private VpnTunnelName(Builder builder) { + private SpokeName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - resourceId = Preconditions.checkNotNull(builder.getResourceId()); + location = Preconditions.checkNotNull(builder.getLocation()); + spoke = Preconditions.checkNotNull(builder.getSpoke()); } public String getProject() { return project; } - public String getRegion() { - return region; + public String getLocation() { + return location; } - public String getResourceId() { - return resourceId; + public String getSpoke() { + return spoke; } public static Builder newBuilder() { @@ -70,40 +70,40 @@ public Builder toBuilder() { return new Builder(this); } - public static VpnTunnelName of(String project, String region, String resourceId) { - return newBuilder().setProject(project).setRegion(region).setResourceId(resourceId).build(); + public static SpokeName of(String project, String location, String spoke) { + return newBuilder().setProject(project).setLocation(location).setSpoke(spoke).build(); } - public static String format(String project, String region, String resourceId) { + public static String format(String project, String location, String spoke) { return newBuilder() .setProject(project) - .setRegion(region) - .setResourceId(resourceId) + .setLocation(location) + .setSpoke(spoke) .build() .toString(); } - public static VpnTunnelName parse(String formattedString) { + public static SpokeName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } Map matchMap = - PROJECT_REGION_RESOURCE_ID.validatedMatch( - formattedString, "VpnTunnelName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("resource_id")); + PROJECT_LOCATION_SPOKE.validatedMatch( + formattedString, "SpokeName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("spoke")); } - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); + 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) { + public static List toStringList(List values) { List list = new ArrayList<>(values.size()); - for (VpnTunnelName value : values) { + for (SpokeName value : values) { if (value == null) { list.add(""); } else { @@ -114,7 +114,7 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PROJECT_REGION_RESOURCE_ID.matches(formattedString); + return PROJECT_LOCATION_SPOKE.matches(formattedString); } @Override @@ -126,11 +126,11 @@ public Map getFieldValuesMap() { if (project != null) { fieldMapBuilder.put("project", project); } - if (region != null) { - fieldMapBuilder.put("region", region); + if (location != null) { + fieldMapBuilder.put("location", location); } - if (resourceId != null) { - fieldMapBuilder.put("resource_id", resourceId); + if (spoke != null) { + fieldMapBuilder.put("spoke", spoke); } fieldValuesMap = fieldMapBuilder.build(); } @@ -145,8 +145,8 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PROJECT_REGION_RESOURCE_ID.instantiate( - "project", project, "region", region, "resource_id", resourceId); + return PROJECT_LOCATION_SPOKE.instantiate( + "project", project, "location", location, "spoke", spoke); } @Override @@ -155,10 +155,10 @@ public boolean equals(Object o) { return true; } if (o != null || getClass() == o.getClass()) { - VpnTunnelName that = ((VpnTunnelName) o); + SpokeName that = ((SpokeName) o); return Objects.equals(this.project, that.project) - && Objects.equals(this.region, that.region) - && Objects.equals(this.resourceId, that.resourceId); + && Objects.equals(this.location, that.location) + && Objects.equals(this.spoke, that.spoke); } return false; } @@ -169,17 +169,17 @@ public int hashCode() { h *= 1000003; h ^= Objects.hashCode(project); h *= 1000003; - h ^= Objects.hashCode(region); + h ^= Objects.hashCode(location); h *= 1000003; - h ^= Objects.hashCode(resourceId); + h ^= Objects.hashCode(spoke); return h; } - /** Builder for projects/{project}/regions/{region}/vpnTunnels/{resource_id}. */ + /** Builder for projects/{project}/locations/{location}/spokes/{spoke}. */ public static class Builder { private String project; - private String region; - private String resourceId; + private String location; + private String spoke; protected Builder() {} @@ -187,12 +187,12 @@ public String getProject() { return project; } - public String getRegion() { - return region; + public String getLocation() { + return location; } - public String getResourceId() { - return resourceId; + public String getSpoke() { + return spoke; } public Builder setProject(String project) { @@ -200,24 +200,24 @@ public Builder setProject(String project) { return this; } - public Builder setRegion(String region) { - this.region = region; + public Builder setLocation(String location) { + this.location = location; return this; } - public Builder setResourceId(String resourceId) { - this.resourceId = resourceId; + public Builder setSpoke(String spoke) { + this.spoke = spoke; return this; } - private Builder(VpnTunnelName vpnTunnelName) { - this.project = vpnTunnelName.project; - this.region = vpnTunnelName.region; - this.resourceId = vpnTunnelName.resourceId; + private Builder(SpokeName spokeName) { + this.project = spokeName.project; + this.location = spokeName.location; + this.spoke = spokeName.spoke; } - public VpnTunnelName build() { - return new VpnTunnelName(this); + public SpokeName build() { + return new SpokeName(this); } } } diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/SpokeOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/SpokeOrBuilder.java new file mode 100644 index 00000000..52e258ab --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/SpokeOrBuilder.java @@ -0,0 +1,427 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface SpokeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.Spoke) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The name of the spoke. Spoke names must be unique. They use the
+   * following form:
+   *     `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The name of the spoke. Spoke names must be unique. They use the
+   * following form:
+   *     `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The time the spoke 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. The time the spoke was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the spoke was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the spoke was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time the spoke was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time the spoke was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional labels in key:value format. For more information about labels, see
+   * [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * An optional description of the spoke.
+   * 
+ * + * string description = 5; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * An optional description of the spoke.
+   * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Immutable. The URI of the hub that this spoke is attached to.
+   * 
+ * + * + * string hub = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The hub. + */ + java.lang.String getHub(); + /** + * + * + *
+   * Immutable. The URI of the hub that this spoke is attached to.
+   * 
+ * + * + * string hub = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for hub. + */ + com.google.protobuf.ByteString getHubBytes(); + + /** + * + * + *
+   * VPN tunnels that are associated with the spoke.
+   * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + * + * @return Whether the linkedVpnTunnels field is set. + */ + boolean hasLinkedVpnTunnels(); + /** + * + * + *
+   * VPN tunnels that are associated with the spoke.
+   * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + * + * @return The linkedVpnTunnels. + */ + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnels getLinkedVpnTunnels(); + /** + * + * + *
+   * VPN tunnels that are associated with the spoke.
+   * 
+ * + * .google.cloud.networkconnectivity.v1.LinkedVpnTunnels linked_vpn_tunnels = 17; + */ + com.google.cloud.networkconnectivity.v1.LinkedVpnTunnelsOrBuilder getLinkedVpnTunnelsOrBuilder(); + + /** + * + * + *
+   * VLAN attachments that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + * + * @return Whether the linkedInterconnectAttachments field is set. + */ + boolean hasLinkedInterconnectAttachments(); + /** + * + * + *
+   * VLAN attachments that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + * + * @return The linkedInterconnectAttachments. + */ + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + getLinkedInterconnectAttachments(); + /** + * + * + *
+   * VLAN attachments that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments linked_interconnect_attachments = 18; + * + */ + com.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachmentsOrBuilder + getLinkedInterconnectAttachmentsOrBuilder(); + + /** + * + * + *
+   * Router appliance instances that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + * + * @return Whether the linkedRouterApplianceInstances field is set. + */ + boolean hasLinkedRouterApplianceInstances(); + /** + * + * + *
+   * Router appliance instances that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + * + * @return The linkedRouterApplianceInstances. + */ + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + getLinkedRouterApplianceInstances(); + /** + * + * + *
+   * Router appliance instances that are associated with the spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + * + */ + com.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstancesOrBuilder + getLinkedRouterApplianceInstancesOrBuilder(); + + /** + * + * + *
+   * Output only. The Google-generated UUID for the spoke. This value is unique across all
+   * spoke resources. If a spoke is deleted and another with the same name is
+   * created, the new spoke is assigned a different unique_id.
+   * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uniqueId. + */ + java.lang.String getUniqueId(); + /** + * + * + *
+   * Output only. The Google-generated UUID for the spoke. This value is unique across all
+   * spoke resources. If a spoke is deleted and another with the same name is
+   * created, the new spoke is assigned a different unique_id.
+   * 
+ * + * string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uniqueId. + */ + com.google.protobuf.ByteString getUniqueIdBytes(); + + /** + * + * + *
+   * Output only. The current lifecycle state of this spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current lifecycle state of this spoke.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.networkconnectivity.v1.State getState(); +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/State.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/State.java new file mode 100644 index 00000000..cb12e01e --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/State.java @@ -0,0 +1,199 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * The State enum represents the lifecycle stage of a Network Connectivity
+ * Center resource.
+ * 
+ * + * Protobuf enum {@code google.cloud.networkconnectivity.v1.State} + */ +public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No state information available
+   * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+   * The resource's create operation is in progress
+   * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+   * The resource is active
+   * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + /** + * + * + *
+   * The resource's Delete operation is in progress
+   * 
+ * + * DELETING = 3; + */ + DELETING(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No state information available
+   * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The resource's create operation is in progress
+   * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+   * The resource is active
+   * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_VALUE = 2; + /** + * + * + *
+   * The resource's Delete operation is in progress
+   * 
+ * + * DELETING = 3; + */ + public static final int DELETING_VALUE = 3; + + 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 State 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 State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CREATING; + case 2: + return ACTIVE; + case 3: + return DELETING; + 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 State findValueByNumber(int number) { + return State.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.HubProto.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.networkconnectivity.v1.State) +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateHubRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateHubRequest.java new file mode 100644 index 00000000..f4846767 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateHubRequest.java @@ -0,0 +1,1345 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * Request for [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.UpdateHubRequest} + */ +public final class UpdateHubRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.UpdateHubRequest) + UpdateHubRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateHubRequest.newBuilder() to construct. + private UpdateHubRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateHubRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateHubRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateHubRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.networkconnectivity.v1.Hub.Builder subBuilder = null; + if (hub_ != null) { + subBuilder = hub_.toBuilder(); + } + hub_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1.Hub.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(hub_); + hub_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.UpdateHubRequest.class, + com.google.cloud.networkconnectivity.v1.UpdateHubRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. In the case of an update to an existing hub, field mask is used to specify
+   * the fields to be overwritten. The fields specified in the update_mask are
+   * relative to the resource, not the full request. A field is overwritten if
+   * it is in the mask. If the user does not provide a mask, then all fields are
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. In the case of an update to an existing hub, field mask is used to specify
+   * the fields to be overwritten. The fields specified in the update_mask are
+   * relative to the resource, not the full request. A field is overwritten if
+   * it is in the mask. If the user does not provide a mask, then all fields are
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. In the case of an update to an existing hub, field mask is used to specify
+   * the fields to be overwritten. The fields specified in the update_mask are
+   * relative to the resource, not the full request. A field is overwritten if
+   * it is in the mask. If the user does not provide a mask, then all fields are
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int HUB_FIELD_NUMBER = 2; + private com.google.cloud.networkconnectivity.v1.Hub hub_; + /** + * + * + *
+   * Required. The state that the hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + @java.lang.Override + public boolean hasHub() { + return hub_ != null; + } + /** + * + * + *
+   * Required. The state that the hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Hub getHub() { + return hub_ == null ? com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance() : hub_; + } + /** + * + * + *
+   * Required. The state that the hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.HubOrBuilder getHubOrBuilder() { + return getHub(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 = 3 [(.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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 = 3 [(.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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (hub_ != null) { + output.writeMessage(2, getHub()); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (hub_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getHub()); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + size += unknownFields.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.UpdateHubRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.UpdateHubRequest other = + (com.google.cloud.networkconnectivity.v1.UpdateHubRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasHub() != other.hasHub()) return false; + if (hasHub()) { + if (!getHub().equals(other.getHub())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasHub()) { + hash = (37 * hash) + HUB_FIELD_NUMBER; + hash = (53 * hash) + getHub().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.UpdateHubRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateHubRequest 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.UpdateHubRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateHubRequest 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.UpdateHubRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateHubRequest 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.UpdateHubRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateHubRequest 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.UpdateHubRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateHubRequest 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.UpdateHubRequest 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.UpdateHubRequest 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.UpdateHubRequest 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 [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.UpdateHubRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.UpdateHubRequest) + com.google.cloud.networkconnectivity.v1.UpdateHubRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateHubRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateHubRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.UpdateHubRequest.class, + com.google.cloud.networkconnectivity.v1.UpdateHubRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.UpdateHubRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (hubBuilder_ == null) { + hub_ = null; + } else { + hub_ = null; + hubBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateHubRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.UpdateHubRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.UpdateHubRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.UpdateHubRequest build() { + com.google.cloud.networkconnectivity.v1.UpdateHubRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.UpdateHubRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.UpdateHubRequest result = + new com.google.cloud.networkconnectivity.v1.UpdateHubRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (hubBuilder_ == null) { + result.hub_ = hub_; + } else { + result.hub_ = hubBuilder_.build(); + } + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.UpdateHubRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.UpdateHubRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.UpdateHubRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.UpdateHubRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasHub()) { + mergeHub(other.getHub()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.UpdateHubRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.UpdateHubRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. In the case of an update to an existing hub, field mask is used to specify
+     * the fields to be overwritten. The fields specified in the update_mask are
+     * relative to the resource, not the full request. A field is overwritten if
+     * it is in the mask. If the user does not provide a mask, then all fields are
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing hub, field mask is used to specify
+     * the fields to be overwritten. The fields specified in the update_mask are
+     * relative to the resource, not the full request. A field is overwritten if
+     * it is in the mask. If the user does not provide a mask, then all fields are
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. In the case of an update to an existing hub, field mask is used to specify
+     * the fields to be overwritten. The fields specified in the update_mask are
+     * relative to the resource, not the full request. A field is overwritten if
+     * it is in the mask. If the user does not provide a mask, then all fields are
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing hub, field mask is used to specify
+     * the fields to be overwritten. The fields specified in the update_mask are
+     * relative to the resource, not the full request. A field is overwritten if
+     * it is in the mask. If the user does not provide a mask, then all fields are
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing hub, field mask is used to specify
+     * the fields to be overwritten. The fields specified in the update_mask are
+     * relative to the resource, not the full request. A field is overwritten if
+     * it is in the mask. If the user does not provide a mask, then all fields are
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing hub, field mask is used to specify
+     * the fields to be overwritten. The fields specified in the update_mask are
+     * relative to the resource, not the full request. A field is overwritten if
+     * it is in the mask. If the user does not provide a mask, then all fields are
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing hub, field mask is used to specify
+     * the fields to be overwritten. The fields specified in the update_mask are
+     * relative to the resource, not the full request. A field is overwritten if
+     * it is in the mask. If the user does not provide a mask, then all fields are
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. In the case of an update to an existing hub, field mask is used to specify
+     * the fields to be overwritten. The fields specified in the update_mask are
+     * relative to the resource, not the full request. A field is overwritten if
+     * it is in the mask. If the user does not provide a mask, then all fields are
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. In the case of an update to an existing hub, field mask is used to specify
+     * the fields to be overwritten. The fields specified in the update_mask are
+     * relative to the resource, not the full request. A field is overwritten if
+     * it is in the mask. If the user does not provide a mask, then all fields are
+     * overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.networkconnectivity.v1.Hub hub_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Hub, + com.google.cloud.networkconnectivity.v1.Hub.Builder, + com.google.cloud.networkconnectivity.v1.HubOrBuilder> + hubBuilder_; + /** + * + * + *
+     * Required. The state that the hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + public boolean hasHub() { + return hubBuilder_ != null || hub_ != null; + } + /** + * + * + *
+     * Required. The state that the hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + public com.google.cloud.networkconnectivity.v1.Hub getHub() { + if (hubBuilder_ == null) { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance() + : hub_; + } else { + return hubBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The state that the hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHub(com.google.cloud.networkconnectivity.v1.Hub value) { + if (hubBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hub_ = value; + onChanged(); + } else { + hubBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setHub(com.google.cloud.networkconnectivity.v1.Hub.Builder builderForValue) { + if (hubBuilder_ == null) { + hub_ = builderForValue.build(); + onChanged(); + } else { + hubBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeHub(com.google.cloud.networkconnectivity.v1.Hub value) { + if (hubBuilder_ == null) { + if (hub_ != null) { + hub_ = + com.google.cloud.networkconnectivity.v1.Hub.newBuilder(hub_) + .mergeFrom(value) + .buildPartial(); + } else { + hub_ = value; + } + onChanged(); + } else { + hubBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearHub() { + if (hubBuilder_ == null) { + hub_ = null; + onChanged(); + } else { + hub_ = null; + hubBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The state that the hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1.Hub.Builder getHubBuilder() { + + onChanged(); + return getHubFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The state that the hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1.HubOrBuilder getHubOrBuilder() { + if (hubBuilder_ != null) { + return hubBuilder_.getMessageOrBuilder(); + } else { + return hub_ == null + ? com.google.cloud.networkconnectivity.v1.Hub.getDefaultInstance() + : hub_; + } + } + /** + * + * + *
+     * Required. The state that the hub should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Hub, + com.google.cloud.networkconnectivity.v1.Hub.Builder, + com.google.cloud.networkconnectivity.v1.HubOrBuilder> + getHubFieldBuilder() { + if (hubBuilder_ == null) { + hubBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Hub, + com.google.cloud.networkconnectivity.v1.Hub.Builder, + com.google.cloud.networkconnectivity.v1.HubOrBuilder>( + getHub(), getParentForChildren(), isClean()); + hub_ = null; + } + return hubBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.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; + 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.UpdateHubRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.UpdateHubRequest) + private static final com.google.cloud.networkconnectivity.v1.UpdateHubRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.UpdateHubRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateHubRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateHubRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateHubRequest(input, extensionRegistry); + } + }; + + 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.UpdateHubRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateHubRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateHubRequestOrBuilder.java new file mode 100644 index 00000000..baf3acd1 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateHubRequestOrBuilder.java @@ -0,0 +1,163 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface UpdateHubRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.UpdateHubRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. In the case of an update to an existing hub, field mask is used to specify
+   * the fields to be overwritten. The fields specified in the update_mask are
+   * relative to the resource, not the full request. A field is overwritten if
+   * it is in the mask. If the user does not provide a mask, then all fields are
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. In the case of an update to an existing hub, field mask is used to specify
+   * the fields to be overwritten. The fields specified in the update_mask are
+   * relative to the resource, not the full request. A field is overwritten if
+   * it is in the mask. If the user does not provide a mask, then all fields are
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. In the case of an update to an existing hub, field mask is used to specify
+   * the fields to be overwritten. The fields specified in the update_mask are
+   * relative to the resource, not the full request. A field is overwritten if
+   * it is in the mask. If the user does not provide a mask, then all fields are
+   * overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The state that the hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the hub field is set. + */ + boolean hasHub(); + /** + * + * + *
+   * Required. The state that the hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The hub. + */ + com.google.cloud.networkconnectivity.v1.Hub getHub(); + /** + * + * + *
+   * Required. The state that the hub should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Hub hub = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networkconnectivity.v1.HubOrBuilder getHubOrBuilder(); + + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateSpokeRequest.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateSpokeRequest.java new file mode 100644 index 00000000..81522d06 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateSpokeRequest.java @@ -0,0 +1,1347 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +/** + * + * + *
+ * Request for [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke] method.
+ * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.UpdateSpokeRequest} + */ +public final class UpdateSpokeRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.UpdateSpokeRequest) + UpdateSpokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSpokeRequest.newBuilder() to construct. + private UpdateSpokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSpokeRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSpokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateSpokeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.networkconnectivity.v1.Spoke.Builder subBuilder = null; + if (spoke_ != null) { + subBuilder = spoke_.toBuilder(); + } + spoke_ = + input.readMessage( + com.google.cloud.networkconnectivity.v1.Spoke.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(spoke_); + spoke_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. In the case of an update to an existing spoke, field mask is used to
+   * specify the fields to be overwritten. The fields specified in the
+   * update_mask are relative to the resource, not the full request. A field is
+   * overwritten if it is in the mask. If the user does not provide a mask, then
+   * all fields are overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. In the case of an update to an existing spoke, field mask is used to
+   * specify the fields to be overwritten. The fields specified in the
+   * update_mask are relative to the resource, not the full request. A field is
+   * overwritten if it is in the mask. If the user does not provide a mask, then
+   * all fields are overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. In the case of an update to an existing spoke, field mask is used to
+   * specify the fields to be overwritten. The fields specified in the
+   * update_mask are relative to the resource, not the full request. A field is
+   * overwritten if it is in the mask. If the user does not provide a mask, then
+   * all fields are overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int SPOKE_FIELD_NUMBER = 2; + private com.google.cloud.networkconnectivity.v1.Spoke spoke_; + /** + * + * + *
+   * Required. The state that the spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + @java.lang.Override + public boolean hasSpoke() { + return spoke_ != null; + } + /** + * + * + *
+   * Required. The state that the spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.Spoke getSpoke() { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance() + : spoke_; + } + /** + * + * + *
+   * Required. The state that the spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.SpokeOrBuilder getSpokeOrBuilder() { + return getSpoke(); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 = 3 [(.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. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 = 3 [(.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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (spoke_ != null) { + output.writeMessage(2, getSpoke()); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (spoke_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSpoke()); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + size += unknownFields.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.UpdateSpokeRequest)) { + return super.equals(obj); + } + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest other = + (com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasSpoke() != other.hasSpoke()) return false; + if (hasSpoke()) { + if (!getSpoke().equals(other.getSpoke())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasSpoke()) { + hash = (37 * hash) + SPOKE_FIELD_NUMBER; + hash = (53 * hash) + getSpoke().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest 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.UpdateSpokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest 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.UpdateSpokeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest 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.UpdateSpokeRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest 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.UpdateSpokeRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest 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.UpdateSpokeRequest 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.UpdateSpokeRequest 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.UpdateSpokeRequest 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 [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke] method.
+   * 
+ * + * Protobuf type {@code google.cloud.networkconnectivity.v1.UpdateSpokeRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.UpdateSpokeRequest) + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateSpokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateSpokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest.class, + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest.Builder.class); + } + + // Construct using com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (spokeBuilder_ == null) { + spoke_ = null; + } else { + spoke_ = null; + spokeBuilder_ = null; + } + requestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.networkconnectivity.v1.HubProto + .internal_static_google_cloud_networkconnectivity_v1_UpdateSpokeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest getDefaultInstanceForType() { + return com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest build() { + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest buildPartial() { + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest result = + new com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (spokeBuilder_ == null) { + result.spoke_ = spoke_; + } else { + result.spoke_ = spokeBuilder_.build(); + } + result.requestId_ = requestId_; + onBuilt(); + return result; + } + + @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.UpdateSpokeRequest) { + return mergeFrom((com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest other) { + if (other == com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasSpoke()) { + mergeSpoke(other.getSpoke()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. In the case of an update to an existing spoke, field mask is used to
+     * specify the fields to be overwritten. The fields specified in the
+     * update_mask are relative to the resource, not the full request. A field is
+     * overwritten if it is in the mask. If the user does not provide a mask, then
+     * all fields are overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing spoke, field mask is used to
+     * specify the fields to be overwritten. The fields specified in the
+     * update_mask are relative to the resource, not the full request. A field is
+     * overwritten if it is in the mask. If the user does not provide a mask, then
+     * all fields are overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. In the case of an update to an existing spoke, field mask is used to
+     * specify the fields to be overwritten. The fields specified in the
+     * update_mask are relative to the resource, not the full request. A field is
+     * overwritten if it is in the mask. If the user does not provide a mask, then
+     * all fields are overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing spoke, field mask is used to
+     * specify the fields to be overwritten. The fields specified in the
+     * update_mask are relative to the resource, not the full request. A field is
+     * overwritten if it is in the mask. If the user does not provide a mask, then
+     * all fields are overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing spoke, field mask is used to
+     * specify the fields to be overwritten. The fields specified in the
+     * update_mask are relative to the resource, not the full request. A field is
+     * overwritten if it is in the mask. If the user does not provide a mask, then
+     * all fields are overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing spoke, field mask is used to
+     * specify the fields to be overwritten. The fields specified in the
+     * update_mask are relative to the resource, not the full request. A field is
+     * overwritten if it is in the mask. If the user does not provide a mask, then
+     * all fields are overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. In the case of an update to an existing spoke, field mask is used to
+     * specify the fields to be overwritten. The fields specified in the
+     * update_mask are relative to the resource, not the full request. A field is
+     * overwritten if it is in the mask. If the user does not provide a mask, then
+     * all fields are overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. In the case of an update to an existing spoke, field mask is used to
+     * specify the fields to be overwritten. The fields specified in the
+     * update_mask are relative to the resource, not the full request. A field is
+     * overwritten if it is in the mask. If the user does not provide a mask, then
+     * all fields are overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. In the case of an update to an existing spoke, field mask is used to
+     * specify the fields to be overwritten. The fields specified in the
+     * update_mask are relative to the resource, not the full request. A field is
+     * overwritten if it is in the mask. If the user does not provide a mask, then
+     * all fields are overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.networkconnectivity.v1.Spoke spoke_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Spoke, + com.google.cloud.networkconnectivity.v1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder> + spokeBuilder_; + /** + * + * + *
+     * Required. The state that the spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + public boolean hasSpoke() { + return spokeBuilder_ != null || spoke_ != null; + } + /** + * + * + *
+     * Required. The state that the spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + public com.google.cloud.networkconnectivity.v1.Spoke getSpoke() { + if (spokeBuilder_ == null) { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance() + : spoke_; + } else { + return spokeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The state that the spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpoke(com.google.cloud.networkconnectivity.v1.Spoke value) { + if (spokeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spoke_ = value; + onChanged(); + } else { + spokeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSpoke(com.google.cloud.networkconnectivity.v1.Spoke.Builder builderForValue) { + if (spokeBuilder_ == null) { + spoke_ = builderForValue.build(); + onChanged(); + } else { + spokeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSpoke(com.google.cloud.networkconnectivity.v1.Spoke value) { + if (spokeBuilder_ == null) { + if (spoke_ != null) { + spoke_ = + com.google.cloud.networkconnectivity.v1.Spoke.newBuilder(spoke_) + .mergeFrom(value) + .buildPartial(); + } else { + spoke_ = value; + } + onChanged(); + } else { + spokeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The state that the spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSpoke() { + if (spokeBuilder_ == null) { + spoke_ = null; + onChanged(); + } else { + spoke_ = null; + spokeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The state that the spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1.Spoke.Builder getSpokeBuilder() { + + onChanged(); + return getSpokeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The state that the spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.networkconnectivity.v1.SpokeOrBuilder getSpokeOrBuilder() { + if (spokeBuilder_ != null) { + return spokeBuilder_.getMessageOrBuilder(); + } else { + return spoke_ == null + ? com.google.cloud.networkconnectivity.v1.Spoke.getDefaultInstance() + : spoke_; + } + } + /** + * + * + *
+     * Required. The state that the spoke should be in after the update.
+     * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Spoke, + com.google.cloud.networkconnectivity.v1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder> + getSpokeFieldBuilder() { + if (spokeBuilder_ == null) { + spokeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.networkconnectivity.v1.Spoke, + com.google.cloud.networkconnectivity.v1.Spoke.Builder, + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder>( + getSpoke(), getParentForChildren(), isClean()); + spoke_ = null; + } + return spokeBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.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. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique request ID (optional). If you specify this ID, you can use it
+     * in cases when you need to retry your request. When you need to retry, this
+     * ID lets the server know that it can ignore the request if it has already
+     * been completed. The server guarantees that for at least 60 minutes after
+     * the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check to see whether the original operation
+     * was received. If it was, the server ignores the second request. This
+     * behavior prevents clients from mistakenly 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 = 3 [(.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; + 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.UpdateSpokeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.UpdateSpokeRequest) + private static final com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest(); + } + + public static com.google.cloud.networkconnectivity.v1.UpdateSpokeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSpokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateSpokeRequest(input, extensionRegistry); + } + }; + + 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.UpdateSpokeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateSpokeRequestOrBuilder.java b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateSpokeRequestOrBuilder.java new file mode 100644 index 00000000..c4ce0af5 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/UpdateSpokeRequestOrBuilder.java @@ -0,0 +1,163 @@ +/* + * 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/hub.proto + +package com.google.cloud.networkconnectivity.v1; + +public interface UpdateSpokeRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.UpdateSpokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. In the case of an update to an existing spoke, field mask is used to
+   * specify the fields to be overwritten. The fields specified in the
+   * update_mask are relative to the resource, not the full request. A field is
+   * overwritten if it is in the mask. If the user does not provide a mask, then
+   * all fields are overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. In the case of an update to an existing spoke, field mask is used to
+   * specify the fields to be overwritten. The fields specified in the
+   * update_mask are relative to the resource, not the full request. A field is
+   * overwritten if it is in the mask. If the user does not provide a mask, then
+   * all fields are overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. In the case of an update to an existing spoke, field mask is used to
+   * specify the fields to be overwritten. The fields specified in the
+   * update_mask are relative to the resource, not the full request. A field is
+   * overwritten if it is in the mask. If the user does not provide a mask, then
+   * all fields are overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The state that the spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the spoke field is set. + */ + boolean hasSpoke(); + /** + * + * + *
+   * Required. The state that the spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The spoke. + */ + com.google.cloud.networkconnectivity.v1.Spoke getSpoke(); + /** + * + * + *
+   * Required. The state that the spoke should be in after the update.
+   * 
+ * + * + * .google.cloud.networkconnectivity.v1.Spoke spoke = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.networkconnectivity.v1.SpokeOrBuilder getSpokeOrBuilder(); + + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. A unique request ID (optional). If you specify this ID, you can use it
+   * in cases when you need to retry your request. When you need to retry, this
+   * ID lets the server know that it can ignore the request if it has already
+   * been completed. The server guarantees that for at least 60 minutes after
+   * the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check to see whether the original operation
+   * was received. If it was, the server ignores the second request. This
+   * behavior prevents clients from mistakenly 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/common.proto b/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/common.proto new file mode 100644 index 00000000..014e23f0 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/common.proto @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.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 = "CommonProto"; +option java_package = "com.google.cloud.networkconnectivity.v1"; +option php_namespace = "Google\\Cloud\\NetworkConnectivity\\V1"; +option ruby_package = "Google::Cloud::NetworkConnectivity::V1"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/hub.proto b/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/hub.proto new file mode 100644 index 00000000..ac43a231 --- /dev/null +++ b/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/hub.proto @@ -0,0 +1,704 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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/field_mask.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 = "HubProto"; +option java_package = "com.google.cloud.networkconnectivity.v1"; +option php_namespace = "Google\\Cloud\\NetworkConnectivity\\V1"; +option ruby_package = "Google::Cloud::NetworkConnectivity::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/VpnTunnel" + pattern: "projects/{project}/regions/{region}/vpnTunnels/{resource_id}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/InterconnectAttachment" + pattern: "projects/{project}/regions/{region}/interconnectAttachments/{resource_id}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Instance" + pattern: "projects/{project}/zones/{zone}/instances/{instance}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{resource_id}" +}; + +// Network Connectivity Center is a hub-and-spoke abstraction for network +// connectivity management in Google Cloud. It reduces operational complexity +// through a simple, centralized connectivity management model. +service HubService { + option (google.api.default_host) = "networkconnectivity.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists hubs in a given project. + rpc ListHubs(ListHubsRequest) returns (ListHubsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/global}/hubs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details about the specified hub. + rpc GetHub(GetHubRequest) returns (Hub) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new hub in the specified project. + rpc CreateHub(CreateHubRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/global}/hubs" + body: "hub" + }; + option (google.api.method_signature) = "parent,hub,hub_id"; + option (google.longrunning.operation_info) = { + response_type: "Hub" + metadata_type: "OperationMetadata" + }; + } + + // Updates the description and/or labels of the specified hub. + rpc UpdateHub(UpdateHubRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{hub.name=projects/*/locations/global/hubs/*}" + body: "hub" + }; + option (google.api.method_signature) = "hub,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Hub" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified hub. + rpc DeleteHub(DeleteHubRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/global/hubs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists the spokes in the specified project and location. + rpc ListSpokes(ListSpokesRequest) returns (ListSpokesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/spokes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details about the specified spoke. + rpc GetSpoke(GetSpokeRequest) returns (Spoke) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/spokes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a spoke in the specified project and location. + rpc CreateSpoke(CreateSpokeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/spokes" + body: "spoke" + }; + option (google.api.method_signature) = "parent,spoke,spoke_id"; + option (google.longrunning.operation_info) = { + response_type: "Spoke" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of the specified spoke. + rpc UpdateSpoke(UpdateSpokeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{spoke.name=projects/*/locations/*/spokes/*}" + body: "spoke" + }; + option (google.api.method_signature) = "spoke,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Spoke" + metadata_type: "OperationMetadata" + }; + } + + // Deactivates the specified spoke. Deactivating keeps the spoke information + // for future re-activation, but disconnects the Google Cloud network from + // non-Google-Cloud network. + rpc DeactivateSpoke(DeactivateSpokeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/spokes/*}:deactivate" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Spoke" + metadata_type: "OperationMetadata" + }; + } + + // Activates the specified spoke. Activating reconnects the Google Cloud + // network with the non-Google-Cloud network. + rpc ActivateSpoke(ActivateSpokeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/spokes/*}:activate" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Spoke" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified spoke. + rpc DeleteSpoke(DeleteSpokeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/spokes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} + +// A hub is essentially a collection of spokes. A single hub can contain spokes +// from multiple regions. However, all of a hub's spokes must be associated with +// resources that reside in the same VPC network. +message Hub { + option (google.api.resource) = { + type: "networkconnectivity.googleapis.com/Hub" + pattern: "projects/{project}/locations/global/hubs/{hub}" + }; + + // Immutable. The name of the hub. Hub names must be unique. They use the + // following form: + // `projects/{project_number}/locations/global/hubs/{hub_id}` + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The time the hub was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the hub was last updated. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional labels in key:value format. For more information about labels, see + // [Requirements for + // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). + map labels = 4; + + // An optional description of the hub. + string description = 5; + + // Output only. The Google-generated UUID for the hub. This value is unique across all hub + // resources. If a hub is deleted and another with the same name is created, + // the new hub is assigned a different unique_id. + string unique_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current lifecycle state of this hub. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The State enum represents the lifecycle stage of a Network Connectivity +// Center resource. +enum State { + // No state information available + STATE_UNSPECIFIED = 0; + + // The resource's create operation is in progress + CREATING = 1; + + // The resource is active + ACTIVE = 2; + + // The resource's Delete operation is in progress + DELETING = 3; +} + +// A spoke represents a connection between your Google Cloud network resources +// and a non-Google-Cloud network. +// +// When you create a spoke, you associate it with a hub. You must also identify +// a value for exactly one of the following fields: +// +// * linked_vpn_tunnels +// * linked_interconnect_attachments +// * linked_router_appliance_instances +message Spoke { + option (google.api.resource) = { + type: "networkconnectivity.googleapis.com/Spoke" + pattern: "projects/{project}/locations/{location}/spokes/{spoke}" + }; + + // Immutable. The name of the spoke. Spoke names must be unique. They use the + // following form: + // `projects/{project_number}/locations/{region}/spokes/{spoke_id}` + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The time the spoke was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the spoke was last updated. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional labels in key:value format. For more information about labels, see + // [Requirements for + // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). + map labels = 4; + + // An optional description of the spoke. + string description = 5; + + // Immutable. The URI of the hub that this spoke is attached to. + string hub = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; + + // VPN tunnels that are associated with the spoke. + LinkedVpnTunnels linked_vpn_tunnels = 17; + + // VLAN attachments that are associated with the spoke. + LinkedInterconnectAttachments linked_interconnect_attachments = 18; + + // Router appliance instances that are associated with the spoke. + LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + + // Output only. The Google-generated UUID for the spoke. This value is unique across all + // spoke resources. If a spoke is deleted and another with the same name is + // created, the new spoke is assigned a different unique_id. + string unique_id = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current lifecycle state of this spoke. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs] method. +message ListHubsRequest { + // 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; + + // An 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 [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs] method. +message ListHubsResponse { + // The requested hubs. + repeated Hub hubs = 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 [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub] method. +message GetHubRequest { + // Required. The name of the hub resource to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; +} + +// Request for [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub] method. +message CreateHubRequest { + // Required. The parent resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. A unique identifier for the hub. + string hub_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The initial values for a new hub. + Hub hub = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique request ID (optional). If you specify this ID, you can use it + // in cases when you need to retry your request. When you need to retry, this + // ID lets the server know that it can ignore the request if it has already + // been completed. The server guarantees that for at least 60 minutes after + // the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly 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 [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub] method. +message UpdateHubRequest { + // Optional. In the case of an update to an existing hub, field mask is used to specify + // the fields to be overwritten. The fields specified in the update_mask are + // relative to the resource, not the full request. A field is overwritten if + // it is in the mask. If the user does not provide a mask, then all fields are + // overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The state that the hub should be in after the update. + Hub hub = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique request ID (optional). If you specify this ID, you can use it + // in cases when you need to retry your request. When you need to retry, this + // ID lets the server know that it can ignore the request if it has already + // been completed. The server guarantees that for at least 60 minutes after + // the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly 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 = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub]. +message DeleteHubRequest { + // Required. The name of the hub to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; + + // Optional. A unique request ID (optional). If you specify this ID, you can use it + // in cases when you need to retry your request. When you need to retry, this + // ID lets the server know that it can ignore the request if it has already + // been completed. The server guarantees that for at least 60 minutes after + // the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly 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]; +} + +// The request for [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes]. +message ListSpokesRequest { + // Required. The parent resource. + 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; + + // An expression that filters the results listed in the response. + string filter = 4; + + // Sort the results by a certain order. + string order_by = 5; +} + +// The response for [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes]. +message ListSpokesResponse { + // The requested spokes. + repeated Spoke spokes = 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; +} + +// The request for [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke]. +message GetSpokeRequest { + // Required. The name of the spoke resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; +} + +// The request for [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke]. +message CreateSpokeRequest { + // Required. The parent resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Unique id for the spoke to create. + string spoke_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The initial values for a new spoke. + Spoke spoke = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique request ID (optional). If you specify this ID, you can use it + // in cases when you need to retry your request. When you need to retry, this + // ID lets the server know that it can ignore the request if it has already + // been completed. The server guarantees that for at least 60 minutes after + // the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly 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 [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke] method. +message UpdateSpokeRequest { + // Optional. In the case of an update to an existing spoke, field mask is used to + // specify the fields to be overwritten. The fields specified in the + // update_mask are relative to the resource, not the full request. A field is + // overwritten if it is in the mask. If the user does not provide a mask, then + // all fields are overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The state that the spoke should be in after the update. + Spoke spoke = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique request ID (optional). If you specify this ID, you can use it + // in cases when you need to retry your request. When you need to retry, this + // ID lets the server know that it can ignore the request if it has already + // been completed. The server guarantees that for at least 60 minutes after + // the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly 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 = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request for [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]. +message DeleteSpokeRequest { + // Required. The name of the spoke to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; + + // Optional. A unique request ID (optional). If you specify this ID, you can use it + // in cases when you need to retry your request. When you need to retry, this + // ID lets the server know that it can ignore the request if it has already + // been completed. The server guarantees that for at least 60 minutes after + // the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly 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]; +} + +// The request for [HubService.DeactivateSpoke][google.cloud.networkconnectivity.v1.HubService.DeactivateSpoke]. +message DeactivateSpokeRequest { + // Required. The name of the spoke to deactivate. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; + + // Optional. A unique request ID (optional). If you specify this ID, you can use it + // in cases when you need to retry your request. When you need to retry, this + // ID lets the server know that it can ignore the request if it has already + // been completed. The server guarantees that for at least 60 minutes after + // the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly 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]; +} + +// The request for [HubService.ActivateSpoke][google.cloud.networkconnectivity.v1.HubService.ActivateSpoke]. +message ActivateSpokeRequest { + // Required. The name of the spoke to activate. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; + + // Optional. A unique request ID (optional). If you specify this ID, you can use it + // in cases when you need to retry your request. When you need to retry, this + // ID lets the server know that it can ignore the request if it has already + // been completed. The server guarantees that for at least 60 minutes after + // the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly 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]; +} + +// A collection of Cloud VPN tunnel resources. These resources should be +// redundant HA VPN tunnels that all advertise the same prefixes to Google +// Cloud. Alternatively, in a passive/active configuration, all tunnels +// should be capable of advertising the same prefixes. +message LinkedVpnTunnels { + // The URIs of linked VPN tunnel resources. + repeated string uris = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/VpnTunnel" + }]; + + // A value that controls whether site-to-site data transfer is enabled for + // these resources. If true, routes are propagated between the spoke + // associated with these resources and other spokes in the hub that have data + // transfer enabled. If false, the spoke associated with these resources + // provides connectivity only between the external site and Google Cloud. In + // regions where data transfer is unsupported, you cannot set this field + // to true. + bool site_to_site_data_transfer = 2; +} + +// A collection of VLAN attachment resources. These resources should +// be redundant attachments that all advertise the same prefixes to Google +// Cloud. Alternatively, in active/passive configurations, all attachments +// should be capable of advertising the same prefixes. +message LinkedInterconnectAttachments { + // The URIs of linked interconnect attachment resources + repeated string uris = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/InterconnectAttachment" + }]; + + // A value that controls whether site-to-site data transfer is enabled for + // these resources. If true, routes are propagated between the spoke + // associated with these resources and other spokes in the hub that have data + // transfer enabled. If false, the spoke associated with these resources + // provides connectivity only between the external site and Google Cloud. In + // regions where data transfer is unsupported, you cannot set this field + // to true. + bool site_to_site_data_transfer = 2; +} + +// A collection of router appliance instances. If you have multiple router +// appliance instances connected to the same site, they should all be attached +// to the same spoke. +message LinkedRouterApplianceInstances { + // The list of router appliance instances. + repeated RouterApplianceInstance instances = 1; + + // A value that controls whether site-to-site data transfer is enabled for + // these resources. If true, routes are propagated between the spoke + // associated with these resources and other spokes in the hub that have data + // transfer enabled. If false, the spoke associated with these resources + // provides connectivity only between the external site and Google Cloud. In + // regions where data transfer is unsupported, you cannot set this field + // to true. + bool site_to_site_data_transfer = 2; +} + +// A router appliance instance is a Compute Engine virtual machine (VM) instance +// that acts as a BGP speaker. A router appliance instance is specified by the +// URI of the VM and the internal IP address of one of the VM's network +// interfaces. +message RouterApplianceInstance { + // The URI of the VM. + string virtual_machine = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + }]; + + // The IP address on the VM to use for peering. + string ip_address = 3; +} diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/clirr-ignored-differences.xml b/proto-google-cloud-networkconnectivity-v1alpha1/clirr-ignored-differences.xml index ef713754..b76d7c3d 100644 --- a/proto-google-cloud-networkconnectivity-v1alpha1/clirr-ignored-differences.xml +++ b/proto-google-cloud-networkconnectivity-v1alpha1/clirr-ignored-differences.xml @@ -16,4 +16,24 @@ com/google/cloud/networkconnectivity/v1alpha1/*OrBuilder boolean has*(*) + + + com/google/cloud/networkconnectivity/v1alpha1/SpokeOrBuilder + + 7012 + * getStateValue() + + + + com/google/cloud/networkconnectivity/v1alpha1/InstanceName* + 8001 + + + com/google/cloud/networkconnectivity/v1alpha1/VpnTunnelName* + 8001 + + + com/google/cloud/networkconnectivity/v1alpha1/InterconnectAttachment* + 8001 + diff --git a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InterconnectAttachmentName.java b/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InterconnectAttachmentName.java deleted file mode 100644 index d99bb821..00000000 --- a/proto-google-cloud-networkconnectivity-v1alpha1/src/main/java/com/google/cloud/networkconnectivity/v1alpha1/InterconnectAttachmentName.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.networkconnectivity.v1alpha1; - -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 InterconnectAttachmentName implements ResourceName { - private static final PathTemplate PROJECT_REGION_RESOURCE_ID = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/regions/{region}/interconnectAttachments/{resource_id}"); - private volatile Map fieldValuesMap; - private final String project; - private final String region; - private final String resourceId; - - @Deprecated - protected InterconnectAttachmentName() { - project = null; - region = null; - resourceId = null; - } - - private InterconnectAttachmentName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - region = Preconditions.checkNotNull(builder.getRegion()); - resourceId = Preconditions.checkNotNull(builder.getResourceId()); - } - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - public String getResourceId() { - return resourceId; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static InterconnectAttachmentName of(String project, String region, String resourceId) { - return newBuilder().setProject(project).setRegion(region).setResourceId(resourceId).build(); - } - - public static String format(String project, String region, String resourceId) { - return newBuilder() - .setProject(project) - .setRegion(region) - .setResourceId(resourceId) - .build() - .toString(); - } - - public static InterconnectAttachmentName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_REGION_RESOURCE_ID.validatedMatch( - formattedString, - "InterconnectAttachmentName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("resource_id")); - } - - 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 (InterconnectAttachmentName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_REGION_RESOURCE_ID.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 (region != null) { - fieldMapBuilder.put("region", region); - } - if (resourceId != null) { - fieldMapBuilder.put("resource_id", resourceId); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_REGION_RESOURCE_ID.instantiate( - "project", project, "region", region, "resource_id", resourceId); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - InterconnectAttachmentName that = ((InterconnectAttachmentName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.region, that.region) - && Objects.equals(this.resourceId, that.resourceId); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(region); - h *= 1000003; - h ^= Objects.hashCode(resourceId); - return h; - } - - /** Builder for projects/{project}/regions/{region}/interconnectAttachments/{resource_id}. */ - public static class Builder { - private String project; - private String region; - private String resourceId; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getRegion() { - return region; - } - - public String getResourceId() { - return resourceId; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setRegion(String region) { - this.region = region; - return this; - } - - public Builder setResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - private Builder(InterconnectAttachmentName interconnectAttachmentName) { - this.project = interconnectAttachmentName.project; - this.region = interconnectAttachmentName.region; - this.resourceId = interconnectAttachmentName.resourceId; - } - - public InterconnectAttachmentName build() { - return new InterconnectAttachmentName(this); - } - } -} diff --git a/versions.txt b/versions.txt index 262e8a16..f95db8ef 100644 --- a/versions.txt +++ b/versions.txt @@ -3,4 +3,6 @@ google-cloud-networkconnectivity:0.3.2:0.3.3-SNAPSHOT grpc-google-cloud-networkconnectivity-v1alpha1:0.3.2:0.3.3-SNAPSHOT +grpc-google-cloud-networkconnectivity-v1:0.3.1:0.3.3-SNAPSHOT proto-google-cloud-networkconnectivity-v1alpha1:0.3.2:0.3.3-SNAPSHOT +proto-google-cloud-networkconnectivity-v1:0.3.1:0.3.3-SNAPSHOT