From 25d0ab46f8324da7cdd776b553ee89b73627ebf5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Feb 2022 00:09:43 -0500 Subject: [PATCH] fix: fix subpackage dependencies in BUILD.bezel (#186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: fix subpackage dependencies in BUILD.bezel PiperOrigin-RevId: 424462701 Source-Link: https://github.com/googleapis/googleapis/commit/241062730c4d14cce67f5a5f92995175074e7dc9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ad03cec9a09d3cbd006726c590fdfc315dc81bfd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWQwM2NlYzlhMDlkM2NiZDAwNjcyNmM1OTBmZGZjMzE1ZGM4MWJmZCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/gkehub/v1/GkeHubClient.java | 249 +- .../cloud/gkehub/v1/gapic_metadata.json | 12 +- .../google/cloud/gkehub/v1/package-info.java | 4 +- .../cloud/gkehub/v1/GkeHubClientTest.java | 339 ++- .../cloud/gkehub/v1/CreateFeatureRequest.java | 42 +- .../v1/CreateFeatureRequestOrBuilder.java | 12 +- .../cloud/gkehub/v1/DeleteFeatureRequest.java | 28 +- .../v1/DeleteFeatureRequestOrBuilder.java | 8 +- .../google/cloud/gkehub/v1/FeatureName.java | 223 ++ .../v1/GenerateConnectManifestRequest.java | 28 +- ...nerateConnectManifestRequestOrBuilder.java | 8 +- .../cloud/gkehub/v1/GetFeatureRequest.java | 28 +- .../gkehub/v1/GetFeatureRequestOrBuilder.java | 8 +- .../google/cloud/gkehub/v1/GkeCluster.java | 14 +- .../cloud/gkehub/v1/GkeClusterOrBuilder.java | 4 +- .../cloud/gkehub/v1/KubernetesResource.java | 2326 +++++++++++++++++ .../v1/KubernetesResourceOrBuilder.java | 280 ++ .../cloud/gkehub/v1/ListFeaturesRequest.java | 28 +- .../v1/ListFeaturesRequestOrBuilder.java | 8 +- .../cloud/gkehub/v1/MembershipEndpoint.java | 374 +++ .../v1/MembershipEndpointOrBuilder.java | 59 + .../cloud/gkehub/v1/MembershipProto.java | 115 +- .../cloud/gkehub/v1/ResourceManifest.java | 738 ++++++ .../gkehub/v1/ResourceManifestOrBuilder.java | 66 + .../cloud/gkehub/v1/ResourceOptions.java | 943 +++++++ .../gkehub/v1/ResourceOptionsOrBuilder.java | 99 + .../google/cloud/gkehub/v1/ServiceProto.java | 248 +- .../cloud/gkehub/v1/UpdateFeatureRequest.java | 42 +- .../v1/UpdateFeatureRequestOrBuilder.java | 12 +- .../gkehub/v1/UpdateMembershipRequest.java | 28 +- .../v1/UpdateMembershipRequestOrBuilder.java | 8 +- .../google/cloud/gkehub/v1/membership.proto | 83 +- .../google/cloud/gkehub/v1/service.proto | 59 +- 33 files changed, 6169 insertions(+), 354 deletions(-) create mode 100644 proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/FeatureName.java create mode 100644 proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/KubernetesResource.java create mode 100644 proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/KubernetesResourceOrBuilder.java create mode 100644 proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceManifest.java create mode 100644 proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceManifestOrBuilder.java create mode 100644 proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceOptions.java create mode 100644 proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceOptionsOrBuilder.java diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/GkeHubClient.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/GkeHubClient.java index 37c51449..69408e95 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/GkeHubClient.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/GkeHubClient.java @@ -328,15 +328,42 @@ public final ListMembershipsPagedResponse listMemberships(ListMembershipsRequest * *
{@code
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
-   *   String parent = "parent-995424086";
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Feature element : gkeHubClient.listFeatures(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent (project and location) where the Features will be listed. + * Specified in the format `projects/*/locations/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFeaturesPagedResponse listFeatures(LocationName parent) { + ListFeaturesRequest request = + ListFeaturesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listFeatures(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Features in a given project and location. + * + *

Sample code: + * + *

{@code
+   * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
    *   for (Feature element : gkeHubClient.listFeatures(parent).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * }
* - * @param parent The parent (project and location) where the Features will be listed. Specified in - * the format `projects/*/locations/*`. + * @param parent Required. The parent (project and location) where the Features will be listed. + * Specified in the format `projects/*/locations/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListFeaturesPagedResponse listFeatures(String parent) { @@ -354,7 +381,7 @@ public final ListFeaturesPagedResponse listFeatures(String parent) { * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * ListFeaturesRequest request = * ListFeaturesRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setFilter("filter-1274492040") @@ -383,7 +410,7 @@ public final ListFeaturesPagedResponse listFeatures(ListFeaturesRequest request) * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * ListFeaturesRequest request = * ListFeaturesRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setFilter("filter-1274492040") @@ -412,7 +439,7 @@ public final ListFeaturesPagedResponse listFeatures(ListFeaturesRequest request) * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * ListFeaturesRequest request = * ListFeaturesRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setFilter("filter-1274492040") @@ -535,12 +562,35 @@ public final UnaryCallable getMembershipCallab * *
{@code
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
-   *   String name = "name3373707";
+   *   FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]");
+   *   Feature response = gkeHubClient.getFeature(name);
+   * }
+   * }
+ * + * @param name Required. The Feature resource name in the format + * `projects/*/locations/*/features/*` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Feature getFeature(FeatureName name) { + GetFeatureRequest request = + GetFeatureRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getFeature(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Feature. + * + *

Sample code: + * + *

{@code
+   * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
+   *   String name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString();
    *   Feature response = gkeHubClient.getFeature(name);
    * }
    * }
* - * @param name The Feature resource name in the format + * @param name Required. The Feature resource name in the format * `projects/*/locations/*/features/*` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -557,7 +607,10 @@ public final Feature getFeature(String name) { * *
{@code
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
-   *   GetFeatureRequest request = GetFeatureRequest.newBuilder().setName("name3373707").build();
+   *   GetFeatureRequest request =
+   *       GetFeatureRequest.newBuilder()
+   *           .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString())
+   *           .build();
    *   Feature response = gkeHubClient.getFeature(request);
    * }
    * }
@@ -577,7 +630,10 @@ public final Feature getFeature(GetFeatureRequest request) { * *
{@code
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
-   *   GetFeatureRequest request = GetFeatureRequest.newBuilder().setName("name3373707").build();
+   *   GetFeatureRequest request =
+   *       GetFeatureRequest.newBuilder()
+   *           .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString())
+   *           .build();
    *   ApiFuture future = gkeHubClient.getFeatureCallable().futureCall(request);
    *   // Do something.
    *   Feature response = future.get();
@@ -771,15 +827,47 @@ public final UnaryCallable createMembershipC
    *
    * 
{@code
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
-   *   String parent = "parent-995424086";
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Feature resource = Feature.newBuilder().build();
+   *   String featureId = "featureId-420503887";
+   *   Feature response = gkeHubClient.createFeatureAsync(parent, resource, featureId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent (project and location) where the Feature will be created. + * Specified in the format `projects/*/locations/*`. + * @param resource The Feature resource to create. + * @param featureId The ID of the feature to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFeatureAsync( + LocationName parent, Feature resource, String featureId) { + CreateFeatureRequest request = + CreateFeatureRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setResource(resource) + .setFeatureId(featureId) + .build(); + return createFeatureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a new Feature. + * + *

Sample code: + * + *

{@code
+   * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
    *   Feature resource = Feature.newBuilder().build();
    *   String featureId = "featureId-420503887";
    *   Feature response = gkeHubClient.createFeatureAsync(parent, resource, featureId).get();
    * }
    * }
* - * @param parent The parent (project and location) where the Feature will be created. Specified in - * the format `projects/*/locations/*`. + * @param parent Required. The parent (project and location) where the Feature will be created. + * Specified in the format `projects/*/locations/*`. * @param resource The Feature resource to create. * @param featureId The ID of the feature to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -805,7 +893,7 @@ public final OperationFuture createFeatureAsync( * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * CreateFeatureRequest request = * CreateFeatureRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setFeatureId("featureId-420503887") * .setResource(Feature.newBuilder().build()) * .setRequestId("requestId693933066") @@ -832,7 +920,7 @@ public final OperationFuture createFeatureAsync( * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * CreateFeatureRequest request = * CreateFeatureRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setFeatureId("featureId-420503887") * .setResource(Feature.newBuilder().build()) * .setRequestId("requestId693933066") @@ -859,7 +947,7 @@ public final OperationFuture createFeatureAsync( * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * CreateFeatureRequest request = * CreateFeatureRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setFeatureId("featureId-420503887") * .setResource(Feature.newBuilder().build()) * .setRequestId("requestId693933066") @@ -1021,12 +1109,35 @@ public final UnaryCallable deleteMembershipC * *
{@code
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
-   *   String name = "name3373707";
+   *   FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]");
    *   gkeHubClient.deleteFeatureAsync(name).get();
    * }
    * }
* - * @param name The Feature resource name in the format + * @param name Required. The Feature resource name in the format + * `projects/*/locations/*/features/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFeatureAsync(FeatureName name) { + DeleteFeatureRequest request = + DeleteFeatureRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteFeatureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes a Feature. + * + *

Sample code: + * + *

{@code
+   * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
+   *   String name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString();
+   *   gkeHubClient.deleteFeatureAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The Feature resource name in the format * `projects/*/locations/*/features/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1045,7 +1156,7 @@ public final OperationFuture deleteFeatureAsync(String * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * DeleteFeatureRequest request = * DeleteFeatureRequest.newBuilder() - * .setName("name3373707") + * .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) * .setForce(true) * .setRequestId("requestId693933066") * .build(); @@ -1071,7 +1182,7 @@ public final OperationFuture deleteFeatureAsync( * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * DeleteFeatureRequest request = * DeleteFeatureRequest.newBuilder() - * .setName("name3373707") + * .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) * .setForce(true) * .setRequestId("requestId693933066") * .build(); @@ -1097,7 +1208,7 @@ public final OperationFuture deleteFeatureAsync( * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * DeleteFeatureRequest request = * DeleteFeatureRequest.newBuilder() - * .setName("name3373707") + * .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) * .setForce(true) * .setRequestId("requestId693933066") * .build(); @@ -1119,7 +1230,44 @@ public final UnaryCallable deleteFeatureCallabl * *
{@code
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
-   *   String name = "name3373707";
+   *   MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]");
+   *   Membership resource = Membership.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Membership response = gkeHubClient.updateMembershipAsync(name, resource, updateMask).get();
+   * }
+   * }
+ * + * @param name Required. The Membership resource name in the format + * `projects/*/locations/*/memberships/*`. + * @param resource Required. Only fields specified in update_mask are updated. If you specify a + * field in the update_mask but don't specify its value here that field will be deleted. If + * you are updating a map field, set the value of a key to null or empty string to delete the + * key from the map. It's not possible to update a key's value to the empty string. If you + * specify the update_mask to be a special path "*", fully replaces all user-modifiable + * fields to match `resource`. + * @param updateMask Required. Mask of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateMembershipAsync( + MembershipName name, Membership resource, FieldMask updateMask) { + UpdateMembershipRequest request = + UpdateMembershipRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setResource(resource) + .setUpdateMask(updateMask) + .build(); + return updateMembershipAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing Membership. + * + *

Sample code: + * + *

{@code
+   * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
+   *   String name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString();
    *   Membership resource = Membership.newBuilder().build();
    *   FieldMask updateMask = FieldMask.newBuilder().build();
    *   Membership response = gkeHubClient.updateMembershipAsync(name, resource, updateMask).get();
@@ -1158,7 +1306,7 @@ public final OperationFuture updateMembershipAsyn
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
    *   UpdateMembershipRequest request =
    *       UpdateMembershipRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .setResource(Membership.newBuilder().build())
    *           .setRequestId("requestId693933066")
@@ -1185,7 +1333,7 @@ public final OperationFuture updateMembershipAsyn
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
    *   UpdateMembershipRequest request =
    *       UpdateMembershipRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .setResource(Membership.newBuilder().build())
    *           .setRequestId("requestId693933066")
@@ -1212,7 +1360,7 @@ public final OperationFuture updateMembershipAsyn
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
    *   UpdateMembershipRequest request =
    *       UpdateMembershipRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .setResource(Membership.newBuilder().build())
    *           .setRequestId("requestId693933066")
@@ -1235,14 +1383,51 @@ public final UnaryCallable updateMembershipC
    *
    * 
{@code
    * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
-   *   String name = "name3373707";
+   *   FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]");
    *   Feature resource = Feature.newBuilder().build();
    *   FieldMask updateMask = FieldMask.newBuilder().build();
    *   Feature response = gkeHubClient.updateFeatureAsync(name, resource, updateMask).get();
    * }
    * }
* - * @param name The Feature resource name in the format + * @param name Required. The Feature resource name in the format + * `projects/*/locations/*/features/*`. + * @param resource Only fields specified in update_mask are updated. If you specify a field in the + * update_mask but don't specify its value here that field will be deleted. If you are + * updating a map field, set the value of a key to null or empty string to delete the key from + * the map. It's not possible to update a key's value to the empty string. If you specify the + * update_mask to be a special path "*", fully replaces all user-modifiable fields to + * match `resource`. + * @param updateMask Mask of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateFeatureAsync( + FeatureName name, Feature resource, FieldMask updateMask) { + UpdateFeatureRequest request = + UpdateFeatureRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setResource(resource) + .setUpdateMask(updateMask) + .build(); + return updateFeatureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing Feature. + * + *

Sample code: + * + *

{@code
+   * try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
+   *   String name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString();
+   *   Feature resource = Feature.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Feature response = gkeHubClient.updateFeatureAsync(name, resource, updateMask).get();
+   * }
+   * }
+ * + * @param name Required. The Feature resource name in the format * `projects/*/locations/*/features/*`. * @param resource Only fields specified in update_mask are updated. If you specify a field in the * update_mask but don't specify its value here that field will be deleted. If you are @@ -1274,7 +1459,7 @@ public final OperationFuture updateFeatureAsync( * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * UpdateFeatureRequest request = * UpdateFeatureRequest.newBuilder() - * .setName("name3373707") + * .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) * .setUpdateMask(FieldMask.newBuilder().build()) * .setResource(Feature.newBuilder().build()) * .setRequestId("requestId693933066") @@ -1301,7 +1486,7 @@ public final OperationFuture updateFeatureAsync( * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * UpdateFeatureRequest request = * UpdateFeatureRequest.newBuilder() - * .setName("name3373707") + * .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) * .setUpdateMask(FieldMask.newBuilder().build()) * .setResource(Feature.newBuilder().build()) * .setRequestId("requestId693933066") @@ -1328,7 +1513,7 @@ public final OperationFuture updateFeatureAsync( * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * UpdateFeatureRequest request = * UpdateFeatureRequest.newBuilder() - * .setName("name3373707") + * .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) * .setUpdateMask(FieldMask.newBuilder().build()) * .setResource(Feature.newBuilder().build()) * .setRequestId("requestId693933066") @@ -1356,7 +1541,7 @@ public final UnaryCallable updateFeatureCallabl * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * GenerateConnectManifestRequest request = * GenerateConnectManifestRequest.newBuilder() - * .setName("name3373707") + * .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) * .setNamespace("namespace1252218203") * .setProxy(ByteString.EMPTY) * .setVersion("version351608024") @@ -1389,7 +1574,7 @@ public final GenerateConnectManifestResponse generateConnectManifest( * try (GkeHubClient gkeHubClient = GkeHubClient.create()) { * GenerateConnectManifestRequest request = * GenerateConnectManifestRequest.newBuilder() - * .setName("name3373707") + * .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) * .setNamespace("namespace1252218203") * .setProxy(ByteString.EMPTY) * .setVersion("version351608024") diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/gapic_metadata.json b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/gapic_metadata.json index 78eaa8e7..f7106915 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/gapic_metadata.json +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/gapic_metadata.json @@ -11,13 +11,13 @@ "libraryClient": "GkeHubClient", "rpcs": { "CreateFeature": { - "methods": ["createFeatureAsync", "createFeatureAsync", "createFeatureOperationCallable", "createFeatureCallable"] + "methods": ["createFeatureAsync", "createFeatureAsync", "createFeatureAsync", "createFeatureOperationCallable", "createFeatureCallable"] }, "CreateMembership": { "methods": ["createMembershipAsync", "createMembershipAsync", "createMembershipAsync", "createMembershipOperationCallable", "createMembershipCallable"] }, "DeleteFeature": { - "methods": ["deleteFeatureAsync", "deleteFeatureAsync", "deleteFeatureOperationCallable", "deleteFeatureCallable"] + "methods": ["deleteFeatureAsync", "deleteFeatureAsync", "deleteFeatureAsync", "deleteFeatureOperationCallable", "deleteFeatureCallable"] }, "DeleteMembership": { "methods": ["deleteMembershipAsync", "deleteMembershipAsync", "deleteMembershipAsync", "deleteMembershipOperationCallable", "deleteMembershipCallable"] @@ -26,22 +26,22 @@ "methods": ["generateConnectManifest", "generateConnectManifestCallable"] }, "GetFeature": { - "methods": ["getFeature", "getFeature", "getFeatureCallable"] + "methods": ["getFeature", "getFeature", "getFeature", "getFeatureCallable"] }, "GetMembership": { "methods": ["getMembership", "getMembership", "getMembership", "getMembershipCallable"] }, "ListFeatures": { - "methods": ["listFeatures", "listFeatures", "listFeaturesPagedCallable", "listFeaturesCallable"] + "methods": ["listFeatures", "listFeatures", "listFeatures", "listFeaturesPagedCallable", "listFeaturesCallable"] }, "ListMemberships": { "methods": ["listMemberships", "listMemberships", "listMemberships", "listMembershipsPagedCallable", "listMembershipsCallable"] }, "UpdateFeature": { - "methods": ["updateFeatureAsync", "updateFeatureAsync", "updateFeatureOperationCallable", "updateFeatureCallable"] + "methods": ["updateFeatureAsync", "updateFeatureAsync", "updateFeatureAsync", "updateFeatureOperationCallable", "updateFeatureCallable"] }, "UpdateMembership": { - "methods": ["updateMembershipAsync", "updateMembershipAsync", "updateMembershipOperationCallable", "updateMembershipCallable"] + "methods": ["updateMembershipAsync", "updateMembershipAsync", "updateMembershipAsync", "updateMembershipOperationCallable", "updateMembershipCallable"] } } } diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/package-info.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/package-info.java index 96d1a527..f1199d2c 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/package-info.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to GKE Hub + * + *

The interfaces provided are listed below, along with usage samples. * *

======================= GkeHubClient ======================= * diff --git a/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1/GkeHubClientTest.java b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1/GkeHubClientTest.java index ef31bae6..e7420d3c 100644 --- a/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1/GkeHubClientTest.java +++ b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1/GkeHubClientTest.java @@ -187,6 +187,50 @@ public void listFeaturesTest() throws Exception { .build(); mockGkeHub.addResponse(expectedResponse); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListFeaturesPagedResponse pagedListResponse = client.listFeatures(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), resources.get(0)); + + List actualRequests = mockGkeHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFeaturesRequest actualRequest = ((ListFeaturesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFeaturesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listFeatures(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFeaturesTest2() throws Exception { + Feature responsesElement = Feature.newBuilder().build(); + ListFeaturesResponse expectedResponse = + ListFeaturesResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockGkeHub.addResponse(expectedResponse); + String parent = "parent-995424086"; ListFeaturesPagedResponse pagedListResponse = client.listFeatures(parent); @@ -208,7 +252,7 @@ public void listFeaturesTest() throws Exception { } @Test - public void listFeaturesExceptionTest() throws Exception { + public void listFeaturesExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHub.addException(exception); @@ -321,7 +365,54 @@ public void getMembershipExceptionTest2() throws Exception { public void getFeatureTest() throws Exception { Feature expectedResponse = Feature.newBuilder() - .setName("name3373707") + .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) + .putAllLabels(new HashMap()) + .setResourceState(FeatureResourceState.newBuilder().build()) + .setSpec(CommonFeatureSpec.newBuilder().build()) + .putAllMembershipSpecs(new HashMap()) + .setState(CommonFeatureState.newBuilder().build()) + .putAllMembershipStates(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockGkeHub.addResponse(expectedResponse); + + FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); + + Feature actualResponse = client.getFeature(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGkeHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFeatureRequest actualRequest = ((GetFeatureRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFeatureExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHub.addException(exception); + + try { + FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); + client.getFeature(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFeatureTest2() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .putAllLabels(new HashMap()) .setResourceState(FeatureResourceState.newBuilder().build()) .setSpec(CommonFeatureSpec.newBuilder().build()) @@ -351,7 +442,7 @@ public void getFeatureTest() throws Exception { } @Test - public void getFeatureExceptionTest() throws Exception { + public void getFeatureExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHub.addException(exception); @@ -492,7 +583,68 @@ public void createMembershipExceptionTest2() throws Exception { public void createFeatureTest() throws Exception { Feature expectedResponse = Feature.newBuilder() - .setName("name3373707") + .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) + .putAllLabels(new HashMap()) + .setResourceState(FeatureResourceState.newBuilder().build()) + .setSpec(CommonFeatureSpec.newBuilder().build()) + .putAllMembershipSpecs(new HashMap()) + .setState(CommonFeatureState.newBuilder().build()) + .putAllMembershipStates(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFeatureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGkeHub.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Feature resource = Feature.newBuilder().build(); + String featureId = "featureId-420503887"; + + Feature actualResponse = client.createFeatureAsync(parent, resource, featureId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGkeHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFeatureRequest actualRequest = ((CreateFeatureRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(featureId, actualRequest.getFeatureId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFeatureExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHub.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Feature resource = Feature.newBuilder().build(); + String featureId = "featureId-420503887"; + client.createFeatureAsync(parent, resource, featureId).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 createFeatureTest2() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .putAllLabels(new HashMap()) .setResourceState(FeatureResourceState.newBuilder().build()) .setSpec(CommonFeatureSpec.newBuilder().build()) @@ -532,7 +684,7 @@ public void createFeatureTest() throws Exception { } @Test - public void createFeatureExceptionTest() throws Exception { + public void createFeatureExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHub.addException(exception); @@ -644,6 +796,48 @@ public void deleteFeatureTest() throws Exception { .build(); mockGkeHub.addResponse(resultOperation); + FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); + + client.deleteFeatureAsync(name).get(); + + List actualRequests = mockGkeHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFeatureRequest actualRequest = ((DeleteFeatureRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFeatureExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHub.addException(exception); + + try { + FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); + client.deleteFeatureAsync(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 deleteFeatureTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFeatureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGkeHub.addResponse(resultOperation); + String name = "name3373707"; client.deleteFeatureAsync(name).get(); @@ -660,7 +854,7 @@ public void deleteFeatureTest() throws Exception { } @Test - public void deleteFeatureExceptionTest() throws Exception { + public void deleteFeatureExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHub.addException(exception); @@ -699,6 +893,68 @@ public void updateMembershipTest() throws Exception { .build(); mockGkeHub.addResponse(resultOperation); + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + Membership resource = Membership.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Membership actualResponse = client.updateMembershipAsync(name, resource, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGkeHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateMembershipRequest actualRequest = ((UpdateMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateMembershipExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHub.addException(exception); + + try { + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + Membership resource = Membership.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateMembershipAsync(name, resource, 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 updateMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(MembershipState.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .setAuthority(Authority.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGkeHub.addResponse(resultOperation); + String name = "name3373707"; Membership resource = Membership.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -720,7 +976,7 @@ public void updateMembershipTest() throws Exception { } @Test - public void updateMembershipExceptionTest() throws Exception { + public void updateMembershipExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHub.addException(exception); @@ -741,7 +997,68 @@ public void updateMembershipExceptionTest() throws Exception { public void updateFeatureTest() throws Exception { Feature expectedResponse = Feature.newBuilder() - .setName("name3373707") + .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) + .putAllLabels(new HashMap()) + .setResourceState(FeatureResourceState.newBuilder().build()) + .setSpec(CommonFeatureSpec.newBuilder().build()) + .putAllMembershipSpecs(new HashMap()) + .setState(CommonFeatureState.newBuilder().build()) + .putAllMembershipStates(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFeatureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGkeHub.addResponse(resultOperation); + + FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); + Feature resource = Feature.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Feature actualResponse = client.updateFeatureAsync(name, resource, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGkeHub.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFeatureRequest actualRequest = ((UpdateFeatureRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateFeatureExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHub.addException(exception); + + try { + FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); + Feature resource = Feature.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFeatureAsync(name, resource, 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 updateFeatureTest2() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .setName(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .putAllLabels(new HashMap()) .setResourceState(FeatureResourceState.newBuilder().build()) .setSpec(CommonFeatureSpec.newBuilder().build()) @@ -781,7 +1098,7 @@ public void updateFeatureTest() throws Exception { } @Test - public void updateFeatureExceptionTest() throws Exception { + public void updateFeatureExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHub.addException(exception); @@ -808,7 +1125,7 @@ public void generateConnectManifestTest() throws Exception { GenerateConnectManifestRequest request = GenerateConnectManifestRequest.newBuilder() - .setName("name3373707") + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setNamespace("namespace1252218203") .setProxy(ByteString.EMPTY) .setVersion("version351608024") @@ -847,7 +1164,7 @@ public void generateConnectManifestExceptionTest() throws Exception { try { GenerateConnectManifestRequest request = GenerateConnectManifestRequest.newBuilder() - .setName("name3373707") + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setNamespace("namespace1252218203") .setProxy(ByteString.EMPTY) .setVersion("version351608024") diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/CreateFeatureRequest.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/CreateFeatureRequest.java index 85a92638..f44e51b0 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/CreateFeatureRequest.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/CreateFeatureRequest.java @@ -148,11 +148,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *

-   * The parent (project and location) where the Feature will be created.
+   * Required. The parent (project and location) where the Feature will be created.
    * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The parent. */ @@ -172,11 +172,11 @@ public java.lang.String getParent() { * * *
-   * The parent (project and location) where the Feature will be created.
+   * Required. The parent (project and location) where the Feature will be created.
    * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for parent. */ @@ -307,7 +307,7 @@ public com.google.cloud.gkehub.v1.FeatureOrBuilder getResourceOrBuilder() { * not supported (00000000-0000-0000-0000-000000000000). *
* - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The requestId. */ @@ -340,7 +340,7 @@ public java.lang.String getRequestId() { * not supported (00000000-0000-0000-0000-000000000000). *
* - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The bytes for requestId. */ @@ -739,11 +739,11 @@ public Builder mergeFrom( * * *
-     * The parent (project and location) where the Feature will be created.
+     * Required. The parent (project and location) where the Feature will be created.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The parent. */ @@ -762,11 +762,11 @@ public java.lang.String getParent() { * * *
-     * The parent (project and location) where the Feature will be created.
+     * Required. The parent (project and location) where the Feature will be created.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for parent. */ @@ -785,11 +785,11 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * The parent (project and location) where the Feature will be created.
+     * Required. The parent (project and location) where the Feature will be created.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @param value The parent to set. * @return This builder for chaining. @@ -807,11 +807,11 @@ public Builder setParent(java.lang.String value) { * * *
-     * The parent (project and location) where the Feature will be created.
+     * Required. The parent (project and location) where the Feature will be created.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ @@ -825,11 +825,11 @@ public Builder clearParent() { * * *
-     * The parent (project and location) where the Feature will be created.
+     * Required. The parent (project and location) where the Feature will be created.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @param value The bytes for parent to set. * @return This builder for chaining. @@ -1154,7 +1154,7 @@ public com.google.cloud.gkehub.v1.FeatureOrBuilder getResourceOrBuilder() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The requestId. */ @@ -1186,7 +1186,7 @@ public java.lang.String getRequestId() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The bytes for requestId. */ @@ -1218,7 +1218,7 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @param value The requestId to set. * @return This builder for chaining. @@ -1249,7 +1249,7 @@ public Builder setRequestId(java.lang.String value) { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return This builder for chaining. */ @@ -1276,7 +1276,7 @@ public Builder clearRequestId() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @param value The bytes for requestId to set. * @return This builder for chaining. diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/CreateFeatureRequestOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/CreateFeatureRequestOrBuilder.java index 73ef1088..9cf2ffce 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/CreateFeatureRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/CreateFeatureRequestOrBuilder.java @@ -27,11 +27,11 @@ public interface CreateFeatureRequestOrBuilder * * *
-   * The parent (project and location) where the Feature will be created.
+   * Required. The parent (project and location) where the Feature will be created.
    * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The parent. */ @@ -40,11 +40,11 @@ public interface CreateFeatureRequestOrBuilder * * *
-   * The parent (project and location) where the Feature will be created.
+   * Required. The parent (project and location) where the Feature will be created.
    * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for parent. */ @@ -127,7 +127,7 @@ public interface CreateFeatureRequestOrBuilder * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The requestId. */ @@ -149,7 +149,7 @@ public interface CreateFeatureRequestOrBuilder * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The bytes for requestId. */ diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/DeleteFeatureRequest.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/DeleteFeatureRequest.java index c9f830a1..736f69f7 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/DeleteFeatureRequest.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/DeleteFeatureRequest.java @@ -130,11 +130,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -154,11 +154,11 @@ public java.lang.String getName() { * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ @@ -617,11 +617,11 @@ public Builder mergeFrom( * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -640,11 +640,11 @@ public java.lang.String getName() { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ @@ -663,11 +663,11 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @param value The name to set. * @return This builder for chaining. @@ -685,11 +685,11 @@ public Builder setName(java.lang.String value) { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ @@ -703,11 +703,11 @@ public Builder clearName() { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @param value The bytes for name to set. * @return This builder for chaining. diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/DeleteFeatureRequestOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/DeleteFeatureRequestOrBuilder.java index a2a101c9..7ab51c7e 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/DeleteFeatureRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/DeleteFeatureRequestOrBuilder.java @@ -27,11 +27,11 @@ public interface DeleteFeatureRequestOrBuilder * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -40,11 +40,11 @@ public interface DeleteFeatureRequestOrBuilder * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/FeatureName.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/FeatureName.java new file mode 100644 index 00000000..1ae4c669 --- /dev/null +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/FeatureName.java @@ -0,0 +1,223 @@ +/* + * 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.gkehub.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 FeatureName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_FEATURE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/features/{feature}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String feature; + + @Deprecated + protected FeatureName() { + project = null; + location = null; + feature = null; + } + + private FeatureName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + feature = Preconditions.checkNotNull(builder.getFeature()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFeature() { + return feature; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static FeatureName of(String project, String location, String feature) { + return newBuilder().setProject(project).setLocation(location).setFeature(feature).build(); + } + + public static String format(String project, String location, String feature) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setFeature(feature) + .build() + .toString(); + } + + public static FeatureName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_FEATURE.validatedMatch( + formattedString, "FeatureName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("feature")); + } + + 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 (FeatureName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_FEATURE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (feature != null) { + fieldMapBuilder.put("feature", feature); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_FEATURE.instantiate( + "project", project, "location", location, "feature", feature); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + FeatureName that = ((FeatureName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.feature, that.feature); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(feature); + return h; + } + + /** Builder for projects/{project}/locations/{location}/features/{feature}. */ + public static class Builder { + private String project; + private String location; + private String feature; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFeature() { + return feature; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setFeature(String feature) { + this.feature = feature; + return this; + } + + private Builder(FeatureName featureName) { + this.project = featureName.project; + this.location = featureName.location; + this.feature = featureName.feature; + } + + public FeatureName build() { + return new FeatureName(this); + } + } +} diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GenerateConnectManifestRequest.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GenerateConnectManifestRequest.java index aa3bb5d6..5847192c 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GenerateConnectManifestRequest.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GenerateConnectManifestRequest.java @@ -165,7 +165,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -189,7 +191,9 @@ public java.lang.String getName() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -843,7 +847,9 @@ public Builder mergeFrom( * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -866,7 +872,9 @@ public java.lang.String getName() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -889,7 +897,9 @@ public com.google.protobuf.ByteString getNameBytes() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The name to set. * @return This builder for chaining. @@ -911,7 +921,9 @@ public Builder setName(java.lang.String value) { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -929,7 +941,9 @@ public Builder clearName() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * 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. diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GenerateConnectManifestRequestOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GenerateConnectManifestRequestOrBuilder.java index dd2c6a99..32404bc5 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GenerateConnectManifestRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GenerateConnectManifestRequestOrBuilder.java @@ -31,7 +31,9 @@ public interface GenerateConnectManifestRequestOrBuilder * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -44,7 +46,9 @@ public interface GenerateConnectManifestRequestOrBuilder * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GetFeatureRequest.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GetFeatureRequest.java index 03795655..b65a6560 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GetFeatureRequest.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GetFeatureRequest.java @@ -117,11 +117,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -141,11 +141,11 @@ public java.lang.String getName() { * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ @@ -483,11 +483,11 @@ public Builder mergeFrom( * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -506,11 +506,11 @@ public java.lang.String getName() { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ @@ -529,11 +529,11 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @param value The name to set. * @return This builder for chaining. @@ -551,11 +551,11 @@ public Builder setName(java.lang.String value) { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ @@ -569,11 +569,11 @@ public Builder clearName() { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @param value The bytes for name to set. * @return This builder for chaining. diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GetFeatureRequestOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GetFeatureRequestOrBuilder.java index e2b6cf2f..87f50831 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GetFeatureRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GetFeatureRequestOrBuilder.java @@ -27,11 +27,11 @@ public interface GetFeatureRequestOrBuilder * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -40,11 +40,11 @@ public interface GetFeatureRequestOrBuilder * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GkeCluster.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GkeCluster.java index 10bbf02c..d5a946cf 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GkeCluster.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GkeCluster.java @@ -118,7 +118,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Immutable. Self-link of the GCP resource for the GKE cluster. For example:
-   *     //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+   * //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
    * Zonal clusters are also supported.
    * 
* @@ -143,7 +143,7 @@ public java.lang.String getResourceLink() { * *
    * Immutable. Self-link of the GCP resource for the GKE cluster. For example:
-   *     //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+   * //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
    * Zonal clusters are also supported.
    * 
* @@ -484,7 +484,7 @@ public Builder mergeFrom( * *
      * Immutable. Self-link of the GCP resource for the GKE cluster. For example:
-     *     //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
      * Zonal clusters are also supported.
      * 
* @@ -508,7 +508,7 @@ public java.lang.String getResourceLink() { * *
      * Immutable. Self-link of the GCP resource for the GKE cluster. For example:
-     *     //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
      * Zonal clusters are also supported.
      * 
* @@ -532,7 +532,7 @@ public com.google.protobuf.ByteString getResourceLinkBytes() { * *
      * Immutable. Self-link of the GCP resource for the GKE cluster. For example:
-     *     //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
      * Zonal clusters are also supported.
      * 
* @@ -555,7 +555,7 @@ public Builder setResourceLink(java.lang.String value) { * *
      * Immutable. Self-link of the GCP resource for the GKE cluster. For example:
-     *     //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
      * Zonal clusters are also supported.
      * 
* @@ -574,7 +574,7 @@ public Builder clearResourceLink() { * *
      * Immutable. Self-link of the GCP resource for the GKE cluster. For example:
-     *     //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
      * Zonal clusters are also supported.
      * 
* diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GkeClusterOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GkeClusterOrBuilder.java index f1d60b16..07ca61ad 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GkeClusterOrBuilder.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/GkeClusterOrBuilder.java @@ -28,7 +28,7 @@ public interface GkeClusterOrBuilder * *
    * Immutable. Self-link of the GCP resource for the GKE cluster. For example:
-   *     //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+   * //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
    * Zonal clusters are also supported.
    * 
* @@ -42,7 +42,7 @@ public interface GkeClusterOrBuilder * *
    * Immutable. Self-link of the GCP resource for the GKE cluster. For example:
-   *     //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+   * //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
    * Zonal clusters are also supported.
    * 
* diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/KubernetesResource.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/KubernetesResource.java new file mode 100644 index 00000000..1f30ce71 --- /dev/null +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/KubernetesResource.java @@ -0,0 +1,2326 @@ +/* + * 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/gkehub/v1/membership.proto + +package com.google.cloud.gkehub.v1; + +/** + * + * + *
+ * KubernetesResource contains the YAML manifests and configuration for
+ * Membership Kubernetes resources in the cluster. After CreateMembership or
+ * UpdateMembership, these resources should be re-applied in the cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.gkehub.v1.KubernetesResource} + */ +public final class KubernetesResource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkehub.v1.KubernetesResource) + KubernetesResourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use KubernetesResource.newBuilder() to construct. + private KubernetesResource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private KubernetesResource() { + membershipCrManifest_ = ""; + membershipResources_ = java.util.Collections.emptyList(); + connectResources_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new KubernetesResource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private KubernetesResource( + 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(); + + membershipCrManifest_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + membershipResources_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + membershipResources_.add( + input.readMessage( + com.google.cloud.gkehub.v1.ResourceManifest.parser(), extensionRegistry)); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + connectResources_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + connectResources_.add( + input.readMessage( + com.google.cloud.gkehub.v1.ResourceManifest.parser(), extensionRegistry)); + break; + } + case 34: + { + com.google.cloud.gkehub.v1.ResourceOptions.Builder subBuilder = null; + if (resourceOptions_ != null) { + subBuilder = resourceOptions_.toBuilder(); + } + resourceOptions_ = + input.readMessage( + com.google.cloud.gkehub.v1.ResourceOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resourceOptions_); + resourceOptions_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + membershipResources_ = java.util.Collections.unmodifiableList(membershipResources_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + connectResources_ = java.util.Collections.unmodifiableList(connectResources_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_KubernetesResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_KubernetesResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1.KubernetesResource.class, + com.google.cloud.gkehub.v1.KubernetesResource.Builder.class); + } + + public static final int MEMBERSHIP_CR_MANIFEST_FIELD_NUMBER = 1; + private volatile java.lang.Object membershipCrManifest_; + /** + * + * + *
+   * Input only. The YAML representation of the Membership CR. This field is ignored for GKE
+   * clusters where Hub can read the CR directly.
+   * Callers should provide the CR that is currently present in the cluster
+   * during CreateMembership or UpdateMembership, or leave this field empty if
+   * none exists. The CR manifest is used to validate the cluster has not been
+   * registered with another Membership.
+   * 
+ * + * string membership_cr_manifest = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The membershipCrManifest. + */ + @java.lang.Override + public java.lang.String getMembershipCrManifest() { + java.lang.Object ref = membershipCrManifest_; + 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(); + membershipCrManifest_ = s; + return s; + } + } + /** + * + * + *
+   * Input only. The YAML representation of the Membership CR. This field is ignored for GKE
+   * clusters where Hub can read the CR directly.
+   * Callers should provide the CR that is currently present in the cluster
+   * during CreateMembership or UpdateMembership, or leave this field empty if
+   * none exists. The CR manifest is used to validate the cluster has not been
+   * registered with another Membership.
+   * 
+ * + * string membership_cr_manifest = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for membershipCrManifest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMembershipCrManifestBytes() { + java.lang.Object ref = membershipCrManifest_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + membershipCrManifest_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MEMBERSHIP_RESOURCES_FIELD_NUMBER = 2; + private java.util.List membershipResources_; + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getMembershipResourcesList() { + return membershipResources_; + } + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getMembershipResourcesOrBuilderList() { + return membershipResources_; + } + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getMembershipResourcesCount() { + return membershipResources_.size(); + } + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceManifest getMembershipResources(int index) { + return membershipResources_.get(index); + } + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceManifestOrBuilder getMembershipResourcesOrBuilder( + int index) { + return membershipResources_.get(index); + } + + public static final int CONNECT_RESOURCES_FIELD_NUMBER = 3; + private java.util.List connectResources_; + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getConnectResourcesList() { + return connectResources_; + } + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getConnectResourcesOrBuilderList() { + return connectResources_; + } + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getConnectResourcesCount() { + return connectResources_.size(); + } + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceManifest getConnectResources(int index) { + return connectResources_.get(index); + } + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceManifestOrBuilder getConnectResourcesOrBuilder( + int index) { + return connectResources_.get(index); + } + + public static final int RESOURCE_OPTIONS_FIELD_NUMBER = 4; + private com.google.cloud.gkehub.v1.ResourceOptions resourceOptions_; + /** + * + * + *
+   * Optional. Options for Kubernetes resource generation.
+   * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the resourceOptions field is set. + */ + @java.lang.Override + public boolean hasResourceOptions() { + return resourceOptions_ != null; + } + /** + * + * + *
+   * Optional. Options for Kubernetes resource generation.
+   * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The resourceOptions. + */ + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceOptions getResourceOptions() { + return resourceOptions_ == null + ? com.google.cloud.gkehub.v1.ResourceOptions.getDefaultInstance() + : resourceOptions_; + } + /** + * + * + *
+   * Optional. Options for Kubernetes resource generation.
+   * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceOptionsOrBuilder getResourceOptionsOrBuilder() { + return getResourceOptions(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(membershipCrManifest_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, membershipCrManifest_); + } + for (int i = 0; i < membershipResources_.size(); i++) { + output.writeMessage(2, membershipResources_.get(i)); + } + for (int i = 0; i < connectResources_.size(); i++) { + output.writeMessage(3, connectResources_.get(i)); + } + if (resourceOptions_ != null) { + output.writeMessage(4, getResourceOptions()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(membershipCrManifest_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, membershipCrManifest_); + } + for (int i = 0; i < membershipResources_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, membershipResources_.get(i)); + } + for (int i = 0; i < connectResources_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, connectResources_.get(i)); + } + if (resourceOptions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getResourceOptions()); + } + 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.gkehub.v1.KubernetesResource)) { + return super.equals(obj); + } + com.google.cloud.gkehub.v1.KubernetesResource other = + (com.google.cloud.gkehub.v1.KubernetesResource) obj; + + if (!getMembershipCrManifest().equals(other.getMembershipCrManifest())) return false; + if (!getMembershipResourcesList().equals(other.getMembershipResourcesList())) return false; + if (!getConnectResourcesList().equals(other.getConnectResourcesList())) return false; + if (hasResourceOptions() != other.hasResourceOptions()) return false; + if (hasResourceOptions()) { + if (!getResourceOptions().equals(other.getResourceOptions())) 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) + MEMBERSHIP_CR_MANIFEST_FIELD_NUMBER; + hash = (53 * hash) + getMembershipCrManifest().hashCode(); + if (getMembershipResourcesCount() > 0) { + hash = (37 * hash) + MEMBERSHIP_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getMembershipResourcesList().hashCode(); + } + if (getConnectResourcesCount() > 0) { + hash = (37 * hash) + CONNECT_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getConnectResourcesList().hashCode(); + } + if (hasResourceOptions()) { + hash = (37 * hash) + RESOURCE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getResourceOptions().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkehub.v1.KubernetesResource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1.KubernetesResource 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.gkehub.v1.KubernetesResource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1.KubernetesResource 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.gkehub.v1.KubernetesResource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1.KubernetesResource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkehub.v1.KubernetesResource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1.KubernetesResource 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.gkehub.v1.KubernetesResource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1.KubernetesResource 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.gkehub.v1.KubernetesResource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1.KubernetesResource 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.gkehub.v1.KubernetesResource 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; + } + /** + * + * + *
+   * KubernetesResource contains the YAML manifests and configuration for
+   * Membership Kubernetes resources in the cluster. After CreateMembership or
+   * UpdateMembership, these resources should be re-applied in the cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.gkehub.v1.KubernetesResource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkehub.v1.KubernetesResource) + com.google.cloud.gkehub.v1.KubernetesResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_KubernetesResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_KubernetesResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1.KubernetesResource.class, + com.google.cloud.gkehub.v1.KubernetesResource.Builder.class); + } + + // Construct using com.google.cloud.gkehub.v1.KubernetesResource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMembershipResourcesFieldBuilder(); + getConnectResourcesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + membershipCrManifest_ = ""; + + if (membershipResourcesBuilder_ == null) { + membershipResources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + membershipResourcesBuilder_.clear(); + } + if (connectResourcesBuilder_ == null) { + connectResources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + connectResourcesBuilder_.clear(); + } + if (resourceOptionsBuilder_ == null) { + resourceOptions_ = null; + } else { + resourceOptions_ = null; + resourceOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_KubernetesResource_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1.KubernetesResource getDefaultInstanceForType() { + return com.google.cloud.gkehub.v1.KubernetesResource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkehub.v1.KubernetesResource build() { + com.google.cloud.gkehub.v1.KubernetesResource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1.KubernetesResource buildPartial() { + com.google.cloud.gkehub.v1.KubernetesResource result = + new com.google.cloud.gkehub.v1.KubernetesResource(this); + int from_bitField0_ = bitField0_; + result.membershipCrManifest_ = membershipCrManifest_; + if (membershipResourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + membershipResources_ = java.util.Collections.unmodifiableList(membershipResources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.membershipResources_ = membershipResources_; + } else { + result.membershipResources_ = membershipResourcesBuilder_.build(); + } + if (connectResourcesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + connectResources_ = java.util.Collections.unmodifiableList(connectResources_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.connectResources_ = connectResources_; + } else { + result.connectResources_ = connectResourcesBuilder_.build(); + } + if (resourceOptionsBuilder_ == null) { + result.resourceOptions_ = resourceOptions_; + } else { + result.resourceOptions_ = resourceOptionsBuilder_.build(); + } + 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.gkehub.v1.KubernetesResource) { + return mergeFrom((com.google.cloud.gkehub.v1.KubernetesResource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gkehub.v1.KubernetesResource other) { + if (other == com.google.cloud.gkehub.v1.KubernetesResource.getDefaultInstance()) return this; + if (!other.getMembershipCrManifest().isEmpty()) { + membershipCrManifest_ = other.membershipCrManifest_; + onChanged(); + } + if (membershipResourcesBuilder_ == null) { + if (!other.membershipResources_.isEmpty()) { + if (membershipResources_.isEmpty()) { + membershipResources_ = other.membershipResources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMembershipResourcesIsMutable(); + membershipResources_.addAll(other.membershipResources_); + } + onChanged(); + } + } else { + if (!other.membershipResources_.isEmpty()) { + if (membershipResourcesBuilder_.isEmpty()) { + membershipResourcesBuilder_.dispose(); + membershipResourcesBuilder_ = null; + membershipResources_ = other.membershipResources_; + bitField0_ = (bitField0_ & ~0x00000001); + membershipResourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMembershipResourcesFieldBuilder() + : null; + } else { + membershipResourcesBuilder_.addAllMessages(other.membershipResources_); + } + } + } + if (connectResourcesBuilder_ == null) { + if (!other.connectResources_.isEmpty()) { + if (connectResources_.isEmpty()) { + connectResources_ = other.connectResources_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureConnectResourcesIsMutable(); + connectResources_.addAll(other.connectResources_); + } + onChanged(); + } + } else { + if (!other.connectResources_.isEmpty()) { + if (connectResourcesBuilder_.isEmpty()) { + connectResourcesBuilder_.dispose(); + connectResourcesBuilder_ = null; + connectResources_ = other.connectResources_; + bitField0_ = (bitField0_ & ~0x00000002); + connectResourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConnectResourcesFieldBuilder() + : null; + } else { + connectResourcesBuilder_.addAllMessages(other.connectResources_); + } + } + } + if (other.hasResourceOptions()) { + mergeResourceOptions(other.getResourceOptions()); + } + 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.gkehub.v1.KubernetesResource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gkehub.v1.KubernetesResource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object membershipCrManifest_ = ""; + /** + * + * + *
+     * Input only. The YAML representation of the Membership CR. This field is ignored for GKE
+     * clusters where Hub can read the CR directly.
+     * Callers should provide the CR that is currently present in the cluster
+     * during CreateMembership or UpdateMembership, or leave this field empty if
+     * none exists. The CR manifest is used to validate the cluster has not been
+     * registered with another Membership.
+     * 
+ * + * string membership_cr_manifest = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The membershipCrManifest. + */ + public java.lang.String getMembershipCrManifest() { + java.lang.Object ref = membershipCrManifest_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + membershipCrManifest_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Input only. The YAML representation of the Membership CR. This field is ignored for GKE
+     * clusters where Hub can read the CR directly.
+     * Callers should provide the CR that is currently present in the cluster
+     * during CreateMembership or UpdateMembership, or leave this field empty if
+     * none exists. The CR manifest is used to validate the cluster has not been
+     * registered with another Membership.
+     * 
+ * + * string membership_cr_manifest = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for membershipCrManifest. + */ + public com.google.protobuf.ByteString getMembershipCrManifestBytes() { + java.lang.Object ref = membershipCrManifest_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + membershipCrManifest_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Input only. The YAML representation of the Membership CR. This field is ignored for GKE
+     * clusters where Hub can read the CR directly.
+     * Callers should provide the CR that is currently present in the cluster
+     * during CreateMembership or UpdateMembership, or leave this field empty if
+     * none exists. The CR manifest is used to validate the cluster has not been
+     * registered with another Membership.
+     * 
+ * + * string membership_cr_manifest = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The membershipCrManifest to set. + * @return This builder for chaining. + */ + public Builder setMembershipCrManifest(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + membershipCrManifest_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. The YAML representation of the Membership CR. This field is ignored for GKE
+     * clusters where Hub can read the CR directly.
+     * Callers should provide the CR that is currently present in the cluster
+     * during CreateMembership or UpdateMembership, or leave this field empty if
+     * none exists. The CR manifest is used to validate the cluster has not been
+     * registered with another Membership.
+     * 
+ * + * string membership_cr_manifest = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMembershipCrManifest() { + + membershipCrManifest_ = getDefaultInstance().getMembershipCrManifest(); + onChanged(); + return this; + } + /** + * + * + *
+     * Input only. The YAML representation of the Membership CR. This field is ignored for GKE
+     * clusters where Hub can read the CR directly.
+     * Callers should provide the CR that is currently present in the cluster
+     * during CreateMembership or UpdateMembership, or leave this field empty if
+     * none exists. The CR manifest is used to validate the cluster has not been
+     * registered with another Membership.
+     * 
+ * + * string membership_cr_manifest = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @param value The bytes for membershipCrManifest to set. + * @return This builder for chaining. + */ + public Builder setMembershipCrManifestBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + membershipCrManifest_ = value; + onChanged(); + return this; + } + + private java.util.List membershipResources_ = + java.util.Collections.emptyList(); + + private void ensureMembershipResourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + membershipResources_ = + new java.util.ArrayList( + membershipResources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkehub.v1.ResourceManifest, + com.google.cloud.gkehub.v1.ResourceManifest.Builder, + com.google.cloud.gkehub.v1.ResourceManifestOrBuilder> + membershipResourcesBuilder_; + + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMembershipResourcesList() { + if (membershipResourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(membershipResources_); + } else { + return membershipResourcesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getMembershipResourcesCount() { + if (membershipResourcesBuilder_ == null) { + return membershipResources_.size(); + } else { + return membershipResourcesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifest getMembershipResources(int index) { + if (membershipResourcesBuilder_ == null) { + return membershipResources_.get(index); + } else { + return membershipResourcesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMembershipResources( + int index, com.google.cloud.gkehub.v1.ResourceManifest value) { + if (membershipResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMembershipResourcesIsMutable(); + membershipResources_.set(index, value); + onChanged(); + } else { + membershipResourcesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMembershipResources( + int index, com.google.cloud.gkehub.v1.ResourceManifest.Builder builderForValue) { + if (membershipResourcesBuilder_ == null) { + ensureMembershipResourcesIsMutable(); + membershipResources_.set(index, builderForValue.build()); + onChanged(); + } else { + membershipResourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMembershipResources(com.google.cloud.gkehub.v1.ResourceManifest value) { + if (membershipResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMembershipResourcesIsMutable(); + membershipResources_.add(value); + onChanged(); + } else { + membershipResourcesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMembershipResources( + int index, com.google.cloud.gkehub.v1.ResourceManifest value) { + if (membershipResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMembershipResourcesIsMutable(); + membershipResources_.add(index, value); + onChanged(); + } else { + membershipResourcesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMembershipResources( + com.google.cloud.gkehub.v1.ResourceManifest.Builder builderForValue) { + if (membershipResourcesBuilder_ == null) { + ensureMembershipResourcesIsMutable(); + membershipResources_.add(builderForValue.build()); + onChanged(); + } else { + membershipResourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMembershipResources( + int index, com.google.cloud.gkehub.v1.ResourceManifest.Builder builderForValue) { + if (membershipResourcesBuilder_ == null) { + ensureMembershipResourcesIsMutable(); + membershipResources_.add(index, builderForValue.build()); + onChanged(); + } else { + membershipResourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllMembershipResources( + java.lang.Iterable values) { + if (membershipResourcesBuilder_ == null) { + ensureMembershipResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, membershipResources_); + onChanged(); + } else { + membershipResourcesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMembershipResources() { + if (membershipResourcesBuilder_ == null) { + membershipResources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + membershipResourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeMembershipResources(int index) { + if (membershipResourcesBuilder_ == null) { + ensureMembershipResourcesIsMutable(); + membershipResources_.remove(index); + onChanged(); + } else { + membershipResourcesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifest.Builder getMembershipResourcesBuilder( + int index) { + return getMembershipResourcesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifestOrBuilder getMembershipResourcesOrBuilder( + int index) { + if (membershipResourcesBuilder_ == null) { + return membershipResources_.get(index); + } else { + return membershipResourcesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMembershipResourcesOrBuilderList() { + if (membershipResourcesBuilder_ != null) { + return membershipResourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(membershipResources_); + } + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifest.Builder addMembershipResourcesBuilder() { + return getMembershipResourcesFieldBuilder() + .addBuilder(com.google.cloud.gkehub.v1.ResourceManifest.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifest.Builder addMembershipResourcesBuilder( + int index) { + return getMembershipResourcesFieldBuilder() + .addBuilder(index, com.google.cloud.gkehub.v1.ResourceManifest.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Additional Kubernetes resources that need to be applied to the cluster
+     * after Membership creation, and after every update.
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMembershipResourcesBuilderList() { + return getMembershipResourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkehub.v1.ResourceManifest, + com.google.cloud.gkehub.v1.ResourceManifest.Builder, + com.google.cloud.gkehub.v1.ResourceManifestOrBuilder> + getMembershipResourcesFieldBuilder() { + if (membershipResourcesBuilder_ == null) { + membershipResourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkehub.v1.ResourceManifest, + com.google.cloud.gkehub.v1.ResourceManifest.Builder, + com.google.cloud.gkehub.v1.ResourceManifestOrBuilder>( + membershipResources_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + membershipResources_ = null; + } + return membershipResourcesBuilder_; + } + + private java.util.List connectResources_ = + java.util.Collections.emptyList(); + + private void ensureConnectResourcesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + connectResources_ = + new java.util.ArrayList(connectResources_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkehub.v1.ResourceManifest, + com.google.cloud.gkehub.v1.ResourceManifest.Builder, + com.google.cloud.gkehub.v1.ResourceManifestOrBuilder> + connectResourcesBuilder_; + + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getConnectResourcesList() { + if (connectResourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(connectResources_); + } else { + return connectResourcesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getConnectResourcesCount() { + if (connectResourcesBuilder_ == null) { + return connectResources_.size(); + } else { + return connectResourcesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifest getConnectResources(int index) { + if (connectResourcesBuilder_ == null) { + return connectResources_.get(index); + } else { + return connectResourcesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setConnectResources( + int index, com.google.cloud.gkehub.v1.ResourceManifest value) { + if (connectResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectResourcesIsMutable(); + connectResources_.set(index, value); + onChanged(); + } else { + connectResourcesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setConnectResources( + int index, com.google.cloud.gkehub.v1.ResourceManifest.Builder builderForValue) { + if (connectResourcesBuilder_ == null) { + ensureConnectResourcesIsMutable(); + connectResources_.set(index, builderForValue.build()); + onChanged(); + } else { + connectResourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConnectResources(com.google.cloud.gkehub.v1.ResourceManifest value) { + if (connectResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectResourcesIsMutable(); + connectResources_.add(value); + onChanged(); + } else { + connectResourcesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConnectResources( + int index, com.google.cloud.gkehub.v1.ResourceManifest value) { + if (connectResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectResourcesIsMutable(); + connectResources_.add(index, value); + onChanged(); + } else { + connectResourcesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConnectResources( + com.google.cloud.gkehub.v1.ResourceManifest.Builder builderForValue) { + if (connectResourcesBuilder_ == null) { + ensureConnectResourcesIsMutable(); + connectResources_.add(builderForValue.build()); + onChanged(); + } else { + connectResourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addConnectResources( + int index, com.google.cloud.gkehub.v1.ResourceManifest.Builder builderForValue) { + if (connectResourcesBuilder_ == null) { + ensureConnectResourcesIsMutable(); + connectResources_.add(index, builderForValue.build()); + onChanged(); + } else { + connectResourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllConnectResources( + java.lang.Iterable values) { + if (connectResourcesBuilder_ == null) { + ensureConnectResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, connectResources_); + onChanged(); + } else { + connectResourcesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearConnectResources() { + if (connectResourcesBuilder_ == null) { + connectResources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + connectResourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeConnectResources(int index) { + if (connectResourcesBuilder_ == null) { + ensureConnectResourcesIsMutable(); + connectResources_.remove(index); + onChanged(); + } else { + connectResourcesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifest.Builder getConnectResourcesBuilder( + int index) { + return getConnectResourcesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifestOrBuilder getConnectResourcesOrBuilder( + int index) { + if (connectResourcesBuilder_ == null) { + return connectResources_.get(index); + } else { + return connectResourcesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getConnectResourcesOrBuilderList() { + if (connectResourcesBuilder_ != null) { + return connectResourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(connectResources_); + } + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifest.Builder addConnectResourcesBuilder() { + return getConnectResourcesFieldBuilder() + .addBuilder(com.google.cloud.gkehub.v1.ResourceManifest.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.gkehub.v1.ResourceManifest.Builder addConnectResourcesBuilder( + int index) { + return getConnectResourcesFieldBuilder() + .addBuilder(index, com.google.cloud.gkehub.v1.ResourceManifest.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The Kubernetes resources for installing the GKE Connect agent
+     * This field is only populated in the Membership returned from a successful
+     * long-running operation from CreateMembership or UpdateMembership. It is not
+     * populated during normal GetMembership or ListMemberships requests. To get
+     * the resource manifest after the initial registration, the caller should
+     * make a UpdateMembership call with an empty field mask.
+     * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getConnectResourcesBuilderList() { + return getConnectResourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkehub.v1.ResourceManifest, + com.google.cloud.gkehub.v1.ResourceManifest.Builder, + com.google.cloud.gkehub.v1.ResourceManifestOrBuilder> + getConnectResourcesFieldBuilder() { + if (connectResourcesBuilder_ == null) { + connectResourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkehub.v1.ResourceManifest, + com.google.cloud.gkehub.v1.ResourceManifest.Builder, + com.google.cloud.gkehub.v1.ResourceManifestOrBuilder>( + connectResources_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + connectResources_ = null; + } + return connectResourcesBuilder_; + } + + private com.google.cloud.gkehub.v1.ResourceOptions resourceOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1.ResourceOptions, + com.google.cloud.gkehub.v1.ResourceOptions.Builder, + com.google.cloud.gkehub.v1.ResourceOptionsOrBuilder> + resourceOptionsBuilder_; + /** + * + * + *
+     * Optional. Options for Kubernetes resource generation.
+     * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the resourceOptions field is set. + */ + public boolean hasResourceOptions() { + return resourceOptionsBuilder_ != null || resourceOptions_ != null; + } + /** + * + * + *
+     * Optional. Options for Kubernetes resource generation.
+     * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The resourceOptions. + */ + public com.google.cloud.gkehub.v1.ResourceOptions getResourceOptions() { + if (resourceOptionsBuilder_ == null) { + return resourceOptions_ == null + ? com.google.cloud.gkehub.v1.ResourceOptions.getDefaultInstance() + : resourceOptions_; + } else { + return resourceOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Options for Kubernetes resource generation.
+     * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setResourceOptions(com.google.cloud.gkehub.v1.ResourceOptions value) { + if (resourceOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resourceOptions_ = value; + onChanged(); + } else { + resourceOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Options for Kubernetes resource generation.
+     * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setResourceOptions( + com.google.cloud.gkehub.v1.ResourceOptions.Builder builderForValue) { + if (resourceOptionsBuilder_ == null) { + resourceOptions_ = builderForValue.build(); + onChanged(); + } else { + resourceOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Options for Kubernetes resource generation.
+     * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeResourceOptions(com.google.cloud.gkehub.v1.ResourceOptions value) { + if (resourceOptionsBuilder_ == null) { + if (resourceOptions_ != null) { + resourceOptions_ = + com.google.cloud.gkehub.v1.ResourceOptions.newBuilder(resourceOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + resourceOptions_ = value; + } + onChanged(); + } else { + resourceOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Options for Kubernetes resource generation.
+     * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearResourceOptions() { + if (resourceOptionsBuilder_ == null) { + resourceOptions_ = null; + onChanged(); + } else { + resourceOptions_ = null; + resourceOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Options for Kubernetes resource generation.
+     * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.gkehub.v1.ResourceOptions.Builder getResourceOptionsBuilder() { + + onChanged(); + return getResourceOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Options for Kubernetes resource generation.
+     * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.gkehub.v1.ResourceOptionsOrBuilder getResourceOptionsOrBuilder() { + if (resourceOptionsBuilder_ != null) { + return resourceOptionsBuilder_.getMessageOrBuilder(); + } else { + return resourceOptions_ == null + ? com.google.cloud.gkehub.v1.ResourceOptions.getDefaultInstance() + : resourceOptions_; + } + } + /** + * + * + *
+     * Optional. Options for Kubernetes resource generation.
+     * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1.ResourceOptions, + com.google.cloud.gkehub.v1.ResourceOptions.Builder, + com.google.cloud.gkehub.v1.ResourceOptionsOrBuilder> + getResourceOptionsFieldBuilder() { + if (resourceOptionsBuilder_ == null) { + resourceOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1.ResourceOptions, + com.google.cloud.gkehub.v1.ResourceOptions.Builder, + com.google.cloud.gkehub.v1.ResourceOptionsOrBuilder>( + getResourceOptions(), getParentForChildren(), isClean()); + resourceOptions_ = null; + } + return resourceOptionsBuilder_; + } + + @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.gkehub.v1.KubernetesResource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkehub.v1.KubernetesResource) + private static final com.google.cloud.gkehub.v1.KubernetesResource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gkehub.v1.KubernetesResource(); + } + + public static com.google.cloud.gkehub.v1.KubernetesResource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KubernetesResource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KubernetesResource(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.gkehub.v1.KubernetesResource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/KubernetesResourceOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/KubernetesResourceOrBuilder.java new file mode 100644 index 00000000..2a3f7d1b --- /dev/null +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/KubernetesResourceOrBuilder.java @@ -0,0 +1,280 @@ +/* + * 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/gkehub/v1/membership.proto + +package com.google.cloud.gkehub.v1; + +public interface KubernetesResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkehub.v1.KubernetesResource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Input only. The YAML representation of the Membership CR. This field is ignored for GKE
+   * clusters where Hub can read the CR directly.
+   * Callers should provide the CR that is currently present in the cluster
+   * during CreateMembership or UpdateMembership, or leave this field empty if
+   * none exists. The CR manifest is used to validate the cluster has not been
+   * registered with another Membership.
+   * 
+ * + * string membership_cr_manifest = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The membershipCrManifest. + */ + java.lang.String getMembershipCrManifest(); + /** + * + * + *
+   * Input only. The YAML representation of the Membership CR. This field is ignored for GKE
+   * clusters where Hub can read the CR directly.
+   * Callers should provide the CR that is currently present in the cluster
+   * during CreateMembership or UpdateMembership, or leave this field empty if
+   * none exists. The CR manifest is used to validate the cluster has not been
+   * registered with another Membership.
+   * 
+ * + * string membership_cr_manifest = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * @return The bytes for membershipCrManifest. + */ + com.google.protobuf.ByteString getMembershipCrManifestBytes(); + + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getMembershipResourcesList(); + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.gkehub.v1.ResourceManifest getMembershipResources(int index); + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getMembershipResourcesCount(); + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getMembershipResourcesOrBuilderList(); + /** + * + * + *
+   * Output only. Additional Kubernetes resources that need to be applied to the cluster
+   * after Membership creation, and after every update.
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest membership_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.gkehub.v1.ResourceManifestOrBuilder getMembershipResourcesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getConnectResourcesList(); + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.gkehub.v1.ResourceManifest getConnectResources(int index); + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getConnectResourcesCount(); + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getConnectResourcesOrBuilderList(); + /** + * + * + *
+   * Output only. The Kubernetes resources for installing the GKE Connect agent
+   * This field is only populated in the Membership returned from a successful
+   * long-running operation from CreateMembership or UpdateMembership. It is not
+   * populated during normal GetMembership or ListMemberships requests. To get
+   * the resource manifest after the initial registration, the caller should
+   * make a UpdateMembership call with an empty field mask.
+   * 
+ * + * + * repeated .google.cloud.gkehub.v1.ResourceManifest connect_resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.gkehub.v1.ResourceManifestOrBuilder getConnectResourcesOrBuilder(int index); + + /** + * + * + *
+   * Optional. Options for Kubernetes resource generation.
+   * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the resourceOptions field is set. + */ + boolean hasResourceOptions(); + /** + * + * + *
+   * Optional. Options for Kubernetes resource generation.
+   * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The resourceOptions. + */ + com.google.cloud.gkehub.v1.ResourceOptions getResourceOptions(); + /** + * + * + *
+   * Optional. Options for Kubernetes resource generation.
+   * 
+ * + * + * .google.cloud.gkehub.v1.ResourceOptions resource_options = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.gkehub.v1.ResourceOptionsOrBuilder getResourceOptionsOrBuilder(); +} diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ListFeaturesRequest.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ListFeaturesRequest.java index 8a97c2ea..c82b90e8 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ListFeaturesRequest.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ListFeaturesRequest.java @@ -146,11 +146,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * The parent (project and location) where the Features will be listed.
+   * Required. The parent (project and location) where the Features will be listed.
    * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The parent. */ @@ -170,11 +170,11 @@ public java.lang.String getParent() { * * *
-   * The parent (project and location) where the Features will be listed.
+   * Required. The parent (project and location) where the Features will be listed.
    * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for parent. */ @@ -764,11 +764,11 @@ public Builder mergeFrom( * * *
-     * The parent (project and location) where the Features will be listed.
+     * Required. The parent (project and location) where the Features will be listed.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The parent. */ @@ -787,11 +787,11 @@ public java.lang.String getParent() { * * *
-     * The parent (project and location) where the Features will be listed.
+     * Required. The parent (project and location) where the Features will be listed.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for parent. */ @@ -810,11 +810,11 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * The parent (project and location) where the Features will be listed.
+     * Required. The parent (project and location) where the Features will be listed.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @param value The parent to set. * @return This builder for chaining. @@ -832,11 +832,11 @@ public Builder setParent(java.lang.String value) { * * *
-     * The parent (project and location) where the Features will be listed.
+     * Required. The parent (project and location) where the Features will be listed.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ @@ -850,11 +850,11 @@ public Builder clearParent() { * * *
-     * The parent (project and location) where the Features will be listed.
+     * Required. The parent (project and location) where the Features will be listed.
      * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @param value The bytes for parent to set. * @return This builder for chaining. diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ListFeaturesRequestOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ListFeaturesRequestOrBuilder.java index 02b34d3a..0f03a433 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ListFeaturesRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ListFeaturesRequestOrBuilder.java @@ -27,11 +27,11 @@ public interface ListFeaturesRequestOrBuilder * * *
-   * The parent (project and location) where the Features will be listed.
+   * Required. The parent (project and location) where the Features will be listed.
    * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The parent. */ @@ -40,11 +40,11 @@ public interface ListFeaturesRequestOrBuilder * * *
-   * The parent (project and location) where the Features will be listed.
+   * Required. The parent (project and location) where the Features will be listed.
    * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1; + * string parent = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for parent. */ diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipEndpoint.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipEndpoint.java index 96be33b5..13b81214 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipEndpoint.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipEndpoint.java @@ -99,6 +99,22 @@ private MembershipEndpoint( kubernetesMetadata_ = subBuilder.buildPartial(); } + break; + } + case 26: + { + com.google.cloud.gkehub.v1.KubernetesResource.Builder subBuilder = null; + if (kubernetesResource_ != null) { + subBuilder = kubernetesResource_.toBuilder(); + } + kubernetesResource_ = + input.readMessage( + com.google.cloud.gkehub.v1.KubernetesResource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kubernetesResource_); + kubernetesResource_ = subBuilder.buildPartial(); + } + break; } default: @@ -243,6 +259,78 @@ public com.google.cloud.gkehub.v1.KubernetesMetadataOrBuilder getKubernetesMetad return getKubernetesMetadata(); } + public static final int KUBERNETES_RESOURCE_FIELD_NUMBER = 3; + private com.google.cloud.gkehub.v1.KubernetesResource kubernetesResource_; + /** + * + * + *
+   * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+   * registered cluster, in the steady state. These resources:
+   *   * Ensure that the cluster is exclusively registered to one and only one
+   *     Hub Membership.
+   *   * Propagate Workload Pool Information available in the Membership
+   *     Authority field.
+   *   * Ensure proper initial configuration of default Hub Features.
+   * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the kubernetesResource field is set. + */ + @java.lang.Override + public boolean hasKubernetesResource() { + return kubernetesResource_ != null; + } + /** + * + * + *
+   * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+   * registered cluster, in the steady state. These resources:
+   *   * Ensure that the cluster is exclusively registered to one and only one
+   *     Hub Membership.
+   *   * Propagate Workload Pool Information available in the Membership
+   *     Authority field.
+   *   * Ensure proper initial configuration of default Hub Features.
+   * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The kubernetesResource. + */ + @java.lang.Override + public com.google.cloud.gkehub.v1.KubernetesResource getKubernetesResource() { + return kubernetesResource_ == null + ? com.google.cloud.gkehub.v1.KubernetesResource.getDefaultInstance() + : kubernetesResource_; + } + /** + * + * + *
+   * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+   * registered cluster, in the steady state. These resources:
+   *   * Ensure that the cluster is exclusively registered to one and only one
+   *     Hub Membership.
+   *   * Propagate Workload Pool Information available in the Membership
+   *     Authority field.
+   *   * Ensure proper initial configuration of default Hub Features.
+   * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1.KubernetesResourceOrBuilder getKubernetesResourceOrBuilder() { + return getKubernetesResource(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -263,6 +351,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (kubernetesMetadata_ != null) { output.writeMessage(2, getKubernetesMetadata()); } + if (kubernetesResource_ != null) { + output.writeMessage(3, getKubernetesResource()); + } unknownFields.writeTo(output); } @@ -278,6 +369,9 @@ public int getSerializedSize() { if (kubernetesMetadata_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getKubernetesMetadata()); } + if (kubernetesResource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getKubernetesResource()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -302,6 +396,10 @@ public boolean equals(final java.lang.Object obj) { if (hasKubernetesMetadata()) { if (!getKubernetesMetadata().equals(other.getKubernetesMetadata())) return false; } + if (hasKubernetesResource() != other.hasKubernetesResource()) return false; + if (hasKubernetesResource()) { + if (!getKubernetesResource().equals(other.getKubernetesResource())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -321,6 +419,10 @@ public int hashCode() { hash = (37 * hash) + KUBERNETES_METADATA_FIELD_NUMBER; hash = (53 * hash) + getKubernetesMetadata().hashCode(); } + if (hasKubernetesResource()) { + hash = (37 * hash) + KUBERNETES_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getKubernetesResource().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -479,6 +581,12 @@ public Builder clear() { kubernetesMetadata_ = null; kubernetesMetadataBuilder_ = null; } + if (kubernetesResourceBuilder_ == null) { + kubernetesResource_ = null; + } else { + kubernetesResource_ = null; + kubernetesResourceBuilder_ = null; + } return this; } @@ -516,6 +624,11 @@ public com.google.cloud.gkehub.v1.MembershipEndpoint buildPartial() { } else { result.kubernetesMetadata_ = kubernetesMetadataBuilder_.build(); } + if (kubernetesResourceBuilder_ == null) { + result.kubernetesResource_ = kubernetesResource_; + } else { + result.kubernetesResource_ = kubernetesResourceBuilder_.build(); + } onBuilt(); return result; } @@ -571,6 +684,9 @@ public Builder mergeFrom(com.google.cloud.gkehub.v1.MembershipEndpoint other) { if (other.hasKubernetesMetadata()) { mergeKubernetesMetadata(other.getKubernetesMetadata()); } + if (other.hasKubernetesResource()) { + mergeKubernetesResource(other.getKubernetesResource()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1007,6 +1123,264 @@ public com.google.cloud.gkehub.v1.KubernetesMetadataOrBuilder getKubernetesMetad return kubernetesMetadataBuilder_; } + private com.google.cloud.gkehub.v1.KubernetesResource kubernetesResource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1.KubernetesResource, + com.google.cloud.gkehub.v1.KubernetesResource.Builder, + com.google.cloud.gkehub.v1.KubernetesResourceOrBuilder> + kubernetesResourceBuilder_; + /** + * + * + *
+     * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+     * registered cluster, in the steady state. These resources:
+     *   * Ensure that the cluster is exclusively registered to one and only one
+     *     Hub Membership.
+     *   * Propagate Workload Pool Information available in the Membership
+     *     Authority field.
+     *   * Ensure proper initial configuration of default Hub Features.
+     * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the kubernetesResource field is set. + */ + public boolean hasKubernetesResource() { + return kubernetesResourceBuilder_ != null || kubernetesResource_ != null; + } + /** + * + * + *
+     * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+     * registered cluster, in the steady state. These resources:
+     *   * Ensure that the cluster is exclusively registered to one and only one
+     *     Hub Membership.
+     *   * Propagate Workload Pool Information available in the Membership
+     *     Authority field.
+     *   * Ensure proper initial configuration of default Hub Features.
+     * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The kubernetesResource. + */ + public com.google.cloud.gkehub.v1.KubernetesResource getKubernetesResource() { + if (kubernetesResourceBuilder_ == null) { + return kubernetesResource_ == null + ? com.google.cloud.gkehub.v1.KubernetesResource.getDefaultInstance() + : kubernetesResource_; + } else { + return kubernetesResourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+     * registered cluster, in the steady state. These resources:
+     *   * Ensure that the cluster is exclusively registered to one and only one
+     *     Hub Membership.
+     *   * Propagate Workload Pool Information available in the Membership
+     *     Authority field.
+     *   * Ensure proper initial configuration of default Hub Features.
+     * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setKubernetesResource(com.google.cloud.gkehub.v1.KubernetesResource value) { + if (kubernetesResourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kubernetesResource_ = value; + onChanged(); + } else { + kubernetesResourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+     * registered cluster, in the steady state. These resources:
+     *   * Ensure that the cluster is exclusively registered to one and only one
+     *     Hub Membership.
+     *   * Propagate Workload Pool Information available in the Membership
+     *     Authority field.
+     *   * Ensure proper initial configuration of default Hub Features.
+     * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setKubernetesResource( + com.google.cloud.gkehub.v1.KubernetesResource.Builder builderForValue) { + if (kubernetesResourceBuilder_ == null) { + kubernetesResource_ = builderForValue.build(); + onChanged(); + } else { + kubernetesResourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+     * registered cluster, in the steady state. These resources:
+     *   * Ensure that the cluster is exclusively registered to one and only one
+     *     Hub Membership.
+     *   * Propagate Workload Pool Information available in the Membership
+     *     Authority field.
+     *   * Ensure proper initial configuration of default Hub Features.
+     * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeKubernetesResource(com.google.cloud.gkehub.v1.KubernetesResource value) { + if (kubernetesResourceBuilder_ == null) { + if (kubernetesResource_ != null) { + kubernetesResource_ = + com.google.cloud.gkehub.v1.KubernetesResource.newBuilder(kubernetesResource_) + .mergeFrom(value) + .buildPartial(); + } else { + kubernetesResource_ = value; + } + onChanged(); + } else { + kubernetesResourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+     * registered cluster, in the steady state. These resources:
+     *   * Ensure that the cluster is exclusively registered to one and only one
+     *     Hub Membership.
+     *   * Propagate Workload Pool Information available in the Membership
+     *     Authority field.
+     *   * Ensure proper initial configuration of default Hub Features.
+     * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearKubernetesResource() { + if (kubernetesResourceBuilder_ == null) { + kubernetesResource_ = null; + onChanged(); + } else { + kubernetesResource_ = null; + kubernetesResourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+     * registered cluster, in the steady state. These resources:
+     *   * Ensure that the cluster is exclusively registered to one and only one
+     *     Hub Membership.
+     *   * Propagate Workload Pool Information available in the Membership
+     *     Authority field.
+     *   * Ensure proper initial configuration of default Hub Features.
+     * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.gkehub.v1.KubernetesResource.Builder getKubernetesResourceBuilder() { + + onChanged(); + return getKubernetesResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+     * registered cluster, in the steady state. These resources:
+     *   * Ensure that the cluster is exclusively registered to one and only one
+     *     Hub Membership.
+     *   * Propagate Workload Pool Information available in the Membership
+     *     Authority field.
+     *   * Ensure proper initial configuration of default Hub Features.
+     * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.gkehub.v1.KubernetesResourceOrBuilder getKubernetesResourceOrBuilder() { + if (kubernetesResourceBuilder_ != null) { + return kubernetesResourceBuilder_.getMessageOrBuilder(); + } else { + return kubernetesResource_ == null + ? com.google.cloud.gkehub.v1.KubernetesResource.getDefaultInstance() + : kubernetesResource_; + } + } + /** + * + * + *
+     * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+     * registered cluster, in the steady state. These resources:
+     *   * Ensure that the cluster is exclusively registered to one and only one
+     *     Hub Membership.
+     *   * Propagate Workload Pool Information available in the Membership
+     *     Authority field.
+     *   * Ensure proper initial configuration of default Hub Features.
+     * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1.KubernetesResource, + com.google.cloud.gkehub.v1.KubernetesResource.Builder, + com.google.cloud.gkehub.v1.KubernetesResourceOrBuilder> + getKubernetesResourceFieldBuilder() { + if (kubernetesResourceBuilder_ == null) { + kubernetesResourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1.KubernetesResource, + com.google.cloud.gkehub.v1.KubernetesResource.Builder, + com.google.cloud.gkehub.v1.KubernetesResourceOrBuilder>( + getKubernetesResource(), getParentForChildren(), isClean()); + kubernetesResource_ = null; + } + return kubernetesResourceBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipEndpointOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipEndpointOrBuilder.java index d8b208b5..b57033df 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipEndpointOrBuilder.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipEndpointOrBuilder.java @@ -104,4 +104,63 @@ public interface MembershipEndpointOrBuilder * */ com.google.cloud.gkehub.v1.KubernetesMetadataOrBuilder getKubernetesMetadataOrBuilder(); + + /** + * + * + *
+   * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+   * registered cluster, in the steady state. These resources:
+   *   * Ensure that the cluster is exclusively registered to one and only one
+   *     Hub Membership.
+   *   * Propagate Workload Pool Information available in the Membership
+   *     Authority field.
+   *   * Ensure proper initial configuration of default Hub Features.
+   * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the kubernetesResource field is set. + */ + boolean hasKubernetesResource(); + /** + * + * + *
+   * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+   * registered cluster, in the steady state. These resources:
+   *   * Ensure that the cluster is exclusively registered to one and only one
+   *     Hub Membership.
+   *   * Propagate Workload Pool Information available in the Membership
+   *     Authority field.
+   *   * Ensure proper initial configuration of default Hub Features.
+   * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The kubernetesResource. + */ + com.google.cloud.gkehub.v1.KubernetesResource getKubernetesResource(); + /** + * + * + *
+   * Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
+   * registered cluster, in the steady state. These resources:
+   *   * Ensure that the cluster is exclusively registered to one and only one
+   *     Hub Membership.
+   *   * Propagate Workload Pool Information available in the Membership
+   *     Authority field.
+   *   * Ensure proper initial configuration of default Hub Features.
+   * 
+ * + * + * .google.cloud.gkehub.v1.KubernetesResource kubernetes_resource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.gkehub.v1.KubernetesResourceOrBuilder getKubernetesResourceOrBuilder(); } diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipProto.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipProto.java index a4d575bb..b77d9b4a 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipProto.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/MembershipProto.java @@ -39,6 +39,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_gkehub_v1_MembershipEndpoint_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_gkehub_v1_MembershipEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkehub_v1_KubernetesResource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkehub_v1_KubernetesResource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkehub_v1_ResourceOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkehub_v1_ResourceOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkehub_v1_ResourceManifest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkehub_v1_ResourceManifest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_gkehub_v1_GkeCluster_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -65,10 +77,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\'google/cloud/gkehub/v1/membership.prot" - + "o\022\026google.cloud.gkehub.v1\032\037google/api/fi" - + "eld_behavior.proto\032\031google/api/resource." - + "proto\032\037google/protobuf/timestamp.proto\032\034" - + "google/api/annotations.proto\"\356\005\n\nMembers" + + "o\022\026google.cloud.gkehub.v1\032\034google/api/an" + + "notations.proto\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032\037goo" + + "gle/protobuf/timestamp.proto\"\356\005\n\nMembers" + "hip\022C\n\010endpoint\030\004 \001(\0132*.google.cloud.gke" + "hub.v1.MembershipEndpointB\003\340A\001H\000\022\021\n\004name" + "\030\001 \001(\tB\003\340A\003\022C\n\006labels\030\002 \003(\0132..google.clo" @@ -87,40 +99,53 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:g\352Ad\n gkehu" + "b.googleapis.com/Membership\022@projects/{p" + "roject}/locations/{location}/memberships" - + "/{membership}B\006\n\004type\"\240\001\n\022MembershipEndp" + + "/{membership}B\006\n\004type\"\356\001\n\022MembershipEndp" + "oint\022<\n\013gke_cluster\030\001 \001(\0132\".google.cloud" + ".gkehub.v1.GkeClusterB\003\340A\001\022L\n\023kubernetes" + "_metadata\030\002 \001(\0132*.google.cloud.gkehub.v1" - + ".KubernetesMetadataB\003\340A\003\"(\n\nGkeCluster\022\032" - + "\n\rresource_link\030\001 \001(\tB\003\340A\005\"\337\001\n\022Kubernete" - + "sMetadata\022*\n\035kubernetes_api_server_versi" - + "on\030\001 \001(\tB\003\340A\003\022\035\n\020node_provider_id\030\002 \001(\tB" - + "\003\340A\003\022\027\n\nnode_count\030\003 \001(\005B\003\340A\003\022\027\n\nvcpu_co" - + "unt\030\004 \001(\005B\003\340A\003\022\026\n\tmemory_mb\030\005 \001(\005B\003\340A\003\0224" - + "\n\013update_time\030d \001(\0132\032.google.protobuf.Ti" - + "mestampB\003\340A\003\"\273\001\n\017MembershipState\022?\n\004code" - + "\030\001 \001(\0162,.google.cloud.gkehub.v1.Membersh" - + "ipState.CodeB\003\340A\003\"g\n\004Code\022\024\n\020CODE_UNSPEC" - + "IFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002\022\014\n\010DELE" - + "TING\020\003\022\014\n\010UPDATING\020\004\022\024\n\020SERVICE_UPDATING" - + "\020\005\"}\n\tAuthority\022\023\n\006issuer\030\001 \001(\tB\003\340A\001\022#\n\026" - + "workload_identity_pool\030\002 \001(\tB\003\340A\003\022\036\n\021ide" - + "ntity_provider\030\003 \001(\tB\003\340A\003\022\026\n\toidc_jwks\030\004" - + " \001(\014B\003\340A\001B\273\001\n\032com.google.cloud.gkehub.v1" - + "B\017MembershipProtoP\001Z + * ResourceManifest represents a single Kubernetes resource to be applied to + * the cluster. + * + * + * Protobuf type {@code google.cloud.gkehub.v1.ResourceManifest} + */ +public final class ResourceManifest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkehub.v1.ResourceManifest) + ResourceManifestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourceManifest.newBuilder() to construct. + private ResourceManifest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourceManifest() { + manifest_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourceManifest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResourceManifest( + 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(); + + manifest_ = s; + break; + } + case 16: + { + clusterScoped_ = 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceManifest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceManifest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1.ResourceManifest.class, + com.google.cloud.gkehub.v1.ResourceManifest.Builder.class); + } + + public static final int MANIFEST_FIELD_NUMBER = 1; + private volatile java.lang.Object manifest_; + /** + * + * + *
+   * YAML manifest of the resource.
+   * 
+ * + * string manifest = 1; + * + * @return The manifest. + */ + @java.lang.Override + public java.lang.String getManifest() { + java.lang.Object ref = manifest_; + 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(); + manifest_ = s; + return s; + } + } + /** + * + * + *
+   * YAML manifest of the resource.
+   * 
+ * + * string manifest = 1; + * + * @return The bytes for manifest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getManifestBytes() { + java.lang.Object ref = manifest_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + manifest_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_SCOPED_FIELD_NUMBER = 2; + private boolean clusterScoped_; + /** + * + * + *
+   * Whether the resource provided in the manifest is `cluster_scoped`.
+   * If unset, the manifest is assumed to be namespace scoped.
+   * This field is used for REST mapping when applying the resource in a
+   * cluster.
+   * 
+ * + * bool cluster_scoped = 2; + * + * @return The clusterScoped. + */ + @java.lang.Override + public boolean getClusterScoped() { + return clusterScoped_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(manifest_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, manifest_); + } + if (clusterScoped_ != false) { + output.writeBool(2, clusterScoped_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(manifest_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, manifest_); + } + if (clusterScoped_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, clusterScoped_); + } + 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.gkehub.v1.ResourceManifest)) { + return super.equals(obj); + } + com.google.cloud.gkehub.v1.ResourceManifest other = + (com.google.cloud.gkehub.v1.ResourceManifest) obj; + + if (!getManifest().equals(other.getManifest())) return false; + if (getClusterScoped() != other.getClusterScoped()) 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) + MANIFEST_FIELD_NUMBER; + hash = (53 * hash) + getManifest().hashCode(); + hash = (37 * hash) + CLUSTER_SCOPED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClusterScoped()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkehub.v1.ResourceManifest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1.ResourceManifest 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.gkehub.v1.ResourceManifest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1.ResourceManifest 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.gkehub.v1.ResourceManifest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1.ResourceManifest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkehub.v1.ResourceManifest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1.ResourceManifest 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.gkehub.v1.ResourceManifest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1.ResourceManifest 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.gkehub.v1.ResourceManifest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1.ResourceManifest 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.gkehub.v1.ResourceManifest 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; + } + /** + * + * + *
+   * ResourceManifest represents a single Kubernetes resource to be applied to
+   * the cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.gkehub.v1.ResourceManifest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkehub.v1.ResourceManifest) + com.google.cloud.gkehub.v1.ResourceManifestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceManifest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceManifest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1.ResourceManifest.class, + com.google.cloud.gkehub.v1.ResourceManifest.Builder.class); + } + + // Construct using com.google.cloud.gkehub.v1.ResourceManifest.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(); + manifest_ = ""; + + clusterScoped_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceManifest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceManifest getDefaultInstanceForType() { + return com.google.cloud.gkehub.v1.ResourceManifest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceManifest build() { + com.google.cloud.gkehub.v1.ResourceManifest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceManifest buildPartial() { + com.google.cloud.gkehub.v1.ResourceManifest result = + new com.google.cloud.gkehub.v1.ResourceManifest(this); + result.manifest_ = manifest_; + result.clusterScoped_ = clusterScoped_; + 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.gkehub.v1.ResourceManifest) { + return mergeFrom((com.google.cloud.gkehub.v1.ResourceManifest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gkehub.v1.ResourceManifest other) { + if (other == com.google.cloud.gkehub.v1.ResourceManifest.getDefaultInstance()) return this; + if (!other.getManifest().isEmpty()) { + manifest_ = other.manifest_; + onChanged(); + } + if (other.getClusterScoped() != false) { + setClusterScoped(other.getClusterScoped()); + } + 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.gkehub.v1.ResourceManifest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gkehub.v1.ResourceManifest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object manifest_ = ""; + /** + * + * + *
+     * YAML manifest of the resource.
+     * 
+ * + * string manifest = 1; + * + * @return The manifest. + */ + public java.lang.String getManifest() { + java.lang.Object ref = manifest_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + manifest_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * YAML manifest of the resource.
+     * 
+ * + * string manifest = 1; + * + * @return The bytes for manifest. + */ + public com.google.protobuf.ByteString getManifestBytes() { + java.lang.Object ref = manifest_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + manifest_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * YAML manifest of the resource.
+     * 
+ * + * string manifest = 1; + * + * @param value The manifest to set. + * @return This builder for chaining. + */ + public Builder setManifest(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + manifest_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * YAML manifest of the resource.
+     * 
+ * + * string manifest = 1; + * + * @return This builder for chaining. + */ + public Builder clearManifest() { + + manifest_ = getDefaultInstance().getManifest(); + onChanged(); + return this; + } + /** + * + * + *
+     * YAML manifest of the resource.
+     * 
+ * + * string manifest = 1; + * + * @param value The bytes for manifest to set. + * @return This builder for chaining. + */ + public Builder setManifestBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + manifest_ = value; + onChanged(); + return this; + } + + private boolean clusterScoped_; + /** + * + * + *
+     * Whether the resource provided in the manifest is `cluster_scoped`.
+     * If unset, the manifest is assumed to be namespace scoped.
+     * This field is used for REST mapping when applying the resource in a
+     * cluster.
+     * 
+ * + * bool cluster_scoped = 2; + * + * @return The clusterScoped. + */ + @java.lang.Override + public boolean getClusterScoped() { + return clusterScoped_; + } + /** + * + * + *
+     * Whether the resource provided in the manifest is `cluster_scoped`.
+     * If unset, the manifest is assumed to be namespace scoped.
+     * This field is used for REST mapping when applying the resource in a
+     * cluster.
+     * 
+ * + * bool cluster_scoped = 2; + * + * @param value The clusterScoped to set. + * @return This builder for chaining. + */ + public Builder setClusterScoped(boolean value) { + + clusterScoped_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the resource provided in the manifest is `cluster_scoped`.
+     * If unset, the manifest is assumed to be namespace scoped.
+     * This field is used for REST mapping when applying the resource in a
+     * cluster.
+     * 
+ * + * bool cluster_scoped = 2; + * + * @return This builder for chaining. + */ + public Builder clearClusterScoped() { + + clusterScoped_ = 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.gkehub.v1.ResourceManifest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkehub.v1.ResourceManifest) + private static final com.google.cloud.gkehub.v1.ResourceManifest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gkehub.v1.ResourceManifest(); + } + + public static com.google.cloud.gkehub.v1.ResourceManifest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceManifest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResourceManifest(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.gkehub.v1.ResourceManifest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceManifestOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceManifestOrBuilder.java new file mode 100644 index 00000000..b3df58f1 --- /dev/null +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceManifestOrBuilder.java @@ -0,0 +1,66 @@ +/* + * 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/gkehub/v1/membership.proto + +package com.google.cloud.gkehub.v1; + +public interface ResourceManifestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkehub.v1.ResourceManifest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * YAML manifest of the resource.
+   * 
+ * + * string manifest = 1; + * + * @return The manifest. + */ + java.lang.String getManifest(); + /** + * + * + *
+   * YAML manifest of the resource.
+   * 
+ * + * string manifest = 1; + * + * @return The bytes for manifest. + */ + com.google.protobuf.ByteString getManifestBytes(); + + /** + * + * + *
+   * Whether the resource provided in the manifest is `cluster_scoped`.
+   * If unset, the manifest is assumed to be namespace scoped.
+   * This field is used for REST mapping when applying the resource in a
+   * cluster.
+   * 
+ * + * bool cluster_scoped = 2; + * + * @return The clusterScoped. + */ + boolean getClusterScoped(); +} diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceOptions.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceOptions.java new file mode 100644 index 00000000..91b0119d --- /dev/null +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceOptions.java @@ -0,0 +1,943 @@ +/* + * 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/gkehub/v1/membership.proto + +package com.google.cloud.gkehub.v1; + +/** + * + * + *
+ * ResourceOptions represent options for Kubernetes resource generation.
+ * 
+ * + * Protobuf type {@code google.cloud.gkehub.v1.ResourceOptions} + */ +public final class ResourceOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkehub.v1.ResourceOptions) + ResourceOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourceOptions.newBuilder() to construct. + private ResourceOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourceOptions() { + connectVersion_ = ""; + k8SVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourceOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResourceOptions( + 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(); + + connectVersion_ = s; + break; + } + case 16: + { + v1Beta1Crd_ = input.readBool(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + k8SVersion_ = 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.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1.ResourceOptions.class, + com.google.cloud.gkehub.v1.ResourceOptions.Builder.class); + } + + public static final int CONNECT_VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object connectVersion_; + /** + * + * + *
+   * Optional. The Connect agent version to use for connect_resources. Defaults to the
+   * latest GKE Connect version. The version must be a currently supported
+   * version, obsolete versions will be rejected.
+   * 
+ * + * string connect_version = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The connectVersion. + */ + @java.lang.Override + public java.lang.String getConnectVersion() { + java.lang.Object ref = connectVersion_; + 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(); + connectVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The Connect agent version to use for connect_resources. Defaults to the
+   * latest GKE Connect version. The version must be a currently supported
+   * version, obsolete versions will be rejected.
+   * 
+ * + * string connect_version = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for connectVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectVersionBytes() { + java.lang.Object ref = connectVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int V1BETA1_CRD_FIELD_NUMBER = 2; + private boolean v1Beta1Crd_; + /** + * + * + *
+   * Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
+   * CustomResourceDefinition resources.
+   * This option should be set for clusters with Kubernetes apiserver versions
+   * <1.16.
+   * 
+ * + * bool v1beta1_crd = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The v1beta1Crd. + */ + @java.lang.Override + public boolean getV1Beta1Crd() { + return v1Beta1Crd_; + } + + public static final int K8S_VERSION_FIELD_NUMBER = 3; + private volatile java.lang.Object k8SVersion_; + /** + * + * + *
+   * Optional. Major version of the Kubernetes cluster. This is only used to determine
+   * which version to use for the CustomResourceDefinition resources,
+   * `apiextensions/v1beta1` or`apiextensions/v1`.
+   * 
+ * + * string k8s_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The k8sVersion. + */ + @java.lang.Override + public java.lang.String getK8SVersion() { + java.lang.Object ref = k8SVersion_; + 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(); + k8SVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Major version of the Kubernetes cluster. This is only used to determine
+   * which version to use for the CustomResourceDefinition resources,
+   * `apiextensions/v1beta1` or`apiextensions/v1`.
+   * 
+ * + * string k8s_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for k8sVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getK8SVersionBytes() { + java.lang.Object ref = k8SVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + k8SVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(connectVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, connectVersion_); + } + if (v1Beta1Crd_ != false) { + output.writeBool(2, v1Beta1Crd_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(k8SVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, k8SVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(connectVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, connectVersion_); + } + if (v1Beta1Crd_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, v1Beta1Crd_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(k8SVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, k8SVersion_); + } + 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.gkehub.v1.ResourceOptions)) { + return super.equals(obj); + } + com.google.cloud.gkehub.v1.ResourceOptions other = + (com.google.cloud.gkehub.v1.ResourceOptions) obj; + + if (!getConnectVersion().equals(other.getConnectVersion())) return false; + if (getV1Beta1Crd() != other.getV1Beta1Crd()) return false; + if (!getK8SVersion().equals(other.getK8SVersion())) 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) + CONNECT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getConnectVersion().hashCode(); + hash = (37 * hash) + V1BETA1_CRD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getV1Beta1Crd()); + hash = (37 * hash) + K8S_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getK8SVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkehub.v1.ResourceOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1.ResourceOptions 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.gkehub.v1.ResourceOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1.ResourceOptions 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.gkehub.v1.ResourceOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1.ResourceOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkehub.v1.ResourceOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1.ResourceOptions 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.gkehub.v1.ResourceOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1.ResourceOptions 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.gkehub.v1.ResourceOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1.ResourceOptions 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.gkehub.v1.ResourceOptions 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; + } + /** + * + * + *
+   * ResourceOptions represent options for Kubernetes resource generation.
+   * 
+ * + * Protobuf type {@code google.cloud.gkehub.v1.ResourceOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkehub.v1.ResourceOptions) + com.google.cloud.gkehub.v1.ResourceOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1.ResourceOptions.class, + com.google.cloud.gkehub.v1.ResourceOptions.Builder.class); + } + + // Construct using com.google.cloud.gkehub.v1.ResourceOptions.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(); + connectVersion_ = ""; + + v1Beta1Crd_ = false; + + k8SVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkehub.v1.MembershipProto + .internal_static_google_cloud_gkehub_v1_ResourceOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceOptions getDefaultInstanceForType() { + return com.google.cloud.gkehub.v1.ResourceOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceOptions build() { + com.google.cloud.gkehub.v1.ResourceOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1.ResourceOptions buildPartial() { + com.google.cloud.gkehub.v1.ResourceOptions result = + new com.google.cloud.gkehub.v1.ResourceOptions(this); + result.connectVersion_ = connectVersion_; + result.v1Beta1Crd_ = v1Beta1Crd_; + result.k8SVersion_ = k8SVersion_; + 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.gkehub.v1.ResourceOptions) { + return mergeFrom((com.google.cloud.gkehub.v1.ResourceOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gkehub.v1.ResourceOptions other) { + if (other == com.google.cloud.gkehub.v1.ResourceOptions.getDefaultInstance()) return this; + if (!other.getConnectVersion().isEmpty()) { + connectVersion_ = other.connectVersion_; + onChanged(); + } + if (other.getV1Beta1Crd() != false) { + setV1Beta1Crd(other.getV1Beta1Crd()); + } + if (!other.getK8SVersion().isEmpty()) { + k8SVersion_ = other.k8SVersion_; + 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.gkehub.v1.ResourceOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gkehub.v1.ResourceOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object connectVersion_ = ""; + /** + * + * + *
+     * Optional. The Connect agent version to use for connect_resources. Defaults to the
+     * latest GKE Connect version. The version must be a currently supported
+     * version, obsolete versions will be rejected.
+     * 
+ * + * string connect_version = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The connectVersion. + */ + public java.lang.String getConnectVersion() { + java.lang.Object ref = connectVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The Connect agent version to use for connect_resources. Defaults to the
+     * latest GKE Connect version. The version must be a currently supported
+     * version, obsolete versions will be rejected.
+     * 
+ * + * string connect_version = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for connectVersion. + */ + public com.google.protobuf.ByteString getConnectVersionBytes() { + java.lang.Object ref = connectVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The Connect agent version to use for connect_resources. Defaults to the
+     * latest GKE Connect version. The version must be a currently supported
+     * version, obsolete versions will be rejected.
+     * 
+ * + * string connect_version = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The connectVersion to set. + * @return This builder for chaining. + */ + public Builder setConnectVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + connectVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The Connect agent version to use for connect_resources. Defaults to the
+     * latest GKE Connect version. The version must be a currently supported
+     * version, obsolete versions will be rejected.
+     * 
+ * + * string connect_version = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearConnectVersion() { + + connectVersion_ = getDefaultInstance().getConnectVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The Connect agent version to use for connect_resources. Defaults to the
+     * latest GKE Connect version. The version must be a currently supported
+     * version, obsolete versions will be rejected.
+     * 
+ * + * string connect_version = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for connectVersion to set. + * @return This builder for chaining. + */ + public Builder setConnectVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + connectVersion_ = value; + onChanged(); + return this; + } + + private boolean v1Beta1Crd_; + /** + * + * + *
+     * Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
+     * CustomResourceDefinition resources.
+     * This option should be set for clusters with Kubernetes apiserver versions
+     * <1.16.
+     * 
+ * + * bool v1beta1_crd = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The v1beta1Crd. + */ + @java.lang.Override + public boolean getV1Beta1Crd() { + return v1Beta1Crd_; + } + /** + * + * + *
+     * Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
+     * CustomResourceDefinition resources.
+     * This option should be set for clusters with Kubernetes apiserver versions
+     * <1.16.
+     * 
+ * + * bool v1beta1_crd = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The v1beta1Crd to set. + * @return This builder for chaining. + */ + public Builder setV1Beta1Crd(boolean value) { + + v1Beta1Crd_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
+     * CustomResourceDefinition resources.
+     * This option should be set for clusters with Kubernetes apiserver versions
+     * <1.16.
+     * 
+ * + * bool v1beta1_crd = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearV1Beta1Crd() { + + v1Beta1Crd_ = false; + onChanged(); + return this; + } + + private java.lang.Object k8SVersion_ = ""; + /** + * + * + *
+     * Optional. Major version of the Kubernetes cluster. This is only used to determine
+     * which version to use for the CustomResourceDefinition resources,
+     * `apiextensions/v1beta1` or`apiextensions/v1`.
+     * 
+ * + * string k8s_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The k8sVersion. + */ + public java.lang.String getK8SVersion() { + java.lang.Object ref = k8SVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + k8SVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Major version of the Kubernetes cluster. This is only used to determine
+     * which version to use for the CustomResourceDefinition resources,
+     * `apiextensions/v1beta1` or`apiextensions/v1`.
+     * 
+ * + * string k8s_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for k8sVersion. + */ + public com.google.protobuf.ByteString getK8SVersionBytes() { + java.lang.Object ref = k8SVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + k8SVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Major version of the Kubernetes cluster. This is only used to determine
+     * which version to use for the CustomResourceDefinition resources,
+     * `apiextensions/v1beta1` or`apiextensions/v1`.
+     * 
+ * + * string k8s_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The k8sVersion to set. + * @return This builder for chaining. + */ + public Builder setK8SVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + k8SVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Major version of the Kubernetes cluster. This is only used to determine
+     * which version to use for the CustomResourceDefinition resources,
+     * `apiextensions/v1beta1` or`apiextensions/v1`.
+     * 
+ * + * string k8s_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearK8SVersion() { + + k8SVersion_ = getDefaultInstance().getK8SVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Major version of the Kubernetes cluster. This is only used to determine
+     * which version to use for the CustomResourceDefinition resources,
+     * `apiextensions/v1beta1` or`apiextensions/v1`.
+     * 
+ * + * string k8s_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for k8sVersion to set. + * @return This builder for chaining. + */ + public Builder setK8SVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + k8SVersion_ = 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.gkehub.v1.ResourceOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkehub.v1.ResourceOptions) + private static final com.google.cloud.gkehub.v1.ResourceOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gkehub.v1.ResourceOptions(); + } + + public static com.google.cloud.gkehub.v1.ResourceOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResourceOptions(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.gkehub.v1.ResourceOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceOptionsOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceOptionsOrBuilder.java new file mode 100644 index 00000000..4cfe4738 --- /dev/null +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ResourceOptionsOrBuilder.java @@ -0,0 +1,99 @@ +/* + * 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/gkehub/v1/membership.proto + +package com.google.cloud.gkehub.v1; + +public interface ResourceOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkehub.v1.ResourceOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The Connect agent version to use for connect_resources. Defaults to the
+   * latest GKE Connect version. The version must be a currently supported
+   * version, obsolete versions will be rejected.
+   * 
+ * + * string connect_version = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The connectVersion. + */ + java.lang.String getConnectVersion(); + /** + * + * + *
+   * Optional. The Connect agent version to use for connect_resources. Defaults to the
+   * latest GKE Connect version. The version must be a currently supported
+   * version, obsolete versions will be rejected.
+   * 
+ * + * string connect_version = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for connectVersion. + */ + com.google.protobuf.ByteString getConnectVersionBytes(); + + /** + * + * + *
+   * Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
+   * CustomResourceDefinition resources.
+   * This option should be set for clusters with Kubernetes apiserver versions
+   * <1.16.
+   * 
+ * + * bool v1beta1_crd = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The v1beta1Crd. + */ + boolean getV1Beta1Crd(); + + /** + * + * + *
+   * Optional. Major version of the Kubernetes cluster. This is only used to determine
+   * which version to use for the CustomResourceDefinition resources,
+   * `apiextensions/v1beta1` or`apiextensions/v1`.
+   * 
+ * + * string k8s_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The k8sVersion. + */ + java.lang.String getK8SVersion(); + /** + * + * + *
+   * Optional. Major version of the Kubernetes cluster. This is only used to determine
+   * which version to use for the CustomResourceDefinition resources,
+   * `apiextensions/v1beta1` or`apiextensions/v1`.
+   * 
+ * + * string k8s_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for k8sVersion. + */ + com.google.protobuf.ByteString getK8SVersionBytes(); +} diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ServiceProto.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ServiceProto.java index 1ade51b3..e81a29d8 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ServiceProto.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/ServiceProto.java @@ -111,126 +111,132 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "pi/resource.proto\032$google/cloud/gkehub/v" + "1/feature.proto\032\'google/cloud/gkehub/v1/" + "membership.proto\032#google/longrunning/ope" - + "rations.proto\032 google/protobuf/field_mas" - + "k.proto\032\037google/protobuf/timestamp.proto" - + "\"\257\001\n\026ListMembershipsRequest\0228\n\006parent\030\001 " - + "\001(\tB(\340A\002\372A\"\022 gkehub.googleapis.com/Membe" - + "rship\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_to" - + "ken\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001\022\025\n\010o" - + "rder_by\030\005 \001(\tB\003\340A\001\"~\n\027ListMembershipsRes" - + "ponse\0225\n\tresources\030\001 \003(\0132\".google.cloud." - + "gkehub.v1.Membership\022\027\n\017next_page_token\030" - + "\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"N\n\024GetMembers" - + "hipRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n gkehub" - + ".googleapis.com/Membership\"\303\001\n\027CreateMem" - + "bershipRequest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 " - + "gkehub.googleapis.com/Membership\022\032\n\rmemb" - + "ership_id\030\002 \001(\tB\003\340A\002\0229\n\010resource\030\003 \001(\0132\"" - + ".google.cloud.gkehub.v1.MembershipB\003\340A\002\022" - + "\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"j\n\027DeleteMember" - + "shipRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n gkehu" - + "b.googleapis.com/Membership\022\027\n\nrequest_i" - + "d\030\002 \001(\tB\003\340A\001\"\266\001\n\027UpdateMembershipRequest" - + "\022\021\n\004name\030\001 \001(\tB\003\340A\002\0224\n\013update_mask\030\002 \001(\013" - + "2\032.google.protobuf.FieldMaskB\003\340A\002\0229\n\010res" - + "ource\030\003 \001(\0132\".google.cloud.gkehub.v1.Mem" - + "bershipB\003\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"\315\001" - + "\n\036GenerateConnectManifestRequest\022\021\n\004name" - + "\030\001 \001(\tB\003\340A\002\022\026\n\tnamespace\030\002 \001(\tB\003\340A\001\022\022\n\005p" - + "roxy\030\003 \001(\014B\003\340A\001\022\024\n\007version\030\004 \001(\tB\003\340A\001\022\027\n" - + "\nis_upgrade\030\005 \001(\010B\003\340A\001\022\025\n\010registry\030\006 \001(\t" - + "B\003\340A\001\022&\n\031image_pull_secret_content\030\007 \001(\014" - + "B\003\340A\001\"a\n\037GenerateConnectManifestResponse" - + "\022>\n\010manifest\030\001 \003(\0132,.google.cloud.gkehub" - + ".v1.ConnectAgentResource\"X\n\024ConnectAgent" - + "Resource\022.\n\004type\030\001 \001(\0132 .google.cloud.gk" - + "ehub.v1.TypeMeta\022\020\n\010manifest\030\002 \001(\t\"-\n\010Ty" - + "peMeta\022\014\n\004kind\030\001 \001(\t\022\023\n\013api_version\030\002 \001(" - + "\t\"n\n\023ListFeaturesRequest\022\016\n\006parent\030\001 \001(\t" - + "\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022" - + "\016\n\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"c\n\024Lis" - + "tFeaturesResponse\0222\n\tresources\030\001 \003(\0132\037.g" - + "oogle.cloud.gkehub.v1.Feature\022\027\n\017next_pa" - + "ge_token\030\002 \001(\t\"!\n\021GetFeatureRequest\022\014\n\004n" - + "ame\030\001 \001(\t\"\206\001\n\024CreateFeatureRequest\022\016\n\006pa" - + "rent\030\001 \001(\t\022\022\n\nfeature_id\030\002 \001(\t\0221\n\010resour" - + "ce\030\003 \001(\0132\037.google.cloud.gkehub.v1.Featur" - + "e\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"L\n\024DeleteFeat" - + "ureRequest\022\014\n\004name\030\001 \001(\t\022\r\n\005force\030\002 \001(\010\022" - + "\027\n\nrequest_id\030\003 \001(\tB\003\340A\001\"\241\001\n\024UpdateFeatu" - + "reRequest\022\014\n\004name\030\001 \001(\t\022/\n\013update_mask\030\002" - + " \001(\0132\032.google.protobuf.FieldMask\0221\n\010reso" - + "urce\030\003 \001(\0132\037.google.cloud.gkehub.v1.Feat" - + "ure\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"\371\001\n\021Operati" - + "onMetadata\0224\n\013create_time\030\001 \001(\0132\032.google" - + ".protobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 \001" - + "(\0132\032.google.protobuf.TimestampB\003\340A\003\022\023\n\006t" - + "arget\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\032\n\rs" - + "tatus_detail\030\005 \001(\tB\003\340A\003\022\035\n\020cancel_reques" - + "ted\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB\003\340A\003" - + "2\360\021\n\006GkeHub\022\264\001\n\017ListMemberships\022..google" - + ".cloud.gkehub.v1.ListMembershipsRequest\032" - + "/.google.cloud.gkehub.v1.ListMemberships" - + "Response\"@\202\323\344\223\0021\022//v1/{parent=projects/*" - + "/locations/*}/memberships\332A\006parent\022\250\001\n\014L" - + "istFeatures\022+.google.cloud.gkehub.v1.Lis" - + "tFeaturesRequest\032,.google.cloud.gkehub.v" - + "1.ListFeaturesResponse\"=\202\323\344\223\002.\022,/v1/{par" - + "ent=projects/*/locations/*}/features\332A\006p" - + "arent\022\241\001\n\rGetMembership\022,.google.cloud.g" - + "kehub.v1.GetMembershipRequest\032\".google.c" - + "loud.gkehub.v1.Membership\">\202\323\344\223\0021\022//v1/{" - + "name=projects/*/locations/*/memberships/" - + "*}\332A\004name\022\225\001\n\nGetFeature\022).google.cloud." - + "gkehub.v1.GetFeatureRequest\032\037.google.clo" - + "ud.gkehub.v1.Feature\";\202\323\344\223\002.\022,/v1/{name=" - + "projects/*/locations/*/features/*}\332A\004nam" - + "e\022\350\001\n\020CreateMembership\022/.google.cloud.gk" - + "ehub.v1.CreateMembershipRequest\032\035.google" - + ".longrunning.Operation\"\203\001\202\323\344\223\002;\"//v1/{pa" - + "rent=projects/*/locations/*}/memberships" - + ":\010resource\332A\035parent,resource,membership_" - + "id\312A\037\n\nMembership\022\021OperationMetadata\022\330\001\n" - + "\rCreateFeature\022,.google.cloud.gkehub.v1." - + "CreateFeatureRequest\032\035.google.longrunnin" - + "g.Operation\"z\202\323\344\223\0028\",/v1/{parent=project" - + "s/*/locations/*}/features:\010resource\332A\032pa" - + "rent,resource,feature_id\312A\034\n\007Feature\022\021Op" - + "erationMetadata\022\317\001\n\020DeleteMembership\022/.g" - + "oogle.cloud.gkehub.v1.DeleteMembershipRe" - + "quest\032\035.google.longrunning.Operation\"k\202\323" - + "\344\223\0021*//v1/{name=projects/*/locations/*/m" - + "emberships/*}\332A\004name\312A*\n\025google.protobuf" - + ".Empty\022\021OperationMetadata\022\306\001\n\rDeleteFeat" - + "ure\022,.google.cloud.gkehub.v1.DeleteFeatu" - + "reRequest\032\035.google.longrunning.Operation" - + "\"h\202\323\344\223\002.*,/v1/{name=projects/*/locations" - + "/*/features/*}\332A\004name\312A*\n\025google.protobu" - + "f.Empty\022\021OperationMetadata\022\343\001\n\020UpdateMem" - + "bership\022/.google.cloud.gkehub.v1.UpdateM" - + "embershipRequest\032\035.google.longrunning.Op" - + "eration\"\177\202\323\344\223\002;2//v1/{name=projects/*/lo" - + "cations/*/memberships/*}:\010resource\332A\031nam" - + "e,resource,update_mask\312A\037\n\nMembership\022\021O" - + "perationMetadata\022\327\001\n\rUpdateFeature\022,.goo" - + "gle.cloud.gkehub.v1.UpdateFeatureRequest" - + "\032\035.google.longrunning.Operation\"y\202\323\344\223\00282" - + ",/v1/{name=projects/*/locations/*/featur" - + "es/*}:\010resource\332A\031name,resource,update_m" - + "ask\312A\034\n\007Feature\022\021OperationMetadata\022\333\001\n\027G" - + "enerateConnectManifest\0226.google.cloud.gk" - + "ehub.v1.GenerateConnectManifestRequest\0327" - + ".google.cloud.gkehub.v1.GenerateConnectM" - + "anifestResponse\"O\202\323\344\223\002I\022G/v1/{name=proje" - + "cts/*/locations/*/memberships/*}:generat" - + "eConnectManifest\032I\312A\025gkehub.googleapis.c" - + "om\322A.https://www.googleapis.com/auth/clo" - + "ud-platformB\270\001\n\032com.google.cloud.gkehub." - + "v1B\014ServiceProtoP\001Z\n\010manifest\030\001 \003(" + + "\0132,.google.cloud.gkehub.v1.ConnectAgentR" + + "esource\"X\n\024ConnectAgentResource\022.\n\004type\030" + + "\001 \001(\0132 .google.cloud.gkehub.v1.TypeMeta\022" + + "\020\n\010manifest\030\002 \001(\t\"-\n\010TypeMeta\022\014\n\004kind\030\001 " + + "\001(\t\022\023\n\013api_version\030\002 \001(\t\"\222\001\n\023ListFeature" + + "sRequest\0222\n\006parent\030\001 \001(\tB\"\372A\037\022\035gkehub.go" + + "ogleapis.com/Feature\022\021\n\tpage_size\030\002 \001(\005\022" + + "\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010o" + + "rder_by\030\005 \001(\t\"c\n\024ListFeaturesResponse\0222\n" + + "\tresources\030\001 \003(\0132\037.google.cloud.gkehub.v" + + "1.Feature\022\027\n\017next_page_token\030\002 \001(\t\"E\n\021Ge" + + "tFeatureRequest\0220\n\004name\030\001 \001(\tB\"\372A\037\n\035gkeh" + + "ub.googleapis.com/Feature\"\245\001\n\024CreateFeat" + + "ureRequest\0222\n\006parent\030\001 \001(\tB\"\372A\037\022\035gkehub." + + "googleapis.com/Feature\022\022\n\nfeature_id\030\002 \001" + + "(\t\0221\n\010resource\030\003 \001(\0132\037.google.cloud.gkeh" + + "ub.v1.Feature\022\022\n\nrequest_id\030\004 \001(\t\"p\n\024Del" + + "eteFeatureRequest\0220\n\004name\030\001 \001(\tB\"\372A\037\n\035gk" + + "ehub.googleapis.com/Feature\022\r\n\005force\030\002 \001" + + "(\010\022\027\n\nrequest_id\030\003 \001(\tB\003\340A\001\"\300\001\n\024UpdateFe" + + "atureRequest\0220\n\004name\030\001 \001(\tB\"\372A\037\n\035gkehub." + + "googleapis.com/Feature\022/\n\013update_mask\030\002 " + + "\001(\0132\032.google.protobuf.FieldMask\0221\n\010resou" + + "rce\030\003 \001(\0132\037.google.cloud.gkehub.v1.Featu" + + "re\022\022\n\nrequest_id\030\004 \001(\t\"\371\001\n\021OperationMeta" + + "data\0224\n\013create_time\030\001 \001(\0132\032.google.proto" + + "buf.TimestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032.g" + + "oogle.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\032\n\rstatus_" + + "detail\030\005 \001(\tB\003\340A\003\022\035\n\020cancel_requested\030\006 " + + "\001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB\003\340A\0032\360\021\n\006G" + + "keHub\022\264\001\n\017ListMemberships\022..google.cloud" + + ".gkehub.v1.ListMembershipsRequest\032/.goog" + + "le.cloud.gkehub.v1.ListMembershipsRespon" + + "se\"@\202\323\344\223\0021\022//v1/{parent=projects/*/locat" + + "ions/*}/memberships\332A\006parent\022\250\001\n\014ListFea" + + "tures\022+.google.cloud.gkehub.v1.ListFeatu" + + "resRequest\032,.google.cloud.gkehub.v1.List" + + "FeaturesResponse\"=\202\323\344\223\002.\022,/v1/{parent=pr" + + "ojects/*/locations/*}/features\332A\006parent\022" + + "\241\001\n\rGetMembership\022,.google.cloud.gkehub." + + "v1.GetMembershipRequest\032\".google.cloud.g" + + "kehub.v1.Membership\">\202\323\344\223\0021\022//v1/{name=p" + + "rojects/*/locations/*/memberships/*}\332A\004n" + + "ame\022\225\001\n\nGetFeature\022).google.cloud.gkehub" + + ".v1.GetFeatureRequest\032\037.google.cloud.gke" + + "hub.v1.Feature\";\202\323\344\223\002.\022,/v1/{name=projec" + + "ts/*/locations/*/features/*}\332A\004name\022\350\001\n\020" + + "CreateMembership\022/.google.cloud.gkehub.v" + + "1.CreateMembershipRequest\032\035.google.longr" + + "unning.Operation\"\203\001\202\323\344\223\002;\"//v1/{parent=p" + + "rojects/*/locations/*}/memberships:\010reso" + + "urce\332A\035parent,resource,membership_id\312A\037\n" + + "\nMembership\022\021OperationMetadata\022\330\001\n\rCreat" + + "eFeature\022,.google.cloud.gkehub.v1.Create" + + "FeatureRequest\032\035.google.longrunning.Oper" + + "ation\"z\202\323\344\223\0028\",/v1/{parent=projects/*/lo" + + "cations/*}/features:\010resource\332A\032parent,r" + + "esource,feature_id\312A\034\n\007Feature\022\021Operatio" + + "nMetadata\022\317\001\n\020DeleteMembership\022/.google." + + "cloud.gkehub.v1.DeleteMembershipRequest\032" + + "\035.google.longrunning.Operation\"k\202\323\344\223\0021*/" + + "/v1/{name=projects/*/locations/*/members" + + "hips/*}\332A\004name\312A*\n\025google.protobuf.Empty" + + "\022\021OperationMetadata\022\306\001\n\rDeleteFeature\022,." + + "google.cloud.gkehub.v1.DeleteFeatureRequ" + + "est\032\035.google.longrunning.Operation\"h\202\323\344\223" + + "\002.*,/v1/{name=projects/*/locations/*/fea" + + "tures/*}\332A\004name\312A*\n\025google.protobuf.Empt" + + "y\022\021OperationMetadata\022\343\001\n\020UpdateMembershi" + + "p\022/.google.cloud.gkehub.v1.UpdateMembers" + + "hipRequest\032\035.google.longrunning.Operatio" + + "n\"\177\202\323\344\223\002;2//v1/{name=projects/*/location" + + "s/*/memberships/*}:\010resource\332A\031name,reso" + + "urce,update_mask\312A\037\n\nMembership\022\021Operati" + + "onMetadata\022\327\001\n\rUpdateFeature\022,.google.cl" + + "oud.gkehub.v1.UpdateFeatureRequest\032\035.goo" + + "gle.longrunning.Operation\"y\202\323\344\223\00282,/v1/{" + + "name=projects/*/locations/*/features/*}:" + + "\010resource\332A\031name,resource,update_mask\312A\034" + + "\n\007Feature\022\021OperationMetadata\022\333\001\n\027Generat" + + "eConnectManifest\0226.google.cloud.gkehub.v" + + "1.GenerateConnectManifestRequest\0327.googl" + + "e.cloud.gkehub.v1.GenerateConnectManifes" + + "tResponse\"O\202\323\344\223\002I\022G/v1/{name=projects/*/" + + "locations/*/memberships/*}:generateConne" + + "ctManifest\032I\312A\025gkehub.googleapis.com\322A.h" + + "ttps://www.googleapis.com/auth/cloud-pla" + + "tformB\270\001\n\032com.google.cloud.gkehub.v1B\014Se" + + "rviceProtoP\001Z - * The Feature resource name in the format + * Required. The Feature resource name in the format * `projects/*/locations/*/features/*`. * * - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -179,11 +179,11 @@ public java.lang.String getName() { * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ @@ -332,7 +332,7 @@ public com.google.cloud.gkehub.v1.FeatureOrBuilder getResourceOrBuilder() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The requestId. */ @@ -365,7 +365,7 @@ public java.lang.String getRequestId() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The bytes for requestId. */ @@ -776,11 +776,11 @@ public Builder mergeFrom( * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -799,11 +799,11 @@ public java.lang.String getName() { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ @@ -822,11 +822,11 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @param value The name to set. * @return This builder for chaining. @@ -844,11 +844,11 @@ public Builder setName(java.lang.String value) { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ @@ -862,11 +862,11 @@ public Builder clearName() { * * *
-     * The Feature resource name in the format
+     * Required. The Feature resource name in the format
      * `projects/*/locations/*/features/*`.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @param value The bytes for name to set. * @return This builder for chaining. @@ -1331,7 +1331,7 @@ public com.google.cloud.gkehub.v1.FeatureOrBuilder getResourceOrBuilder() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The requestId. */ @@ -1363,7 +1363,7 @@ public java.lang.String getRequestId() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The bytes for requestId. */ @@ -1395,7 +1395,7 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @param value The requestId to set. * @return This builder for chaining. @@ -1426,7 +1426,7 @@ public Builder setRequestId(java.lang.String value) { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return This builder for chaining. */ @@ -1453,7 +1453,7 @@ public Builder clearRequestId() { * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @param value The bytes for requestId to set. * @return This builder for chaining. diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateFeatureRequestOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateFeatureRequestOrBuilder.java index a10106ab..fb89ff11 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateFeatureRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateFeatureRequestOrBuilder.java @@ -27,11 +27,11 @@ public interface UpdateFeatureRequestOrBuilder * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -40,11 +40,11 @@ public interface UpdateFeatureRequestOrBuilder * * *
-   * The Feature resource name in the format
+   * Required. The Feature resource name in the format
    * `projects/*/locations/*/features/*`.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ @@ -158,7 +158,7 @@ public interface UpdateFeatureRequestOrBuilder * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The requestId. */ @@ -180,7 +180,7 @@ public interface UpdateFeatureRequestOrBuilder * not supported (00000000-0000-0000-0000-000000000000). * * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * string request_id = 4; * * @return The bytes for requestId. */ diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateMembershipRequest.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateMembershipRequest.java index a312a3f2..4be6ae64 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateMembershipRequest.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateMembershipRequest.java @@ -160,7 +160,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -184,7 +186,9 @@ public java.lang.String getName() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -793,7 +797,9 @@ public Builder mergeFrom( * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -816,7 +822,9 @@ public java.lang.String getName() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -839,7 +847,9 @@ public com.google.protobuf.ByteString getNameBytes() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The name to set. * @return This builder for chaining. @@ -861,7 +871,9 @@ public Builder setName(java.lang.String value) { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -879,7 +891,9 @@ public Builder clearName() { * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * 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. diff --git a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateMembershipRequestOrBuilder.java b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateMembershipRequestOrBuilder.java index 388cba80..71a071d6 100644 --- a/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateMembershipRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1/src/main/java/com/google/cloud/gkehub/v1/UpdateMembershipRequestOrBuilder.java @@ -31,7 +31,9 @@ public interface UpdateMembershipRequestOrBuilder * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -44,7 +46,9 @@ public interface UpdateMembershipRequestOrBuilder * `projects/*/locations/*/memberships/*`. * * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ diff --git a/proto-google-cloud-gkehub-v1/src/main/proto/google/cloud/gkehub/v1/membership.proto b/proto-google-cloud-gkehub-v1/src/main/proto/google/cloud/gkehub/v1/membership.proto index 6699c1f2..6276098f 100644 --- a/proto-google-cloud-gkehub-v1/src/main/proto/google/cloud/gkehub/v1/membership.proto +++ b/proto-google-cloud-gkehub-v1/src/main/proto/google/cloud/gkehub/v1/membership.proto @@ -16,10 +16,10 @@ syntax = "proto3"; package google.cloud.gkehub.v1; +import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.GkeHub.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/gkehub/v1;gkehub"; @@ -110,13 +110,92 @@ message MembershipEndpoint { // Output only. Useful Kubernetes-specific metadata. KubernetesMetadata kubernetes_metadata = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The in-cluster Kubernetes Resources that should be applied for a correctly + // registered cluster, in the steady state. These resources: + // + // * Ensure that the cluster is exclusively registered to one and only one + // Hub Membership. + // * Propagate Workload Pool Information available in the Membership + // Authority field. + // * Ensure proper initial configuration of default Hub Features. + KubernetesResource kubernetes_resource = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// KubernetesResource contains the YAML manifests and configuration for +// Membership Kubernetes resources in the cluster. After CreateMembership or +// UpdateMembership, these resources should be re-applied in the cluster. +message KubernetesResource { + // Input only. The YAML representation of the Membership CR. This field is ignored for GKE + // clusters where Hub can read the CR directly. + // + // Callers should provide the CR that is currently present in the cluster + // during CreateMembership or UpdateMembership, or leave this field empty if + // none exists. The CR manifest is used to validate the cluster has not been + // registered with another Membership. + string membership_cr_manifest = 1 [(google.api.field_behavior) = INPUT_ONLY]; + + // Output only. Additional Kubernetes resources that need to be applied to the cluster + // after Membership creation, and after every update. + // + // This field is only populated in the Membership returned from a successful + // long-running operation from CreateMembership or UpdateMembership. It is not + // populated during normal GetMembership or ListMemberships requests. To get + // the resource manifest after the initial registration, the caller should + // make a UpdateMembership call with an empty field mask. + repeated ResourceManifest membership_resources = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Kubernetes resources for installing the GKE Connect agent + // + // This field is only populated in the Membership returned from a successful + // long-running operation from CreateMembership or UpdateMembership. It is not + // populated during normal GetMembership or ListMemberships requests. To get + // the resource manifest after the initial registration, the caller should + // make a UpdateMembership call with an empty field mask. + repeated ResourceManifest connect_resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Options for Kubernetes resource generation. + ResourceOptions resource_options = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// ResourceOptions represent options for Kubernetes resource generation. +message ResourceOptions { + // Optional. The Connect agent version to use for connect_resources. Defaults to the + // latest GKE Connect version. The version must be a currently supported + // version, obsolete versions will be rejected. + string connect_version = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for + // CustomResourceDefinition resources. + // This option should be set for clusters with Kubernetes apiserver versions + // <1.16. + bool v1beta1_crd = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Major version of the Kubernetes cluster. This is only used to determine + // which version to use for the CustomResourceDefinition resources, + // `apiextensions/v1beta1` or`apiextensions/v1`. + string k8s_version = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// ResourceManifest represents a single Kubernetes resource to be applied to +// the cluster. +message ResourceManifest { + // YAML manifest of the resource. + string manifest = 1; + + // Whether the resource provided in the manifest is `cluster_scoped`. + // If unset, the manifest is assumed to be namespace scoped. + // + // This field is used for REST mapping when applying the resource in a + // cluster. + bool cluster_scoped = 2; } // GkeCluster contains information specific to GKE clusters. message GkeCluster { // Immutable. Self-link of the GCP resource for the GKE cluster. For example: // - // //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster + // //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster // // Zonal clusters are also supported. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE]; diff --git a/proto-google-cloud-gkehub-v1/src/main/proto/google/cloud/gkehub/v1/service.proto b/proto-google-cloud-gkehub-v1/src/main/proto/google/cloud/gkehub/v1/service.proto index 38882973..6caf805f 100644 --- a/proto-google-cloud-gkehub-v1/src/main/proto/google/cloud/gkehub/v1/service.proto +++ b/proto-google-cloud-gkehub-v1/src/main/proto/google/cloud/gkehub/v1/service.proto @@ -23,6 +23,7 @@ import "google/api/resource.proto"; import "google/cloud/gkehub/v1/feature.proto"; import "google/cloud/gkehub/v1/membership.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -325,7 +326,12 @@ message DeleteMembershipRequest { message UpdateMembershipRequest { // Required. The Membership resource name in the format // `projects/*/locations/*/memberships/*`. - string name = 1 [(google.api.field_behavior) = REQUIRED]; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkehub.googleapis.com/Membership" + } + ]; // Required. Mask of fields to update. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; @@ -362,7 +368,12 @@ message UpdateMembershipRequest { message GenerateConnectManifestRequest { // Required. The Membership resource name the Agent will associate with, in the format // `projects/*/locations/*/memberships/*`. - string name = 1 [(google.api.field_behavior) = REQUIRED]; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkehub.googleapis.com/Membership" + } + ]; // Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`. // @@ -423,9 +434,13 @@ message TypeMeta { // Request message for `GkeHub.ListFeatures` method. message ListFeaturesRequest { - // The parent (project and location) where the Features will be listed. + // Required. The parent (project and location) where the Features will be listed. // Specified in the format `projects/*/locations/*`. - string parent = 1; + string parent = 1 [ + (google.api.resource_reference) = { + child_type: "gkehub.googleapis.com/Feature" + } + ]; // When requesting a 'page' of resources, `page_size` specifies number of // resources to return. If unspecified or set to 0, all resources will @@ -473,16 +488,24 @@ message ListFeaturesResponse { // Request message for `GkeHub.GetFeature` method. message GetFeatureRequest { - // The Feature resource name in the format + // Required. The Feature resource name in the format // `projects/*/locations/*/features/*` - string name = 1; + string name = 1 [ + (google.api.resource_reference) = { + type: "gkehub.googleapis.com/Feature" + } + ]; } // Request message for the `GkeHub.CreateFeature` method. message CreateFeatureRequest { - // The parent (project and location) where the Feature will be created. + // Required. The parent (project and location) where the Feature will be created. // Specified in the format `projects/*/locations/*`. - string parent = 1; + string parent = 1 [ + (google.api.resource_reference) = { + child_type: "gkehub.googleapis.com/Feature" + } + ]; // The ID of the feature to create. string feature_id = 2; @@ -503,14 +526,18 @@ message CreateFeatureRequest { // // 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]; + string request_id = 4; } // Request message for `GkeHub.DeleteFeature` method. message DeleteFeatureRequest { - // The Feature resource name in the format + // Required. The Feature resource name in the format // `projects/*/locations/*/features/*`. - string name = 1; + string name = 1 [ + (google.api.resource_reference) = { + type: "gkehub.googleapis.com/Feature" + } + ]; // If set to true, the delete will ignore any outstanding resources for // this Feature (that is, `FeatureState.has_resources` is set to true). These @@ -535,9 +562,13 @@ message DeleteFeatureRequest { // Request message for `GkeHub.UpdateFeature` method. message UpdateFeatureRequest { - // The Feature resource name in the format + // Required. The Feature resource name in the format // `projects/*/locations/*/features/*`. - string name = 1; + string name = 1 [ + (google.api.resource_reference) = { + type: "gkehub.googleapis.com/Feature" + } + ]; // Mask of fields to update. google.protobuf.FieldMask update_mask = 2; @@ -565,7 +596,7 @@ message UpdateFeatureRequest { // // 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]; + string request_id = 4; } // Represents the metadata of the long-running operation.