diff --git a/google-cloud-gkehub/pom.xml b/google-cloud-gkehub/pom.xml index 9f4c4c7c..2b42cea3 100644 --- a/google-cloud-gkehub/pom.xml +++ b/google-cloud-gkehub/pom.xml @@ -41,6 +41,18 @@ com.google.api.grpc proto-google-common-protos + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + com.google.api.grpc @@ -74,6 +86,10 @@ com.google.api gax-grpc + + com.google.api + gax-httpjson + org.threeten threetenbp @@ -113,12 +129,24 @@ test + + com.google.api + gax + testlib + test + com.google.api gax-grpc testlib test + + com.google.api + gax-httpjson + testlib + test + 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 fb06978d..6b12b47f 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 @@ -18,8 +18,8 @@ import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -31,7 +31,6 @@ import com.google.cloud.gkehub.v1.stub.GkeHubStubSettings; import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -116,13 +115,28 @@ * GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings); * } * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * GkeHubSettings gkeHubSettings =
+ *     GkeHubSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             GkeHubSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class GkeHubClient implements BackgroundResource { private final GkeHubSettings settings; private final GkeHubStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of GkeHubClient with default settings. */ public static final GkeHubClient create() throws IOException { @@ -141,7 +155,6 @@ public static final GkeHubClient create(GkeHubSettings settings) throws IOExcept * Constructs an instance of GkeHubClient, using the given stub for making calls. This is for * advanced usage - prefer using create(GkeHubSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final GkeHubClient create(GkeHubStub stub) { return new GkeHubClient(stub); } @@ -153,21 +166,23 @@ public static final GkeHubClient create(GkeHubStub stub) { protected GkeHubClient(GkeHubSettings settings) throws IOException { this.settings = settings; this.stub = ((GkeHubStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected GkeHubClient(GkeHubStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final GkeHubSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public GkeHubStub getStub() { return stub; } @@ -176,10 +191,18 @@ public GkeHubStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Memberships in a given project and location. @@ -318,7 +341,7 @@ public final ListMembershipsPagedResponse listMemberships(ListMembershipsRequest * .build(); * while (true) { * ListMembershipsResponse response = gkeHubClient.listMembershipsCallable().call(request); - * for (Membership element : response.getResponsesList()) { + * for (Membership element : response.getResourcesList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -473,7 +496,7 @@ public final ListFeaturesPagedResponse listFeatures(ListFeaturesRequest request) * .build(); * while (true) { * ListFeaturesResponse response = gkeHubClient.listFeaturesCallable().call(request); - * for (Feature element : response.getResponsesList()) { + * for (Feature element : response.getResourcesList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/GkeHubSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/GkeHubSettings.java index 1448b584..910a50a2 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/GkeHubSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/GkeHubSettings.java @@ -24,6 +24,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -193,11 +194,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return GkeHubStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return GkeHubStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return GkeHubStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return GkeHubStubSettings.defaultTransportChannelProvider(); } @@ -207,11 +215,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return GkeHubStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -249,6 +263,11 @@ private static Builder createDefault() { return new Builder(GkeHubStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(GkeHubStubSettings.newHttpJsonBuilder()); + } + public GkeHubStubSettings.Builder getStubSettingsBuilder() { return ((GkeHubStubSettings.Builder) getStubSettings()); } diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/GkeHubStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/GkeHubStub.java index 26978737..5fa3adbd 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/GkeHubStub.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/GkeHubStub.java @@ -54,7 +54,11 @@ public abstract class GkeHubStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/GkeHubStubSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/GkeHubStubSettings.java index 078f67d3..41aee7c3 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/GkeHubStubSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/GkeHubStubSettings.java @@ -29,6 +29,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -345,13 +348,17 @@ public UnaryCallSettings updateFeatureSettings( return generateConnectManifestSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public GkeHubStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcGkeHubStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonGkeHubStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -384,29 +391,54 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GkeHubStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GkeHubStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GkeHubStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -597,6 +629,19 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .listMembershipsSettings() diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/HttpJsonGkeHubCallableFactory.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/HttpJsonGkeHubCallableFactory.java new file mode 100644 index 00000000..03eb3f33 --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/HttpJsonGkeHubCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the GkeHub service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonGkeHubCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/HttpJsonGkeHubStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/HttpJsonGkeHubStub.java new file mode 100644 index 00000000..554fb30e --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1/stub/HttpJsonGkeHubStub.java @@ -0,0 +1,877 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1.stub; + +import static com.google.cloud.gkehub.v1.GkeHubClient.ListFeaturesPagedResponse; +import static com.google.cloud.gkehub.v1.GkeHubClient.ListMembershipsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gkehub.v1.CreateFeatureRequest; +import com.google.cloud.gkehub.v1.CreateMembershipRequest; +import com.google.cloud.gkehub.v1.DeleteFeatureRequest; +import com.google.cloud.gkehub.v1.DeleteMembershipRequest; +import com.google.cloud.gkehub.v1.Feature; +import com.google.cloud.gkehub.v1.GenerateConnectManifestRequest; +import com.google.cloud.gkehub.v1.GenerateConnectManifestResponse; +import com.google.cloud.gkehub.v1.GetFeatureRequest; +import com.google.cloud.gkehub.v1.GetMembershipRequest; +import com.google.cloud.gkehub.v1.ListFeaturesRequest; +import com.google.cloud.gkehub.v1.ListFeaturesResponse; +import com.google.cloud.gkehub.v1.ListMembershipsRequest; +import com.google.cloud.gkehub.v1.ListMembershipsResponse; +import com.google.cloud.gkehub.v1.Membership; +import com.google.cloud.gkehub.v1.OperationMetadata; +import com.google.cloud.gkehub.v1.UpdateFeatureRequest; +import com.google.cloud.gkehub.v1.UpdateMembershipRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the GkeHub service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonGkeHubStub extends GkeHubStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Feature.getDescriptor()) + .add(Membership.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listMembershipsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/ListMemberships") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/memberships", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListMembershipsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listFeaturesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/ListFeatures") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/features", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListFeaturesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/GetMembership") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/memberships/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Membership.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/GetFeature") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/features/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Feature.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/CreateMembership") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/memberships", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "membershipId", request.getMembershipId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateMembershipRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/CreateFeature") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/features", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "featureId", request.getFeatureId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateFeatureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/DeleteMembership") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/memberships/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteMembershipRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/DeleteFeature") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/features/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteFeatureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/UpdateMembership") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/memberships/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateMembershipRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/UpdateFeature") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/features/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateFeatureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + GenerateConnectManifestRequest, GenerateConnectManifestResponse> + generateConnectManifestMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.gkehub.v1.GkeHub/GenerateConnectManifest") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/memberships/*}:generateConnectManifest", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, + "imagePullSecretContent", + request.getImagePullSecretContent()); + serializer.putQueryParam(fields, "isUpgrade", request.getIsUpgrade()); + serializer.putQueryParam(fields, "namespace", request.getNamespace()); + serializer.putQueryParam(fields, "proxy", request.getProxy()); + serializer.putQueryParam(fields, "registry", request.getRegistry()); + serializer.putQueryParam(fields, "version", request.getVersion()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateConnectManifestResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listMembershipsCallable; + private final UnaryCallable + listMembershipsPagedCallable; + private final UnaryCallable listFeaturesCallable; + private final UnaryCallable + listFeaturesPagedCallable; + private final UnaryCallable getMembershipCallable; + private final UnaryCallable getFeatureCallable; + private final UnaryCallable createMembershipCallable; + private final OperationCallable + createMembershipOperationCallable; + private final UnaryCallable createFeatureCallable; + private final OperationCallable + createFeatureOperationCallable; + private final UnaryCallable deleteMembershipCallable; + private final OperationCallable + deleteMembershipOperationCallable; + private final UnaryCallable deleteFeatureCallable; + private final OperationCallable + deleteFeatureOperationCallable; + private final UnaryCallable updateMembershipCallable; + private final OperationCallable + updateMembershipOperationCallable; + private final UnaryCallable updateFeatureCallable; + private final OperationCallable + updateFeatureOperationCallable; + private final UnaryCallable + generateConnectManifestCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonGkeHubStub create(GkeHubStubSettings settings) throws IOException { + return new HttpJsonGkeHubStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonGkeHubStub create(ClientContext clientContext) throws IOException { + return new HttpJsonGkeHubStub(GkeHubStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonGkeHubStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGkeHubStub( + GkeHubStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonGkeHubStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonGkeHubStub(GkeHubStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonGkeHubCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonGkeHubStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonGkeHubStub( + GkeHubStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings + listMembershipsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMembershipsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listFeaturesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFeaturesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateConnectManifestTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateConnectManifestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listMembershipsCallable = + callableFactory.createUnaryCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.listMembershipsPagedCallable = + callableFactory.createPagedCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.listFeaturesCallable = + callableFactory.createUnaryCallable( + listFeaturesTransportSettings, settings.listFeaturesSettings(), clientContext); + this.listFeaturesPagedCallable = + callableFactory.createPagedCallable( + listFeaturesTransportSettings, settings.listFeaturesSettings(), clientContext); + this.getMembershipCallable = + callableFactory.createUnaryCallable( + getMembershipTransportSettings, settings.getMembershipSettings(), clientContext); + this.getFeatureCallable = + callableFactory.createUnaryCallable( + getFeatureTransportSettings, settings.getFeatureSettings(), clientContext); + this.createMembershipCallable = + callableFactory.createUnaryCallable( + createMembershipTransportSettings, settings.createMembershipSettings(), clientContext); + this.createMembershipOperationCallable = + callableFactory.createOperationCallable( + createMembershipTransportSettings, + settings.createMembershipOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createFeatureCallable = + callableFactory.createUnaryCallable( + createFeatureTransportSettings, settings.createFeatureSettings(), clientContext); + this.createFeatureOperationCallable = + callableFactory.createOperationCallable( + createFeatureTransportSettings, + settings.createFeatureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteMembershipCallable = + callableFactory.createUnaryCallable( + deleteMembershipTransportSettings, settings.deleteMembershipSettings(), clientContext); + this.deleteMembershipOperationCallable = + callableFactory.createOperationCallable( + deleteMembershipTransportSettings, + settings.deleteMembershipOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteFeatureCallable = + callableFactory.createUnaryCallable( + deleteFeatureTransportSettings, settings.deleteFeatureSettings(), clientContext); + this.deleteFeatureOperationCallable = + callableFactory.createOperationCallable( + deleteFeatureTransportSettings, + settings.deleteFeatureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateMembershipCallable = + callableFactory.createUnaryCallable( + updateMembershipTransportSettings, settings.updateMembershipSettings(), clientContext); + this.updateMembershipOperationCallable = + callableFactory.createOperationCallable( + updateMembershipTransportSettings, + settings.updateMembershipOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateFeatureCallable = + callableFactory.createUnaryCallable( + updateFeatureTransportSettings, settings.updateFeatureSettings(), clientContext); + this.updateFeatureOperationCallable = + callableFactory.createOperationCallable( + updateFeatureTransportSettings, + settings.updateFeatureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.generateConnectManifestCallable = + callableFactory.createUnaryCallable( + generateConnectManifestTransportSettings, + settings.generateConnectManifestSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listMembershipsMethodDescriptor); + methodDescriptors.add(listFeaturesMethodDescriptor); + methodDescriptors.add(getMembershipMethodDescriptor); + methodDescriptors.add(getFeatureMethodDescriptor); + methodDescriptors.add(createMembershipMethodDescriptor); + methodDescriptors.add(createFeatureMethodDescriptor); + methodDescriptors.add(deleteMembershipMethodDescriptor); + methodDescriptors.add(deleteFeatureMethodDescriptor); + methodDescriptors.add(updateMembershipMethodDescriptor); + methodDescriptors.add(updateFeatureMethodDescriptor); + methodDescriptors.add(generateConnectManifestMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listMembershipsCallable() { + return listMembershipsCallable; + } + + @Override + public UnaryCallable + listMembershipsPagedCallable() { + return listMembershipsPagedCallable; + } + + @Override + public UnaryCallable listFeaturesCallable() { + return listFeaturesCallable; + } + + @Override + public UnaryCallable listFeaturesPagedCallable() { + return listFeaturesPagedCallable; + } + + @Override + public UnaryCallable getMembershipCallable() { + return getMembershipCallable; + } + + @Override + public UnaryCallable getFeatureCallable() { + return getFeatureCallable; + } + + @Override + public UnaryCallable createMembershipCallable() { + return createMembershipCallable; + } + + @Override + public OperationCallable + createMembershipOperationCallable() { + return createMembershipOperationCallable; + } + + @Override + public UnaryCallable createFeatureCallable() { + return createFeatureCallable; + } + + @Override + public OperationCallable + createFeatureOperationCallable() { + return createFeatureOperationCallable; + } + + @Override + public UnaryCallable deleteMembershipCallable() { + return deleteMembershipCallable; + } + + @Override + public OperationCallable + deleteMembershipOperationCallable() { + return deleteMembershipOperationCallable; + } + + @Override + public UnaryCallable deleteFeatureCallable() { + return deleteFeatureCallable; + } + + @Override + public OperationCallable + deleteFeatureOperationCallable() { + return deleteFeatureOperationCallable; + } + + @Override + public UnaryCallable updateMembershipCallable() { + return updateMembershipCallable; + } + + @Override + public OperationCallable + updateMembershipOperationCallable() { + return updateMembershipOperationCallable; + } + + @Override + public UnaryCallable updateFeatureCallable() { + return updateFeatureCallable; + } + + @Override + public OperationCallable + updateFeatureOperationCallable() { + return updateFeatureOperationCallable; + } + + @Override + public UnaryCallable + generateConnectManifestCallable() { + return generateConnectManifestCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/GkeHubClient.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/GkeHubClient.java index b7e965fa..35bcdfe6 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/GkeHubClient.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/GkeHubClient.java @@ -20,6 +20,7 @@ import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -31,7 +32,6 @@ import com.google.cloud.gkehub.v1alpha.stub.GkeHubStubSettings; import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -116,6 +116,20 @@ * GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings); * } * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * GkeHubSettings gkeHubSettings =
+ *     GkeHubSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             GkeHubSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi @@ -123,7 +137,8 @@ public class GkeHubClient implements BackgroundResource { private final GkeHubSettings settings; private final GkeHubStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of GkeHubClient with default settings. */ public static final GkeHubClient create() throws IOException { @@ -142,7 +157,6 @@ public static final GkeHubClient create(GkeHubSettings settings) throws IOExcept * Constructs an instance of GkeHubClient, using the given stub for making calls. This is for * advanced usage - prefer using create(GkeHubSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final GkeHubClient create(GkeHubStub stub) { return new GkeHubClient(stub); } @@ -154,21 +168,23 @@ public static final GkeHubClient create(GkeHubStub stub) { protected GkeHubClient(GkeHubSettings settings) throws IOException { this.settings = settings; this.stub = ((GkeHubStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected GkeHubClient(GkeHubStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final GkeHubSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public GkeHubStub getStub() { return stub; } @@ -177,10 +193,18 @@ public GkeHubStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Features in a given project and location. @@ -289,7 +313,7 @@ public final ListFeaturesPagedResponse listFeatures(ListFeaturesRequest request) * .build(); * while (true) { * ListFeaturesResponse response = gkeHubClient.listFeaturesCallable().call(request); - * for (Feature element : response.getResponsesList()) { + * for (Feature element : response.getResourcesList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/GkeHubSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/GkeHubSettings.java index a65f1086..efbea95d 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/GkeHubSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/GkeHubSettings.java @@ -23,6 +23,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -142,11 +143,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return GkeHubStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return GkeHubStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return GkeHubStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return GkeHubStubSettings.defaultTransportChannelProvider(); } @@ -156,11 +164,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return GkeHubStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -198,6 +212,11 @@ private static Builder createDefault() { return new Builder(GkeHubStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(GkeHubStubSettings.newHttpJsonBuilder()); + } + public GkeHubStubSettings.Builder getStubSettingsBuilder() { return ((GkeHubStubSettings.Builder) getStubSettings()); } diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/GkeHubStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/GkeHubStub.java index f8998d46..cd085b59 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/GkeHubStub.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/GkeHubStub.java @@ -46,7 +46,11 @@ public abstract class GkeHubStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable listFeaturesPagedCallable() { diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/GkeHubStubSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/GkeHubStubSettings.java index db154ac4..5c40370b 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/GkeHubStubSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/GkeHubStubSettings.java @@ -28,6 +28,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -214,13 +217,17 @@ public UnaryCallSettings updateFeatureSettings( return updateFeatureOperationSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public GkeHubStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcGkeHubStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonGkeHubStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -253,29 +260,54 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GkeHubStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GkeHubStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GkeHubStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -406,6 +438,19 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .listFeaturesSettings() diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/HttpJsonGkeHubCallableFactory.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/HttpJsonGkeHubCallableFactory.java new file mode 100644 index 00000000..5aa9b1f8 --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/HttpJsonGkeHubCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the GkeHub service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonGkeHubCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/HttpJsonGkeHubStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/HttpJsonGkeHubStub.java new file mode 100644 index 00000000..649174aa --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha/stub/HttpJsonGkeHubStub.java @@ -0,0 +1,481 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1alpha.stub; + +import static com.google.cloud.gkehub.v1alpha.GkeHubClient.ListFeaturesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gkehub.v1alpha.CreateFeatureRequest; +import com.google.cloud.gkehub.v1alpha.DeleteFeatureRequest; +import com.google.cloud.gkehub.v1alpha.Feature; +import com.google.cloud.gkehub.v1alpha.GetFeatureRequest; +import com.google.cloud.gkehub.v1alpha.ListFeaturesRequest; +import com.google.cloud.gkehub.v1alpha.ListFeaturesResponse; +import com.google.cloud.gkehub.v1alpha.OperationMetadata; +import com.google.cloud.gkehub.v1alpha.UpdateFeatureRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the GkeHub service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonGkeHubStub extends GkeHubStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(OperationMetadata.getDescriptor()) + .add(Empty.getDescriptor()) + .add(Feature.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listFeaturesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha.GkeHub/ListFeatures") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*}/features", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListFeaturesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha.GkeHub/GetFeature") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/features/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Feature.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha.GkeHub/CreateFeature") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*}/features", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "featureId", request.getFeatureId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateFeatureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha.GkeHub/DeleteFeature") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/features/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteFeatureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha.GkeHub/UpdateFeature") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/features/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateFeatureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable listFeaturesCallable; + private final UnaryCallable + listFeaturesPagedCallable; + private final UnaryCallable getFeatureCallable; + private final UnaryCallable createFeatureCallable; + private final OperationCallable + createFeatureOperationCallable; + private final UnaryCallable deleteFeatureCallable; + private final OperationCallable + deleteFeatureOperationCallable; + private final UnaryCallable updateFeatureCallable; + private final OperationCallable + updateFeatureOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonGkeHubStub create(GkeHubStubSettings settings) throws IOException { + return new HttpJsonGkeHubStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonGkeHubStub create(ClientContext clientContext) throws IOException { + return new HttpJsonGkeHubStub(GkeHubStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonGkeHubStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGkeHubStub( + GkeHubStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonGkeHubStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonGkeHubStub(GkeHubStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonGkeHubCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonGkeHubStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonGkeHubStub( + GkeHubStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings listFeaturesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFeaturesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listFeaturesCallable = + callableFactory.createUnaryCallable( + listFeaturesTransportSettings, settings.listFeaturesSettings(), clientContext); + this.listFeaturesPagedCallable = + callableFactory.createPagedCallable( + listFeaturesTransportSettings, settings.listFeaturesSettings(), clientContext); + this.getFeatureCallable = + callableFactory.createUnaryCallable( + getFeatureTransportSettings, settings.getFeatureSettings(), clientContext); + this.createFeatureCallable = + callableFactory.createUnaryCallable( + createFeatureTransportSettings, settings.createFeatureSettings(), clientContext); + this.createFeatureOperationCallable = + callableFactory.createOperationCallable( + createFeatureTransportSettings, + settings.createFeatureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteFeatureCallable = + callableFactory.createUnaryCallable( + deleteFeatureTransportSettings, settings.deleteFeatureSettings(), clientContext); + this.deleteFeatureOperationCallable = + callableFactory.createOperationCallable( + deleteFeatureTransportSettings, + settings.deleteFeatureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateFeatureCallable = + callableFactory.createUnaryCallable( + updateFeatureTransportSettings, settings.updateFeatureSettings(), clientContext); + this.updateFeatureOperationCallable = + callableFactory.createOperationCallable( + updateFeatureTransportSettings, + settings.updateFeatureOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listFeaturesMethodDescriptor); + methodDescriptors.add(getFeatureMethodDescriptor); + methodDescriptors.add(createFeatureMethodDescriptor); + methodDescriptors.add(deleteFeatureMethodDescriptor); + methodDescriptors.add(updateFeatureMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listFeaturesCallable() { + return listFeaturesCallable; + } + + @Override + public UnaryCallable listFeaturesPagedCallable() { + return listFeaturesPagedCallable; + } + + @Override + public UnaryCallable getFeatureCallable() { + return getFeatureCallable; + } + + @Override + public UnaryCallable createFeatureCallable() { + return createFeatureCallable; + } + + @Override + public OperationCallable + createFeatureOperationCallable() { + return createFeatureOperationCallable; + } + + @Override + public UnaryCallable deleteFeatureCallable() { + return deleteFeatureCallable; + } + + @Override + public OperationCallable + deleteFeatureOperationCallable() { + return deleteFeatureOperationCallable; + } + + @Override + public UnaryCallable updateFeatureCallable() { + return updateFeatureCallable; + } + + @Override + public OperationCallable + updateFeatureOperationCallable() { + return updateFeatureOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/GkeHubClient.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/GkeHubClient.java index 2b44c747..876c7f90 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/GkeHubClient.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/GkeHubClient.java @@ -20,6 +20,7 @@ import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -31,7 +32,6 @@ import com.google.cloud.gkehub.v1alpha2.stub.GkeHubStubSettings; import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -110,6 +110,20 @@ * GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings); * } * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * GkeHubSettings gkeHubSettings =
+ *     GkeHubSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             GkeHubSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi @@ -117,7 +131,8 @@ public class GkeHubClient implements BackgroundResource { private final GkeHubSettings settings; private final GkeHubStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of GkeHubClient with default settings. */ public static final GkeHubClient create() throws IOException { @@ -136,7 +151,6 @@ public static final GkeHubClient create(GkeHubSettings settings) throws IOExcept * Constructs an instance of GkeHubClient, using the given stub for making calls. This is for * advanced usage - prefer using create(GkeHubSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final GkeHubClient create(GkeHubStub stub) { return new GkeHubClient(stub); } @@ -148,21 +162,23 @@ public static final GkeHubClient create(GkeHubStub stub) { protected GkeHubClient(GkeHubSettings settings) throws IOException { this.settings = settings; this.stub = ((GkeHubStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected GkeHubClient(GkeHubStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final GkeHubSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public GkeHubStub getStub() { return stub; } @@ -171,10 +187,18 @@ public GkeHubStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Memberships in a given project and location. @@ -313,7 +337,7 @@ public final ListMembershipsPagedResponse listMemberships(ListMembershipsRequest * .build(); * while (true) { * ListMembershipsResponse response = gkeHubClient.listMembershipsCallable().call(request); - * for (Membership element : response.getResponsesList()) { + * for (Membership element : response.getResourcesList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/GkeHubSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/GkeHubSettings.java index d4ec10ef..53ab991d 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/GkeHubSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/GkeHubSettings.java @@ -23,6 +23,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -154,11 +155,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return GkeHubStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return GkeHubStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return GkeHubStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return GkeHubStubSettings.defaultTransportChannelProvider(); } @@ -168,11 +176,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return GkeHubStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -210,6 +224,11 @@ private static Builder createDefault() { return new Builder(GkeHubStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(GkeHubStubSettings.newHttpJsonBuilder()); + } + public GkeHubStubSettings.Builder getStubSettingsBuilder() { return ((GkeHubStubSettings.Builder) getStubSettings()); } diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/GkeHubStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/GkeHubStub.java index d1e0c6bb..02c0ce12 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/GkeHubStub.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/GkeHubStub.java @@ -50,7 +50,11 @@ public abstract class GkeHubStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/GkeHubStubSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/GkeHubStubSettings.java index 99d2d1e1..6bec16b0 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/GkeHubStubSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/GkeHubStubSettings.java @@ -28,6 +28,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -237,13 +240,17 @@ public UnaryCallSettings initialize return initializeHubSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public GkeHubStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcGkeHubStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonGkeHubStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -276,29 +283,54 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GkeHubStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GkeHubStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GkeHubStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -449,6 +481,19 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .listMembershipsSettings() diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/HttpJsonGkeHubCallableFactory.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/HttpJsonGkeHubCallableFactory.java new file mode 100644 index 00000000..457b065b --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/HttpJsonGkeHubCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1alpha2.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the GkeHub service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonGkeHubCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/HttpJsonGkeHubStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/HttpJsonGkeHubStub.java new file mode 100644 index 00000000..7bcbc87f --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1alpha2/stub/HttpJsonGkeHubStub.java @@ -0,0 +1,603 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1alpha2.stub; + +import static com.google.cloud.gkehub.v1alpha2.GkeHubClient.ListMembershipsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gkehub.v1alpha2.CreateMembershipRequest; +import com.google.cloud.gkehub.v1alpha2.DeleteMembershipRequest; +import com.google.cloud.gkehub.v1alpha2.GenerateConnectManifestRequest; +import com.google.cloud.gkehub.v1alpha2.GenerateConnectManifestResponse; +import com.google.cloud.gkehub.v1alpha2.GetMembershipRequest; +import com.google.cloud.gkehub.v1alpha2.InitializeHubRequest; +import com.google.cloud.gkehub.v1alpha2.InitializeHubResponse; +import com.google.cloud.gkehub.v1alpha2.ListMembershipsRequest; +import com.google.cloud.gkehub.v1alpha2.ListMembershipsResponse; +import com.google.cloud.gkehub.v1alpha2.Membership; +import com.google.cloud.gkehub.v1alpha2.OperationMetadata; +import com.google.cloud.gkehub.v1alpha2.UpdateMembershipRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the GkeHub service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonGkeHubStub extends GkeHubStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Membership.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listMembershipsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha2.GkeHub/ListMemberships") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha2/{parent=projects/*/locations/*}/memberships", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListMembershipsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha2.GkeHub/GetMembership") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha2/{name=projects/*/locations/*/memberships/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Membership.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha2.GkeHub/CreateMembership") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha2/{parent=projects/*/locations/*}/memberships", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "membershipId", request.getMembershipId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateMembershipRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha2.GkeHub/DeleteMembership") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha2/{name=projects/*/locations/*/memberships/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteMembershipRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha2.GkeHub/UpdateMembership") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha2/{name=projects/*/locations/*/memberships/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateMembershipRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + GenerateConnectManifestRequest, GenerateConnectManifestResponse> + generateConnectManifestMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha2.GkeHub/GenerateConnectManifest") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha2/{name=projects/*/locations/*/memberships/*}:generateConnectManifest", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, + "imagePullSecretContent", + request.getImagePullSecretContent()); + serializer.putQueryParam(fields, "isUpgrade", request.getIsUpgrade()); + serializer.putQueryParam(fields, "namespace", request.getNamespace()); + serializer.putQueryParam(fields, "proxy", request.getProxy()); + serializer.putQueryParam(fields, "registry", request.getRegistry()); + serializer.putQueryParam(fields, "version", request.getVersion()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateConnectManifestResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + initializeHubMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1alpha2.GkeHub/InitializeHub") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha2/{project=projects/*/locations/global/memberships}:initializeHub", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "project", request.getProject()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearProject().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(InitializeHubResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listMembershipsCallable; + private final UnaryCallable + listMembershipsPagedCallable; + private final UnaryCallable getMembershipCallable; + private final UnaryCallable createMembershipCallable; + private final OperationCallable + createMembershipOperationCallable; + private final UnaryCallable deleteMembershipCallable; + private final OperationCallable + deleteMembershipOperationCallable; + private final UnaryCallable updateMembershipCallable; + private final OperationCallable + updateMembershipOperationCallable; + private final UnaryCallable + generateConnectManifestCallable; + private final UnaryCallable initializeHubCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonGkeHubStub create(GkeHubStubSettings settings) throws IOException { + return new HttpJsonGkeHubStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonGkeHubStub create(ClientContext clientContext) throws IOException { + return new HttpJsonGkeHubStub(GkeHubStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonGkeHubStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGkeHubStub( + GkeHubStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonGkeHubStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonGkeHubStub(GkeHubStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonGkeHubCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonGkeHubStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonGkeHubStub( + GkeHubStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings + listMembershipsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMembershipsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateConnectManifestTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateConnectManifestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + initializeHubTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(initializeHubMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listMembershipsCallable = + callableFactory.createUnaryCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.listMembershipsPagedCallable = + callableFactory.createPagedCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.getMembershipCallable = + callableFactory.createUnaryCallable( + getMembershipTransportSettings, settings.getMembershipSettings(), clientContext); + this.createMembershipCallable = + callableFactory.createUnaryCallable( + createMembershipTransportSettings, settings.createMembershipSettings(), clientContext); + this.createMembershipOperationCallable = + callableFactory.createOperationCallable( + createMembershipTransportSettings, + settings.createMembershipOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteMembershipCallable = + callableFactory.createUnaryCallable( + deleteMembershipTransportSettings, settings.deleteMembershipSettings(), clientContext); + this.deleteMembershipOperationCallable = + callableFactory.createOperationCallable( + deleteMembershipTransportSettings, + settings.deleteMembershipOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateMembershipCallable = + callableFactory.createUnaryCallable( + updateMembershipTransportSettings, settings.updateMembershipSettings(), clientContext); + this.updateMembershipOperationCallable = + callableFactory.createOperationCallable( + updateMembershipTransportSettings, + settings.updateMembershipOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.generateConnectManifestCallable = + callableFactory.createUnaryCallable( + generateConnectManifestTransportSettings, + settings.generateConnectManifestSettings(), + clientContext); + this.initializeHubCallable = + callableFactory.createUnaryCallable( + initializeHubTransportSettings, settings.initializeHubSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listMembershipsMethodDescriptor); + methodDescriptors.add(getMembershipMethodDescriptor); + methodDescriptors.add(createMembershipMethodDescriptor); + methodDescriptors.add(deleteMembershipMethodDescriptor); + methodDescriptors.add(updateMembershipMethodDescriptor); + methodDescriptors.add(generateConnectManifestMethodDescriptor); + methodDescriptors.add(initializeHubMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listMembershipsCallable() { + return listMembershipsCallable; + } + + @Override + public UnaryCallable + listMembershipsPagedCallable() { + return listMembershipsPagedCallable; + } + + @Override + public UnaryCallable getMembershipCallable() { + return getMembershipCallable; + } + + @Override + public UnaryCallable createMembershipCallable() { + return createMembershipCallable; + } + + @Override + public OperationCallable + createMembershipOperationCallable() { + return createMembershipOperationCallable; + } + + @Override + public UnaryCallable deleteMembershipCallable() { + return deleteMembershipCallable; + } + + @Override + public OperationCallable + deleteMembershipOperationCallable() { + return deleteMembershipOperationCallable; + } + + @Override + public UnaryCallable updateMembershipCallable() { + return updateMembershipCallable; + } + + @Override + public OperationCallable + updateMembershipOperationCallable() { + return updateMembershipOperationCallable; + } + + @Override + public UnaryCallable + generateConnectManifestCallable() { + return generateConnectManifestCallable; + } + + @Override + public UnaryCallable initializeHubCallable() { + return initializeHubCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/GkeHubClient.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/GkeHubClient.java index 34a56ecb..3b91174d 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/GkeHubClient.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/GkeHubClient.java @@ -20,6 +20,7 @@ import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -31,7 +32,6 @@ import com.google.cloud.gkehub.v1beta.stub.GkeHubStubSettings; import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -116,6 +116,20 @@ * GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings); * } * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * GkeHubSettings gkeHubSettings =
+ *     GkeHubSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             GkeHubSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi @@ -123,7 +137,8 @@ public class GkeHubClient implements BackgroundResource { private final GkeHubSettings settings; private final GkeHubStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of GkeHubClient with default settings. */ public static final GkeHubClient create() throws IOException { @@ -142,7 +157,6 @@ public static final GkeHubClient create(GkeHubSettings settings) throws IOExcept * Constructs an instance of GkeHubClient, using the given stub for making calls. This is for * advanced usage - prefer using create(GkeHubSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final GkeHubClient create(GkeHubStub stub) { return new GkeHubClient(stub); } @@ -154,21 +168,23 @@ public static final GkeHubClient create(GkeHubStub stub) { protected GkeHubClient(GkeHubSettings settings) throws IOException { this.settings = settings; this.stub = ((GkeHubStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected GkeHubClient(GkeHubStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final GkeHubSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public GkeHubStub getStub() { return stub; } @@ -177,10 +193,18 @@ public GkeHubStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Features in a given project and location. @@ -289,7 +313,7 @@ public final ListFeaturesPagedResponse listFeatures(ListFeaturesRequest request) * .build(); * while (true) { * ListFeaturesResponse response = gkeHubClient.listFeaturesCallable().call(request); - * for (Feature element : response.getResponsesList()) { + * for (Feature element : response.getResourcesList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/GkeHubSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/GkeHubSettings.java index ae1f4853..ec48a115 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/GkeHubSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/GkeHubSettings.java @@ -23,6 +23,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -142,11 +143,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return GkeHubStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return GkeHubStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return GkeHubStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return GkeHubStubSettings.defaultTransportChannelProvider(); } @@ -156,11 +164,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return GkeHubStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -198,6 +212,11 @@ private static Builder createDefault() { return new Builder(GkeHubStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(GkeHubStubSettings.newHttpJsonBuilder()); + } + public GkeHubStubSettings.Builder getStubSettingsBuilder() { return ((GkeHubStubSettings.Builder) getStubSettings()); } diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/GkeHubStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/GkeHubStub.java index 4a3361b2..7265a8b9 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/GkeHubStub.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/GkeHubStub.java @@ -46,7 +46,11 @@ public abstract class GkeHubStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable listFeaturesPagedCallable() { diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/GkeHubStubSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/GkeHubStubSettings.java index 95e921b2..4da9fe00 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/GkeHubStubSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/GkeHubStubSettings.java @@ -28,6 +28,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -214,13 +217,17 @@ public UnaryCallSettings updateFeatureSettings( return updateFeatureOperationSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public GkeHubStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcGkeHubStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonGkeHubStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -253,29 +260,54 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GkeHubStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(GkeHubStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GkeHubStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -406,6 +438,19 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .listFeaturesSettings() diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/HttpJsonGkeHubCallableFactory.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/HttpJsonGkeHubCallableFactory.java new file mode 100644 index 00000000..f14708c2 --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/HttpJsonGkeHubCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the GkeHub service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonGkeHubCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/HttpJsonGkeHubStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/HttpJsonGkeHubStub.java new file mode 100644 index 00000000..07d542cd --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta/stub/HttpJsonGkeHubStub.java @@ -0,0 +1,481 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1beta.stub; + +import static com.google.cloud.gkehub.v1beta.GkeHubClient.ListFeaturesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gkehub.v1beta.CreateFeatureRequest; +import com.google.cloud.gkehub.v1beta.DeleteFeatureRequest; +import com.google.cloud.gkehub.v1beta.Feature; +import com.google.cloud.gkehub.v1beta.GetFeatureRequest; +import com.google.cloud.gkehub.v1beta.ListFeaturesRequest; +import com.google.cloud.gkehub.v1beta.ListFeaturesResponse; +import com.google.cloud.gkehub.v1beta.OperationMetadata; +import com.google.cloud.gkehub.v1beta.UpdateFeatureRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the GkeHub service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonGkeHubStub extends GkeHubStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Feature.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listFeaturesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1beta.GkeHub/ListFeatures") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/features", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListFeaturesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1beta.GkeHub/GetFeature") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/features/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Feature.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1beta.GkeHub/CreateFeature") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/features", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "featureId", request.getFeatureId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateFeatureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1beta.GkeHub/DeleteFeature") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/features/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "force", request.getForce()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteFeatureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateFeatureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.gkehub.v1beta.GkeHub/UpdateFeature") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/features/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateFeatureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable listFeaturesCallable; + private final UnaryCallable + listFeaturesPagedCallable; + private final UnaryCallable getFeatureCallable; + private final UnaryCallable createFeatureCallable; + private final OperationCallable + createFeatureOperationCallable; + private final UnaryCallable deleteFeatureCallable; + private final OperationCallable + deleteFeatureOperationCallable; + private final UnaryCallable updateFeatureCallable; + private final OperationCallable + updateFeatureOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonGkeHubStub create(GkeHubStubSettings settings) throws IOException { + return new HttpJsonGkeHubStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonGkeHubStub create(ClientContext clientContext) throws IOException { + return new HttpJsonGkeHubStub(GkeHubStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonGkeHubStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGkeHubStub( + GkeHubStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonGkeHubStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonGkeHubStub(GkeHubStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonGkeHubCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonGkeHubStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonGkeHubStub( + GkeHubStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings listFeaturesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFeaturesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateFeatureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateFeatureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listFeaturesCallable = + callableFactory.createUnaryCallable( + listFeaturesTransportSettings, settings.listFeaturesSettings(), clientContext); + this.listFeaturesPagedCallable = + callableFactory.createPagedCallable( + listFeaturesTransportSettings, settings.listFeaturesSettings(), clientContext); + this.getFeatureCallable = + callableFactory.createUnaryCallable( + getFeatureTransportSettings, settings.getFeatureSettings(), clientContext); + this.createFeatureCallable = + callableFactory.createUnaryCallable( + createFeatureTransportSettings, settings.createFeatureSettings(), clientContext); + this.createFeatureOperationCallable = + callableFactory.createOperationCallable( + createFeatureTransportSettings, + settings.createFeatureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteFeatureCallable = + callableFactory.createUnaryCallable( + deleteFeatureTransportSettings, settings.deleteFeatureSettings(), clientContext); + this.deleteFeatureOperationCallable = + callableFactory.createOperationCallable( + deleteFeatureTransportSettings, + settings.deleteFeatureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateFeatureCallable = + callableFactory.createUnaryCallable( + updateFeatureTransportSettings, settings.updateFeatureSettings(), clientContext); + this.updateFeatureOperationCallable = + callableFactory.createOperationCallable( + updateFeatureTransportSettings, + settings.updateFeatureOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listFeaturesMethodDescriptor); + methodDescriptors.add(getFeatureMethodDescriptor); + methodDescriptors.add(createFeatureMethodDescriptor); + methodDescriptors.add(deleteFeatureMethodDescriptor); + methodDescriptors.add(updateFeatureMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listFeaturesCallable() { + return listFeaturesCallable; + } + + @Override + public UnaryCallable listFeaturesPagedCallable() { + return listFeaturesPagedCallable; + } + + @Override + public UnaryCallable getFeatureCallable() { + return getFeatureCallable; + } + + @Override + public UnaryCallable createFeatureCallable() { + return createFeatureCallable; + } + + @Override + public OperationCallable + createFeatureOperationCallable() { + return createFeatureOperationCallable; + } + + @Override + public UnaryCallable deleteFeatureCallable() { + return deleteFeatureCallable; + } + + @Override + public OperationCallable + deleteFeatureOperationCallable() { + return deleteFeatureOperationCallable; + } + + @Override + public UnaryCallable updateFeatureCallable() { + return updateFeatureCallable; + } + + @Override + public OperationCallable + updateFeatureOperationCallable() { + return updateFeatureOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClient.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClient.java index a7d376be..527cdc3d 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClient.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClient.java @@ -20,6 +20,7 @@ import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -29,9 +30,17 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.gkehub.v1beta1.stub.GkeHubMembershipServiceStub; import com.google.cloud.gkehub.v1beta1.stub.GkeHubMembershipServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -59,7 +68,7 @@ * // It may require modifications to work in your environment. * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient = * GkeHubMembershipServiceClient.create()) { - * String name = "name3373707"; + * MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); * Membership response = gkeHubMembershipServiceClient.getMembership(name); * } * } @@ -115,6 +124,21 @@ * GkeHubMembershipServiceClient.create(gkeHubMembershipServiceSettings); * } * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * GkeHubMembershipServiceSettings gkeHubMembershipServiceSettings =
+ *     GkeHubMembershipServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             GkeHubMembershipServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+ *     GkeHubMembershipServiceClient.create(gkeHubMembershipServiceSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi @@ -122,7 +146,8 @@ public class GkeHubMembershipServiceClient implements BackgroundResource { private final GkeHubMembershipServiceSettings settings; private final GkeHubMembershipServiceStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of GkeHubMembershipServiceClient with default settings. */ public static final GkeHubMembershipServiceClient create() throws IOException { @@ -142,7 +167,6 @@ public static final GkeHubMembershipServiceClient create(GkeHubMembershipService * Constructs an instance of GkeHubMembershipServiceClient, using the given stub for making calls. * This is for advanced usage - prefer using create(GkeHubMembershipServiceSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final GkeHubMembershipServiceClient create(GkeHubMembershipServiceStub stub) { return new GkeHubMembershipServiceClient(stub); } @@ -156,21 +180,23 @@ protected GkeHubMembershipServiceClient(GkeHubMembershipServiceSettings settings throws IOException { this.settings = settings; this.stub = ((GkeHubMembershipServiceStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected GkeHubMembershipServiceClient(GkeHubMembershipServiceStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final GkeHubMembershipServiceSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public GkeHubMembershipServiceStub getStub() { return stub; } @@ -179,10 +205,49 @@ public GkeHubMembershipServiceStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Memberships in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Membership element :
+   *       gkeHubMembershipServiceClient.listMemberships(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent (project and location) where the Memberships will be listed. + * Specified in the format `projects/*/locations/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMembershipsPagedResponse listMemberships(LocationName parent) { + ListMembershipsRequest request = + ListMembershipsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listMemberships(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Memberships in a given project and location. @@ -194,7 +259,7 @@ public final OperationsClient getOperationsClient() { * // It may require modifications to work in your environment. * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient = * GkeHubMembershipServiceClient.create()) { - * String parent = "parent-995424086"; + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); * for (Membership element : * gkeHubMembershipServiceClient.listMemberships(parent).iterateAll()) { * // doThingsWith(element); @@ -224,7 +289,7 @@ public final ListMembershipsPagedResponse listMemberships(String parent) { * GkeHubMembershipServiceClient.create()) { * ListMembershipsRequest request = * ListMembershipsRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setFilter("filter-1274492040") @@ -257,7 +322,7 @@ public final ListMembershipsPagedResponse listMemberships(ListMembershipsRequest * GkeHubMembershipServiceClient.create()) { * ListMembershipsRequest request = * ListMembershipsRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setFilter("filter-1274492040") @@ -290,7 +355,7 @@ public final ListMembershipsPagedResponse listMemberships(ListMembershipsRequest * GkeHubMembershipServiceClient.create()) { * ListMembershipsRequest request = * ListMembershipsRequest.newBuilder() - * .setParent("parent-995424086") + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setFilter("filter-1274492040") @@ -299,7 +364,7 @@ public final ListMembershipsPagedResponse listMemberships(ListMembershipsRequest * while (true) { * ListMembershipsResponse response = * gkeHubMembershipServiceClient.listMembershipsCallable().call(request); - * for (Membership element : response.getResponsesList()) { + * for (Membership element : response.getResourcesList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -328,7 +393,33 @@ public final ListMembershipsPagedResponse listMemberships(ListMembershipsRequest * // It may require modifications to work in your environment. * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient = * GkeHubMembershipServiceClient.create()) { - * String name = "name3373707"; + * MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + * Membership response = gkeHubMembershipServiceClient.getMembership(name); + * } + * } + * + * @param name Required. The Membership resource name in the format + * `projects/*/locations/*/memberships/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Membership getMembership(MembershipName name) { + GetMembershipRequest request = + GetMembershipRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getMembership(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the details of a Membership. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   String name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString();
    *   Membership response = gkeHubMembershipServiceClient.getMembership(name);
    * }
    * }
@@ -354,7 +445,9 @@ public final Membership getMembership(String name) { * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient = * GkeHubMembershipServiceClient.create()) { * GetMembershipRequest request = - * GetMembershipRequest.newBuilder().setName("name3373707").build(); + * GetMembershipRequest.newBuilder() + * .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + * .build(); * Membership response = gkeHubMembershipServiceClient.getMembership(request); * } * } @@ -378,7 +471,9 @@ public final Membership getMembership(GetMembershipRequest request) { * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient = * GkeHubMembershipServiceClient.create()) { * GetMembershipRequest request = - * GetMembershipRequest.newBuilder().setName("name3373707").build(); + * GetMembershipRequest.newBuilder() + * .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + * .build(); * ApiFuture future = * gkeHubMembershipServiceClient.getMembershipCallable().futureCall(request); * // Do something. @@ -405,7 +500,52 @@ public final UnaryCallable getMembershipCallab * // It may require modifications to work in your environment. * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient = * GkeHubMembershipServiceClient.create()) { - * String parent = "parent-995424086"; + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Membership resource = Membership.newBuilder().build(); + * String membershipId = "membershipId517665681"; + * Membership response = + * gkeHubMembershipServiceClient.createMembershipAsync(parent, resource, membershipId).get(); + * } + * } + * + * @param parent Required. The parent (project and location) where the Memberships will be + * created. Specified in the format `projects/*/locations/*`. + * @param resource Required. The membership to create. + * @param membershipId Required. Client chosen ID for the membership. `membership_id` must be a + * valid RFC 1123 compliant DNS label: + *

1. At most 63 characters in length 2. It must consist of lower case alphanumeric + * characters or `-` 3. It must start and end with an alphanumeric character + *

Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, with a maximum + * length of 63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createMembershipAsync( + LocationName parent, Membership resource, String membershipId) { + CreateMembershipRequest request = + CreateMembershipRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setResource(resource) + .setMembershipId(membershipId) + .build(); + return createMembershipAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Membership. + * + *

**This is currently only supported for GKE clusters on Google Cloud**. To + * register other clusters, follow the instructions at + * https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
    *   Membership resource = Membership.newBuilder().build();
    *   String membershipId = "membershipId517665681";
    *   Membership response =
@@ -452,7 +592,7 @@ public final OperationFuture createMembershipAsyn
    *     GkeHubMembershipServiceClient.create()) {
    *   CreateMembershipRequest request =
    *       CreateMembershipRequest.newBuilder()
-   *           .setParent("parent-995424086")
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
    *           .setMembershipId("membershipId517665681")
    *           .setResource(Membership.newBuilder().build())
    *           .setRequestId("requestId693933066")
@@ -486,7 +626,7 @@ public final OperationFuture createMembershipAsyn
    *     GkeHubMembershipServiceClient.create()) {
    *   CreateMembershipRequest request =
    *       CreateMembershipRequest.newBuilder()
-   *           .setParent("parent-995424086")
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
    *           .setMembershipId("membershipId517665681")
    *           .setResource(Membership.newBuilder().build())
    *           .setRequestId("requestId693933066")
@@ -520,7 +660,7 @@ public final OperationFuture createMembershipAsyn
    *     GkeHubMembershipServiceClient.create()) {
    *   CreateMembershipRequest request =
    *       CreateMembershipRequest.newBuilder()
-   *           .setParent("parent-995424086")
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
    *           .setMembershipId("membershipId517665681")
    *           .setResource(Membership.newBuilder().build())
    *           .setRequestId("requestId693933066")
@@ -551,7 +691,38 @@ public final UnaryCallable createMembershipC
    * // It may require modifications to work in your environment.
    * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
    *     GkeHubMembershipServiceClient.create()) {
-   *   String name = "name3373707";
+   *   MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]");
+   *   gkeHubMembershipServiceClient.deleteMembershipAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The Membership resource name in the format + * `projects/*/locations/*/memberships/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteMembershipAsync( + MembershipName name) { + DeleteMembershipRequest request = + DeleteMembershipRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteMembershipAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes a Membership. + * + *

**This is currently only supported for GKE clusters on Google Cloud**. To + * unregister other clusters, follow the instructions at + * https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   String name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString();
    *   gkeHubMembershipServiceClient.deleteMembershipAsync(name).get();
    * }
    * }
@@ -582,7 +753,7 @@ public final OperationFuture deleteMembershipAsync(Str * GkeHubMembershipServiceClient.create()) { * DeleteMembershipRequest request = * DeleteMembershipRequest.newBuilder() - * .setName("name3373707") + * .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) * .setRequestId("requestId693933066") * .build(); * gkeHubMembershipServiceClient.deleteMembershipAsync(request).get(); @@ -614,7 +785,7 @@ public final OperationFuture deleteMembershipAsync( * GkeHubMembershipServiceClient.create()) { * DeleteMembershipRequest request = * DeleteMembershipRequest.newBuilder() - * .setName("name3373707") + * .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) * .setRequestId("requestId693933066") * .build(); * OperationFuture future = @@ -646,7 +817,7 @@ public final OperationFuture deleteMembershipAsync( * GkeHubMembershipServiceClient.create()) { * DeleteMembershipRequest request = * DeleteMembershipRequest.newBuilder() - * .setName("name3373707") + * .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) * .setRequestId("requestId693933066") * .build(); * ApiFuture future = @@ -671,7 +842,49 @@ public final UnaryCallable deleteMembershipC * // It may require modifications to work in your environment. * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient = * GkeHubMembershipServiceClient.create()) { - * String name = "name3373707"; + * MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + * Membership resource = Membership.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Membership response = + * gkeHubMembershipServiceClient.updateMembershipAsync(name, resource, updateMask).get(); + * } + * } + * + * @param name Required. The membership resource name in the format: + * `projects/[project_id]/locations/global/memberships/[membership_id]` + * @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. At least one field path must be specified + * in this mask. + * @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
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   String name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString();
    *   Membership resource = Membership.newBuilder().build();
    *   FieldMask updateMask = FieldMask.newBuilder().build();
    *   Membership response =
@@ -715,7 +928,7 @@ public final OperationFuture updateMembershipAsyn
    *     GkeHubMembershipServiceClient.create()) {
    *   UpdateMembershipRequest request =
    *       UpdateMembershipRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .setResource(Membership.newBuilder().build())
    *           .setRequestId("requestId693933066")
@@ -745,7 +958,7 @@ public final OperationFuture updateMembershipAsyn
    *     GkeHubMembershipServiceClient.create()) {
    *   UpdateMembershipRequest request =
    *       UpdateMembershipRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .setResource(Membership.newBuilder().build())
    *           .setRequestId("requestId693933066")
@@ -775,7 +988,7 @@ public final OperationFuture updateMembershipAsyn
    *     GkeHubMembershipServiceClient.create()) {
    *   UpdateMembershipRequest request =
    *       UpdateMembershipRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .setResource(Membership.newBuilder().build())
    *           .setRequestId("requestId693933066")
@@ -807,7 +1020,7 @@ public final UnaryCallable updateMembershipC
    *     GkeHubMembershipServiceClient.create()) {
    *   GenerateConnectManifestRequest request =
    *       GenerateConnectManifestRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setConnectAgent(ConnectAgent.newBuilder().build())
    *           .setVersion("version351608024")
    *           .setIsUpgrade(true)
@@ -843,7 +1056,7 @@ public final GenerateConnectManifestResponse generateConnectManifest(
    *     GkeHubMembershipServiceClient.create()) {
    *   GenerateConnectManifestRequest request =
    *       GenerateConnectManifestRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setConnectAgent(ConnectAgent.newBuilder().build())
    *           .setVersion("version351608024")
    *           .setIsUpgrade(true)
@@ -876,7 +1089,7 @@ public final GenerateConnectManifestResponse generateConnectManifest(
    *     GkeHubMembershipServiceClient.create()) {
    *   ValidateExclusivityRequest request =
    *       ValidateExclusivityRequest.newBuilder()
-   *           .setParent("parent-995424086")
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
    *           .setCrManifest("crManifest-1971077186")
    *           .setIntendedMembership("intendedMembership-2074920351")
    *           .build();
@@ -906,7 +1119,7 @@ public final ValidateExclusivityResponse validateExclusivity(ValidateExclusivity
    *     GkeHubMembershipServiceClient.create()) {
    *   ValidateExclusivityRequest request =
    *       ValidateExclusivityRequest.newBuilder()
-   *           .setParent("parent-995424086")
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
    *           .setCrManifest("crManifest-1971077186")
    *           .setIntendedMembership("intendedMembership-2074920351")
    *           .build();
@@ -944,7 +1157,7 @@ public final ValidateExclusivityResponse validateExclusivity(ValidateExclusivity
    *     GkeHubMembershipServiceClient.create()) {
    *   GenerateExclusivityManifestRequest request =
    *       GenerateExclusivityManifestRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setCrdManifest("crdManifest1401188132")
    *           .setCrManifest("crManifest-1971077186")
    *           .build();
@@ -983,7 +1196,7 @@ public final GenerateExclusivityManifestResponse generateExclusivityManifest(
    *     GkeHubMembershipServiceClient.create()) {
    *   GenerateExclusivityManifestRequest request =
    *       GenerateExclusivityManifestRequest.newBuilder()
-   *           .setName("name3373707")
+   *           .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
    *           .setCrdManifest("crdManifest1401188132")
    *           .setCrManifest("crManifest-1971077186")
    *           .build();
@@ -1000,6 +1213,335 @@ public final GenerateExclusivityManifestResponse generateExclusivityManifest(
     return stub.generateExclusivityManifestCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD.
+  /**
+   * Lists information about the supported locations for this service.
+   *
+   * 

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : gkeHubMembershipServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       gkeHubMembershipServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         gkeHubMembershipServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = gkeHubMembershipServiceClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       gkeHubMembershipServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = gkeHubMembershipServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gkeHubMembershipServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = gkeHubMembershipServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gkeHubMembershipServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response =
+   *       gkeHubMembershipServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient =
+   *     GkeHubMembershipServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       gkeHubMembershipServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + @Override public final void close() { stub.close(); @@ -1106,4 +1648,80 @@ protected ListMembershipsFixedSizeCollection createCollection( return new ListMembershipsFixedSizeCollection(pages, collectionSize); } } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceSettings.java index 44900faf..4c2e986b 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.gkehub.v1beta1; +import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListLocationsPagedResponse; import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListMembershipsPagedResponse; import com.google.api.core.ApiFunction; @@ -23,6 +24,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -31,6 +33,15 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.gkehub.v1beta1.stub.GkeHubMembershipServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -145,6 +156,33 @@ public UnaryCallSettings updateMembershipSet .generateExclusivityManifestSettings(); } + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((GkeHubMembershipServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((GkeHubMembershipServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((GkeHubMembershipServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((GkeHubMembershipServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((GkeHubMembershipServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + public static final GkeHubMembershipServiceSettings create( GkeHubMembershipServiceStubSettings stub) throws IOException { return new GkeHubMembershipServiceSettings.Builder(stub.toBuilder()).build(); @@ -170,11 +208,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return GkeHubMembershipServiceStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return GkeHubMembershipServiceStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return GkeHubMembershipServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return GkeHubMembershipServiceStubSettings.defaultTransportChannelProvider(); } @@ -184,11 +229,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return GkeHubMembershipServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -227,6 +278,11 @@ private static Builder createDefault() { return new Builder(GkeHubMembershipServiceStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(GkeHubMembershipServiceStubSettings.newHttpJsonBuilder()); + } + public GkeHubMembershipServiceStubSettings.Builder getStubSettingsBuilder() { return ((GkeHubMembershipServiceStubSettings.Builder) getStubSettings()); } @@ -311,6 +367,34 @@ public UnaryCallSettings.Builder getMembership return getStubSettingsBuilder().generateExclusivityManifestSettings(); } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + @Override public GkeHubMembershipServiceSettings build() throws IOException { return new GkeHubMembershipServiceSettings(this); diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/gapic_metadata.json b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/gapic_metadata.json index b7d70193..baa8b4e8 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/gapic_metadata.json +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/gapic_metadata.json @@ -11,10 +11,10 @@ "libraryClient": "GkeHubMembershipServiceClient", "rpcs": { "CreateMembership": { - "methods": ["createMembershipAsync", "createMembershipAsync", "createMembershipOperationCallable", "createMembershipCallable"] + "methods": ["createMembershipAsync", "createMembershipAsync", "createMembershipAsync", "createMembershipOperationCallable", "createMembershipCallable"] }, "DeleteMembership": { - "methods": ["deleteMembershipAsync", "deleteMembershipAsync", "deleteMembershipOperationCallable", "deleteMembershipCallable"] + "methods": ["deleteMembershipAsync", "deleteMembershipAsync", "deleteMembershipAsync", "deleteMembershipOperationCallable", "deleteMembershipCallable"] }, "GenerateConnectManifest": { "methods": ["generateConnectManifest", "generateConnectManifestCallable"] @@ -22,14 +22,29 @@ "GenerateExclusivityManifest": { "methods": ["generateExclusivityManifest", "generateExclusivityManifestCallable"] }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, "GetMembership": { - "methods": ["getMembership", "getMembership", "getMembershipCallable"] + "methods": ["getMembership", "getMembership", "getMembership", "getMembershipCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] }, "ListMemberships": { - "methods": ["listMemberships", "listMemberships", "listMembershipsPagedCallable", "listMembershipsCallable"] + "methods": ["listMemberships", "listMemberships", "listMemberships", "listMembershipsPagedCallable", "listMembershipsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] }, "UpdateMembership": { - "methods": ["updateMembershipAsync", "updateMembershipAsync", "updateMembershipOperationCallable", "updateMembershipCallable"] + "methods": ["updateMembershipAsync", "updateMembershipAsync", "updateMembershipAsync", "updateMembershipOperationCallable", "updateMembershipCallable"] }, "ValidateExclusivity": { "methods": ["validateExclusivity", "validateExclusivityCallable"] diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/package-info.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/package-info.java index 8feff9e3..9e99050d 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/package-info.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/package-info.java @@ -38,7 +38,7 @@ * // It may require modifications to work in your environment. * try (GkeHubMembershipServiceClient gkeHubMembershipServiceClient = * GkeHubMembershipServiceClient.create()) { - * String name = "name3373707"; + * MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); * Membership response = gkeHubMembershipServiceClient.getMembership(name); * } * }
diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GkeHubMembershipServiceStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GkeHubMembershipServiceStub.java index b732e267..083b71e1 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GkeHubMembershipServiceStub.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GkeHubMembershipServiceStub.java @@ -16,6 +16,7 @@ package com.google.cloud.gkehub.v1beta1.stub; +import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListLocationsPagedResponse; import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListMembershipsPagedResponse; import com.google.api.core.BetaApi; @@ -36,6 +37,15 @@ import com.google.cloud.gkehub.v1beta1.UpdateMembershipRequest; import com.google.cloud.gkehub.v1beta1.ValidateExclusivityRequest; import com.google.cloud.gkehub.v1beta1.ValidateExclusivityResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -52,7 +62,11 @@ public abstract class GkeHubMembershipServiceStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable @@ -111,6 +125,32 @@ public UnaryCallable updateMembershipCallabl "Not implemented: generateExclusivityManifestCallable()"); } + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GkeHubMembershipServiceStubSettings.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GkeHubMembershipServiceStubSettings.java index 1b1c2629..f8020713 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GkeHubMembershipServiceStubSettings.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GkeHubMembershipServiceStubSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.gkehub.v1beta1.stub; +import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListLocationsPagedResponse; import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListMembershipsPagedResponse; import com.google.api.core.ApiFunction; @@ -28,6 +29,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -58,10 +62,19 @@ import com.google.cloud.gkehub.v1beta1.UpdateMembershipRequest; import com.google.cloud.gkehub.v1beta1.ValidateExclusivityRequest; import com.google.cloud.gkehub.v1beta1.ValidateExclusivityResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; @@ -132,6 +145,14 @@ public class GkeHubMembershipServiceStubSettings private final UnaryCallSettings< GenerateExclusivityManifestRequest, GenerateExclusivityManifestResponse> generateExclusivityManifestSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; private static final PagedListDescriptor< ListMembershipsRequest, ListMembershipsResponse, Membership> @@ -172,6 +193,42 @@ public Iterable extractResources(ListMembershipsResponse payload) { } }; + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + private static final PagedListResponseFactory< ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse> LIST_MEMBERSHIPS_PAGE_STR_FACT = @@ -189,6 +246,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listMemberships. */ public PagedCallSettings< ListMembershipsRequest, ListMembershipsResponse, ListMembershipsPagedResponse> @@ -252,13 +326,44 @@ public UnaryCallSettings updateMembershipSet return generateExclusivityManifestSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + public GkeHubMembershipServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcGkeHubMembershipServiceStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonGkeHubMembershipServiceStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -291,18 +396,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(GkeHubMembershipServiceStubSettings.class)) @@ -310,11 +422,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(GkeHubMembershipServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GkeHubMembershipServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -340,6 +471,11 @@ protected GkeHubMembershipServiceStubSettings(Builder settingsBuilder) throws IO validateExclusivitySettings = settingsBuilder.validateExclusivitySettings().build(); generateExclusivityManifestSettings = settingsBuilder.generateExclusivityManifestSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } /** Builder for GkeHubMembershipServiceStubSettings. */ @@ -372,6 +508,14 @@ public static class Builder private final UnaryCallSettings.Builder< GenerateExclusivityManifestRequest, GenerateExclusivityManifestResponse> generateExclusivityManifestSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -421,6 +565,11 @@ protected Builder(ClientContext clientContext) { generateConnectManifestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); validateExclusivitySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); generateExclusivityManifestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -431,7 +580,12 @@ protected Builder(ClientContext clientContext) { updateMembershipSettings, generateConnectManifestSettings, validateExclusivitySettings, - generateExclusivityManifestSettings); + generateExclusivityManifestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); initDefaults(this); } @@ -450,6 +604,11 @@ protected Builder(GkeHubMembershipServiceStubSettings settings) { validateExclusivitySettings = settings.validateExclusivitySettings.toBuilder(); generateExclusivityManifestSettings = settings.generateExclusivityManifestSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -460,7 +619,12 @@ protected Builder(GkeHubMembershipServiceStubSettings settings) { updateMembershipSettings, generateConnectManifestSettings, validateExclusivitySettings, - generateExclusivityManifestSettings); + generateExclusivityManifestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); } private static Builder createDefault() { @@ -476,6 +640,19 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .listMembershipsSettings() @@ -517,6 +694,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createMembershipOperationSettings() .setInitialCallSettings( @@ -681,6 +883,34 @@ public UnaryCallSettings.Builder getMembership return generateExclusivityManifestSettings; } + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + @Override public GkeHubMembershipServiceStubSettings build() throws IOException { return new GkeHubMembershipServiceStubSettings(this); diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GrpcGkeHubMembershipServiceStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GrpcGkeHubMembershipServiceStub.java index d686125a..0dad32d6 100644 --- a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GrpcGkeHubMembershipServiceStub.java +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/GrpcGkeHubMembershipServiceStub.java @@ -16,6 +16,7 @@ package com.google.cloud.gkehub.v1beta1.stub; +import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListLocationsPagedResponse; import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListMembershipsPagedResponse; import com.google.api.core.BetaApi; @@ -40,7 +41,16 @@ import com.google.cloud.gkehub.v1beta1.UpdateMembershipRequest; import com.google.cloud.gkehub.v1beta1.ValidateExclusivityRequest; import com.google.cloud.gkehub.v1beta1.ValidateExclusivityResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -155,6 +165,52 @@ public class GrpcGkeHubMembershipServiceStub extends GkeHubMembershipServiceStub ProtoUtils.marshaller(GenerateExclusivityManifestResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private final UnaryCallable listMembershipsCallable; private final UnaryCallable @@ -176,6 +232,14 @@ public class GrpcGkeHubMembershipServiceStub extends GkeHubMembershipServiceStub private final UnaryCallable< GenerateExclusivityManifestRequest, GenerateExclusivityManifestResponse> generateExclusivityManifestCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -309,6 +373,57 @@ protected GrpcGkeHubMembershipServiceStub( return params.build(); }) .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); this.listMembershipsCallable = callableFactory.createUnaryCallable( @@ -361,6 +476,26 @@ protected GrpcGkeHubMembershipServiceStub( generateExclusivityManifestTransportSettings, settings.generateExclusivityManifestSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -437,6 +572,38 @@ public UnaryCallable updateMembershipCallabl return generateExclusivityManifestCallable; } + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/HttpJsonGkeHubMembershipServiceCallableFactory.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/HttpJsonGkeHubMembershipServiceCallableFactory.java new file mode 100644 index 00000000..96699b85 --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/HttpJsonGkeHubMembershipServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the GkeHubMembershipService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonGkeHubMembershipServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/HttpJsonGkeHubMembershipServiceStub.java b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/HttpJsonGkeHubMembershipServiceStub.java new file mode 100644 index 00000000..97991786 --- /dev/null +++ b/google-cloud-gkehub/src/main/java/com/google/cloud/gkehub/v1beta1/stub/HttpJsonGkeHubMembershipServiceStub.java @@ -0,0 +1,961 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1beta1.stub; + +import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListMembershipsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gkehub.v1beta1.CreateMembershipRequest; +import com.google.cloud.gkehub.v1beta1.DeleteMembershipRequest; +import com.google.cloud.gkehub.v1beta1.GenerateConnectManifestRequest; +import com.google.cloud.gkehub.v1beta1.GenerateConnectManifestResponse; +import com.google.cloud.gkehub.v1beta1.GenerateExclusivityManifestRequest; +import com.google.cloud.gkehub.v1beta1.GenerateExclusivityManifestResponse; +import com.google.cloud.gkehub.v1beta1.GetMembershipRequest; +import com.google.cloud.gkehub.v1beta1.ListMembershipsRequest; +import com.google.cloud.gkehub.v1beta1.ListMembershipsResponse; +import com.google.cloud.gkehub.v1beta1.Membership; +import com.google.cloud.gkehub.v1beta1.OperationMetadata; +import com.google.cloud.gkehub.v1beta1.UpdateMembershipRequest; +import com.google.cloud.gkehub.v1beta1.ValidateExclusivityRequest; +import com.google.cloud.gkehub.v1beta1.ValidateExclusivityResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the GkeHubMembershipService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonGkeHubMembershipServiceStub extends GkeHubMembershipServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Membership.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listMembershipsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.gkehub.v1beta1.GkeHubMembershipService/ListMemberships") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/memberships", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListMembershipsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.gkehub.v1beta1.GkeHubMembershipService/GetMembership") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/memberships/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Membership.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.gkehub.v1beta1.GkeHubMembershipService/CreateMembership") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/memberships", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "membershipId", request.getMembershipId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateMembershipRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.gkehub.v1beta1.GkeHubMembershipService/DeleteMembership") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/memberships/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteMembershipRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateMembershipMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.gkehub.v1beta1.GkeHubMembershipService/UpdateMembership") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/memberships/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("resource", request.getResource())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateMembershipRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + GenerateConnectManifestRequest, GenerateConnectManifestResponse> + generateConnectManifestMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.gkehub.v1beta1.GkeHubMembershipService/GenerateConnectManifest") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateConnectManifest", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "connectAgent", request.getConnectAgent()); + serializer.putQueryParam( + fields, + "imagePullSecretContent", + request.getImagePullSecretContent()); + serializer.putQueryParam(fields, "isUpgrade", request.getIsUpgrade()); + serializer.putQueryParam(fields, "registry", request.getRegistry()); + serializer.putQueryParam(fields, "version", request.getVersion()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateConnectManifestResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + validateExclusivityMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.gkehub.v1beta1.GkeHubMembershipService/ValidateExclusivity") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/memberships:validateExclusivity", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "crManifest", request.getCrManifest()); + serializer.putQueryParam( + fields, "intendedMembership", request.getIntendedMembership()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ValidateExclusivityResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GenerateExclusivityManifestRequest, GenerateExclusivityManifestResponse> + generateExclusivityManifestMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.gkehub.v1beta1.GkeHubMembershipService/GenerateExclusivityManifest") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateExclusivityManifest", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "crManifest", request.getCrManifest()); + serializer.putQueryParam( + fields, "crdManifest", request.getCrdManifest()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateExclusivityManifestResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/memberships/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/memberships/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/memberships/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listMembershipsCallable; + private final UnaryCallable + listMembershipsPagedCallable; + private final UnaryCallable getMembershipCallable; + private final UnaryCallable createMembershipCallable; + private final OperationCallable + createMembershipOperationCallable; + private final UnaryCallable deleteMembershipCallable; + private final OperationCallable + deleteMembershipOperationCallable; + private final UnaryCallable updateMembershipCallable; + private final OperationCallable + updateMembershipOperationCallable; + private final UnaryCallable + generateConnectManifestCallable; + private final UnaryCallable + validateExclusivityCallable; + private final UnaryCallable< + GenerateExclusivityManifestRequest, GenerateExclusivityManifestResponse> + generateExclusivityManifestCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonGkeHubMembershipServiceStub create( + GkeHubMembershipServiceStubSettings settings) throws IOException { + return new HttpJsonGkeHubMembershipServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonGkeHubMembershipServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonGkeHubMembershipServiceStub( + GkeHubMembershipServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonGkeHubMembershipServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonGkeHubMembershipServiceStub( + GkeHubMembershipServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonGkeHubMembershipServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonGkeHubMembershipServiceStub( + GkeHubMembershipServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonGkeHubMembershipServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonGkeHubMembershipServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonGkeHubMembershipServiceStub( + GkeHubMembershipServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings + listMembershipsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMembershipsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateMembershipTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateMembershipMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateConnectManifestTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateConnectManifestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + validateExclusivityTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(validateExclusivityMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateExclusivityManifestTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(generateExclusivityManifestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listMembershipsCallable = + callableFactory.createUnaryCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.listMembershipsPagedCallable = + callableFactory.createPagedCallable( + listMembershipsTransportSettings, settings.listMembershipsSettings(), clientContext); + this.getMembershipCallable = + callableFactory.createUnaryCallable( + getMembershipTransportSettings, settings.getMembershipSettings(), clientContext); + this.createMembershipCallable = + callableFactory.createUnaryCallable( + createMembershipTransportSettings, settings.createMembershipSettings(), clientContext); + this.createMembershipOperationCallable = + callableFactory.createOperationCallable( + createMembershipTransportSettings, + settings.createMembershipOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteMembershipCallable = + callableFactory.createUnaryCallable( + deleteMembershipTransportSettings, settings.deleteMembershipSettings(), clientContext); + this.deleteMembershipOperationCallable = + callableFactory.createOperationCallable( + deleteMembershipTransportSettings, + settings.deleteMembershipOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateMembershipCallable = + callableFactory.createUnaryCallable( + updateMembershipTransportSettings, settings.updateMembershipSettings(), clientContext); + this.updateMembershipOperationCallable = + callableFactory.createOperationCallable( + updateMembershipTransportSettings, + settings.updateMembershipOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.generateConnectManifestCallable = + callableFactory.createUnaryCallable( + generateConnectManifestTransportSettings, + settings.generateConnectManifestSettings(), + clientContext); + this.validateExclusivityCallable = + callableFactory.createUnaryCallable( + validateExclusivityTransportSettings, + settings.validateExclusivitySettings(), + clientContext); + this.generateExclusivityManifestCallable = + callableFactory.createUnaryCallable( + generateExclusivityManifestTransportSettings, + settings.generateExclusivityManifestSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listMembershipsMethodDescriptor); + methodDescriptors.add(getMembershipMethodDescriptor); + methodDescriptors.add(createMembershipMethodDescriptor); + methodDescriptors.add(deleteMembershipMethodDescriptor); + methodDescriptors.add(updateMembershipMethodDescriptor); + methodDescriptors.add(generateConnectManifestMethodDescriptor); + methodDescriptors.add(validateExclusivityMethodDescriptor); + methodDescriptors.add(generateExclusivityManifestMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listMembershipsCallable() { + return listMembershipsCallable; + } + + @Override + public UnaryCallable + listMembershipsPagedCallable() { + return listMembershipsPagedCallable; + } + + @Override + public UnaryCallable getMembershipCallable() { + return getMembershipCallable; + } + + @Override + public UnaryCallable createMembershipCallable() { + return createMembershipCallable; + } + + @Override + public OperationCallable + createMembershipOperationCallable() { + return createMembershipOperationCallable; + } + + @Override + public UnaryCallable deleteMembershipCallable() { + return deleteMembershipCallable; + } + + @Override + public OperationCallable + deleteMembershipOperationCallable() { + return deleteMembershipOperationCallable; + } + + @Override + public UnaryCallable updateMembershipCallable() { + return updateMembershipCallable; + } + + @Override + public OperationCallable + updateMembershipOperationCallable() { + return updateMembershipOperationCallable; + } + + @Override + public UnaryCallable + generateConnectManifestCallable() { + return generateConnectManifestCallable; + } + + @Override + public UnaryCallable + validateExclusivityCallable() { + return validateExclusivityCallable; + } + + @Override + public UnaryCallable + generateExclusivityManifestCallable() { + return generateExclusivityManifestCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1/GkeHubClientHttpJsonTest.java b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1/GkeHubClientHttpJsonTest.java new file mode 100644 index 00000000..19fa01d5 --- /dev/null +++ b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1/GkeHubClientHttpJsonTest.java @@ -0,0 +1,1242 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1; + +import static com.google.cloud.gkehub.v1.GkeHubClient.ListFeaturesPagedResponse; +import static com.google.cloud.gkehub.v1.GkeHubClient.ListMembershipsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.gkehub.v1.stub.HttpJsonGkeHubStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class GkeHubClientHttpJsonTest { + private static MockHttpService mockService; + private static GkeHubClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonGkeHubStub.getMethodDescriptors(), GkeHubSettings.getDefaultEndpoint()); + GkeHubSettings settings = + GkeHubSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + GkeHubSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GkeHubClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listMembershipsTest() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMembershipsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMembershipsTest2() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMembershipsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFeaturesTest() throws Exception { + Feature responsesElement = Feature.newBuilder().build(); + ListFeaturesResponse expectedResponse = + ListFeaturesResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockService.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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFeaturesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFeaturesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listFeatures(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest() 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(); + mockService.addResponse(expectedResponse); + + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + + Membership actualResponse = client.getMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest2() 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(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + + Membership actualResponse = client.getMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFeatureTest() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .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(); + mockService.addResponse(expectedResponse); + + FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); + + Feature actualResponse = client.getFeature(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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()) + .putAllMembershipSpecs(new HashMap()) + .setState(CommonFeatureState.newBuilder().build()) + .putAllMembershipStates(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + + Feature actualResponse = client.getFeature(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFeatureExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + client.getFeature(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMembershipTest() 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("createMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + + Membership actualResponse = client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createMembershipTest2() 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("createMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + + Membership actualResponse = client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createFeatureTest() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .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(); + mockService.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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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) { + } + } + + @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()) + .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(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Feature resource = Feature.newBuilder().build(); + String featureId = "featureId-420503887"; + + Feature actualResponse = client.createFeatureAsync(parent, resource, featureId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFeatureExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Feature resource = Feature.newBuilder().build(); + String featureId = "featureId-420503887"; + client.createFeatureAsync(parent, resource, featureId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteMembershipTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + + client.deleteMembershipAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + client.deleteMembershipAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteMembershipTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + + client.deleteMembershipAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + client.deleteMembershipAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFeatureTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFeatureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); + + client.deleteFeatureAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); + client.deleteFeatureAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFeatureTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFeatureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + + client.deleteFeatureAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFeatureExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + client.deleteFeatureAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateMembershipTest() 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(); + mockService.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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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) { + } + } + + @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(); + mockService.addResponse(resultOperation); + + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + Membership resource = Membership.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Membership actualResponse = client.updateMembershipAsync(name, resource, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + Membership resource = Membership.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateMembershipAsync(name, resource, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateFeatureTest() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .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(); + mockService.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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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) { + } + } + + @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()) + .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(); + mockService.addResponse(resultOperation); + + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + Feature resource = Feature.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Feature actualResponse = client.updateFeatureAsync(name, resource, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateFeatureExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + Feature resource = Feature.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFeatureAsync(name, resource, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void generateConnectManifestTest() throws Exception { + GenerateConnectManifestResponse expectedResponse = + GenerateConnectManifestResponse.newBuilder() + .addAllManifest(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + GenerateConnectManifestRequest request = + GenerateConnectManifestRequest.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setNamespace("namespace1252218203") + .setProxy(ByteString.EMPTY) + .setVersion("version351608024") + .setIsUpgrade(true) + .setRegistry("registry-690212803") + .setImagePullSecretContent(ByteString.EMPTY) + .build(); + + GenerateConnectManifestResponse actualResponse = client.generateConnectManifest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateConnectManifestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateConnectManifestRequest request = + GenerateConnectManifestRequest.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setNamespace("namespace1252218203") + .setProxy(ByteString.EMPTY) + .setVersion("version351608024") + .setIsUpgrade(true) + .setRegistry("registry-690212803") + .setImagePullSecretContent(ByteString.EMPTY) + .build(); + client.generateConnectManifest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1alpha/GkeHubClientHttpJsonTest.java b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1alpha/GkeHubClientHttpJsonTest.java new file mode 100644 index 00000000..52d855a1 --- /dev/null +++ b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1alpha/GkeHubClientHttpJsonTest.java @@ -0,0 +1,355 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1alpha; + +import static com.google.cloud.gkehub.v1alpha.GkeHubClient.ListFeaturesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.gkehub.v1alpha.stub.HttpJsonGkeHubStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class GkeHubClientHttpJsonTest { + private static MockHttpService mockService; + private static GkeHubClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonGkeHubStub.getMethodDescriptors(), GkeHubSettings.getDefaultEndpoint()); + GkeHubSettings settings = + GkeHubSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + GkeHubSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GkeHubClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listFeaturesTest() throws Exception { + Feature responsesElement = Feature.newBuilder().build(); + ListFeaturesResponse expectedResponse = + ListFeaturesResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFeaturesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listFeatures(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFeatureTest() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .setName("name3373707") + .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(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + + Feature actualResponse = client.getFeature(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + client.getFeature(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFeatureTest() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .setName("name3373707") + .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(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Feature resource = Feature.newBuilder().build(); + String featureId = "featureId-420503887"; + + Feature actualResponse = client.createFeatureAsync(parent, resource, featureId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Feature resource = Feature.newBuilder().build(); + String featureId = "featureId-420503887"; + client.createFeatureAsync(parent, resource, featureId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFeatureTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFeatureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + + client.deleteFeatureAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + client.deleteFeatureAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateFeatureTest() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .setName("name3373707") + .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(); + mockService.addResponse(resultOperation); + + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + Feature resource = Feature.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Feature actualResponse = client.updateFeatureAsync(name, resource, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + Feature resource = Feature.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFeatureAsync(name, resource, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1alpha2/GkeHubClientHttpJsonTest.java b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1alpha2/GkeHubClientHttpJsonTest.java new file mode 100644 index 00000000..f31d7902 --- /dev/null +++ b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1alpha2/GkeHubClientHttpJsonTest.java @@ -0,0 +1,685 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1alpha2; + +import static com.google.cloud.gkehub.v1alpha2.GkeHubClient.ListMembershipsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.gkehub.v1alpha2.stub.HttpJsonGkeHubStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class GkeHubClientHttpJsonTest { + private static MockHttpService mockService; + private static GkeHubClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonGkeHubStub.getMethodDescriptors(), GkeHubSettings.getDefaultEndpoint()); + GkeHubSettings settings = + GkeHubSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + GkeHubSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GkeHubClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listMembershipsTest() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMembershipsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMembershipsTest2() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMembershipsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest() 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") + .setAuthority(Authority.newBuilder().build()) + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + mockService.addResponse(expectedResponse); + + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + + Membership actualResponse = client.getMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest2() 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") + .setAuthority(Authority.newBuilder().build()) + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + + Membership actualResponse = client.getMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMembershipTest() 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") + .setAuthority(Authority.newBuilder().build()) + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + + Membership actualResponse = client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createMembershipTest2() 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") + .setAuthority(Authority.newBuilder().build()) + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + + Membership actualResponse = client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteMembershipTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + + client.deleteMembershipAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + client.deleteMembershipAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteMembershipTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + + client.deleteMembershipAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + client.deleteMembershipAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateMembershipTest() 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") + .setAuthority(Authority.newBuilder().build()) + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + Membership resource = Membership.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Membership actualResponse = client.updateMembershipAsync(name, resource, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + Membership resource = Membership.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateMembershipAsync(name, resource, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void generateConnectManifestTest() throws Exception { + GenerateConnectManifestResponse expectedResponse = + GenerateConnectManifestResponse.newBuilder() + .addAllManifest(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + GenerateConnectManifestRequest request = + GenerateConnectManifestRequest.newBuilder() + .setName("projects/project-883/locations/location-883/memberships/membership-883") + .setNamespace("namespace1252218203") + .setProxy(ByteString.EMPTY) + .setVersion("version351608024") + .setIsUpgrade(true) + .setRegistry("registry-690212803") + .setImagePullSecretContent(ByteString.EMPTY) + .build(); + + GenerateConnectManifestResponse actualResponse = client.generateConnectManifest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateConnectManifestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateConnectManifestRequest request = + GenerateConnectManifestRequest.newBuilder() + .setName("projects/project-883/locations/location-883/memberships/membership-883") + .setNamespace("namespace1252218203") + .setProxy(ByteString.EMPTY) + .setVersion("version351608024") + .setIsUpgrade(true) + .setRegistry("registry-690212803") + .setImagePullSecretContent(ByteString.EMPTY) + .build(); + client.generateConnectManifest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void initializeHubTest() throws Exception { + InitializeHubResponse expectedResponse = + InitializeHubResponse.newBuilder() + .setServiceIdentity("serviceIdentity1094915731") + .setWorkloadIdentityPool("workloadIdentityPool-74620143") + .build(); + mockService.addResponse(expectedResponse); + + InitializeHubRequest request = + InitializeHubRequest.newBuilder() + .setProject("projects/project-5197/locations/global/memberships") + .build(); + + InitializeHubResponse actualResponse = client.initializeHub(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void initializeHubExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InitializeHubRequest request = + InitializeHubRequest.newBuilder() + .setProject("projects/project-5197/locations/global/memberships") + .build(); + client.initializeHub(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta/GkeHubClientHttpJsonTest.java b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta/GkeHubClientHttpJsonTest.java new file mode 100644 index 00000000..45a7a6f0 --- /dev/null +++ b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta/GkeHubClientHttpJsonTest.java @@ -0,0 +1,355 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1beta; + +import static com.google.cloud.gkehub.v1beta.GkeHubClient.ListFeaturesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.gkehub.v1beta.stub.HttpJsonGkeHubStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class GkeHubClientHttpJsonTest { + private static MockHttpService mockService; + private static GkeHubClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonGkeHubStub.getMethodDescriptors(), GkeHubSettings.getDefaultEndpoint()); + GkeHubSettings settings = + GkeHubSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + GkeHubSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GkeHubClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listFeaturesTest() throws Exception { + Feature responsesElement = Feature.newBuilder().build(); + ListFeaturesResponse expectedResponse = + ListFeaturesResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFeaturesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listFeatures(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFeatureTest() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .setName("name3373707") + .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(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + + Feature actualResponse = client.getFeature(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + client.getFeature(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFeatureTest() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .setName("name3373707") + .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(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Feature resource = Feature.newBuilder().build(); + String featureId = "featureId-420503887"; + + Feature actualResponse = client.createFeatureAsync(parent, resource, featureId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Feature resource = Feature.newBuilder().build(); + String featureId = "featureId-420503887"; + client.createFeatureAsync(parent, resource, featureId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFeatureTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFeatureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + + client.deleteFeatureAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + client.deleteFeatureAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateFeatureTest() throws Exception { + Feature expectedResponse = + Feature.newBuilder() + .setName("name3373707") + .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(); + mockService.addResponse(resultOperation); + + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + Feature resource = Feature.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Feature actualResponse = client.updateFeatureAsync(name, resource, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateFeatureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-8365/locations/location-8365/features/feature-8365"; + Feature resource = Feature.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFeatureAsync(name, resource, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClientHttpJsonTest.java b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClientHttpJsonTest.java new file mode 100644 index 00000000..8292510f --- /dev/null +++ b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClientHttpJsonTest.java @@ -0,0 +1,1096 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.gkehub.v1beta1; + +import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListMembershipsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.gkehub.v1beta1.stub.HttpJsonGkeHubMembershipServiceStub; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class GkeHubMembershipServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static GkeHubMembershipServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonGkeHubMembershipServiceStub.getMethodDescriptors(), + GkeHubMembershipServiceSettings.getDefaultEndpoint()); + GkeHubMembershipServiceSettings settings = + GkeHubMembershipServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + GkeHubMembershipServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GkeHubMembershipServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listMembershipsTest() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMembershipsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMembershipsTest2() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMembershipsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(MembershipState.newBuilder().build()) + .setAuthority(Authority.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + mockService.addResponse(expectedResponse); + + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + + Membership actualResponse = client.getMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(MembershipState.newBuilder().build()) + .setAuthority(Authority.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + + Membership actualResponse = client.getMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createMembershipTest() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(MembershipState.newBuilder().build()) + .setAuthority(Authority.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + + Membership actualResponse = client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(MembershipState.newBuilder().build()) + .setAuthority(Authority.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + + Membership actualResponse = client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteMembershipTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + + client.deleteMembershipAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + client.deleteMembershipAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteMembershipTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + + client.deleteMembershipAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + client.deleteMembershipAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateMembershipTest() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(MembershipState.newBuilder().build()) + .setAuthority(Authority.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateMembershipExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.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) { + } + } + + @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()) + .setAuthority(Authority.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + Membership resource = Membership.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Membership actualResponse = client.updateMembershipAsync(name, resource, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateMembershipExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-883/locations/location-883/memberships/membership-883"; + Membership resource = Membership.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateMembershipAsync(name, resource, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void generateConnectManifestTest() throws Exception { + GenerateConnectManifestResponse expectedResponse = + GenerateConnectManifestResponse.newBuilder() + .addAllManifest(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + GenerateConnectManifestRequest request = + GenerateConnectManifestRequest.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setConnectAgent(ConnectAgent.newBuilder().build()) + .setVersion("version351608024") + .setIsUpgrade(true) + .setRegistry("registry-690212803") + .setImagePullSecretContent(ByteString.EMPTY) + .build(); + + GenerateConnectManifestResponse actualResponse = client.generateConnectManifest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateConnectManifestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateConnectManifestRequest request = + GenerateConnectManifestRequest.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setConnectAgent(ConnectAgent.newBuilder().build()) + .setVersion("version351608024") + .setIsUpgrade(true) + .setRegistry("registry-690212803") + .setImagePullSecretContent(ByteString.EMPTY) + .build(); + client.generateConnectManifest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void validateExclusivityTest() throws Exception { + ValidateExclusivityResponse expectedResponse = + ValidateExclusivityResponse.newBuilder().setStatus(Status.newBuilder().build()).build(); + mockService.addResponse(expectedResponse); + + ValidateExclusivityRequest request = + ValidateExclusivityRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setCrManifest("crManifest-1971077186") + .setIntendedMembership("intendedMembership-2074920351") + .build(); + + ValidateExclusivityResponse actualResponse = client.validateExclusivity(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void validateExclusivityExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ValidateExclusivityRequest request = + ValidateExclusivityRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setCrManifest("crManifest-1971077186") + .setIntendedMembership("intendedMembership-2074920351") + .build(); + client.validateExclusivity(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateExclusivityManifestTest() throws Exception { + GenerateExclusivityManifestResponse expectedResponse = + GenerateExclusivityManifestResponse.newBuilder() + .setCrdManifest("crdManifest1401188132") + .setCrManifest("crManifest-1971077186") + .build(); + mockService.addResponse(expectedResponse); + + GenerateExclusivityManifestRequest request = + GenerateExclusivityManifestRequest.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setCrdManifest("crdManifest1401188132") + .setCrManifest("crManifest-1971077186") + .build(); + + GenerateExclusivityManifestResponse actualResponse = + client.generateExclusivityManifest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateExclusivityManifestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateExclusivityManifestRequest request = + GenerateExclusivityManifestRequest.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setCrdManifest("crdManifest1401188132") + .setCrManifest("crManifest-1971077186") + .build(); + client.generateExclusivityManifest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClientTest.java b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClientTest.java index 3b6265c3..dfa6513b 100644 --- a/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClientTest.java +++ b/google-cloud-gkehub/src/test/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceClientTest.java @@ -16,6 +16,7 @@ package com.google.cloud.gkehub.v1beta1; +import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListLocationsPagedResponse; import static com.google.cloud.gkehub.v1beta1.GkeHubMembershipServiceClient.ListMembershipsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -26,7 +27,21 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.MockLocations; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.MockIAMPolicy; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; @@ -54,6 +69,8 @@ @Generated("by gapic-generator-java") public class GkeHubMembershipServiceClientTest { private static MockGkeHubMembershipService mockGkeHubMembershipService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; private GkeHubMembershipServiceClient client; @@ -61,10 +78,13 @@ public class GkeHubMembershipServiceClientTest { @BeforeClass public static void startStaticServer() { mockGkeHubMembershipService = new MockGkeHubMembershipService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList(mockGkeHubMembershipService)); + Arrays.asList( + mockGkeHubMembershipService, mockLocations, mockIAMPolicy)); mockServiceHelper.start(); } @@ -100,6 +120,50 @@ public void listMembershipsTest() throws Exception { .build(); mockGkeHubMembershipService.addResponse(expectedResponse); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourcesList().get(0), resources.get(0)); + + List actualRequests = mockGkeHubMembershipService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMembershipsRequest actualRequest = ((ListMembershipsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMembershipsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHubMembershipService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listMemberships(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMembershipsTest2() throws Exception { + Membership responsesElement = Membership.newBuilder().build(); + ListMembershipsResponse expectedResponse = + ListMembershipsResponse.newBuilder() + .setNextPageToken("") + .addAllResources(Arrays.asList(responsesElement)) + .build(); + mockGkeHubMembershipService.addResponse(expectedResponse); + String parent = "parent-995424086"; ListMembershipsPagedResponse pagedListResponse = client.listMemberships(parent); @@ -121,7 +185,7 @@ public void listMembershipsTest() throws Exception { } @Test - public void listMembershipsExceptionTest() throws Exception { + public void listMembershipsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHubMembershipService.addException(exception); @@ -138,7 +202,55 @@ public void listMembershipsExceptionTest() throws Exception { public void getMembershipTest() throws Exception { Membership expectedResponse = Membership.newBuilder() - .setName("name3373707") + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(MembershipState.newBuilder().build()) + .setAuthority(Authority.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + mockGkeHubMembershipService.addResponse(expectedResponse); + + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + + Membership actualResponse = client.getMembership(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGkeHubMembershipService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMembershipRequest actualRequest = ((GetMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMembershipExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHubMembershipService.addException(exception); + + try { + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + client.getMembership(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .putAllLabels(new HashMap()) .setDescription("description-1724546052") .setState(MembershipState.newBuilder().build()) @@ -169,7 +281,7 @@ public void getMembershipTest() throws Exception { } @Test - public void getMembershipExceptionTest() throws Exception { + public void getMembershipExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHubMembershipService.addException(exception); @@ -186,7 +298,69 @@ public void getMembershipExceptionTest() throws Exception { public void createMembershipTest() throws Exception { Membership expectedResponse = Membership.newBuilder() - .setName("name3373707") + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(MembershipState.newBuilder().build()) + .setAuthority(Authority.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGkeHubMembershipService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + + Membership actualResponse = client.createMembershipAsync(parent, resource, membershipId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGkeHubMembershipService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateMembershipRequest actualRequest = ((CreateMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(membershipId, actualRequest.getMembershipId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createMembershipExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHubMembershipService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Membership resource = Membership.newBuilder().build(); + String membershipId = "membershipId517665681"; + client.createMembershipAsync(parent, resource, membershipId).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 createMembershipTest2() throws Exception { + Membership expectedResponse = + Membership.newBuilder() + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .putAllLabels(new HashMap()) .setDescription("description-1724546052") .setState(MembershipState.newBuilder().build()) @@ -227,7 +401,7 @@ public void createMembershipTest() throws Exception { } @Test - public void createMembershipExceptionTest() throws Exception { + public void createMembershipExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHubMembershipService.addException(exception); @@ -255,6 +429,48 @@ public void deleteMembershipTest() throws Exception { .build(); mockGkeHubMembershipService.addResponse(resultOperation); + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + + client.deleteMembershipAsync(name).get(); + + List actualRequests = mockGkeHubMembershipService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteMembershipRequest actualRequest = ((DeleteMembershipRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteMembershipExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockGkeHubMembershipService.addException(exception); + + try { + MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); + client.deleteMembershipAsync(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 deleteMembershipTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGkeHubMembershipService.addResponse(resultOperation); + String name = "name3373707"; client.deleteMembershipAsync(name).get(); @@ -271,7 +487,7 @@ public void deleteMembershipTest() throws Exception { } @Test - public void deleteMembershipExceptionTest() throws Exception { + public void deleteMembershipExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockGkeHubMembershipService.addException(exception); @@ -290,7 +506,69 @@ public void deleteMembershipExceptionTest() throws Exception { public void updateMembershipTest() throws Exception { Membership expectedResponse = Membership.newBuilder() - .setName("name3373707") + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .setState(MembershipState.newBuilder().build()) + .setAuthority(Authority.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setExternalId("externalId-1699764666") + .setLastConnectionTime(Timestamp.newBuilder().build()) + .setUniqueId("uniqueId-294460212") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateMembershipTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGkeHubMembershipService.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 = mockGkeHubMembershipService.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); + mockGkeHubMembershipService.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()) @@ -331,7 +609,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); mockGkeHubMembershipService.addException(exception); @@ -358,7 +636,7 @@ public void generateConnectManifestTest() throws Exception { GenerateConnectManifestRequest request = GenerateConnectManifestRequest.newBuilder() - .setName("name3373707") + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setConnectAgent(ConnectAgent.newBuilder().build()) .setVersion("version351608024") .setIsUpgrade(true) @@ -395,7 +673,7 @@ public void generateConnectManifestExceptionTest() throws Exception { try { GenerateConnectManifestRequest request = GenerateConnectManifestRequest.newBuilder() - .setName("name3373707") + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setConnectAgent(ConnectAgent.newBuilder().build()) .setVersion("version351608024") .setIsUpgrade(true) @@ -417,7 +695,7 @@ public void validateExclusivityTest() throws Exception { ValidateExclusivityRequest request = ValidateExclusivityRequest.newBuilder() - .setParent("parent-995424086") + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCrManifest("crManifest-1971077186") .setIntendedMembership("intendedMembership-2074920351") .build(); @@ -446,7 +724,7 @@ public void validateExclusivityExceptionTest() throws Exception { try { ValidateExclusivityRequest request = ValidateExclusivityRequest.newBuilder() - .setParent("parent-995424086") + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCrManifest("crManifest-1971077186") .setIntendedMembership("intendedMembership-2074920351") .build(); @@ -468,7 +746,7 @@ public void generateExclusivityManifestTest() throws Exception { GenerateExclusivityManifestRequest request = GenerateExclusivityManifestRequest.newBuilder() - .setName("name3373707") + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setCrdManifest("crdManifest1401188132") .setCrManifest("crManifest-1971077186") .build(); @@ -499,7 +777,7 @@ public void generateExclusivityManifestExceptionTest() throws Exception { try { GenerateExclusivityManifestRequest request = GenerateExclusivityManifestRequest.newBuilder() - .setName("name3373707") + .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setCrdManifest("crdManifest1401188132") .setCrManifest("crManifest-1971077186") .build(); @@ -509,4 +787,253 @@ public void generateExclusivityManifestExceptionTest() throws Exception { // Expected exception. } } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/google-cloud-gkehub/src/test/java/com/google/cloud/location/MockLocations.java b/google-cloud-gkehub/src/test/java/com/google/cloud/location/MockLocations.java new file mode 100644 index 00000000..8ce43edf --- /dev/null +++ b/google-cloud-gkehub/src/test/java/com/google/cloud/location/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.location; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-gkehub/src/test/java/com/google/cloud/location/MockLocationsImpl.java b/google-cloud-gkehub/src/test/java/com/google/cloud/location/MockLocationsImpl.java new file mode 100644 index 00000000..d6b51f13 --- /dev/null +++ b/google-cloud-gkehub/src/test/java/com/google/cloud/location/MockLocationsImpl.java @@ -0,0 +1,101 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.location; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-gkehub/src/test/java/com/google/iam/v1/MockIAMPolicy.java b/google-cloud-gkehub/src/test/java/com/google/iam/v1/MockIAMPolicy.java new file mode 100644 index 00000000..3d785982 --- /dev/null +++ b/google-cloud-gkehub/src/test/java/com/google/iam/v1/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-gkehub/src/test/java/com/google/iam/v1/MockIAMPolicyImpl.java b/google-cloud-gkehub/src/test/java/com/google/iam/v1/MockIAMPolicyImpl.java new file mode 100644 index 00000000..4c1f9e24 --- /dev/null +++ b/google-cloud-gkehub/src/test/java/com/google/iam/v1/MockIAMPolicyImpl.java @@ -0,0 +1,122 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceGrpc.java b/grpc-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceGrpc.java index 3af5e648..fe792c2e 100644 --- a/grpc-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceGrpc.java +++ b/grpc-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeHubMembershipServiceGrpc.java @@ -22,8 +22,7 @@ * *
  * The GKE Hub MembershipService handles the registration of many Kubernetes
- * clusters to Google Cloud, represented with the
- * [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
+ * clusters to Google Cloud, represented with the [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
  * GKE Hub is currently only available in the global region.
  * **Membership management may be non-trivial:** it is recommended to use one
  * of the Google-provided client libraries or tools where possible when working
@@ -477,8 +476,7 @@ public GkeHubMembershipServiceFutureStub newStub(
    *
    * 
    * The GKE Hub MembershipService handles the registration of many Kubernetes
-   * clusters to Google Cloud, represented with the
-   * [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
+   * clusters to Google Cloud, represented with the [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
    * GKE Hub is currently only available in the global region.
    * **Membership management may be non-trivial:** it is recommended to use one
    * of the Google-provided client libraries or tools where possible when working
@@ -686,8 +684,7 @@ public final io.grpc.ServerServiceDefinition bindService() {
    *
    * 
    * The GKE Hub MembershipService handles the registration of many Kubernetes
-   * clusters to Google Cloud, represented with the
-   * [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
+   * clusters to Google Cloud, represented with the [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
    * GKE Hub is currently only available in the global region.
    * **Membership management may be non-trivial:** it is recommended to use one
    * of the Google-provided client libraries or tools where possible when working
@@ -863,8 +860,7 @@ public void generateExclusivityManifest(
    *
    * 
    * The GKE Hub MembershipService handles the registration of many Kubernetes
-   * clusters to Google Cloud, represented with the
-   * [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
+   * clusters to Google Cloud, represented with the [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
    * GKE Hub is currently only available in the global region.
    * **Membership management may be non-trivial:** it is recommended to use one
    * of the Google-provided client libraries or tools where possible when working
@@ -1013,8 +1009,7 @@ public com.google.cloud.gkehub.v1beta1.ValidateExclusivityResponse validateExclu
    *
    * 
    * The GKE Hub MembershipService handles the registration of many Kubernetes
-   * clusters to Google Cloud, represented with the
-   * [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
+   * clusters to Google Cloud, represented with the [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
    * GKE Hub is currently only available in the global region.
    * **Membership management may be non-trivial:** it is recommended to use one
    * of the Google-provided client libraries or tools where possible when working
diff --git a/proto-google-cloud-gkehub-v1beta1/pom.xml b/proto-google-cloud-gkehub-v1beta1/pom.xml
index 5cffdb4e..b9ddb939 100644
--- a/proto-google-cloud-gkehub-v1beta1/pom.xml
+++ b/proto-google-cloud-gkehub-v1beta1/pom.xml
@@ -21,6 +21,14 @@
       com.google.api.grpc
       proto-google-common-protos
     
+    
+      com.google.guava
+      guava
+    
+    
+      com.google.api
+      api-common
+    
   
 
   
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ApplianceCluster.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ApplianceCluster.java
new file mode 100644
index 00000000..cc34983a
--- /dev/null
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ApplianceCluster.java
@@ -0,0 +1,653 @@
+/*
+ * 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/v1beta1/membership.proto
+
+package com.google.cloud.gkehub.v1beta1;
+
+/**
+ *
+ *
+ * 
+ * ApplianceCluster contains information specific to GDC Edge Appliance
+ * Clusters.
+ * 
+ * + * Protobuf type {@code google.cloud.gkehub.v1beta1.ApplianceCluster} + */ +public final class ApplianceCluster extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkehub.v1beta1.ApplianceCluster) + ApplianceClusterOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApplianceCluster.newBuilder() to construct. + private ApplianceCluster(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ApplianceCluster() { + resourceLink_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ApplianceCluster(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ApplianceCluster( + 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(); + + resourceLink_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1beta1.ApplianceCluster.class, + com.google.cloud.gkehub.v1beta1.ApplianceCluster.Builder.class); + } + + public static final int RESOURCE_LINK_FIELD_NUMBER = 1; + private volatile java.lang.Object resourceLink_; + /** + * + * + *
+   * Immutable. Self-link of the GCP resource for the Appliance Cluster. For
+   * example:
+   * //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
+   * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The resourceLink. + */ + @java.lang.Override + public java.lang.String getResourceLink() { + java.lang.Object ref = resourceLink_; + 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(); + resourceLink_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Self-link of the GCP resource for the Appliance Cluster. For
+   * example:
+   * //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
+   * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for resourceLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceLinkBytes() { + java.lang.Object ref = resourceLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceLink_ = 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(resourceLink_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceLink_); + } + 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(resourceLink_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceLink_); + } + 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.v1beta1.ApplianceCluster)) { + return super.equals(obj); + } + com.google.cloud.gkehub.v1beta1.ApplianceCluster other = + (com.google.cloud.gkehub.v1beta1.ApplianceCluster) obj; + + if (!getResourceLink().equals(other.getResourceLink())) 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) + RESOURCE_LINK_FIELD_NUMBER; + hash = (53 * hash) + getResourceLink().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkehub.v1beta1.ApplianceCluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1beta1.ApplianceCluster 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.v1beta1.ApplianceCluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1beta1.ApplianceCluster 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.v1beta1.ApplianceCluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1beta1.ApplianceCluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkehub.v1beta1.ApplianceCluster parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1beta1.ApplianceCluster 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.v1beta1.ApplianceCluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1beta1.ApplianceCluster 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.v1beta1.ApplianceCluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1beta1.ApplianceCluster 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.v1beta1.ApplianceCluster 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; + } + /** + * + * + *
+   * ApplianceCluster contains information specific to GDC Edge Appliance
+   * Clusters.
+   * 
+ * + * Protobuf type {@code google.cloud.gkehub.v1beta1.ApplianceCluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkehub.v1beta1.ApplianceCluster) + com.google.cloud.gkehub.v1beta1.ApplianceClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkehub.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1beta1.ApplianceCluster.class, + com.google.cloud.gkehub.v1beta1.ApplianceCluster.Builder.class); + } + + // Construct using com.google.cloud.gkehub.v1beta1.ApplianceCluster.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(); + resourceLink_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkehub.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.ApplianceCluster getDefaultInstanceForType() { + return com.google.cloud.gkehub.v1beta1.ApplianceCluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.ApplianceCluster build() { + com.google.cloud.gkehub.v1beta1.ApplianceCluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.ApplianceCluster buildPartial() { + com.google.cloud.gkehub.v1beta1.ApplianceCluster result = + new com.google.cloud.gkehub.v1beta1.ApplianceCluster(this); + result.resourceLink_ = resourceLink_; + 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.v1beta1.ApplianceCluster) { + return mergeFrom((com.google.cloud.gkehub.v1beta1.ApplianceCluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gkehub.v1beta1.ApplianceCluster other) { + if (other == com.google.cloud.gkehub.v1beta1.ApplianceCluster.getDefaultInstance()) + return this; + if (!other.getResourceLink().isEmpty()) { + resourceLink_ = other.resourceLink_; + 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.v1beta1.ApplianceCluster parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gkehub.v1beta1.ApplianceCluster) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object resourceLink_ = ""; + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Appliance Cluster. For
+     * example:
+     * //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The resourceLink. + */ + public java.lang.String getResourceLink() { + java.lang.Object ref = resourceLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Appliance Cluster. For
+     * example:
+     * //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for resourceLink. + */ + public com.google.protobuf.ByteString getResourceLinkBytes() { + java.lang.Object ref = resourceLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Appliance Cluster. For
+     * example:
+     * //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The resourceLink to set. + * @return This builder for chaining. + */ + public Builder setResourceLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceLink_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Appliance Cluster. For
+     * example:
+     * //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearResourceLink() { + + resourceLink_ = getDefaultInstance().getResourceLink(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Appliance Cluster. For
+     * example:
+     * //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for resourceLink to set. + * @return This builder for chaining. + */ + public Builder setResourceLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceLink_ = 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.v1beta1.ApplianceCluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkehub.v1beta1.ApplianceCluster) + private static final com.google.cloud.gkehub.v1beta1.ApplianceCluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gkehub.v1beta1.ApplianceCluster(); + } + + public static com.google.cloud.gkehub.v1beta1.ApplianceCluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApplianceCluster parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ApplianceCluster(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.v1beta1.ApplianceCluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ApplianceClusterOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ApplianceClusterOrBuilder.java new file mode 100644 index 00000000..3af3d421 --- /dev/null +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ApplianceClusterOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gkehub/v1beta1/membership.proto + +package com.google.cloud.gkehub.v1beta1; + +public interface ApplianceClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkehub.v1beta1.ApplianceCluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Self-link of the GCP resource for the Appliance Cluster. For
+   * example:
+   * //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
+   * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The resourceLink. + */ + java.lang.String getResourceLink(); + /** + * + * + *
+   * Immutable. Self-link of the GCP resource for the Appliance Cluster. For
+   * example:
+   * //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
+   * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for resourceLink. + */ + com.google.protobuf.ByteString getResourceLinkBytes(); +} diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/Authority.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/Authority.java index c84fb032..d6e045fd 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/Authority.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/Authority.java @@ -143,8 +143,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
-   * `https://` and be a valid URL with length <2000 characters.
+   * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
+   * be a valid URL with length <2000 characters.
    * If set, then Google will allow valid OIDC tokens from this issuer to
    * authenticate within the workload_identity_pool. OIDC discovery will be
    * performed on this URI to validate tokens from the issuer.
@@ -173,8 +173,8 @@ public java.lang.String getIssuer() {
    *
    *
    * 
-   * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
-   * `https://` and be a valid URL with length <2000 characters.
+   * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
+   * be a valid URL with length <2000 characters.
    * If set, then Google will allow valid OIDC tokens from this issuer to
    * authenticate within the workload_identity_pool. OIDC discovery will be
    * performed on this URI to validate tokens from the issuer.
@@ -206,8 +206,8 @@ public com.google.protobuf.ByteString getIssuerBytes() {
    *
    *
    * 
-   * Output only. The name of the workload identity pool in which `issuer` will
-   * be recognized.
+   * Output only. The name of the workload identity pool in which `issuer` will be
+   * recognized.
    * There is a single Workload Identity Pool per Hub that is shared
    * between all Memberships that belong to that Hub. For a Hub hosted in
    * {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
@@ -234,8 +234,8 @@ public java.lang.String getWorkloadIdentityPool() {
    *
    *
    * 
-   * Output only. The name of the workload identity pool in which `issuer` will
-   * be recognized.
+   * Output only. The name of the workload identity pool in which `issuer` will be
+   * recognized.
    * There is a single Workload Identity Pool per Hub that is shared
    * between all Memberships that belong to that Hub. For a Hub hosted in
    * {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
@@ -265,8 +265,8 @@ public com.google.protobuf.ByteString getWorkloadIdentityPoolBytes() {
    *
    *
    * 
-   * Output only. An identity provider that reflects the `issuer` in the
-   * workload identity pool.
+   * Output only. An identity provider that reflects the `issuer` in the workload identity
+   * pool.
    * 
* * string identity_provider = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -289,8 +289,8 @@ public java.lang.String getIdentityProvider() { * * *
-   * Output only. An identity provider that reflects the `issuer` in the
-   * workload identity pool.
+   * Output only. An identity provider that reflects the `issuer` in the workload identity
+   * pool.
    * 
* * string identity_provider = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -316,8 +316,7 @@ public com.google.protobuf.ByteString getIdentityProviderBytes() { * * *
-   * Optional. OIDC verification keys for this Membership in JWKS format (RFC
-   * 7517).
+   * Optional. OIDC verification keys for this Membership in JWKS format (RFC 7517).
    * When this field is set, OIDC discovery will NOT be performed on `issuer`,
    * and instead OIDC tokens will be validated using this field.
    * 
@@ -701,8 +700,8 @@ public Builder mergeFrom( * * *
-     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
-     * `https://` and be a valid URL with length <2000 characters.
+     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
+     * be a valid URL with length <2000 characters.
      * If set, then Google will allow valid OIDC tokens from this issuer to
      * authenticate within the workload_identity_pool. OIDC discovery will be
      * performed on this URI to validate tokens from the issuer.
@@ -730,8 +729,8 @@ public java.lang.String getIssuer() {
      *
      *
      * 
-     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
-     * `https://` and be a valid URL with length <2000 characters.
+     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
+     * be a valid URL with length <2000 characters.
      * If set, then Google will allow valid OIDC tokens from this issuer to
      * authenticate within the workload_identity_pool. OIDC discovery will be
      * performed on this URI to validate tokens from the issuer.
@@ -759,8 +758,8 @@ public com.google.protobuf.ByteString getIssuerBytes() {
      *
      *
      * 
-     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
-     * `https://` and be a valid URL with length <2000 characters.
+     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
+     * be a valid URL with length <2000 characters.
      * If set, then Google will allow valid OIDC tokens from this issuer to
      * authenticate within the workload_identity_pool. OIDC discovery will be
      * performed on this URI to validate tokens from the issuer.
@@ -787,8 +786,8 @@ public Builder setIssuer(java.lang.String value) {
      *
      *
      * 
-     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
-     * `https://` and be a valid URL with length <2000 characters.
+     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
+     * be a valid URL with length <2000 characters.
      * If set, then Google will allow valid OIDC tokens from this issuer to
      * authenticate within the workload_identity_pool. OIDC discovery will be
      * performed on this URI to validate tokens from the issuer.
@@ -811,8 +810,8 @@ public Builder clearIssuer() {
      *
      *
      * 
-     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
-     * `https://` and be a valid URL with length <2000 characters.
+     * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
+     * be a valid URL with length <2000 characters.
      * If set, then Google will allow valid OIDC tokens from this issuer to
      * authenticate within the workload_identity_pool. OIDC discovery will be
      * performed on this URI to validate tokens from the issuer.
@@ -842,8 +841,8 @@ public Builder setIssuerBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * Output only. The name of the workload identity pool in which `issuer` will
-     * be recognized.
+     * Output only. The name of the workload identity pool in which `issuer` will be
+     * recognized.
      * There is a single Workload Identity Pool per Hub that is shared
      * between all Memberships that belong to that Hub. For a Hub hosted in
      * {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
@@ -869,8 +868,8 @@ public java.lang.String getWorkloadIdentityPool() {
      *
      *
      * 
-     * Output only. The name of the workload identity pool in which `issuer` will
-     * be recognized.
+     * Output only. The name of the workload identity pool in which `issuer` will be
+     * recognized.
      * There is a single Workload Identity Pool per Hub that is shared
      * between all Memberships that belong to that Hub. For a Hub hosted in
      * {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
@@ -896,8 +895,8 @@ public com.google.protobuf.ByteString getWorkloadIdentityPoolBytes() {
      *
      *
      * 
-     * Output only. The name of the workload identity pool in which `issuer` will
-     * be recognized.
+     * Output only. The name of the workload identity pool in which `issuer` will be
+     * recognized.
      * There is a single Workload Identity Pool per Hub that is shared
      * between all Memberships that belong to that Hub. For a Hub hosted in
      * {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
@@ -922,8 +921,8 @@ public Builder setWorkloadIdentityPool(java.lang.String value) {
      *
      *
      * 
-     * Output only. The name of the workload identity pool in which `issuer` will
-     * be recognized.
+     * Output only. The name of the workload identity pool in which `issuer` will be
+     * recognized.
      * There is a single Workload Identity Pool per Hub that is shared
      * between all Memberships that belong to that Hub. For a Hub hosted in
      * {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
@@ -944,8 +943,8 @@ public Builder clearWorkloadIdentityPool() {
      *
      *
      * 
-     * Output only. The name of the workload identity pool in which `issuer` will
-     * be recognized.
+     * Output only. The name of the workload identity pool in which `issuer` will be
+     * recognized.
      * There is a single Workload Identity Pool per Hub that is shared
      * between all Memberships that belong to that Hub. For a Hub hosted in
      * {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
@@ -973,8 +972,8 @@ public Builder setWorkloadIdentityPoolBytes(com.google.protobuf.ByteString value
      *
      *
      * 
-     * Output only. An identity provider that reflects the `issuer` in the
-     * workload identity pool.
+     * Output only. An identity provider that reflects the `issuer` in the workload identity
+     * pool.
      * 
* * string identity_provider = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -996,8 +995,8 @@ public java.lang.String getIdentityProvider() { * * *
-     * Output only. An identity provider that reflects the `issuer` in the
-     * workload identity pool.
+     * Output only. An identity provider that reflects the `issuer` in the workload identity
+     * pool.
      * 
* * string identity_provider = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1019,8 +1018,8 @@ public com.google.protobuf.ByteString getIdentityProviderBytes() { * * *
-     * Output only. An identity provider that reflects the `issuer` in the
-     * workload identity pool.
+     * Output only. An identity provider that reflects the `issuer` in the workload identity
+     * pool.
      * 
* * string identity_provider = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1041,8 +1040,8 @@ public Builder setIdentityProvider(java.lang.String value) { * * *
-     * Output only. An identity provider that reflects the `issuer` in the
-     * workload identity pool.
+     * Output only. An identity provider that reflects the `issuer` in the workload identity
+     * pool.
      * 
* * string identity_provider = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1059,8 +1058,8 @@ public Builder clearIdentityProvider() { * * *
-     * Output only. An identity provider that reflects the `issuer` in the
-     * workload identity pool.
+     * Output only. An identity provider that reflects the `issuer` in the workload identity
+     * pool.
      * 
* * string identity_provider = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1084,8 +1083,7 @@ public Builder setIdentityProviderBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. OIDC verification keys for this Membership in JWKS format (RFC
-     * 7517).
+     * Optional. OIDC verification keys for this Membership in JWKS format (RFC 7517).
      * When this field is set, OIDC discovery will NOT be performed on `issuer`,
      * and instead OIDC tokens will be validated using this field.
      * 
@@ -1102,8 +1100,7 @@ public com.google.protobuf.ByteString getOidcJwks() { * * *
-     * Optional. OIDC verification keys for this Membership in JWKS format (RFC
-     * 7517).
+     * Optional. OIDC verification keys for this Membership in JWKS format (RFC 7517).
      * When this field is set, OIDC discovery will NOT be performed on `issuer`,
      * and instead OIDC tokens will be validated using this field.
      * 
@@ -1126,8 +1123,7 @@ public Builder setOidcJwks(com.google.protobuf.ByteString value) { * * *
-     * Optional. OIDC verification keys for this Membership in JWKS format (RFC
-     * 7517).
+     * Optional. OIDC verification keys for this Membership in JWKS format (RFC 7517).
      * When this field is set, OIDC discovery will NOT be performed on `issuer`,
      * and instead OIDC tokens will be validated using this field.
      * 
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/AuthorityOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/AuthorityOrBuilder.java index 2036889b..38c85133 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/AuthorityOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/AuthorityOrBuilder.java @@ -27,8 +27,8 @@ public interface AuthorityOrBuilder * * *
-   * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
-   * `https://` and be a valid URL with length <2000 characters.
+   * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
+   * be a valid URL with length <2000 characters.
    * If set, then Google will allow valid OIDC tokens from this issuer to
    * authenticate within the workload_identity_pool. OIDC discovery will be
    * performed on this URI to validate tokens from the issuer.
@@ -46,8 +46,8 @@ public interface AuthorityOrBuilder
    *
    *
    * 
-   * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
-   * `https://` and be a valid URL with length <2000 characters.
+   * Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
+   * be a valid URL with length <2000 characters.
    * If set, then Google will allow valid OIDC tokens from this issuer to
    * authenticate within the workload_identity_pool. OIDC discovery will be
    * performed on this URI to validate tokens from the issuer.
@@ -66,8 +66,8 @@ public interface AuthorityOrBuilder
    *
    *
    * 
-   * Output only. The name of the workload identity pool in which `issuer` will
-   * be recognized.
+   * Output only. The name of the workload identity pool in which `issuer` will be
+   * recognized.
    * There is a single Workload Identity Pool per Hub that is shared
    * between all Memberships that belong to that Hub. For a Hub hosted in
    * {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
@@ -83,8 +83,8 @@ public interface AuthorityOrBuilder
    *
    *
    * 
-   * Output only. The name of the workload identity pool in which `issuer` will
-   * be recognized.
+   * Output only. The name of the workload identity pool in which `issuer` will be
+   * recognized.
    * There is a single Workload Identity Pool per Hub that is shared
    * between all Memberships that belong to that Hub. For a Hub hosted in
    * {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
@@ -101,8 +101,8 @@ public interface AuthorityOrBuilder
    *
    *
    * 
-   * Output only. An identity provider that reflects the `issuer` in the
-   * workload identity pool.
+   * Output only. An identity provider that reflects the `issuer` in the workload identity
+   * pool.
    * 
* * string identity_provider = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -114,8 +114,8 @@ public interface AuthorityOrBuilder * * *
-   * Output only. An identity provider that reflects the `issuer` in the
-   * workload identity pool.
+   * Output only. An identity provider that reflects the `issuer` in the workload identity
+   * pool.
    * 
* * string identity_provider = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -128,8 +128,7 @@ public interface AuthorityOrBuilder * * *
-   * Optional. OIDC verification keys for this Membership in JWKS format (RFC
-   * 7517).
+   * Optional. OIDC verification keys for this Membership in JWKS format (RFC 7517).
    * When this field is set, OIDC discovery will NOT be performed on `issuer`,
    * and instead OIDC tokens will be validated using this field.
    * 
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ConnectAgent.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ConnectAgent.java index 73a9ba51..57735a37 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ConnectAgent.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ConnectAgent.java @@ -139,7 +139,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * string name = 1 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.ConnectAgent.name is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=724 + * google/cloud/gkehub/v1beta1/membership.proto;l=773 * @return The name. */ @java.lang.Override @@ -165,7 +165,7 @@ public java.lang.String getName() { * string name = 1 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.ConnectAgent.name is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=724 + * google/cloud/gkehub/v1beta1/membership.proto;l=773 * @return The bytes for name. */ @java.lang.Override @@ -188,9 +188,9 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Optional. URI of a proxy if connectivity from the agent to
-   * gkeconnect.googleapis.com requires the use of a proxy. Format must be in
-   * the form `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
+   * Optional. URI of a proxy if connectivity from the agent to gkeconnect.googleapis.com
+   * requires the use of a proxy. Format must be in the form
+   * `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
    * supported by the proxy. This will direct the connect agent's outbound
    * traffic through a HTTP(S) proxy.
    * 
@@ -210,8 +210,7 @@ public com.google.protobuf.ByteString getProxy() { * * *
-   * Optional. Namespace for GKE Connect agent resources. Defaults to
-   * `gke-connect`.
+   * Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
    * The Connect Agent is authorized automatically when run in the default
    * namespace. Otherwise, explicit authorization must be granted with an
    * additional IAM binding.
@@ -237,8 +236,7 @@ public java.lang.String getNamespace() {
    *
    *
    * 
-   * Optional. Namespace for GKE Connect agent resources. Defaults to
-   * `gke-connect`.
+   * Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
    * The Connect Agent is authorized automatically when run in the default
    * namespace. Otherwise, explicit authorization must be granted with an
    * additional IAM binding.
@@ -619,7 +617,7 @@ public Builder mergeFrom(
      * string name = 1 [deprecated = true];
      *
      * @deprecated google.cloud.gkehub.v1beta1.ConnectAgent.name is deprecated. See
-     *     google/cloud/gkehub/v1beta1/membership.proto;l=724
+     *     google/cloud/gkehub/v1beta1/membership.proto;l=773
      * @return The name.
      */
     @java.lang.Deprecated
@@ -644,7 +642,7 @@ public java.lang.String getName() {
      * string name = 1 [deprecated = true];
      *
      * @deprecated google.cloud.gkehub.v1beta1.ConnectAgent.name is deprecated. See
-     *     google/cloud/gkehub/v1beta1/membership.proto;l=724
+     *     google/cloud/gkehub/v1beta1/membership.proto;l=773
      * @return The bytes for name.
      */
     @java.lang.Deprecated
@@ -669,7 +667,7 @@ public com.google.protobuf.ByteString getNameBytes() {
      * string name = 1 [deprecated = true];
      *
      * @deprecated google.cloud.gkehub.v1beta1.ConnectAgent.name is deprecated. See
-     *     google/cloud/gkehub/v1beta1/membership.proto;l=724
+     *     google/cloud/gkehub/v1beta1/membership.proto;l=773
      * @param value The name to set.
      * @return This builder for chaining.
      */
@@ -693,7 +691,7 @@ public Builder setName(java.lang.String value) {
      * string name = 1 [deprecated = true];
      *
      * @deprecated google.cloud.gkehub.v1beta1.ConnectAgent.name is deprecated. See
-     *     google/cloud/gkehub/v1beta1/membership.proto;l=724
+     *     google/cloud/gkehub/v1beta1/membership.proto;l=773
      * @return This builder for chaining.
      */
     @java.lang.Deprecated
@@ -713,7 +711,7 @@ public Builder clearName() {
      * string name = 1 [deprecated = true];
      *
      * @deprecated google.cloud.gkehub.v1beta1.ConnectAgent.name is deprecated. See
-     *     google/cloud/gkehub/v1beta1/membership.proto;l=724
+     *     google/cloud/gkehub/v1beta1/membership.proto;l=773
      * @param value The bytes for name to set.
      * @return This builder for chaining.
      */
@@ -734,9 +732,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * Optional. URI of a proxy if connectivity from the agent to
-     * gkeconnect.googleapis.com requires the use of a proxy. Format must be in
-     * the form `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
+     * Optional. URI of a proxy if connectivity from the agent to gkeconnect.googleapis.com
+     * requires the use of a proxy. Format must be in the form
+     * `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
      * supported by the proxy. This will direct the connect agent's outbound
      * traffic through a HTTP(S) proxy.
      * 
@@ -753,9 +751,9 @@ public com.google.protobuf.ByteString getProxy() { * * *
-     * Optional. URI of a proxy if connectivity from the agent to
-     * gkeconnect.googleapis.com requires the use of a proxy. Format must be in
-     * the form `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
+     * Optional. URI of a proxy if connectivity from the agent to gkeconnect.googleapis.com
+     * requires the use of a proxy. Format must be in the form
+     * `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
      * supported by the proxy. This will direct the connect agent's outbound
      * traffic through a HTTP(S) proxy.
      * 
@@ -778,9 +776,9 @@ public Builder setProxy(com.google.protobuf.ByteString value) { * * *
-     * Optional. URI of a proxy if connectivity from the agent to
-     * gkeconnect.googleapis.com requires the use of a proxy. Format must be in
-     * the form `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
+     * Optional. URI of a proxy if connectivity from the agent to gkeconnect.googleapis.com
+     * requires the use of a proxy. Format must be in the form
+     * `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
      * supported by the proxy. This will direct the connect agent's outbound
      * traffic through a HTTP(S) proxy.
      * 
@@ -801,8 +799,7 @@ public Builder clearProxy() { * * *
-     * Optional. Namespace for GKE Connect agent resources. Defaults to
-     * `gke-connect`.
+     * Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
      * The Connect Agent is authorized automatically when run in the default
      * namespace. Otherwise, explicit authorization must be granted with an
      * additional IAM binding.
@@ -827,8 +824,7 @@ public java.lang.String getNamespace() {
      *
      *
      * 
-     * Optional. Namespace for GKE Connect agent resources. Defaults to
-     * `gke-connect`.
+     * Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
      * The Connect Agent is authorized automatically when run in the default
      * namespace. Otherwise, explicit authorization must be granted with an
      * additional IAM binding.
@@ -853,8 +849,7 @@ public com.google.protobuf.ByteString getNamespaceBytes() {
      *
      *
      * 
-     * Optional. Namespace for GKE Connect agent resources. Defaults to
-     * `gke-connect`.
+     * Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
      * The Connect Agent is authorized automatically when run in the default
      * namespace. Otherwise, explicit authorization must be granted with an
      * additional IAM binding.
@@ -878,8 +873,7 @@ public Builder setNamespace(java.lang.String value) {
      *
      *
      * 
-     * Optional. Namespace for GKE Connect agent resources. Defaults to
-     * `gke-connect`.
+     * Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
      * The Connect Agent is authorized automatically when run in the default
      * namespace. Otherwise, explicit authorization must be granted with an
      * additional IAM binding.
@@ -899,8 +893,7 @@ public Builder clearNamespace() {
      *
      *
      * 
-     * Optional. Namespace for GKE Connect agent resources. Defaults to
-     * `gke-connect`.
+     * Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
      * The Connect Agent is authorized automatically when run in the default
      * namespace. Otherwise, explicit authorization must be granted with an
      * additional IAM binding.
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ConnectAgentOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ConnectAgentOrBuilder.java
index 2faa9909..4e56e9b9 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ConnectAgentOrBuilder.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ConnectAgentOrBuilder.java
@@ -33,7 +33,7 @@ public interface ConnectAgentOrBuilder
    * string name = 1 [deprecated = true];
    *
    * @deprecated google.cloud.gkehub.v1beta1.ConnectAgent.name is deprecated. See
-   *     google/cloud/gkehub/v1beta1/membership.proto;l=724
+   *     google/cloud/gkehub/v1beta1/membership.proto;l=773
    * @return The name.
    */
   @java.lang.Deprecated
@@ -48,7 +48,7 @@ public interface ConnectAgentOrBuilder
    * string name = 1 [deprecated = true];
    *
    * @deprecated google.cloud.gkehub.v1beta1.ConnectAgent.name is deprecated. See
-   *     google/cloud/gkehub/v1beta1/membership.proto;l=724
+   *     google/cloud/gkehub/v1beta1/membership.proto;l=773
    * @return The bytes for name.
    */
   @java.lang.Deprecated
@@ -58,9 +58,9 @@ public interface ConnectAgentOrBuilder
    *
    *
    * 
-   * Optional. URI of a proxy if connectivity from the agent to
-   * gkeconnect.googleapis.com requires the use of a proxy. Format must be in
-   * the form `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
+   * Optional. URI of a proxy if connectivity from the agent to gkeconnect.googleapis.com
+   * requires the use of a proxy. Format must be in the form
+   * `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
    * supported by the proxy. This will direct the connect agent's outbound
    * traffic through a HTTP(S) proxy.
    * 
@@ -75,8 +75,7 @@ public interface ConnectAgentOrBuilder * * *
-   * Optional. Namespace for GKE Connect agent resources. Defaults to
-   * `gke-connect`.
+   * Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
    * The Connect Agent is authorized automatically when run in the default
    * namespace. Otherwise, explicit authorization must be granted with an
    * additional IAM binding.
@@ -91,8 +90,7 @@ public interface ConnectAgentOrBuilder
    *
    *
    * 
-   * Optional. Namespace for GKE Connect agent resources. Defaults to
-   * `gke-connect`.
+   * Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
    * The Connect Agent is authorized automatically when run in the default
    * namespace. Otherwise, explicit authorization must be granted with an
    * additional IAM binding.
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/CreateMembershipRequest.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/CreateMembershipRequest.java
index e5f70a19..e2e6703d 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/CreateMembershipRequest.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/CreateMembershipRequest.java
@@ -151,11 +151,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    *
    *
    * 
-   * Required. The parent (project and location) where the Memberships will be
-   * created. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be created.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -175,11 +177,13 @@ public java.lang.String getParent() { * * *
-   * Required. The parent (project and location) where the Memberships will be
-   * created. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be created.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -202,8 +206,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-   * Required. Client chosen ID for the membership. `membership_id` must be a
-   * valid RFC 1123 compliant DNS label:
+   * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
+   * 1123 compliant DNS label:
    *   1. At most 63 characters in length
    *   2. It must consist of lower case alphanumeric characters or `-`
    *   3. It must start and end with an alphanumeric character
@@ -231,8 +235,8 @@ public java.lang.String getMembershipId() {
    *
    *
    * 
-   * Required. Client chosen ID for the membership. `membership_id` must be a
-   * valid RFC 1123 compliant DNS label:
+   * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
+   * 1123 compliant DNS label:
    *   1. At most 63 characters in length
    *   2. It must consist of lower case alphanumeric characters or `-`
    *   3. It must start and end with an alphanumeric character
@@ -764,11 +768,13 @@ public Builder mergeFrom(
      *
      *
      * 
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -787,11 +793,13 @@ public java.lang.String getParent() { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -810,11 +818,13 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The parent to set. * @return This builder for chaining. @@ -832,11 +842,13 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -850,11 +862,13 @@ public Builder clearParent() { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for parent to set. * @return This builder for chaining. @@ -875,8 +889,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. Client chosen ID for the membership. `membership_id` must be a
-     * valid RFC 1123 compliant DNS label:
+     * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
+     * 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
      *   3. It must start and end with an alphanumeric character
@@ -903,8 +917,8 @@ public java.lang.String getMembershipId() {
      *
      *
      * 
-     * Required. Client chosen ID for the membership. `membership_id` must be a
-     * valid RFC 1123 compliant DNS label:
+     * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
+     * 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
      *   3. It must start and end with an alphanumeric character
@@ -931,8 +945,8 @@ public com.google.protobuf.ByteString getMembershipIdBytes() {
      *
      *
      * 
-     * Required. Client chosen ID for the membership. `membership_id` must be a
-     * valid RFC 1123 compliant DNS label:
+     * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
+     * 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
      *   3. It must start and end with an alphanumeric character
@@ -958,8 +972,8 @@ public Builder setMembershipId(java.lang.String value) {
      *
      *
      * 
-     * Required. Client chosen ID for the membership. `membership_id` must be a
-     * valid RFC 1123 compliant DNS label:
+     * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
+     * 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
      *   3. It must start and end with an alphanumeric character
@@ -981,8 +995,8 @@ public Builder clearMembershipId() {
      *
      *
      * 
-     * Required. Client chosen ID for the membership. `membership_id` must be a
-     * valid RFC 1123 compliant DNS label:
+     * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
+     * 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
      *   3. It must start and end with an alphanumeric character
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/CreateMembershipRequestOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/CreateMembershipRequestOrBuilder.java
index 0cf40bf0..9e6a45e2 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/CreateMembershipRequestOrBuilder.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/CreateMembershipRequestOrBuilder.java
@@ -27,11 +27,13 @@ public interface CreateMembershipRequestOrBuilder
    *
    *
    * 
-   * Required. The parent (project and location) where the Memberships will be
-   * created. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be created.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -40,11 +42,13 @@ public interface CreateMembershipRequestOrBuilder * * *
-   * Required. The parent (project and location) where the Memberships will be
-   * created. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be created.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -54,8 +58,8 @@ public interface CreateMembershipRequestOrBuilder * * *
-   * Required. Client chosen ID for the membership. `membership_id` must be a
-   * valid RFC 1123 compliant DNS label:
+   * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
+   * 1123 compliant DNS label:
    *   1. At most 63 characters in length
    *   2. It must consist of lower case alphanumeric characters or `-`
    *   3. It must start and end with an alphanumeric character
@@ -72,8 +76,8 @@ public interface CreateMembershipRequestOrBuilder
    *
    *
    * 
-   * Required. Client chosen ID for the membership. `membership_id` must be a
-   * valid RFC 1123 compliant DNS label:
+   * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
+   * 1123 compliant DNS label:
    *   1. At most 63 characters in length
    *   2. It must consist of lower case alphanumeric characters or `-`
    *   3. It must start and end with an alphanumeric character
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/DeleteMembershipRequest.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/DeleteMembershipRequest.java
index 9769815a..cd9919b8 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/DeleteMembershipRequest.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/DeleteMembershipRequest.java
@@ -131,7 +131,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. */ @@ -155,7 +157,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. */ @@ -585,7 +589,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. */ @@ -608,7 +614,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. */ @@ -631,7 +639,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. @@ -653,7 +663,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. */ @@ -671,7 +683,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-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/DeleteMembershipRequestOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/DeleteMembershipRequestOrBuilder.java index 4f82c3ce..32b47e8c 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/DeleteMembershipRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/DeleteMembershipRequestOrBuilder.java @@ -31,7 +31,9 @@ public interface DeleteMembershipRequestOrBuilder * `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 DeleteMembershipRequestOrBuilder * `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-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/EdgeCluster.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/EdgeCluster.java new file mode 100644 index 00000000..f208b763 --- /dev/null +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/EdgeCluster.java @@ -0,0 +1,650 @@ +/* + * 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/v1beta1/membership.proto + +package com.google.cloud.gkehub.v1beta1; + +/** + * + * + *
+ * EdgeCluster contains information specific to Google Edge Clusters.
+ * 
+ * + * Protobuf type {@code google.cloud.gkehub.v1beta1.EdgeCluster} + */ +public final class EdgeCluster extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkehub.v1beta1.EdgeCluster) + EdgeClusterOrBuilder { + private static final long serialVersionUID = 0L; + // Use EdgeCluster.newBuilder() to construct. + private EdgeCluster(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EdgeCluster() { + resourceLink_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EdgeCluster(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EdgeCluster( + 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(); + + resourceLink_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1beta1.EdgeCluster.class, + com.google.cloud.gkehub.v1beta1.EdgeCluster.Builder.class); + } + + public static final int RESOURCE_LINK_FIELD_NUMBER = 1; + private volatile java.lang.Object resourceLink_; + /** + * + * + *
+   * Immutable. Self-link of the GCP resource for the Edge Cluster. For
+   * example:
+   * //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+   * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The resourceLink. + */ + @java.lang.Override + public java.lang.String getResourceLink() { + java.lang.Object ref = resourceLink_; + 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(); + resourceLink_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Self-link of the GCP resource for the Edge Cluster. For
+   * example:
+   * //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+   * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for resourceLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceLinkBytes() { + java.lang.Object ref = resourceLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceLink_ = 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(resourceLink_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceLink_); + } + 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(resourceLink_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceLink_); + } + 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.v1beta1.EdgeCluster)) { + return super.equals(obj); + } + com.google.cloud.gkehub.v1beta1.EdgeCluster other = + (com.google.cloud.gkehub.v1beta1.EdgeCluster) obj; + + if (!getResourceLink().equals(other.getResourceLink())) 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) + RESOURCE_LINK_FIELD_NUMBER; + hash = (53 * hash) + getResourceLink().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkehub.v1beta1.EdgeCluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1beta1.EdgeCluster 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.v1beta1.EdgeCluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1beta1.EdgeCluster 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.v1beta1.EdgeCluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkehub.v1beta1.EdgeCluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkehub.v1beta1.EdgeCluster parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1beta1.EdgeCluster 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.v1beta1.EdgeCluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1beta1.EdgeCluster 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.v1beta1.EdgeCluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkehub.v1beta1.EdgeCluster 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.v1beta1.EdgeCluster 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; + } + /** + * + * + *
+   * EdgeCluster contains information specific to Google Edge Clusters.
+   * 
+ * + * Protobuf type {@code google.cloud.gkehub.v1beta1.EdgeCluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkehub.v1beta1.EdgeCluster) + com.google.cloud.gkehub.v1beta1.EdgeClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkehub.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkehub.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkehub.v1beta1.EdgeCluster.class, + com.google.cloud.gkehub.v1beta1.EdgeCluster.Builder.class); + } + + // Construct using com.google.cloud.gkehub.v1beta1.EdgeCluster.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(); + resourceLink_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkehub.v1beta1.MembershipOuterClass + .internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.EdgeCluster getDefaultInstanceForType() { + return com.google.cloud.gkehub.v1beta1.EdgeCluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.EdgeCluster build() { + com.google.cloud.gkehub.v1beta1.EdgeCluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.EdgeCluster buildPartial() { + com.google.cloud.gkehub.v1beta1.EdgeCluster result = + new com.google.cloud.gkehub.v1beta1.EdgeCluster(this); + result.resourceLink_ = resourceLink_; + 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.v1beta1.EdgeCluster) { + return mergeFrom((com.google.cloud.gkehub.v1beta1.EdgeCluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gkehub.v1beta1.EdgeCluster other) { + if (other == com.google.cloud.gkehub.v1beta1.EdgeCluster.getDefaultInstance()) return this; + if (!other.getResourceLink().isEmpty()) { + resourceLink_ = other.resourceLink_; + 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.v1beta1.EdgeCluster parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gkehub.v1beta1.EdgeCluster) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object resourceLink_ = ""; + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Edge Cluster. For
+     * example:
+     * //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The resourceLink. + */ + public java.lang.String getResourceLink() { + java.lang.Object ref = resourceLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Edge Cluster. For
+     * example:
+     * //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for resourceLink. + */ + public com.google.protobuf.ByteString getResourceLinkBytes() { + java.lang.Object ref = resourceLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Edge Cluster. For
+     * example:
+     * //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The resourceLink to set. + * @return This builder for chaining. + */ + public Builder setResourceLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceLink_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Edge Cluster. For
+     * example:
+     * //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearResourceLink() { + + resourceLink_ = getDefaultInstance().getResourceLink(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Self-link of the GCP resource for the Edge Cluster. For
+     * example:
+     * //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+     * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for resourceLink to set. + * @return This builder for chaining. + */ + public Builder setResourceLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceLink_ = 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.v1beta1.EdgeCluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkehub.v1beta1.EdgeCluster) + private static final com.google.cloud.gkehub.v1beta1.EdgeCluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gkehub.v1beta1.EdgeCluster(); + } + + public static com.google.cloud.gkehub.v1beta1.EdgeCluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EdgeCluster parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EdgeCluster(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.v1beta1.EdgeCluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/EdgeClusterOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/EdgeClusterOrBuilder.java new file mode 100644 index 00000000..15ae48a9 --- /dev/null +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/EdgeClusterOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gkehub/v1beta1/membership.proto + +package com.google.cloud.gkehub.v1beta1; + +public interface EdgeClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkehub.v1beta1.EdgeCluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Self-link of the GCP resource for the Edge Cluster. For
+   * example:
+   * //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+   * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The resourceLink. + */ + java.lang.String getResourceLink(); + /** + * + * + *
+   * Immutable. Self-link of the GCP resource for the Edge Cluster. For
+   * example:
+   * //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
+   * 
+ * + * string resource_link = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for resourceLink. + */ + com.google.protobuf.ByteString getResourceLinkBytes(); +} diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateConnectManifestRequest.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateConnectManifestRequest.java index 5b4736c0..7ffca0f5 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateConnectManifestRequest.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateConnectManifestRequest.java @@ -165,11 +165,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The Membership resource name the Agent will associate with, in
-   * the format `projects/*/locations/*/memberships/*`.
+   * 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) = { ... } + * * * @return The name. */ @@ -189,11 +191,13 @@ public java.lang.String getName() { * * *
-   * Required. The Membership resource name the Agent will associate with, in
-   * the format `projects/*/locations/*/memberships/*`.
+   * 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) = { ... } + * * * @return The bytes for name. */ @@ -270,8 +274,7 @@ public com.google.cloud.gkehub.v1beta1.ConnectAgentOrBuilder getConnectAgentOrBu * * *
-   * Optional. The Connect agent version to use. Defaults to the most current
-   * version.
+   * Optional. The Connect agent version to use. Defaults to the most current version.
    * 
* * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -294,8 +297,7 @@ public java.lang.String getVersion() { * * *
-   * Optional. The Connect agent version to use. Defaults to the most current
-   * version.
+   * Optional. The Connect agent version to use. Defaults to the most current version.
    * 
* * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -822,11 +824,13 @@ public Builder mergeFrom( * * *
-     * Required. The Membership resource name the Agent will associate with, in
-     * the format `projects/*/locations/*/memberships/*`.
+     * 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) = { ... } + * * * @return The name. */ @@ -845,11 +849,13 @@ public java.lang.String getName() { * * *
-     * Required. The Membership resource name the Agent will associate with, in
-     * the format `projects/*/locations/*/memberships/*`.
+     * 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) = { ... } + * * * @return The bytes for name. */ @@ -868,11 +874,13 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The Membership resource name the Agent will associate with, in
-     * the format `projects/*/locations/*/memberships/*`.
+     * 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) = { ... } + * * * @param value The name to set. * @return This builder for chaining. @@ -890,11 +898,13 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The Membership resource name the Agent will associate with, in
-     * the format `projects/*/locations/*/memberships/*`.
+     * 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) = { ... } + * * * @return This builder for chaining. */ @@ -908,11 +918,13 @@ public Builder clearName() { * * *
-     * Required. The Membership resource name the Agent will associate with, in
-     * the format `projects/*/locations/*/memberships/*`.
+     * 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) = { ... } + * * * @param value The bytes for name to set. * @return This builder for chaining. @@ -1137,8 +1149,7 @@ public com.google.cloud.gkehub.v1beta1.ConnectAgentOrBuilder getConnectAgentOrBu * * *
-     * Optional. The Connect agent version to use. Defaults to the most current
-     * version.
+     * Optional. The Connect agent version to use. Defaults to the most current version.
      * 
* * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1160,8 +1171,7 @@ public java.lang.String getVersion() { * * *
-     * Optional. The Connect agent version to use. Defaults to the most current
-     * version.
+     * Optional. The Connect agent version to use. Defaults to the most current version.
      * 
* * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1183,8 +1193,7 @@ public com.google.protobuf.ByteString getVersionBytes() { * * *
-     * Optional. The Connect agent version to use. Defaults to the most current
-     * version.
+     * Optional. The Connect agent version to use. Defaults to the most current version.
      * 
* * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1205,8 +1214,7 @@ public Builder setVersion(java.lang.String value) { * * *
-     * Optional. The Connect agent version to use. Defaults to the most current
-     * version.
+     * Optional. The Connect agent version to use. Defaults to the most current version.
      * 
* * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -1223,8 +1231,7 @@ public Builder clearVersion() { * * *
-     * Optional. The Connect agent version to use. Defaults to the most current
-     * version.
+     * Optional. The Connect agent version to use. Defaults to the most current version.
      * 
* * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateConnectManifestRequestOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateConnectManifestRequestOrBuilder.java index 8ed1997a..429bab42 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateConnectManifestRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateConnectManifestRequestOrBuilder.java @@ -27,11 +27,13 @@ public interface GenerateConnectManifestRequestOrBuilder * * *
-   * Required. The Membership resource name the Agent will associate with, in
-   * the format `projects/*/locations/*/memberships/*`.
+   * 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) = { ... } + * * * @return The name. */ @@ -40,11 +42,13 @@ public interface GenerateConnectManifestRequestOrBuilder * * *
-   * Required. The Membership resource name the Agent will associate with, in
-   * the format `projects/*/locations/*/memberships/*`.
+   * 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) = { ... } + * * * @return The bytes for name. */ @@ -95,8 +99,7 @@ public interface GenerateConnectManifestRequestOrBuilder * * *
-   * Optional. The Connect agent version to use. Defaults to the most current
-   * version.
+   * Optional. The Connect agent version to use. Defaults to the most current version.
    * 
* * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; @@ -108,8 +111,7 @@ public interface GenerateConnectManifestRequestOrBuilder * * *
-   * Optional. The Connect agent version to use. Defaults to the most current
-   * version.
+   * Optional. The Connect agent version to use. Defaults to the most current version.
    * 
* * string version = 3 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateExclusivityManifestRequest.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateExclusivityManifestRequest.java index 15a6ae8c..3879a3bf 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateExclusivityManifestRequest.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateExclusivityManifestRequest.java @@ -140,7 +140,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. */ @@ -164,7 +166,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. */ @@ -655,7 +659,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. */ @@ -678,7 +684,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. */ @@ -701,7 +709,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. @@ -723,7 +733,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. */ @@ -741,7 +753,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-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateExclusivityManifestRequestOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateExclusivityManifestRequestOrBuilder.java index d5018eb8..e822a556 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateExclusivityManifestRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GenerateExclusivityManifestRequestOrBuilder.java @@ -31,7 +31,9 @@ public interface GenerateExclusivityManifestRequestOrBuilder * `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 GenerateExclusivityManifestRequestOrBuilder * `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-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GetMembershipRequest.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GetMembershipRequest.java index 911d234b..e9bc5d44 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GetMembershipRequest.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GetMembershipRequest.java @@ -123,7 +123,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. */ @@ -147,7 +149,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. */ @@ -491,7 +495,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. */ @@ -514,7 +520,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. */ @@ -537,7 +545,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. @@ -559,7 +569,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. */ @@ -577,7 +589,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-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GetMembershipRequestOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GetMembershipRequestOrBuilder.java index 15b2c8f2..e382a7ad 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GetMembershipRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GetMembershipRequestOrBuilder.java @@ -31,7 +31,9 @@ public interface GetMembershipRequestOrBuilder * `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 GetMembershipRequestOrBuilder * `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-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeCluster.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeCluster.java index 164f116c..215c78e5 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeCluster.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeCluster.java @@ -177,8 +177,8 @@ public com.google.protobuf.ByteString getResourceLinkBytes() { * * *
-   * Output only. If cluster_missing is set then it denotes that the GKE cluster
-   * no longer exists in the GKE Control Plane.
+   * Output only. If cluster_missing is set then it denotes that the GKE cluster no longer
+   * exists in the GKE Control Plane.
    * 
* * bool cluster_missing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -642,8 +642,8 @@ public Builder setResourceLinkBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. If cluster_missing is set then it denotes that the GKE cluster
-     * no longer exists in the GKE Control Plane.
+     * Output only. If cluster_missing is set then it denotes that the GKE cluster no longer
+     * exists in the GKE Control Plane.
      * 
* * bool cluster_missing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -658,8 +658,8 @@ public boolean getClusterMissing() { * * *
-     * Output only. If cluster_missing is set then it denotes that the GKE cluster
-     * no longer exists in the GKE Control Plane.
+     * Output only. If cluster_missing is set then it denotes that the GKE cluster no longer
+     * exists in the GKE Control Plane.
      * 
* * bool cluster_missing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -677,8 +677,8 @@ public Builder setClusterMissing(boolean value) { * * *
-     * Output only. If cluster_missing is set then it denotes that the GKE cluster
-     * no longer exists in the GKE Control Plane.
+     * Output only. If cluster_missing is set then it denotes that the GKE cluster no longer
+     * exists in the GKE Control Plane.
      * 
* * bool cluster_missing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeClusterOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeClusterOrBuilder.java index a0b8de55..483e6599 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeClusterOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/GkeClusterOrBuilder.java @@ -56,8 +56,8 @@ public interface GkeClusterOrBuilder * * *
-   * Output only. If cluster_missing is set then it denotes that the GKE cluster
-   * no longer exists in the GKE Control Plane.
+   * Output only. If cluster_missing is set then it denotes that the GKE cluster no longer
+   * exists in the GKE Control Plane.
    * 
* * bool cluster_missing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesMetadata.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesMetadata.java index f4d3356e..37df8a16 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesMetadata.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesMetadata.java @@ -158,8 +158,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Output only. Kubernetes API server version string as reported by
-   * '/version'.
+   * Output only. Kubernetes API server version string as reported by '/version'.
    * 
* * string kubernetes_api_server_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -183,8 +182,7 @@ public java.lang.String getKubernetesApiServerVersion() { * * *
-   * Output only. Kubernetes API server version string as reported by
-   * '/version'.
+   * Output only. Kubernetes API server version string as reported by '/version'.
    * 
* * string kubernetes_api_server_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -211,9 +209,9 @@ public com.google.protobuf.ByteString getKubernetesApiServerVersionBytes() { * * *
-   * Output only. Node providerID as reported by the first node in the list of
-   * nodes on the Kubernetes endpoint. On Kubernetes platforms that support
-   * zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
+   * Output only. Node providerID as reported by the first node in the list of nodes on
+   * the Kubernetes endpoint. On Kubernetes platforms that support zero-node
+   * clusters (like GKE-on-GCP), the node_count will be zero and the
    * node_provider_id will be empty.
    * 
* @@ -237,9 +235,9 @@ public java.lang.String getNodeProviderId() { * * *
-   * Output only. Node providerID as reported by the first node in the list of
-   * nodes on the Kubernetes endpoint. On Kubernetes platforms that support
-   * zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
+   * Output only. Node providerID as reported by the first node in the list of nodes on
+   * the Kubernetes endpoint. On Kubernetes platforms that support zero-node
+   * clusters (like GKE-on-GCP), the node_count will be zero and the
    * node_provider_id will be empty.
    * 
* @@ -302,8 +300,8 @@ public int getVcpuCount() { * * *
-   * Output only. The total memory capacity as reported by the sum of all
-   * Kubernetes nodes resources, defined in MB.
+   * Output only. The total memory capacity as reported by the sum of all Kubernetes nodes
+   * resources, defined in MB.
    * 
* * int32 memory_mb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -321,9 +319,9 @@ public int getMemoryMb() { * * *
-   * Output only. The time at which these details were last updated. This
-   * update_time is different from the Membership-level update_time since
-   * EndpointDetails are updated internally for API consumers.
+   * Output only. The time at which these details were last updated. This update_time is
+   * different from the Membership-level update_time since EndpointDetails are
+   * updated internally for API consumers.
    * 
* * @@ -340,9 +338,9 @@ public boolean hasUpdateTime() { * * *
-   * Output only. The time at which these details were last updated. This
-   * update_time is different from the Membership-level update_time since
-   * EndpointDetails are updated internally for API consumers.
+   * Output only. The time at which these details were last updated. This update_time is
+   * different from the Membership-level update_time since EndpointDetails are
+   * updated internally for API consumers.
    * 
* * @@ -359,9 +357,9 @@ public com.google.protobuf.Timestamp getUpdateTime() { * * *
-   * Output only. The time at which these details were last updated. This
-   * update_time is different from the Membership-level update_time since
-   * EndpointDetails are updated internally for API consumers.
+   * Output only. The time at which these details were last updated. This update_time is
+   * different from the Membership-level update_time since EndpointDetails are
+   * updated internally for API consumers.
    * 
* * @@ -788,8 +786,7 @@ public Builder mergeFrom( * * *
-     * Output only. Kubernetes API server version string as reported by
-     * '/version'.
+     * Output only. Kubernetes API server version string as reported by '/version'.
      * 
* * string kubernetes_api_server_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -812,8 +809,7 @@ public java.lang.String getKubernetesApiServerVersion() { * * *
-     * Output only. Kubernetes API server version string as reported by
-     * '/version'.
+     * Output only. Kubernetes API server version string as reported by '/version'.
      * 
* * string kubernetes_api_server_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -836,8 +832,7 @@ public com.google.protobuf.ByteString getKubernetesApiServerVersionBytes() { * * *
-     * Output only. Kubernetes API server version string as reported by
-     * '/version'.
+     * Output only. Kubernetes API server version string as reported by '/version'.
      * 
* * string kubernetes_api_server_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -859,8 +854,7 @@ public Builder setKubernetesApiServerVersion(java.lang.String value) { * * *
-     * Output only. Kubernetes API server version string as reported by
-     * '/version'.
+     * Output only. Kubernetes API server version string as reported by '/version'.
      * 
* * string kubernetes_api_server_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -878,8 +872,7 @@ public Builder clearKubernetesApiServerVersion() { * * *
-     * Output only. Kubernetes API server version string as reported by
-     * '/version'.
+     * Output only. Kubernetes API server version string as reported by '/version'.
      * 
* * string kubernetes_api_server_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -904,9 +897,9 @@ public Builder setKubernetesApiServerVersionBytes(com.google.protobuf.ByteString * * *
-     * Output only. Node providerID as reported by the first node in the list of
-     * nodes on the Kubernetes endpoint. On Kubernetes platforms that support
-     * zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
+     * Output only. Node providerID as reported by the first node in the list of nodes on
+     * the Kubernetes endpoint. On Kubernetes platforms that support zero-node
+     * clusters (like GKE-on-GCP), the node_count will be zero and the
      * node_provider_id will be empty.
      * 
* @@ -929,9 +922,9 @@ public java.lang.String getNodeProviderId() { * * *
-     * Output only. Node providerID as reported by the first node in the list of
-     * nodes on the Kubernetes endpoint. On Kubernetes platforms that support
-     * zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
+     * Output only. Node providerID as reported by the first node in the list of nodes on
+     * the Kubernetes endpoint. On Kubernetes platforms that support zero-node
+     * clusters (like GKE-on-GCP), the node_count will be zero and the
      * node_provider_id will be empty.
      * 
* @@ -954,9 +947,9 @@ public com.google.protobuf.ByteString getNodeProviderIdBytes() { * * *
-     * Output only. Node providerID as reported by the first node in the list of
-     * nodes on the Kubernetes endpoint. On Kubernetes platforms that support
-     * zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
+     * Output only. Node providerID as reported by the first node in the list of nodes on
+     * the Kubernetes endpoint. On Kubernetes platforms that support zero-node
+     * clusters (like GKE-on-GCP), the node_count will be zero and the
      * node_provider_id will be empty.
      * 
* @@ -978,9 +971,9 @@ public Builder setNodeProviderId(java.lang.String value) { * * *
-     * Output only. Node providerID as reported by the first node in the list of
-     * nodes on the Kubernetes endpoint. On Kubernetes platforms that support
-     * zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
+     * Output only. Node providerID as reported by the first node in the list of nodes on
+     * the Kubernetes endpoint. On Kubernetes platforms that support zero-node
+     * clusters (like GKE-on-GCP), the node_count will be zero and the
      * node_provider_id will be empty.
      * 
* @@ -998,9 +991,9 @@ public Builder clearNodeProviderId() { * * *
-     * Output only. Node providerID as reported by the first node in the list of
-     * nodes on the Kubernetes endpoint. On Kubernetes platforms that support
-     * zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
+     * Output only. Node providerID as reported by the first node in the list of nodes on
+     * the Kubernetes endpoint. On Kubernetes platforms that support zero-node
+     * clusters (like GKE-on-GCP), the node_count will be zero and the
      * node_provider_id will be empty.
      * 
* @@ -1129,8 +1122,8 @@ public Builder clearVcpuCount() { * * *
-     * Output only. The total memory capacity as reported by the sum of all
-     * Kubernetes nodes resources, defined in MB.
+     * Output only. The total memory capacity as reported by the sum of all Kubernetes nodes
+     * resources, defined in MB.
      * 
* * int32 memory_mb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1145,8 +1138,8 @@ public int getMemoryMb() { * * *
-     * Output only. The total memory capacity as reported by the sum of all
-     * Kubernetes nodes resources, defined in MB.
+     * Output only. The total memory capacity as reported by the sum of all Kubernetes nodes
+     * resources, defined in MB.
      * 
* * int32 memory_mb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1164,8 +1157,8 @@ public Builder setMemoryMb(int value) { * * *
-     * Output only. The total memory capacity as reported by the sum of all
-     * Kubernetes nodes resources, defined in MB.
+     * Output only. The total memory capacity as reported by the sum of all Kubernetes nodes
+     * resources, defined in MB.
      * 
* * int32 memory_mb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1189,9 +1182,9 @@ public Builder clearMemoryMb() { * * *
-     * Output only. The time at which these details were last updated. This
-     * update_time is different from the Membership-level update_time since
-     * EndpointDetails are updated internally for API consumers.
+     * Output only. The time at which these details were last updated. This update_time is
+     * different from the Membership-level update_time since EndpointDetails are
+     * updated internally for API consumers.
      * 
* * @@ -1207,9 +1200,9 @@ public boolean hasUpdateTime() { * * *
-     * Output only. The time at which these details were last updated. This
-     * update_time is different from the Membership-level update_time since
-     * EndpointDetails are updated internally for API consumers.
+     * Output only. The time at which these details were last updated. This update_time is
+     * different from the Membership-level update_time since EndpointDetails are
+     * updated internally for API consumers.
      * 
* * @@ -1231,9 +1224,9 @@ public com.google.protobuf.Timestamp getUpdateTime() { * * *
-     * Output only. The time at which these details were last updated. This
-     * update_time is different from the Membership-level update_time since
-     * EndpointDetails are updated internally for API consumers.
+     * Output only. The time at which these details were last updated. This update_time is
+     * different from the Membership-level update_time since EndpointDetails are
+     * updated internally for API consumers.
      * 
* * @@ -1257,9 +1250,9 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. The time at which these details were last updated. This
-     * update_time is different from the Membership-level update_time since
-     * EndpointDetails are updated internally for API consumers.
+     * Output only. The time at which these details were last updated. This update_time is
+     * different from the Membership-level update_time since EndpointDetails are
+     * updated internally for API consumers.
      * 
* * @@ -1280,9 +1273,9 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal * * *
-     * Output only. The time at which these details were last updated. This
-     * update_time is different from the Membership-level update_time since
-     * EndpointDetails are updated internally for API consumers.
+     * Output only. The time at which these details were last updated. This update_time is
+     * different from the Membership-level update_time since EndpointDetails are
+     * updated internally for API consumers.
      * 
* * @@ -1308,9 +1301,9 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. The time at which these details were last updated. This
-     * update_time is different from the Membership-level update_time since
-     * EndpointDetails are updated internally for API consumers.
+     * Output only. The time at which these details were last updated. This update_time is
+     * different from the Membership-level update_time since EndpointDetails are
+     * updated internally for API consumers.
      * 
* * @@ -1332,9 +1325,9 @@ public Builder clearUpdateTime() { * * *
-     * Output only. The time at which these details were last updated. This
-     * update_time is different from the Membership-level update_time since
-     * EndpointDetails are updated internally for API consumers.
+     * Output only. The time at which these details were last updated. This update_time is
+     * different from the Membership-level update_time since EndpointDetails are
+     * updated internally for API consumers.
      * 
* * @@ -1350,9 +1343,9 @@ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { * * *
-     * Output only. The time at which these details were last updated. This
-     * update_time is different from the Membership-level update_time since
-     * EndpointDetails are updated internally for API consumers.
+     * Output only. The time at which these details were last updated. This update_time is
+     * different from the Membership-level update_time since EndpointDetails are
+     * updated internally for API consumers.
      * 
* * @@ -1372,9 +1365,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * * *
-     * Output only. The time at which these details were last updated. This
-     * update_time is different from the Membership-level update_time since
-     * EndpointDetails are updated internally for API consumers.
+     * Output only. The time at which these details were last updated. This update_time is
+     * different from the Membership-level update_time since EndpointDetails are
+     * updated internally for API consumers.
      * 
* * diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesMetadataOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesMetadataOrBuilder.java index e77aa81d..85cfbd24 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesMetadataOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesMetadataOrBuilder.java @@ -27,8 +27,7 @@ public interface KubernetesMetadataOrBuilder * * *
-   * Output only. Kubernetes API server version string as reported by
-   * '/version'.
+   * Output only. Kubernetes API server version string as reported by '/version'.
    * 
* * string kubernetes_api_server_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -41,8 +40,7 @@ public interface KubernetesMetadataOrBuilder * * *
-   * Output only. Kubernetes API server version string as reported by
-   * '/version'.
+   * Output only. Kubernetes API server version string as reported by '/version'.
    * 
* * string kubernetes_api_server_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -56,9 +54,9 @@ public interface KubernetesMetadataOrBuilder * * *
-   * Output only. Node providerID as reported by the first node in the list of
-   * nodes on the Kubernetes endpoint. On Kubernetes platforms that support
-   * zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
+   * Output only. Node providerID as reported by the first node in the list of nodes on
+   * the Kubernetes endpoint. On Kubernetes platforms that support zero-node
+   * clusters (like GKE-on-GCP), the node_count will be zero and the
    * node_provider_id will be empty.
    * 
* @@ -71,9 +69,9 @@ public interface KubernetesMetadataOrBuilder * * *
-   * Output only. Node providerID as reported by the first node in the list of
-   * nodes on the Kubernetes endpoint. On Kubernetes platforms that support
-   * zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
+   * Output only. Node providerID as reported by the first node in the list of nodes on
+   * the Kubernetes endpoint. On Kubernetes platforms that support zero-node
+   * clusters (like GKE-on-GCP), the node_count will be zero and the
    * node_provider_id will be empty.
    * 
* @@ -113,8 +111,8 @@ public interface KubernetesMetadataOrBuilder * * *
-   * Output only. The total memory capacity as reported by the sum of all
-   * Kubernetes nodes resources, defined in MB.
+   * Output only. The total memory capacity as reported by the sum of all Kubernetes nodes
+   * resources, defined in MB.
    * 
* * int32 memory_mb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -127,9 +125,9 @@ public interface KubernetesMetadataOrBuilder * * *
-   * Output only. The time at which these details were last updated. This
-   * update_time is different from the Membership-level update_time since
-   * EndpointDetails are updated internally for API consumers.
+   * Output only. The time at which these details were last updated. This update_time is
+   * different from the Membership-level update_time since EndpointDetails are
+   * updated internally for API consumers.
    * 
* * @@ -143,9 +141,9 @@ public interface KubernetesMetadataOrBuilder * * *
-   * Output only. The time at which these details were last updated. This
-   * update_time is different from the Membership-level update_time since
-   * EndpointDetails are updated internally for API consumers.
+   * Output only. The time at which these details were last updated. This update_time is
+   * different from the Membership-level update_time since EndpointDetails are
+   * updated internally for API consumers.
    * 
* * @@ -159,9 +157,9 @@ public interface KubernetesMetadataOrBuilder * * *
-   * Output only. The time at which these details were last updated. This
-   * update_time is different from the Membership-level update_time since
-   * EndpointDetails are updated internally for API consumers.
+   * Output only. The time at which these details were last updated. This update_time is
+   * different from the Membership-level update_time since EndpointDetails are
+   * updated internally for API consumers.
    * 
* * diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesResource.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesResource.java index e36f77d0..4c429440 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesResource.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesResource.java @@ -172,8 +172,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input only. The YAML representation of the Membership CR. This field is
-   * ignored for GKE clusters where Hub can read the CR directly.
+   * 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
@@ -200,8 +200,8 @@ public 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.
+   * 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
@@ -231,8 +231,8 @@ public 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.
+   * 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
@@ -253,8 +253,8 @@ public 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.
+   * 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
@@ -275,8 +275,8 @@ public 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.
+   * 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
@@ -296,8 +296,8 @@ public int getMembershipResourcesCount() {
    *
    *
    * 
-   * Output only. Additional Kubernetes resources that need to be applied to the
-   * cluster after Membership creation, and after every update.
+   * 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
@@ -317,8 +317,8 @@ public com.google.cloud.gkehub.v1beta1.ResourceManifest getMembershipResources(i
    *
    *
    * 
-   * Output only. Additional Kubernetes resources that need to be applied to the
-   * cluster after Membership creation, and after every update.
+   * 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
@@ -962,8 +962,8 @@ public Builder mergeFrom(
      *
      *
      * 
-     * Input only. The YAML representation of the Membership CR. This field is
-     * ignored for GKE clusters where Hub can read the CR directly.
+     * 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
@@ -989,8 +989,8 @@ public 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.
+     * 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
@@ -1016,8 +1016,8 @@ public com.google.protobuf.ByteString getMembershipCrManifestBytes() {
      *
      *
      * 
-     * Input only. The YAML representation of the Membership CR. This field is
-     * ignored for GKE clusters where Hub can read the CR directly.
+     * 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
@@ -1042,8 +1042,8 @@ public Builder setMembershipCrManifest(java.lang.String value) {
      *
      *
      * 
-     * Input only. The YAML representation of the Membership CR. This field is
-     * ignored for GKE clusters where Hub can read the CR directly.
+     * 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
@@ -1064,8 +1064,8 @@ public Builder clearMembershipCrManifest() {
      *
      *
      * 
-     * Input only. The YAML representation of the Membership CR. This field is
-     * ignored for GKE clusters where Hub can read the CR directly.
+     * 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
@@ -1110,8 +1110,8 @@ private void ensureMembershipResourcesIsMutable() {
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1135,8 +1135,8 @@ private void ensureMembershipResourcesIsMutable() {
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1159,8 +1159,8 @@ public int getMembershipResourcesCount() {
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1183,8 +1183,8 @@ public com.google.cloud.gkehub.v1beta1.ResourceManifest getMembershipResources(i
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1214,8 +1214,8 @@ public Builder setMembershipResources(
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1242,8 +1242,8 @@ public Builder setMembershipResources(
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1272,8 +1272,8 @@ public Builder addMembershipResources(com.google.cloud.gkehub.v1beta1.ResourceMa
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1303,8 +1303,8 @@ public Builder addMembershipResources(
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1331,8 +1331,8 @@ public Builder addMembershipResources(
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1359,8 +1359,8 @@ public Builder addMembershipResources(
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1387,8 +1387,8 @@ public Builder addAllMembershipResources(
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1414,8 +1414,8 @@ public Builder clearMembershipResources() {
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1441,8 +1441,8 @@ public Builder removeMembershipResources(int index) {
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1462,8 +1462,8 @@ public com.google.cloud.gkehub.v1beta1.ResourceManifest.Builder getMembershipRes
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1487,8 +1487,8 @@ public com.google.cloud.gkehub.v1beta1.ResourceManifest.Builder getMembershipRes
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1512,8 +1512,8 @@ public com.google.cloud.gkehub.v1beta1.ResourceManifest.Builder getMembershipRes
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1534,8 +1534,8 @@ public com.google.cloud.gkehub.v1beta1.ResourceManifest.Builder getMembershipRes
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
@@ -1556,8 +1556,8 @@ public com.google.cloud.gkehub.v1beta1.ResourceManifest.Builder addMembershipRes
      *
      *
      * 
-     * Output only. Additional Kubernetes resources that need to be applied to the
-     * cluster after Membership creation, and after every update.
+     * 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
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesResourceOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesResourceOrBuilder.java
index f3ea2713..357a04ce 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesResourceOrBuilder.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/KubernetesResourceOrBuilder.java
@@ -27,8 +27,8 @@ public interface KubernetesResourceOrBuilder
    *
    *
    * 
-   * Input only. The YAML representation of the Membership CR. This field is
-   * ignored for GKE clusters where Hub can read the CR directly.
+   * 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
@@ -44,8 +44,8 @@ public interface KubernetesResourceOrBuilder
    *
    *
    * 
-   * Input only. The YAML representation of the Membership CR. This field is
-   * ignored for GKE clusters where Hub can read the CR directly.
+   * 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
@@ -62,8 +62,8 @@ public interface KubernetesResourceOrBuilder
    *
    *
    * 
-   * Output only. Additional Kubernetes resources that need to be applied to the
-   * cluster after Membership creation, and after every update.
+   * 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
@@ -80,8 +80,8 @@ public interface KubernetesResourceOrBuilder
    *
    *
    * 
-   * Output only. Additional Kubernetes resources that need to be applied to the
-   * cluster after Membership creation, and after every update.
+   * 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
@@ -98,8 +98,8 @@ public interface KubernetesResourceOrBuilder
    *
    *
    * 
-   * Output only. Additional Kubernetes resources that need to be applied to the
-   * cluster after Membership creation, and after every update.
+   * 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
@@ -116,8 +116,8 @@ public interface KubernetesResourceOrBuilder
    *
    *
    * 
-   * Output only. Additional Kubernetes resources that need to be applied to the
-   * cluster after Membership creation, and after every update.
+   * 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
@@ -135,8 +135,8 @@ public interface KubernetesResourceOrBuilder
    *
    *
    * 
-   * Output only. Additional Kubernetes resources that need to be applied to the
-   * cluster after Membership creation, and after every update.
+   * 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
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ListMembershipsRequest.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ListMembershipsRequest.java
index f39f715c..82fd0e9f 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ListMembershipsRequest.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ListMembershipsRequest.java
@@ -148,11 +148,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    *
    *
    * 
-   * Required. The parent (project and location) where the Memberships will be
-   * listed. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be listed.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -172,11 +174,13 @@ public java.lang.String getParent() { * * *
-   * Required. The parent (project and location) where the Memberships will be
-   * listed. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be listed.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -199,9 +203,9 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-   * Optional. When requesting a 'page' of resources, `page_size` specifies
-   * number of resources to return. If unspecified or set to 0, all resources
-   * will be returned.
+   * Optional. When requesting a 'page' of resources, `page_size` specifies number of
+   * resources to return. If unspecified or set to 0, all resources will
+   * be returned.
    * 
* * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -272,8 +276,8 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * * *
-   * Optional. Lists Memberships that match the filter expression, following the
-   * syntax outlined in https://google.aip.dev/160.
+   * Optional. Lists Memberships that match the filter expression, following the syntax
+   * outlined in https://google.aip.dev/160.
    * Examples:
    *   - Name is `bar` in project `foo-proj` and location `global`:
    *       name = "projects/foo-proj/locations/global/membership/bar"
@@ -305,8 +309,8 @@ public java.lang.String getFilter() {
    *
    *
    * 
-   * Optional. Lists Memberships that match the filter expression, following the
-   * syntax outlined in https://google.aip.dev/160.
+   * Optional. Lists Memberships that match the filter expression, following the syntax
+   * outlined in https://google.aip.dev/160.
    * Examples:
    *   - Name is `bar` in project `foo-proj` and location `global`:
    *       name = "projects/foo-proj/locations/global/membership/bar"
@@ -773,11 +777,13 @@ public Builder mergeFrom(
      *
      *
      * 
-     * Required. The parent (project and location) where the Memberships will be
-     * listed. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be listed.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -796,11 +802,13 @@ public java.lang.String getParent() { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * listed. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be listed.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -819,11 +827,13 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * listed. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be listed.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The parent to set. * @return This builder for chaining. @@ -841,11 +851,13 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * listed. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be listed.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -859,11 +871,13 @@ public Builder clearParent() { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * listed. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be listed.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for parent to set. * @return This builder for chaining. @@ -884,9 +898,9 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. When requesting a 'page' of resources, `page_size` specifies
-     * number of resources to return. If unspecified or set to 0, all resources
-     * will be returned.
+     * Optional. When requesting a 'page' of resources, `page_size` specifies number of
+     * resources to return. If unspecified or set to 0, all resources will
+     * be returned.
      * 
* * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -901,9 +915,9 @@ public int getPageSize() { * * *
-     * Optional. When requesting a 'page' of resources, `page_size` specifies
-     * number of resources to return. If unspecified or set to 0, all resources
-     * will be returned.
+     * Optional. When requesting a 'page' of resources, `page_size` specifies number of
+     * resources to return. If unspecified or set to 0, all resources will
+     * be returned.
      * 
* * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -921,9 +935,9 @@ public Builder setPageSize(int value) { * * *
-     * Optional. When requesting a 'page' of resources, `page_size` specifies
-     * number of resources to return. If unspecified or set to 0, all resources
-     * will be returned.
+     * Optional. When requesting a 'page' of resources, `page_size` specifies number of
+     * resources to return. If unspecified or set to 0, all resources will
+     * be returned.
      * 
* * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -1058,8 +1072,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. Lists Memberships that match the filter expression, following the
-     * syntax outlined in https://google.aip.dev/160.
+     * Optional. Lists Memberships that match the filter expression, following the syntax
+     * outlined in https://google.aip.dev/160.
      * Examples:
      *   - Name is `bar` in project `foo-proj` and location `global`:
      *       name = "projects/foo-proj/locations/global/membership/bar"
@@ -1090,8 +1104,8 @@ public java.lang.String getFilter() {
      *
      *
      * 
-     * Optional. Lists Memberships that match the filter expression, following the
-     * syntax outlined in https://google.aip.dev/160.
+     * Optional. Lists Memberships that match the filter expression, following the syntax
+     * outlined in https://google.aip.dev/160.
      * Examples:
      *   - Name is `bar` in project `foo-proj` and location `global`:
      *       name = "projects/foo-proj/locations/global/membership/bar"
@@ -1122,8 +1136,8 @@ public com.google.protobuf.ByteString getFilterBytes() {
      *
      *
      * 
-     * Optional. Lists Memberships that match the filter expression, following the
-     * syntax outlined in https://google.aip.dev/160.
+     * Optional. Lists Memberships that match the filter expression, following the syntax
+     * outlined in https://google.aip.dev/160.
      * Examples:
      *   - Name is `bar` in project `foo-proj` and location `global`:
      *       name = "projects/foo-proj/locations/global/membership/bar"
@@ -1153,8 +1167,8 @@ public Builder setFilter(java.lang.String value) {
      *
      *
      * 
-     * Optional. Lists Memberships that match the filter expression, following the
-     * syntax outlined in https://google.aip.dev/160.
+     * Optional. Lists Memberships that match the filter expression, following the syntax
+     * outlined in https://google.aip.dev/160.
      * Examples:
      *   - Name is `bar` in project `foo-proj` and location `global`:
      *       name = "projects/foo-proj/locations/global/membership/bar"
@@ -1180,8 +1194,8 @@ public Builder clearFilter() {
      *
      *
      * 
-     * Optional. Lists Memberships that match the filter expression, following the
-     * syntax outlined in https://google.aip.dev/160.
+     * Optional. Lists Memberships that match the filter expression, following the syntax
+     * outlined in https://google.aip.dev/160.
      * Examples:
      *   - Name is `bar` in project `foo-proj` and location `global`:
      *       name = "projects/foo-proj/locations/global/membership/bar"
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ListMembershipsRequestOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ListMembershipsRequestOrBuilder.java
index e6b9761e..1477baa7 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ListMembershipsRequestOrBuilder.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ListMembershipsRequestOrBuilder.java
@@ -27,11 +27,13 @@ public interface ListMembershipsRequestOrBuilder
    *
    *
    * 
-   * Required. The parent (project and location) where the Memberships will be
-   * listed. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be listed.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -40,11 +42,13 @@ public interface ListMembershipsRequestOrBuilder * * *
-   * Required. The parent (project and location) where the Memberships will be
-   * listed. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be listed.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -54,9 +58,9 @@ public interface ListMembershipsRequestOrBuilder * * *
-   * Optional. When requesting a 'page' of resources, `page_size` specifies
-   * number of resources to return. If unspecified or set to 0, all resources
-   * will be returned.
+   * Optional. When requesting a 'page' of resources, `page_size` specifies number of
+   * resources to return. If unspecified or set to 0, all resources will
+   * be returned.
    * 
* * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -98,8 +102,8 @@ public interface ListMembershipsRequestOrBuilder * * *
-   * Optional. Lists Memberships that match the filter expression, following the
-   * syntax outlined in https://google.aip.dev/160.
+   * Optional. Lists Memberships that match the filter expression, following the syntax
+   * outlined in https://google.aip.dev/160.
    * Examples:
    *   - Name is `bar` in project `foo-proj` and location `global`:
    *       name = "projects/foo-proj/locations/global/membership/bar"
@@ -120,8 +124,8 @@ public interface ListMembershipsRequestOrBuilder
    *
    *
    * 
-   * Optional. Lists Memberships that match the filter expression, following the
-   * syntax outlined in https://google.aip.dev/160.
+   * Optional. Lists Memberships that match the filter expression, following the syntax
+   * outlined in https://google.aip.dev/160.
    * Examples:
    *   - Name is `bar` in project `foo-proj` and location `global`:
    *       name = "projects/foo-proj/locations/global/membership/bar"
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/LocationName.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/LocationName.java
new file mode 100644
index 00000000..3a6c5643
--- /dev/null
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/LocationName.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.gkehub.v1beta1;
+
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceName;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+@Generated("by gapic-generator-java")
+public class LocationName implements ResourceName {
+  private static final PathTemplate PROJECT_LOCATION =
+      PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}");
+  private volatile Map fieldValuesMap;
+  private final String project;
+  private final String location;
+
+  @Deprecated
+  protected LocationName() {
+    project = null;
+    location = null;
+  }
+
+  private LocationName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    location = Preconditions.checkNotNull(builder.getLocation());
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getLocation() {
+    return location;
+  }
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  public static LocationName of(String project, String location) {
+    return newBuilder().setProject(project).setLocation(location).build();
+  }
+
+  public static String format(String project, String location) {
+    return newBuilder().setProject(project).setLocation(location).build().toString();
+  }
+
+  public static LocationName parse(String formattedString) {
+    if (formattedString.isEmpty()) {
+      return null;
+    }
+    Map matchMap =
+        PROJECT_LOCATION.validatedMatch(
+            formattedString, "LocationName.parse: formattedString not in valid format");
+    return of(matchMap.get("project"), matchMap.get("location"));
+  }
+
+  public static List parseList(List formattedStrings) {
+    List list = new ArrayList<>(formattedStrings.size());
+    for (String formattedString : formattedStrings) {
+      list.add(parse(formattedString));
+    }
+    return list;
+  }
+
+  public static List toStringList(List values) {
+    List list = new ArrayList<>(values.size());
+    for (LocationName value : values) {
+      if (value == null) {
+        list.add("");
+      } else {
+        list.add(value.toString());
+      }
+    }
+    return list;
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PROJECT_LOCATION.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);
+          }
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+  @Override
+  public String toString() {
+    return PROJECT_LOCATION.instantiate("project", project, "location", location);
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o != null || getClass() == o.getClass()) {
+      LocationName that = ((LocationName) o);
+      return Objects.equals(this.project, that.project)
+          && Objects.equals(this.location, that.location);
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    int h = 1;
+    h *= 1000003;
+    h ^= Objects.hashCode(project);
+    h *= 1000003;
+    h ^= Objects.hashCode(location);
+    return h;
+  }
+
+  /** Builder for projects/{project}/locations/{location}. */
+  public static class Builder {
+    private String project;
+    private String location;
+
+    protected Builder() {}
+
+    public String getProject() {
+      return project;
+    }
+
+    public String getLocation() {
+      return location;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    public Builder setLocation(String location) {
+      this.location = location;
+      return this;
+    }
+
+    private Builder(LocationName locationName) {
+      this.project = locationName.project;
+      this.location = locationName.location;
+    }
+
+    public LocationName build() {
+      return new LocationName(this);
+    }
+  }
+}
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/Membership.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/Membership.java
index 7dfb77eb..3de9235b 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/Membership.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/Membership.java
@@ -498,9 +498,8 @@ public TypeCase getTypeCase() {
    *
    *
    * 
-   * Output only. The full, unique name of this Membership resource in the
-   * format `projects/*/locations/*/memberships/{membership_id}`, set during
-   * creation.
+   * Output only. The full, unique name of this Membership resource in the format
+   * `projects/*/locations/*/memberships/{membership_id}`, set during creation.
    * `membership_id` must be a valid RFC 1123 compliant DNS label:
    *   1. At most 63 characters in length
    *   2. It must consist of lower case alphanumeric characters or `-`
@@ -529,9 +528,8 @@ public java.lang.String getName() {
    *
    *
    * 
-   * Output only. The full, unique name of this Membership resource in the
-   * format `projects/*/locations/*/memberships/{membership_id}`, set during
-   * creation.
+   * Output only. The full, unique name of this Membership resource in the format
+   * `projects/*/locations/*/memberships/{membership_id}`, set during creation.
    * `membership_id` must be a valid RFC 1123 compliant DNS label:
    *   1. At most 63 characters in length
    *   2. It must consist of lower case alphanumeric characters or `-`
@@ -1030,10 +1028,9 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() {
    *
    *
    * 
-   * Optional. An externally-generated and managed ID for this Membership. This
-   * ID may be modified after creation, but this is not recommended. For GKE
-   * clusters, external_id is managed by the Hub API and updates will be
-   * ignored.
+   * Optional. An externally-generated and managed ID for this Membership. This ID may
+   * be modified after creation, but this is not recommended. For GKE clusters,
+   * external_id is managed by the Hub API and updates will be ignored.
    * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
    * If this Membership represents a Kubernetes cluster, this value should be
    * set to the UID of the `kube-system` namespace object.
@@ -1059,10 +1056,9 @@ public java.lang.String getExternalId() {
    *
    *
    * 
-   * Optional. An externally-generated and managed ID for this Membership. This
-   * ID may be modified after creation, but this is not recommended. For GKE
-   * clusters, external_id is managed by the Hub API and updates will be
-   * ignored.
+   * Optional. An externally-generated and managed ID for this Membership. This ID may
+   * be modified after creation, but this is not recommended. For GKE clusters,
+   * external_id is managed by the Hub API and updates will be ignored.
    * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
    * If this Membership represents a Kubernetes cluster, this value should be
    * set to the UID of the `kube-system` namespace object.
@@ -1091,11 +1087,10 @@ public com.google.protobuf.ByteString getExternalIdBytes() {
    *
    *
    * 
-   * Output only. For clusters using Connect, the timestamp of the most recent
-   * connection established with Google Cloud. This time is updated every
-   * several minutes, not continuously. For clusters that do not use GKE
-   * Connect, or that have never connected successfully, this field will be
-   * unset.
+   * Output only. For clusters using Connect, the timestamp of the most recent connection
+   * established with Google Cloud. This time is updated every several minutes,
+   * not continuously. For clusters that do not use GKE Connect, or that have
+   * never connected successfully, this field will be unset.
    * 
* * @@ -1112,11 +1107,10 @@ public boolean hasLastConnectionTime() { * * *
-   * Output only. For clusters using Connect, the timestamp of the most recent
-   * connection established with Google Cloud. This time is updated every
-   * several minutes, not continuously. For clusters that do not use GKE
-   * Connect, or that have never connected successfully, this field will be
-   * unset.
+   * Output only. For clusters using Connect, the timestamp of the most recent connection
+   * established with Google Cloud. This time is updated every several minutes,
+   * not continuously. For clusters that do not use GKE Connect, or that have
+   * never connected successfully, this field will be unset.
    * 
* * @@ -1135,11 +1129,10 @@ public com.google.protobuf.Timestamp getLastConnectionTime() { * * *
-   * Output only. For clusters using Connect, the timestamp of the most recent
-   * connection established with Google Cloud. This time is updated every
-   * several minutes, not continuously. For clusters that do not use GKE
-   * Connect, or that have never connected successfully, this field will be
-   * unset.
+   * Output only. For clusters using Connect, the timestamp of the most recent connection
+   * established with Google Cloud. This time is updated every several minutes,
+   * not continuously. For clusters that do not use GKE Connect, or that have
+   * never connected successfully, this field will be unset.
    * 
* * @@ -1157,8 +1150,8 @@ public com.google.protobuf.TimestampOrBuilder getLastConnectionTimeOrBuilder() { * * *
-   * Output only. Google-generated UUID for this resource. This is unique across
-   * all Membership resources. If a Membership resource is deleted and another
+   * Output only. Google-generated UUID for this resource. This is unique across all
+   * Membership resources. If a Membership resource is deleted and another
    * resource with the same name is created, it gets a different unique_id.
    * 
* @@ -1182,8 +1175,8 @@ public java.lang.String getUniqueId() { * * *
-   * Output only. Google-generated UUID for this resource. This is unique across
-   * all Membership resources. If a Membership resource is deleted and another
+   * Output only. Google-generated UUID for this resource. This is unique across all
+   * Membership resources. If a Membership resource is deleted and another
    * resource with the same name is created, it gets a different unique_id.
    * 
* @@ -1907,9 +1900,8 @@ public Builder clearType() { * * *
-     * Output only. The full, unique name of this Membership resource in the
-     * format `projects/*/locations/*/memberships/{membership_id}`, set during
-     * creation.
+     * Output only. The full, unique name of this Membership resource in the format
+     * `projects/*/locations/*/memberships/{membership_id}`, set during creation.
      * `membership_id` must be a valid RFC 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
@@ -1937,9 +1929,8 @@ public java.lang.String getName() {
      *
      *
      * 
-     * Output only. The full, unique name of this Membership resource in the
-     * format `projects/*/locations/*/memberships/{membership_id}`, set during
-     * creation.
+     * Output only. The full, unique name of this Membership resource in the format
+     * `projects/*/locations/*/memberships/{membership_id}`, set during creation.
      * `membership_id` must be a valid RFC 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
@@ -1967,9 +1958,8 @@ public com.google.protobuf.ByteString getNameBytes() {
      *
      *
      * 
-     * Output only. The full, unique name of this Membership resource in the
-     * format `projects/*/locations/*/memberships/{membership_id}`, set during
-     * creation.
+     * Output only. The full, unique name of this Membership resource in the format
+     * `projects/*/locations/*/memberships/{membership_id}`, set during creation.
      * `membership_id` must be a valid RFC 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
@@ -1996,9 +1986,8 @@ public Builder setName(java.lang.String value) {
      *
      *
      * 
-     * Output only. The full, unique name of this Membership resource in the
-     * format `projects/*/locations/*/memberships/{membership_id}`, set during
-     * creation.
+     * Output only. The full, unique name of this Membership resource in the format
+     * `projects/*/locations/*/memberships/{membership_id}`, set during creation.
      * `membership_id` must be a valid RFC 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
@@ -2021,9 +2010,8 @@ public Builder clearName() {
      *
      *
      * 
-     * Output only. The full, unique name of this Membership resource in the
-     * format `projects/*/locations/*/memberships/{membership_id}`, set during
-     * creation.
+     * Output only. The full, unique name of this Membership resource in the format
+     * `projects/*/locations/*/memberships/{membership_id}`, set during creation.
      * `membership_id` must be a valid RFC 1123 compliant DNS label:
      *   1. At most 63 characters in length
      *   2. It must consist of lower case alphanumeric characters or `-`
@@ -3578,10 +3566,9 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() {
      *
      *
      * 
-     * Optional. An externally-generated and managed ID for this Membership. This
-     * ID may be modified after creation, but this is not recommended. For GKE
-     * clusters, external_id is managed by the Hub API and updates will be
-     * ignored.
+     * Optional. An externally-generated and managed ID for this Membership. This ID may
+     * be modified after creation, but this is not recommended. For GKE clusters,
+     * external_id is managed by the Hub API and updates will be ignored.
      * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
      * If this Membership represents a Kubernetes cluster, this value should be
      * set to the UID of the `kube-system` namespace object.
@@ -3606,10 +3593,9 @@ public java.lang.String getExternalId() {
      *
      *
      * 
-     * Optional. An externally-generated and managed ID for this Membership. This
-     * ID may be modified after creation, but this is not recommended. For GKE
-     * clusters, external_id is managed by the Hub API and updates will be
-     * ignored.
+     * Optional. An externally-generated and managed ID for this Membership. This ID may
+     * be modified after creation, but this is not recommended. For GKE clusters,
+     * external_id is managed by the Hub API and updates will be ignored.
      * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
      * If this Membership represents a Kubernetes cluster, this value should be
      * set to the UID of the `kube-system` namespace object.
@@ -3634,10 +3620,9 @@ public com.google.protobuf.ByteString getExternalIdBytes() {
      *
      *
      * 
-     * Optional. An externally-generated and managed ID for this Membership. This
-     * ID may be modified after creation, but this is not recommended. For GKE
-     * clusters, external_id is managed by the Hub API and updates will be
-     * ignored.
+     * Optional. An externally-generated and managed ID for this Membership. This ID may
+     * be modified after creation, but this is not recommended. For GKE clusters,
+     * external_id is managed by the Hub API and updates will be ignored.
      * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
      * If this Membership represents a Kubernetes cluster, this value should be
      * set to the UID of the `kube-system` namespace object.
@@ -3661,10 +3646,9 @@ public Builder setExternalId(java.lang.String value) {
      *
      *
      * 
-     * Optional. An externally-generated and managed ID for this Membership. This
-     * ID may be modified after creation, but this is not recommended. For GKE
-     * clusters, external_id is managed by the Hub API and updates will be
-     * ignored.
+     * Optional. An externally-generated and managed ID for this Membership. This ID may
+     * be modified after creation, but this is not recommended. For GKE clusters,
+     * external_id is managed by the Hub API and updates will be ignored.
      * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
      * If this Membership represents a Kubernetes cluster, this value should be
      * set to the UID of the `kube-system` namespace object.
@@ -3684,10 +3668,9 @@ public Builder clearExternalId() {
      *
      *
      * 
-     * Optional. An externally-generated and managed ID for this Membership. This
-     * ID may be modified after creation, but this is not recommended. For GKE
-     * clusters, external_id is managed by the Hub API and updates will be
-     * ignored.
+     * Optional. An externally-generated and managed ID for this Membership. This ID may
+     * be modified after creation, but this is not recommended. For GKE clusters,
+     * external_id is managed by the Hub API and updates will be ignored.
      * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
      * If this Membership represents a Kubernetes cluster, this value should be
      * set to the UID of the `kube-system` namespace object.
@@ -3719,11 +3702,10 @@ public Builder setExternalIdBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * Output only. For clusters using Connect, the timestamp of the most recent
-     * connection established with Google Cloud. This time is updated every
-     * several minutes, not continuously. For clusters that do not use GKE
-     * Connect, or that have never connected successfully, this field will be
-     * unset.
+     * Output only. For clusters using Connect, the timestamp of the most recent connection
+     * established with Google Cloud. This time is updated every several minutes,
+     * not continuously. For clusters that do not use GKE Connect, or that have
+     * never connected successfully, this field will be unset.
      * 
* * @@ -3739,11 +3721,10 @@ public boolean hasLastConnectionTime() { * * *
-     * Output only. For clusters using Connect, the timestamp of the most recent
-     * connection established with Google Cloud. This time is updated every
-     * several minutes, not continuously. For clusters that do not use GKE
-     * Connect, or that have never connected successfully, this field will be
-     * unset.
+     * Output only. For clusters using Connect, the timestamp of the most recent connection
+     * established with Google Cloud. This time is updated every several minutes,
+     * not continuously. For clusters that do not use GKE Connect, or that have
+     * never connected successfully, this field will be unset.
      * 
* * @@ -3765,11 +3746,10 @@ public com.google.protobuf.Timestamp getLastConnectionTime() { * * *
-     * Output only. For clusters using Connect, the timestamp of the most recent
-     * connection established with Google Cloud. This time is updated every
-     * several minutes, not continuously. For clusters that do not use GKE
-     * Connect, or that have never connected successfully, this field will be
-     * unset.
+     * Output only. For clusters using Connect, the timestamp of the most recent connection
+     * established with Google Cloud. This time is updated every several minutes,
+     * not continuously. For clusters that do not use GKE Connect, or that have
+     * never connected successfully, this field will be unset.
      * 
* * @@ -3793,11 +3773,10 @@ public Builder setLastConnectionTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. For clusters using Connect, the timestamp of the most recent
-     * connection established with Google Cloud. This time is updated every
-     * several minutes, not continuously. For clusters that do not use GKE
-     * Connect, or that have never connected successfully, this field will be
-     * unset.
+     * Output only. For clusters using Connect, the timestamp of the most recent connection
+     * established with Google Cloud. This time is updated every several minutes,
+     * not continuously. For clusters that do not use GKE Connect, or that have
+     * never connected successfully, this field will be unset.
      * 
* * @@ -3818,11 +3797,10 @@ public Builder setLastConnectionTime(com.google.protobuf.Timestamp.Builder build * * *
-     * Output only. For clusters using Connect, the timestamp of the most recent
-     * connection established with Google Cloud. This time is updated every
-     * several minutes, not continuously. For clusters that do not use GKE
-     * Connect, or that have never connected successfully, this field will be
-     * unset.
+     * Output only. For clusters using Connect, the timestamp of the most recent connection
+     * established with Google Cloud. This time is updated every several minutes,
+     * not continuously. For clusters that do not use GKE Connect, or that have
+     * never connected successfully, this field will be unset.
      * 
* * @@ -3850,11 +3828,10 @@ public Builder mergeLastConnectionTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. For clusters using Connect, the timestamp of the most recent
-     * connection established with Google Cloud. This time is updated every
-     * several minutes, not continuously. For clusters that do not use GKE
-     * Connect, or that have never connected successfully, this field will be
-     * unset.
+     * Output only. For clusters using Connect, the timestamp of the most recent connection
+     * established with Google Cloud. This time is updated every several minutes,
+     * not continuously. For clusters that do not use GKE Connect, or that have
+     * never connected successfully, this field will be unset.
      * 
* * @@ -3876,11 +3853,10 @@ public Builder clearLastConnectionTime() { * * *
-     * Output only. For clusters using Connect, the timestamp of the most recent
-     * connection established with Google Cloud. This time is updated every
-     * several minutes, not continuously. For clusters that do not use GKE
-     * Connect, or that have never connected successfully, this field will be
-     * unset.
+     * Output only. For clusters using Connect, the timestamp of the most recent connection
+     * established with Google Cloud. This time is updated every several minutes,
+     * not continuously. For clusters that do not use GKE Connect, or that have
+     * never connected successfully, this field will be unset.
      * 
* * @@ -3896,11 +3872,10 @@ public com.google.protobuf.Timestamp.Builder getLastConnectionTimeBuilder() { * * *
-     * Output only. For clusters using Connect, the timestamp of the most recent
-     * connection established with Google Cloud. This time is updated every
-     * several minutes, not continuously. For clusters that do not use GKE
-     * Connect, or that have never connected successfully, this field will be
-     * unset.
+     * Output only. For clusters using Connect, the timestamp of the most recent connection
+     * established with Google Cloud. This time is updated every several minutes,
+     * not continuously. For clusters that do not use GKE Connect, or that have
+     * never connected successfully, this field will be unset.
      * 
* * @@ -3920,11 +3895,10 @@ public com.google.protobuf.TimestampOrBuilder getLastConnectionTimeOrBuilder() { * * *
-     * Output only. For clusters using Connect, the timestamp of the most recent
-     * connection established with Google Cloud. This time is updated every
-     * several minutes, not continuously. For clusters that do not use GKE
-     * Connect, or that have never connected successfully, this field will be
-     * unset.
+     * Output only. For clusters using Connect, the timestamp of the most recent connection
+     * established with Google Cloud. This time is updated every several minutes,
+     * not continuously. For clusters that do not use GKE Connect, or that have
+     * never connected successfully, this field will be unset.
      * 
* * @@ -3953,8 +3927,8 @@ public com.google.protobuf.TimestampOrBuilder getLastConnectionTimeOrBuilder() { * * *
-     * Output only. Google-generated UUID for this resource. This is unique across
-     * all Membership resources. If a Membership resource is deleted and another
+     * Output only. Google-generated UUID for this resource. This is unique across all
+     * Membership resources. If a Membership resource is deleted and another
      * resource with the same name is created, it gets a different unique_id.
      * 
* @@ -3977,8 +3951,8 @@ public java.lang.String getUniqueId() { * * *
-     * Output only. Google-generated UUID for this resource. This is unique across
-     * all Membership resources. If a Membership resource is deleted and another
+     * Output only. Google-generated UUID for this resource. This is unique across all
+     * Membership resources. If a Membership resource is deleted and another
      * resource with the same name is created, it gets a different unique_id.
      * 
* @@ -4001,8 +3975,8 @@ public com.google.protobuf.ByteString getUniqueIdBytes() { * * *
-     * Output only. Google-generated UUID for this resource. This is unique across
-     * all Membership resources. If a Membership resource is deleted and another
+     * Output only. Google-generated UUID for this resource. This is unique across all
+     * Membership resources. If a Membership resource is deleted and another
      * resource with the same name is created, it gets a different unique_id.
      * 
* @@ -4024,8 +3998,8 @@ public Builder setUniqueId(java.lang.String value) { * * *
-     * Output only. Google-generated UUID for this resource. This is unique across
-     * all Membership resources. If a Membership resource is deleted and another
+     * Output only. Google-generated UUID for this resource. This is unique across all
+     * Membership resources. If a Membership resource is deleted and another
      * resource with the same name is created, it gets a different unique_id.
      * 
* @@ -4043,8 +4017,8 @@ public Builder clearUniqueId() { * * *
-     * Output only. Google-generated UUID for this resource. This is unique across
-     * all Membership resources. If a Membership resource is deleted and another
+     * Output only. Google-generated UUID for this resource. This is unique across all
+     * Membership resources. If a Membership resource is deleted and another
      * resource with the same name is created, it gets a different unique_id.
      * 
* diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipEndpoint.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipEndpoint.java index fdcd110b..b40f0ad2 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipEndpoint.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipEndpoint.java @@ -153,6 +153,38 @@ private MembershipEndpoint( typeCase_ = 8; break; } + case 74: + { + com.google.cloud.gkehub.v1beta1.EdgeCluster.Builder subBuilder = null; + if (typeCase_ == 9) { + subBuilder = ((com.google.cloud.gkehub.v1beta1.EdgeCluster) type_).toBuilder(); + } + type_ = + input.readMessage( + com.google.cloud.gkehub.v1beta1.EdgeCluster.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.gkehub.v1beta1.EdgeCluster) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 9; + break; + } + case 82: + { + com.google.cloud.gkehub.v1beta1.ApplianceCluster.Builder subBuilder = null; + if (typeCase_ == 10) { + subBuilder = ((com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_).toBuilder(); + } + type_ = + input.readMessage( + com.google.cloud.gkehub.v1beta1.ApplianceCluster.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 10; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -199,6 +231,8 @@ public enum TypeCase GKE_CLUSTER(4), ON_PREM_CLUSTER(7), MULTI_CLOUD_CLUSTER(8), + EDGE_CLUSTER(9), + APPLIANCE_CLUSTER(10), TYPE_NOT_SET(0); private final int value; @@ -223,6 +257,10 @@ public static TypeCase forNumber(int value) { return ON_PREM_CLUSTER; case 8: return MULTI_CLOUD_CLUSTER; + case 9: + return EDGE_CLUSTER; + case 10: + return APPLIANCE_CLUSTER; case 0: return TYPE_NOT_SET; default: @@ -301,7 +339,9 @@ public com.google.cloud.gkehub.v1beta1.GkeClusterOrBuilder getGkeClusterOrBuilde * * *
-   * Optional. Specific information for a GKE On-Prem cluster.
+   * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+   * who has no resourceLink is not allowed to use this field, it should have
+   * a nil "type" instead.
    * 
* * @@ -318,7 +358,9 @@ public boolean hasOnPremCluster() { * * *
-   * Optional. Specific information for a GKE On-Prem cluster.
+   * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+   * who has no resourceLink is not allowed to use this field, it should have
+   * a nil "type" instead.
    * 
* * @@ -338,7 +380,9 @@ public com.google.cloud.gkehub.v1beta1.OnPremCluster getOnPremCluster() { * * *
-   * Optional. Specific information for a GKE On-Prem cluster.
+   * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+   * who has no resourceLink is not allowed to use this field, it should have
+   * a nil "type" instead.
    * 
* * @@ -411,6 +455,120 @@ public com.google.cloud.gkehub.v1beta1.MultiCloudCluster getMultiCloudCluster() return com.google.cloud.gkehub.v1beta1.MultiCloudCluster.getDefaultInstance(); } + public static final int EDGE_CLUSTER_FIELD_NUMBER = 9; + /** + * + * + *
+   * Optional. Specific information for a Google Edge cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the edgeCluster field is set. + */ + @java.lang.Override + public boolean hasEdgeCluster() { + return typeCase_ == 9; + } + /** + * + * + *
+   * Optional. Specific information for a Google Edge cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edgeCluster. + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.EdgeCluster getEdgeCluster() { + if (typeCase_ == 9) { + return (com.google.cloud.gkehub.v1beta1.EdgeCluster) type_; + } + return com.google.cloud.gkehub.v1beta1.EdgeCluster.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. Specific information for a Google Edge cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.EdgeClusterOrBuilder getEdgeClusterOrBuilder() { + if (typeCase_ == 9) { + return (com.google.cloud.gkehub.v1beta1.EdgeCluster) type_; + } + return com.google.cloud.gkehub.v1beta1.EdgeCluster.getDefaultInstance(); + } + + public static final int APPLIANCE_CLUSTER_FIELD_NUMBER = 10; + /** + * + * + *
+   * Optional. Specific information for a GDC Edge Appliance cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the applianceCluster field is set. + */ + @java.lang.Override + public boolean hasApplianceCluster() { + return typeCase_ == 10; + } + /** + * + * + *
+   * Optional. Specific information for a GDC Edge Appliance cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The applianceCluster. + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.ApplianceCluster getApplianceCluster() { + if (typeCase_ == 10) { + return (com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_; + } + return com.google.cloud.gkehub.v1beta1.ApplianceCluster.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. Specific information for a GDC Edge Appliance cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.ApplianceClusterOrBuilder getApplianceClusterOrBuilder() { + if (typeCase_ == 10) { + return (com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_; + } + return com.google.cloud.gkehub.v1beta1.ApplianceCluster.getDefaultInstance(); + } + public static final int KUBERNETES_METADATA_FIELD_NUMBER = 5; private com.google.cloud.gkehub.v1beta1.KubernetesMetadata kubernetesMetadata_; /** @@ -472,8 +630,8 @@ public com.google.cloud.gkehub.v1beta1.KubernetesMetadata getKubernetesMetadata( * * *
-   * Optional. The in-cluster Kubernetes Resources that should be applied for a
-   * correctly registered cluster, in the steady state. These resources:
+   * 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
@@ -495,8 +653,8 @@ public boolean hasKubernetesResource() {
    *
    *
    * 
-   * Optional. The in-cluster Kubernetes Resources that should be applied for a
-   * correctly registered cluster, in the steady state. These resources:
+   * 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
@@ -520,8 +678,8 @@ public com.google.cloud.gkehub.v1beta1.KubernetesResource getKubernetesResource(
    *
    *
    * 
-   * Optional. The in-cluster Kubernetes Resources that should be applied for a
-   * correctly registered cluster, in the steady state. These resources:
+   * 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
@@ -568,6 +726,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
     if (typeCase_ == 8) {
       output.writeMessage(8, (com.google.cloud.gkehub.v1beta1.MultiCloudCluster) type_);
     }
+    if (typeCase_ == 9) {
+      output.writeMessage(9, (com.google.cloud.gkehub.v1beta1.EdgeCluster) type_);
+    }
+    if (typeCase_ == 10) {
+      output.writeMessage(10, (com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_);
+    }
     unknownFields.writeTo(output);
   }
 
@@ -598,6 +762,16 @@ public int getSerializedSize() {
           com.google.protobuf.CodedOutputStream.computeMessageSize(
               8, (com.google.cloud.gkehub.v1beta1.MultiCloudCluster) type_);
     }
+    if (typeCase_ == 9) {
+      size +=
+          com.google.protobuf.CodedOutputStream.computeMessageSize(
+              9, (com.google.cloud.gkehub.v1beta1.EdgeCluster) type_);
+    }
+    if (typeCase_ == 10) {
+      size +=
+          com.google.protobuf.CodedOutputStream.computeMessageSize(
+              10, (com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_);
+    }
     size += unknownFields.getSerializedSize();
     memoizedSize = size;
     return size;
@@ -633,6 +807,12 @@ public boolean equals(final java.lang.Object obj) {
       case 8:
         if (!getMultiCloudCluster().equals(other.getMultiCloudCluster())) return false;
         break;
+      case 9:
+        if (!getEdgeCluster().equals(other.getEdgeCluster())) return false;
+        break;
+      case 10:
+        if (!getApplianceCluster().equals(other.getApplianceCluster())) return false;
+        break;
       case 0:
       default:
     }
@@ -668,6 +848,14 @@ public int hashCode() {
         hash = (37 * hash) + MULTI_CLOUD_CLUSTER_FIELD_NUMBER;
         hash = (53 * hash) + getMultiCloudCluster().hashCode();
         break;
+      case 9:
+        hash = (37 * hash) + EDGE_CLUSTER_FIELD_NUMBER;
+        hash = (53 * hash) + getEdgeCluster().hashCode();
+        break;
+      case 10:
+        hash = (37 * hash) + APPLIANCE_CLUSTER_FIELD_NUMBER;
+        hash = (53 * hash) + getApplianceCluster().hashCode();
+        break;
       case 0:
       default:
     }
@@ -879,6 +1067,20 @@ public com.google.cloud.gkehub.v1beta1.MembershipEndpoint buildPartial() {
           result.type_ = multiCloudClusterBuilder_.build();
         }
       }
+      if (typeCase_ == 9) {
+        if (edgeClusterBuilder_ == null) {
+          result.type_ = type_;
+        } else {
+          result.type_ = edgeClusterBuilder_.build();
+        }
+      }
+      if (typeCase_ == 10) {
+        if (applianceClusterBuilder_ == null) {
+          result.type_ = type_;
+        } else {
+          result.type_ = applianceClusterBuilder_.build();
+        }
+      }
       if (kubernetesMetadataBuilder_ == null) {
         result.kubernetesMetadata_ = kubernetesMetadata_;
       } else {
@@ -962,6 +1164,16 @@ public Builder mergeFrom(com.google.cloud.gkehub.v1beta1.MembershipEndpoint othe
             mergeMultiCloudCluster(other.getMultiCloudCluster());
             break;
           }
+        case EDGE_CLUSTER:
+          {
+            mergeEdgeCluster(other.getEdgeCluster());
+            break;
+          }
+        case APPLIANCE_CLUSTER:
+          {
+            mergeApplianceCluster(other.getApplianceCluster());
+            break;
+          }
         case TYPE_NOT_SET:
           {
             break;
@@ -1248,7 +1460,9 @@ public com.google.cloud.gkehub.v1beta1.GkeClusterOrBuilder getGkeClusterOrBuilde
      *
      *
      * 
-     * Optional. Specific information for a GKE On-Prem cluster.
+     * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+     * who has no resourceLink is not allowed to use this field, it should have
+     * a nil "type" instead.
      * 
* * @@ -1265,7 +1479,9 @@ public boolean hasOnPremCluster() { * * *
-     * Optional. Specific information for a GKE On-Prem cluster.
+     * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+     * who has no resourceLink is not allowed to use this field, it should have
+     * a nil "type" instead.
      * 
* * @@ -1292,7 +1508,9 @@ public com.google.cloud.gkehub.v1beta1.OnPremCluster getOnPremCluster() { * * *
-     * Optional. Specific information for a GKE On-Prem cluster.
+     * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+     * who has no resourceLink is not allowed to use this field, it should have
+     * a nil "type" instead.
      * 
* * @@ -1316,7 +1534,9 @@ public Builder setOnPremCluster(com.google.cloud.gkehub.v1beta1.OnPremCluster va * * *
-     * Optional. Specific information for a GKE On-Prem cluster.
+     * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+     * who has no resourceLink is not allowed to use this field, it should have
+     * a nil "type" instead.
      * 
* * @@ -1338,7 +1558,9 @@ public Builder setOnPremCluster( * * *
-     * Optional. Specific information for a GKE On-Prem cluster.
+     * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+     * who has no resourceLink is not allowed to use this field, it should have
+     * a nil "type" instead.
      * 
* * @@ -1372,7 +1594,9 @@ public Builder mergeOnPremCluster(com.google.cloud.gkehub.v1beta1.OnPremCluster * * *
-     * Optional. Specific information for a GKE On-Prem cluster.
+     * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+     * who has no resourceLink is not allowed to use this field, it should have
+     * a nil "type" instead.
      * 
* * @@ -1399,7 +1623,9 @@ public Builder clearOnPremCluster() { * * *
-     * Optional. Specific information for a GKE On-Prem cluster.
+     * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+     * who has no resourceLink is not allowed to use this field, it should have
+     * a nil "type" instead.
      * 
* * @@ -1413,7 +1639,9 @@ public com.google.cloud.gkehub.v1beta1.OnPremCluster.Builder getOnPremClusterBui * * *
-     * Optional. Specific information for a GKE On-Prem cluster.
+     * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+     * who has no resourceLink is not allowed to use this field, it should have
+     * a nil "type" instead.
      * 
* * @@ -1435,7 +1663,9 @@ public com.google.cloud.gkehub.v1beta1.OnPremClusterOrBuilder getOnPremClusterOr * * *
-     * Optional. Specific information for a GKE On-Prem cluster.
+     * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+     * who has no resourceLink is not allowed to use this field, it should have
+     * a nil "type" instead.
      * 
* * @@ -1696,6 +1926,463 @@ public com.google.cloud.gkehub.v1beta1.MultiCloudCluster.Builder getMultiCloudCl return multiCloudClusterBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1beta1.EdgeCluster, + com.google.cloud.gkehub.v1beta1.EdgeCluster.Builder, + com.google.cloud.gkehub.v1beta1.EdgeClusterOrBuilder> + edgeClusterBuilder_; + /** + * + * + *
+     * Optional. Specific information for a Google Edge cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the edgeCluster field is set. + */ + @java.lang.Override + public boolean hasEdgeCluster() { + return typeCase_ == 9; + } + /** + * + * + *
+     * Optional. Specific information for a Google Edge cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edgeCluster. + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.EdgeCluster getEdgeCluster() { + if (edgeClusterBuilder_ == null) { + if (typeCase_ == 9) { + return (com.google.cloud.gkehub.v1beta1.EdgeCluster) type_; + } + return com.google.cloud.gkehub.v1beta1.EdgeCluster.getDefaultInstance(); + } else { + if (typeCase_ == 9) { + return edgeClusterBuilder_.getMessage(); + } + return com.google.cloud.gkehub.v1beta1.EdgeCluster.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Specific information for a Google Edge cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEdgeCluster(com.google.cloud.gkehub.v1beta1.EdgeCluster value) { + if (edgeClusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + edgeClusterBuilder_.setMessage(value); + } + typeCase_ = 9; + return this; + } + /** + * + * + *
+     * Optional. Specific information for a Google Edge cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEdgeCluster( + com.google.cloud.gkehub.v1beta1.EdgeCluster.Builder builderForValue) { + if (edgeClusterBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + edgeClusterBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 9; + return this; + } + /** + * + * + *
+     * Optional. Specific information for a Google Edge cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEdgeCluster(com.google.cloud.gkehub.v1beta1.EdgeCluster value) { + if (edgeClusterBuilder_ == null) { + if (typeCase_ == 9 + && type_ != com.google.cloud.gkehub.v1beta1.EdgeCluster.getDefaultInstance()) { + type_ = + com.google.cloud.gkehub.v1beta1.EdgeCluster.newBuilder( + (com.google.cloud.gkehub.v1beta1.EdgeCluster) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 9) { + edgeClusterBuilder_.mergeFrom(value); + } else { + edgeClusterBuilder_.setMessage(value); + } + } + typeCase_ = 9; + return this; + } + /** + * + * + *
+     * Optional. Specific information for a Google Edge cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEdgeCluster() { + if (edgeClusterBuilder_ == null) { + if (typeCase_ == 9) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 9) { + typeCase_ = 0; + type_ = null; + } + edgeClusterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Specific information for a Google Edge cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.gkehub.v1beta1.EdgeCluster.Builder getEdgeClusterBuilder() { + return getEdgeClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Specific information for a Google Edge cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.EdgeClusterOrBuilder getEdgeClusterOrBuilder() { + if ((typeCase_ == 9) && (edgeClusterBuilder_ != null)) { + return edgeClusterBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 9) { + return (com.google.cloud.gkehub.v1beta1.EdgeCluster) type_; + } + return com.google.cloud.gkehub.v1beta1.EdgeCluster.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Specific information for a Google Edge cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1beta1.EdgeCluster, + com.google.cloud.gkehub.v1beta1.EdgeCluster.Builder, + com.google.cloud.gkehub.v1beta1.EdgeClusterOrBuilder> + getEdgeClusterFieldBuilder() { + if (edgeClusterBuilder_ == null) { + if (!(typeCase_ == 9)) { + type_ = com.google.cloud.gkehub.v1beta1.EdgeCluster.getDefaultInstance(); + } + edgeClusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1beta1.EdgeCluster, + com.google.cloud.gkehub.v1beta1.EdgeCluster.Builder, + com.google.cloud.gkehub.v1beta1.EdgeClusterOrBuilder>( + (com.google.cloud.gkehub.v1beta1.EdgeCluster) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 9; + onChanged(); + ; + return edgeClusterBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1beta1.ApplianceCluster, + com.google.cloud.gkehub.v1beta1.ApplianceCluster.Builder, + com.google.cloud.gkehub.v1beta1.ApplianceClusterOrBuilder> + applianceClusterBuilder_; + /** + * + * + *
+     * Optional. Specific information for a GDC Edge Appliance cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the applianceCluster field is set. + */ + @java.lang.Override + public boolean hasApplianceCluster() { + return typeCase_ == 10; + } + /** + * + * + *
+     * Optional. Specific information for a GDC Edge Appliance cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The applianceCluster. + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.ApplianceCluster getApplianceCluster() { + if (applianceClusterBuilder_ == null) { + if (typeCase_ == 10) { + return (com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_; + } + return com.google.cloud.gkehub.v1beta1.ApplianceCluster.getDefaultInstance(); + } else { + if (typeCase_ == 10) { + return applianceClusterBuilder_.getMessage(); + } + return com.google.cloud.gkehub.v1beta1.ApplianceCluster.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Specific information for a GDC Edge Appliance cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setApplianceCluster(com.google.cloud.gkehub.v1beta1.ApplianceCluster value) { + if (applianceClusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + applianceClusterBuilder_.setMessage(value); + } + typeCase_ = 10; + return this; + } + /** + * + * + *
+     * Optional. Specific information for a GDC Edge Appliance cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setApplianceCluster( + com.google.cloud.gkehub.v1beta1.ApplianceCluster.Builder builderForValue) { + if (applianceClusterBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + applianceClusterBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 10; + return this; + } + /** + * + * + *
+     * Optional. Specific information for a GDC Edge Appliance cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeApplianceCluster(com.google.cloud.gkehub.v1beta1.ApplianceCluster value) { + if (applianceClusterBuilder_ == null) { + if (typeCase_ == 10 + && type_ != com.google.cloud.gkehub.v1beta1.ApplianceCluster.getDefaultInstance()) { + type_ = + com.google.cloud.gkehub.v1beta1.ApplianceCluster.newBuilder( + (com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 10) { + applianceClusterBuilder_.mergeFrom(value); + } else { + applianceClusterBuilder_.setMessage(value); + } + } + typeCase_ = 10; + return this; + } + /** + * + * + *
+     * Optional. Specific information for a GDC Edge Appliance cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearApplianceCluster() { + if (applianceClusterBuilder_ == null) { + if (typeCase_ == 10) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 10) { + typeCase_ = 0; + type_ = null; + } + applianceClusterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Specific information for a GDC Edge Appliance cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.gkehub.v1beta1.ApplianceCluster.Builder getApplianceClusterBuilder() { + return getApplianceClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Specific information for a GDC Edge Appliance cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.ApplianceClusterOrBuilder + getApplianceClusterOrBuilder() { + if ((typeCase_ == 10) && (applianceClusterBuilder_ != null)) { + return applianceClusterBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 10) { + return (com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_; + } + return com.google.cloud.gkehub.v1beta1.ApplianceCluster.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Specific information for a GDC Edge Appliance cluster.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1beta1.ApplianceCluster, + com.google.cloud.gkehub.v1beta1.ApplianceCluster.Builder, + com.google.cloud.gkehub.v1beta1.ApplianceClusterOrBuilder> + getApplianceClusterFieldBuilder() { + if (applianceClusterBuilder_ == null) { + if (!(typeCase_ == 10)) { + type_ = com.google.cloud.gkehub.v1beta1.ApplianceCluster.getDefaultInstance(); + } + applianceClusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkehub.v1beta1.ApplianceCluster, + com.google.cloud.gkehub.v1beta1.ApplianceCluster.Builder, + com.google.cloud.gkehub.v1beta1.ApplianceClusterOrBuilder>( + (com.google.cloud.gkehub.v1beta1.ApplianceCluster) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 10; + onChanged(); + ; + return applianceClusterBuilder_; + } + private com.google.cloud.gkehub.v1beta1.KubernetesMetadata kubernetesMetadata_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.gkehub.v1beta1.KubernetesMetadata, @@ -1913,8 +2600,8 @@ public Builder clearKubernetesMetadata() { * * *
-     * Optional. The in-cluster Kubernetes Resources that should be applied for a
-     * correctly registered cluster, in the steady state. These resources:
+     * 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
@@ -1935,8 +2622,8 @@ public boolean hasKubernetesResource() {
      *
      *
      * 
-     * Optional. The in-cluster Kubernetes Resources that should be applied for a
-     * correctly registered cluster, in the steady state. These resources:
+     * 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
@@ -1963,8 +2650,8 @@ public com.google.cloud.gkehub.v1beta1.KubernetesResource getKubernetesResource(
      *
      *
      * 
-     * Optional. The in-cluster Kubernetes Resources that should be applied for a
-     * correctly registered cluster, in the steady state. These resources:
+     * 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
@@ -1993,8 +2680,8 @@ public Builder setKubernetesResource(com.google.cloud.gkehub.v1beta1.KubernetesR
      *
      *
      * 
-     * Optional. The in-cluster Kubernetes Resources that should be applied for a
-     * correctly registered cluster, in the steady state. These resources:
+     * 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
@@ -2021,8 +2708,8 @@ public Builder setKubernetesResource(
      *
      *
      * 
-     * Optional. The in-cluster Kubernetes Resources that should be applied for a
-     * correctly registered cluster, in the steady state. These resources:
+     * 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
@@ -2056,8 +2743,8 @@ public Builder mergeKubernetesResource(
      *
      *
      * 
-     * Optional. The in-cluster Kubernetes Resources that should be applied for a
-     * correctly registered cluster, in the steady state. These resources:
+     * 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
@@ -2084,8 +2771,8 @@ public Builder clearKubernetesResource() {
      *
      *
      * 
-     * Optional. The in-cluster Kubernetes Resources that should be applied for a
-     * correctly registered cluster, in the steady state. These resources:
+     * 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
@@ -2107,8 +2794,8 @@ public Builder clearKubernetesResource() {
      *
      *
      * 
-     * Optional. The in-cluster Kubernetes Resources that should be applied for a
-     * correctly registered cluster, in the steady state. These resources:
+     * 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
@@ -2134,8 +2821,8 @@ public Builder clearKubernetesResource() {
      *
      *
      * 
-     * Optional. The in-cluster Kubernetes Resources that should be applied for a
-     * correctly registered cluster, in the steady state. These resources:
+     * 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
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipEndpointOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipEndpointOrBuilder.java
index 99f202c0..5632b3f2 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipEndpointOrBuilder.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipEndpointOrBuilder.java
@@ -68,7 +68,9 @@ public interface MembershipEndpointOrBuilder
    *
    *
    * 
-   * Optional. Specific information for a GKE On-Prem cluster.
+   * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+   * who has no resourceLink is not allowed to use this field, it should have
+   * a nil "type" instead.
    * 
* * @@ -82,7 +84,9 @@ public interface MembershipEndpointOrBuilder * * *
-   * Optional. Specific information for a GKE On-Prem cluster.
+   * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+   * who has no resourceLink is not allowed to use this field, it should have
+   * a nil "type" instead.
    * 
* * @@ -96,7 +100,9 @@ public interface MembershipEndpointOrBuilder * * *
-   * Optional. Specific information for a GKE On-Prem cluster.
+   * Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
+   * who has no resourceLink is not allowed to use this field, it should have
+   * a nil "type" instead.
    * 
* * @@ -146,6 +152,88 @@ public interface MembershipEndpointOrBuilder */ com.google.cloud.gkehub.v1beta1.MultiCloudClusterOrBuilder getMultiCloudClusterOrBuilder(); + /** + * + * + *
+   * Optional. Specific information for a Google Edge cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the edgeCluster field is set. + */ + boolean hasEdgeCluster(); + /** + * + * + *
+   * Optional. Specific information for a Google Edge cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The edgeCluster. + */ + com.google.cloud.gkehub.v1beta1.EdgeCluster getEdgeCluster(); + /** + * + * + *
+   * Optional. Specific information for a Google Edge cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.EdgeCluster edge_cluster = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.gkehub.v1beta1.EdgeClusterOrBuilder getEdgeClusterOrBuilder(); + + /** + * + * + *
+   * Optional. Specific information for a GDC Edge Appliance cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the applianceCluster field is set. + */ + boolean hasApplianceCluster(); + /** + * + * + *
+   * Optional. Specific information for a GDC Edge Appliance cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The applianceCluster. + */ + com.google.cloud.gkehub.v1beta1.ApplianceCluster getApplianceCluster(); + /** + * + * + *
+   * Optional. Specific information for a GDC Edge Appliance cluster.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.ApplianceCluster appliance_cluster = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.gkehub.v1beta1.ApplianceClusterOrBuilder getApplianceClusterOrBuilder(); + /** * * @@ -191,8 +279,8 @@ public interface MembershipEndpointOrBuilder * * *
-   * Optional. The in-cluster Kubernetes Resources that should be applied for a
-   * correctly registered cluster, in the steady state. These resources:
+   * 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
@@ -211,8 +299,8 @@ public interface MembershipEndpointOrBuilder
    *
    *
    * 
-   * Optional. The in-cluster Kubernetes Resources that should be applied for a
-   * correctly registered cluster, in the steady state. These resources:
+   * 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
@@ -231,8 +319,8 @@ public interface MembershipEndpointOrBuilder
    *
    *
    * 
-   * Optional. The in-cluster Kubernetes Resources that should be applied for a
-   * correctly registered cluster, in the steady state. These resources:
+   * 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
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipName.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipName.java
new file mode 100644
index 00000000..bad75038
--- /dev/null
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipName.java
@@ -0,0 +1,223 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.gkehub.v1beta1;
+
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceName;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+@Generated("by gapic-generator-java")
+public class MembershipName implements ResourceName {
+  private static final PathTemplate PROJECT_LOCATION_MEMBERSHIP =
+      PathTemplate.createWithoutUrlEncoding(
+          "projects/{project}/locations/{location}/memberships/{membership}");
+  private volatile Map fieldValuesMap;
+  private final String project;
+  private final String location;
+  private final String membership;
+
+  @Deprecated
+  protected MembershipName() {
+    project = null;
+    location = null;
+    membership = null;
+  }
+
+  private MembershipName(Builder builder) {
+    project = Preconditions.checkNotNull(builder.getProject());
+    location = Preconditions.checkNotNull(builder.getLocation());
+    membership = Preconditions.checkNotNull(builder.getMembership());
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getLocation() {
+    return location;
+  }
+
+  public String getMembership() {
+    return membership;
+  }
+
+  public static Builder newBuilder() {
+    return new Builder();
+  }
+
+  public Builder toBuilder() {
+    return new Builder(this);
+  }
+
+  public static MembershipName of(String project, String location, String membership) {
+    return newBuilder().setProject(project).setLocation(location).setMembership(membership).build();
+  }
+
+  public static String format(String project, String location, String membership) {
+    return newBuilder()
+        .setProject(project)
+        .setLocation(location)
+        .setMembership(membership)
+        .build()
+        .toString();
+  }
+
+  public static MembershipName parse(String formattedString) {
+    if (formattedString.isEmpty()) {
+      return null;
+    }
+    Map matchMap =
+        PROJECT_LOCATION_MEMBERSHIP.validatedMatch(
+            formattedString, "MembershipName.parse: formattedString not in valid format");
+    return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("membership"));
+  }
+
+  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 (MembershipName value : values) {
+      if (value == null) {
+        list.add("");
+      } else {
+        list.add(value.toString());
+      }
+    }
+    return list;
+  }
+
+  public static boolean isParsableFrom(String formattedString) {
+    return PROJECT_LOCATION_MEMBERSHIP.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 (membership != null) {
+            fieldMapBuilder.put("membership", membership);
+          }
+          fieldValuesMap = fieldMapBuilder.build();
+        }
+      }
+    }
+    return fieldValuesMap;
+  }
+
+  public String getFieldValue(String fieldName) {
+    return getFieldValuesMap().get(fieldName);
+  }
+
+  @Override
+  public String toString() {
+    return PROJECT_LOCATION_MEMBERSHIP.instantiate(
+        "project", project, "location", location, "membership", membership);
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o != null || getClass() == o.getClass()) {
+      MembershipName that = ((MembershipName) o);
+      return Objects.equals(this.project, that.project)
+          && Objects.equals(this.location, that.location)
+          && Objects.equals(this.membership, that.membership);
+    }
+    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(membership);
+    return h;
+  }
+
+  /** Builder for projects/{project}/locations/{location}/memberships/{membership}. */
+  public static class Builder {
+    private String project;
+    private String location;
+    private String membership;
+
+    protected Builder() {}
+
+    public String getProject() {
+      return project;
+    }
+
+    public String getLocation() {
+      return location;
+    }
+
+    public String getMembership() {
+      return membership;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    public Builder setLocation(String location) {
+      this.location = location;
+      return this;
+    }
+
+    public Builder setMembership(String membership) {
+      this.membership = membership;
+      return this;
+    }
+
+    private Builder(MembershipName membershipName) {
+      this.project = membershipName.project;
+      this.location = membershipName.location;
+      this.membership = membershipName.membership;
+    }
+
+    public MembershipName build() {
+      return new MembershipName(this);
+    }
+  }
+}
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipOrBuilder.java
index 709fdd83..70742617 100644
--- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipOrBuilder.java
+++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipOrBuilder.java
@@ -27,9 +27,8 @@ public interface MembershipOrBuilder
    *
    *
    * 
-   * Output only. The full, unique name of this Membership resource in the
-   * format `projects/*/locations/*/memberships/{membership_id}`, set during
-   * creation.
+   * Output only. The full, unique name of this Membership resource in the format
+   * `projects/*/locations/*/memberships/{membership_id}`, set during creation.
    * `membership_id` must be a valid RFC 1123 compliant DNS label:
    *   1. At most 63 characters in length
    *   2. It must consist of lower case alphanumeric characters or `-`
@@ -47,9 +46,8 @@ public interface MembershipOrBuilder
    *
    *
    * 
-   * Output only. The full, unique name of this Membership resource in the
-   * format `projects/*/locations/*/memberships/{membership_id}`, set during
-   * creation.
+   * Output only. The full, unique name of this Membership resource in the format
+   * `projects/*/locations/*/memberships/{membership_id}`, set during creation.
    * `membership_id` must be a valid RFC 1123 compliant DNS label:
    *   1. At most 63 characters in length
    *   2. It must consist of lower case alphanumeric characters or `-`
@@ -397,10 +395,9 @@ java.lang.String getLabelsOrDefault(
    *
    *
    * 
-   * Optional. An externally-generated and managed ID for this Membership. This
-   * ID may be modified after creation, but this is not recommended. For GKE
-   * clusters, external_id is managed by the Hub API and updates will be
-   * ignored.
+   * Optional. An externally-generated and managed ID for this Membership. This ID may
+   * be modified after creation, but this is not recommended. For GKE clusters,
+   * external_id is managed by the Hub API and updates will be ignored.
    * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
    * If this Membership represents a Kubernetes cluster, this value should be
    * set to the UID of the `kube-system` namespace object.
@@ -415,10 +412,9 @@ java.lang.String getLabelsOrDefault(
    *
    *
    * 
-   * Optional. An externally-generated and managed ID for this Membership. This
-   * ID may be modified after creation, but this is not recommended. For GKE
-   * clusters, external_id is managed by the Hub API and updates will be
-   * ignored.
+   * Optional. An externally-generated and managed ID for this Membership. This ID may
+   * be modified after creation, but this is not recommended. For GKE clusters,
+   * external_id is managed by the Hub API and updates will be ignored.
    * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
    * If this Membership represents a Kubernetes cluster, this value should be
    * set to the UID of the `kube-system` namespace object.
@@ -434,11 +430,10 @@ java.lang.String getLabelsOrDefault(
    *
    *
    * 
-   * Output only. For clusters using Connect, the timestamp of the most recent
-   * connection established with Google Cloud. This time is updated every
-   * several minutes, not continuously. For clusters that do not use GKE
-   * Connect, or that have never connected successfully, this field will be
-   * unset.
+   * Output only. For clusters using Connect, the timestamp of the most recent connection
+   * established with Google Cloud. This time is updated every several minutes,
+   * not continuously. For clusters that do not use GKE Connect, or that have
+   * never connected successfully, this field will be unset.
    * 
* * @@ -452,11 +447,10 @@ java.lang.String getLabelsOrDefault( * * *
-   * Output only. For clusters using Connect, the timestamp of the most recent
-   * connection established with Google Cloud. This time is updated every
-   * several minutes, not continuously. For clusters that do not use GKE
-   * Connect, or that have never connected successfully, this field will be
-   * unset.
+   * Output only. For clusters using Connect, the timestamp of the most recent connection
+   * established with Google Cloud. This time is updated every several minutes,
+   * not continuously. For clusters that do not use GKE Connect, or that have
+   * never connected successfully, this field will be unset.
    * 
* * @@ -470,11 +464,10 @@ java.lang.String getLabelsOrDefault( * * *
-   * Output only. For clusters using Connect, the timestamp of the most recent
-   * connection established with Google Cloud. This time is updated every
-   * several minutes, not continuously. For clusters that do not use GKE
-   * Connect, or that have never connected successfully, this field will be
-   * unset.
+   * Output only. For clusters using Connect, the timestamp of the most recent connection
+   * established with Google Cloud. This time is updated every several minutes,
+   * not continuously. For clusters that do not use GKE Connect, or that have
+   * never connected successfully, this field will be unset.
    * 
* * @@ -487,8 +480,8 @@ java.lang.String getLabelsOrDefault( * * *
-   * Output only. Google-generated UUID for this resource. This is unique across
-   * all Membership resources. If a Membership resource is deleted and another
+   * Output only. Google-generated UUID for this resource. This is unique across all
+   * Membership resources. If a Membership resource is deleted and another
    * resource with the same name is created, it gets a different unique_id.
    * 
* @@ -501,8 +494,8 @@ java.lang.String getLabelsOrDefault( * * *
-   * Output only. Google-generated UUID for this resource. This is unique across
-   * all Membership resources. If a Membership resource is deleted and another
+   * Output only. Google-generated UUID for this resource. This is unique across all
+   * Membership resources. If a Membership resource is deleted and another
    * resource with the same name is created, it gets a different unique_id.
    * 
* diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipOuterClass.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipOuterClass.java index 29ad9edb..d2f5d13f 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipOuterClass.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipOuterClass.java @@ -63,6 +63,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_gkehub_v1beta1_MultiCloudCluster_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_gkehub_v1beta1_MultiCloudCluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_gkehub_v1beta1_KubernetesMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -179,152 +187,170 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "NSPECIFIED\020\000\022\013\n\007ON_PREM\020\001\022\017\n\013MULTI_CLOUD" + "\020\002:g\352Ad\n gkehub.googleapis.com/Membershi" + "p\022@projects/{project}/locations/{locatio" - + "n}/memberships/{membership}B\006\n\004type\"\247\003\n\022" + + "n}/memberships/{membership}B\006\n\004type\"\277\004\n\022" + "MembershipEndpoint\022C\n\013gke_cluster\030\004 \001(\0132" + "\'.google.cloud.gkehub.v1beta1.GkeCluster" + "B\003\340A\001H\000\022J\n\017on_prem_cluster\030\007 \001(\0132*.googl" + "e.cloud.gkehub.v1beta1.OnPremClusterB\003\340A" + "\001H\000\022R\n\023multi_cloud_cluster\030\010 \001(\0132..googl" + "e.cloud.gkehub.v1beta1.MultiCloudCluster" - + "B\003\340A\001H\000\022Q\n\023kubernetes_metadata\030\005 \001(\0132/.g" - + "oogle.cloud.gkehub.v1beta1.KubernetesMet" - + "adataB\003\340A\003\022Q\n\023kubernetes_resource\030\006 \001(\0132" - + "/.google.cloud.gkehub.v1beta1.Kubernetes" - + "ResourceB\003\340A\001B\006\n\004type\"\247\002\n\022KubernetesReso" - + "urce\022#\n\026membership_cr_manifest\030\001 \001(\tB\003\340A" - + "\004\022P\n\024membership_resources\030\002 \003(\0132-.google" - + ".cloud.gkehub.v1beta1.ResourceManifestB\003" - + "\340A\003\022M\n\021connect_resources\030\003 \003(\0132-.google." - + "cloud.gkehub.v1beta1.ResourceManifestB\003\340" - + "A\003\022K\n\020resource_options\030\004 \001(\0132,.google.cl" - + "oud.gkehub.v1beta1.ResourceOptionsB\003\340A\001\"" - + "c\n\017ResourceOptions\022\034\n\017connect_version\030\001 " - + "\001(\tB\003\340A\001\022\030\n\013v1beta1_crd\030\002 \001(\010B\003\340A\001\022\030\n\013k8" - + "s_version\030\003 \001(\tB\003\340A\001\"<\n\020ResourceManifest" - + "\022\020\n\010manifest\030\001 \001(\t\022\026\n\016cluster_scoped\030\002 \001" - + "(\010\"F\n\nGkeCluster\022\032\n\rresource_link\030\001 \001(\tB" - + "\003\340A\005\022\034\n\017cluster_missing\030\003 \001(\010B\003\340A\003\"e\n\rOn" - + "PremCluster\022\032\n\rresource_link\030\001 \001(\tB\003\340A\005\022" - + "\034\n\017cluster_missing\030\002 \001(\010B\003\340A\003\022\032\n\radmin_c" - + "luster\030\003 \001(\010B\003\340A\005\"M\n\021MultiCloudCluster\022\032" - + "\n\rresource_link\030\001 \001(\tB\003\340A\005\022\034\n\017cluster_mi" - + "ssing\030\002 \001(\010B\003\340A\003\"\337\001\n\022KubernetesMetadata\022" - + "*\n\035kubernetes_api_server_version\030\001 \001(\tB\003" - + "\340A\003\022\035\n\020node_provider_id\030\002 \001(\tB\003\340A\003\022\027\n\nno" - + "de_count\030\003 \001(\005B\003\340A\003\022\027\n\nvcpu_count\030\004 \001(\005B" - + "\003\340A\003\022\026\n\tmemory_mb\030\005 \001(\005B\003\340A\003\0224\n\013update_t" - + "ime\030d \001(\0132\032.google.protobuf.TimestampB\003\340" - + "A\003\"}\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\001\"\216\002\n\017MembershipState\022D\n\004code\030\001 " - + "\001(\01621.google.cloud.gkehub.v1beta1.Member" - + "shipState.CodeB\003\340A\003\022\027\n\013description\030\002 \001(\t" - + "B\002\030\001\0223\n\013update_time\030\003 \001(\0132\032.google.proto" - + "buf.TimestampB\002\030\001\"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\"\212\001\n\026ListMembershipsRequest\022\023\n\006parent\030" - + "\001 \001(\tB\003\340A\002\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npa" - + "ge_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001" - + "\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"\203\001\n\027ListMembersh" - + "ipsResponse\022:\n\tresources\030\001 \003(\0132\'.google." - + "cloud.gkehub.v1beta1.Membership\022\027\n\017next_" - + "page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\")\n" - + "\024GetMembershipRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002" - + "\"\243\001\n\027CreateMembershipRequest\022\023\n\006parent\030\001" - + " \001(\tB\003\340A\002\022\032\n\rmembership_id\030\002 \001(\tB\003\340A\002\022>\n" - + "\010resource\030\003 \001(\0132\'.google.cloud.gkehub.v1" - + "beta1.MembershipB\003\340A\002\022\027\n\nrequest_id\030\004 \001(" - + "\tB\003\340A\001\"E\n\027DeleteMembershipRequest\022\021\n\004nam" - + "e\030\001 \001(\tB\003\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"\273\001" - + "\n\027UpdateMembershipRequest\022\021\n\004name\030\001 \001(\tB" - + "\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.proto" - + "buf.FieldMaskB\003\340A\002\022>\n\010resource\030\003 \001(\0132\'.g" - + "oogle.cloud.gkehub.v1beta1.MembershipB\003\340" - + "A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"\350\001\n\036Generate" - + "ConnectManifestRequest\022\021\n\004name\030\001 \001(\tB\003\340A" - + "\002\022E\n\rconnect_agent\030\002 \001(\0132).google.cloud." - + "gkehub.v1beta1.ConnectAgentB\003\340A\001\022\024\n\007vers" - + "ion\030\003 \001(\tB\003\340A\001\022\027\n\nis_upgrade\030\004 \001(\010B\003\340A\001\022" - + "\025\n\010registry\030\005 \001(\tB\003\340A\001\022&\n\031image_pull_sec" - + "ret_content\030\006 \001(\014B\003\340A\001\"f\n\037GenerateConnec" - + "tManifestResponse\022C\n\010manifest\030\001 \003(\01321.go" - + "ogle.cloud.gkehub.v1beta1.ConnectAgentRe" - + "source\"]\n\024ConnectAgentResource\0223\n\004type\030\001" - + " \001(\0132%.google.cloud.gkehub.v1beta1.TypeM" - + "eta\022\020\n\010manifest\030\002 \001(\t\"-\n\010TypeMeta\022\014\n\004kin" - + "d\030\001 \001(\t\022\023\n\013api_version\030\002 \001(\t\"L\n\014ConnectA" - + "gent\022\020\n\004name\030\001 \001(\tB\002\030\001\022\022\n\005proxy\030\002 \001(\014B\003\340" - + "A\001\022\026\n\tnamespace\030\003 \001(\tB\003\340A\001\"m\n\032ValidateEx" - + "clusivityRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\030\n" - + "\013cr_manifest\030\002 \001(\tB\003\340A\001\022 \n\023intended_memb" - + "ership\030\003 \001(\tB\003\340A\002\"A\n\033ValidateExclusivity" - + "Response\022\"\n\006status\030\001 \001(\0132\022.google.rpc.St" - + "atus\"l\n\"GenerateExclusivityManifestReque" - + "st\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\031\n\014crd_manifest\030\002 " - + "\001(\tB\003\340A\001\022\030\n\013cr_manifest\030\003 \001(\tB\003\340A\001\"P\n#Ge" - + "nerateExclusivityManifestResponse\022\024\n\014crd" - + "_manifest\030\001 \001(\t\022\023\n\013cr_manifest\030\002 \001(\t\"\371\001\n" - + "\021OperationMetadata\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\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\020cance" - + "l_requested\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 " - + "\001(\tB\003\340A\0032\346\016\n\027GkeHubMembershipService\022\303\001\n" - + "\017ListMemberships\0223.google.cloud.gkehub.v" - + "1beta1.ListMembershipsRequest\0324.google.c" - + "loud.gkehub.v1beta1.ListMembershipsRespo" - + "nse\"E\202\323\344\223\0026\0224/v1beta1/{parent=projects/*" - + "/locations/*}/memberships\332A\006parent\022\260\001\n\rG" - + "etMembership\0221.google.cloud.gkehub.v1bet" - + "a1.GetMembershipRequest\032\'.google.cloud.g" - + "kehub.v1beta1.Membership\"C\202\323\344\223\0026\0224/v1bet" - + "a1/{name=projects/*/locations/*/membersh" - + "ips/*}\332A\004name\022\362\001\n\020CreateMembership\0224.goo" - + "gle.cloud.gkehub.v1beta1.CreateMembershi" - + "pRequest\032\035.google.longrunning.Operation\"" - + "\210\001\202\323\344\223\002@\"4/v1beta1/{parent=projects/*/lo" - + "cations/*}/memberships:\010resource\332A\035paren" - + "t,resource,membership_id\312A\037\n\nMembership\022" - + "\021OperationMetadata\022\331\001\n\020DeleteMembership\022" - + "4.google.cloud.gkehub.v1beta1.DeleteMemb" - + "ershipRequest\032\035.google.longrunning.Opera" - + "tion\"p\202\323\344\223\0026*4/v1beta1/{name=projects/*/" - + "locations/*/memberships/*}\332A\004name\312A*\n\025go" - + "ogle.protobuf.Empty\022\021OperationMetadata\022\356" - + "\001\n\020UpdateMembership\0224.google.cloud.gkehu" - + "b.v1beta1.UpdateMembershipRequest\032\035.goog" - + "le.longrunning.Operation\"\204\001\202\323\344\223\002@24/v1be" - + "ta1/{name=projects/*/locations/*/members" - + "hips/*}:\010resource\332A\031name,resource,update" - + "_mask\312A\037\n\nMembership\022\021OperationMetadata\022" - + "\352\001\n\027GenerateConnectManifest\022;.google.clo" - + "ud.gkehub.v1beta1.GenerateConnectManifes" - + "tRequest\032<.google.cloud.gkehub.v1beta1.G" - + "enerateConnectManifestResponse\"T\202\323\344\223\002N\022L" - + "/v1beta1/{name=projects/*/locations/*/me" - + "mberships/*}:generateConnectManifest\022\332\001\n" - + "\023ValidateExclusivity\0227.google.cloud.gkeh" - + "ub.v1beta1.ValidateExclusivityRequest\0328." - + "google.cloud.gkehub.v1beta1.ValidateExcl" - + "usivityResponse\"P\202\323\344\223\002J\022H/v1beta1/{paren" - + "t=projects/*/locations/*}/memberships:va" - + "lidateExclusivity\022\372\001\n\033GenerateExclusivit" - + "yManifest\022?.google.cloud.gkehub.v1beta1." - + "GenerateExclusivityManifestRequest\032@.goo" - + "gle.cloud.gkehub.v1beta1.GenerateExclusi" - + "vityManifestResponse\"X\202\323\344\223\002R\022P/v1beta1/{" - + "name=projects/*/locations/*/memberships/" - + "*}:generateExclusivityManifest\032I\312A\025gkehu" - + "b.googleapis.com\322A.https://www.googleapi" - + "s.com/auth/cloud-platformB\303\001\n\037com.google" - + ".cloud.gkehub.v1beta1P\001ZAgoogle.golang.o" - + "rg/genproto/googleapis/cloud/gkehub/v1be" - + "ta1;gkehub\252\002\033Google.Cloud.GkeHub.V1Beta1" - + "\312\002\033Google\\Cloud\\GkeHub\\V1beta1\352\002\036Google:" - + ":Cloud::GkeHub::V1beta1b\006proto3" + + "B\003\340A\001H\000\022E\n\014edge_cluster\030\t \001(\0132(.google.c" + + "loud.gkehub.v1beta1.EdgeClusterB\003\340A\001H\000\022O" + + "\n\021appliance_cluster\030\n \001(\0132-.google.cloud" + + ".gkehub.v1beta1.ApplianceClusterB\003\340A\001H\000\022" + + "Q\n\023kubernetes_metadata\030\005 \001(\0132/.google.cl" + + "oud.gkehub.v1beta1.KubernetesMetadataB\003\340" + + "A\003\022Q\n\023kubernetes_resource\030\006 \001(\0132/.google" + + ".cloud.gkehub.v1beta1.KubernetesResource" + + "B\003\340A\001B\006\n\004type\"\247\002\n\022KubernetesResource\022#\n\026" + + "membership_cr_manifest\030\001 \001(\tB\003\340A\004\022P\n\024mem" + + "bership_resources\030\002 \003(\0132-.google.cloud.g" + + "kehub.v1beta1.ResourceManifestB\003\340A\003\022M\n\021c" + + "onnect_resources\030\003 \003(\0132-.google.cloud.gk" + + "ehub.v1beta1.ResourceManifestB\003\340A\003\022K\n\020re" + + "source_options\030\004 \001(\0132,.google.cloud.gkeh" + + "ub.v1beta1.ResourceOptionsB\003\340A\001\"c\n\017Resou" + + "rceOptions\022\034\n\017connect_version\030\001 \001(\tB\003\340A\001" + + "\022\030\n\013v1beta1_crd\030\002 \001(\010B\003\340A\001\022\030\n\013k8s_versio" + + "n\030\003 \001(\tB\003\340A\001\"<\n\020ResourceManifest\022\020\n\010mani" + + "fest\030\001 \001(\t\022\026\n\016cluster_scoped\030\002 \001(\010\"F\n\nGk" + + "eCluster\022\032\n\rresource_link\030\001 \001(\tB\003\340A\005\022\034\n\017" + + "cluster_missing\030\003 \001(\010B\003\340A\003\"\231\002\n\rOnPremClu" + + "ster\022\032\n\rresource_link\030\001 \001(\tB\003\340A\005\022\034\n\017clus" + + "ter_missing\030\002 \001(\010B\003\340A\003\022\032\n\radmin_cluster\030" + + "\003 \001(\010B\003\340A\005\022Q\n\014cluster_type\030\004 \001(\01626.googl" + + "e.cloud.gkehub.v1beta1.OnPremCluster.Clu" + + "sterTypeB\003\340A\005\"_\n\013ClusterType\022\033\n\027CLUSTERT" + + "YPE_UNSPECIFIED\020\000\022\r\n\tBOOTSTRAP\020\001\022\n\n\006HYBR" + + "ID\020\002\022\016\n\nSTANDALONE\020\003\022\010\n\004USER\020\004\"M\n\021MultiC" + + "loudCluster\022\032\n\rresource_link\030\001 \001(\tB\003\340A\005\022" + + "\034\n\017cluster_missing\030\002 \001(\010B\003\340A\003\")\n\013EdgeClu" + + "ster\022\032\n\rresource_link\030\001 \001(\tB\003\340A\005\".\n\020Appl" + + "ianceCluster\022\032\n\rresource_link\030\001 \001(\tB\003\340A\005" + + "\"\337\001\n\022KubernetesMetadata\022*\n\035kubernetes_ap" + + "i_server_version\030\001 \001(\tB\003\340A\003\022\035\n\020node_prov" + + "ider_id\030\002 \001(\tB\003\340A\003\022\027\n\nnode_count\030\003 \001(\005B\003" + + "\340A\003\022\027\n\nvcpu_count\030\004 \001(\005B\003\340A\003\022\026\n\tmemory_m" + + "b\030\005 \001(\005B\003\340A\003\0224\n\013update_time\030d \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\"}\n\tAuthority\022" + + "\023\n\006issuer\030\001 \001(\tB\003\340A\001\022#\n\026workload_identit" + + "y_pool\030\002 \001(\tB\003\340A\003\022\036\n\021identity_provider\030\003" + + " \001(\tB\003\340A\003\022\026\n\toidc_jwks\030\004 \001(\014B\003\340A\001\"\216\002\n\017Me" + + "mbershipState\022D\n\004code\030\001 \001(\01621.google.clo" + + "ud.gkehub.v1beta1.MembershipState.CodeB\003" + + "\340A\003\022\027\n\013description\030\002 \001(\tB\002\030\001\0223\n\013update_t" + + "ime\030\003 \001(\0132\032.google.protobuf.TimestampB\002\030" + + "\001\"g\n\004Code\022\024\n\020CODE_UNSPECIFIED\020\000\022\014\n\010CREAT" + + "ING\020\001\022\t\n\005READY\020\002\022\014\n\010DELETING\020\003\022\014\n\010UPDATI" + + "NG\020\004\022\024\n\020SERVICE_UPDATING\020\005\"\257\001\n\026ListMembe" + + "rshipsRequest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 g" + + "kehub.googleapis.com/Membership\022\026\n\tpage_" + + "size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001" + + "\022\023\n\006filter\030\004 \001(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB" + + "\003\340A\001\"\203\001\n\027ListMembershipsResponse\022:\n\treso" + + "urces\030\001 \003(\0132\'.google.cloud.gkehub.v1beta" + + "1.Membership\022\027\n\017next_page_token\030\002 \001(\t\022\023\n" + + "\013unreachable\030\003 \003(\t\"N\n\024GetMembershipReque" + + "st\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n gkehub.googlea" + + "pis.com/Membership\"\310\001\n\027CreateMembershipR" + + "equest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 gkehub.g" + + "oogleapis.com/Membership\022\032\n\rmembership_i" + + "d\030\002 \001(\tB\003\340A\002\022>\n\010resource\030\003 \001(\0132\'.google." + + "cloud.gkehub.v1beta1.MembershipB\003\340A\002\022\027\n\n" + + "request_id\030\004 \001(\tB\003\340A\001\"j\n\027DeleteMembershi" + + "pRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n gkehub.g" + + "oogleapis.com/Membership\022\027\n\nrequest_id\030\004" + + " \001(\tB\003\340A\001\"\340\001\n\027UpdateMembershipRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n gkehub.googleapis.c" + + "om/Membership\0224\n\013update_mask\030\002 \001(\0132\032.goo" + + "gle.protobuf.FieldMaskB\003\340A\002\022>\n\010resource\030" + + "\003 \001(\0132\'.google.cloud.gkehub.v1beta1.Memb" + + "ershipB\003\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"\215\002\n" + + "\036GenerateConnectManifestRequest\0226\n\004name\030" + + "\001 \001(\tB(\340A\002\372A\"\n gkehub.googleapis.com/Mem" + + "bership\022E\n\rconnect_agent\030\002 \001(\0132).google." + + "cloud.gkehub.v1beta1.ConnectAgentB\003\340A\001\022\024" + + "\n\007version\030\003 \001(\tB\003\340A\001\022\027\n\nis_upgrade\030\004 \001(\010" + + "B\003\340A\001\022\025\n\010registry\030\005 \001(\tB\003\340A\001\022&\n\031image_pu" + + "ll_secret_content\030\006 \001(\014B\003\340A\001\"f\n\037Generate" + + "ConnectManifestResponse\022C\n\010manifest\030\001 \003(" + + "\01321.google.cloud.gkehub.v1beta1.ConnectA" + + "gentResource\"]\n\024ConnectAgentResource\0223\n\004" + + "type\030\001 \001(\0132%.google.cloud.gkehub.v1beta1" + + ".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\"L\n\014Co" + + "nnectAgent\022\020\n\004name\030\001 \001(\tB\002\030\001\022\022\n\005proxy\030\002 " + + "\001(\014B\003\340A\001\022\026\n\tnamespace\030\003 \001(\tB\003\340A\001\"\222\001\n\032Val" + + "idateExclusivityRequest\0228\n\006parent\030\001 \001(\tB" + + "(\340A\002\372A\"\022 gkehub.googleapis.com/Membershi" + + "p\022\030\n\013cr_manifest\030\002 \001(\tB\003\340A\001\022 \n\023intended_" + + "membership\030\003 \001(\tB\003\340A\002\"A\n\033ValidateExclusi" + + "vityResponse\022\"\n\006status\030\001 \001(\0132\022.google.rp" + + "c.Status\"\221\001\n\"GenerateExclusivityManifest" + + "Request\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n gkehub.go" + + "ogleapis.com/Membership\022\031\n\014crd_manifest\030" + + "\002 \001(\tB\003\340A\001\022\030\n\013cr_manifest\030\003 \001(\tB\003\340A\001\"P\n#" + + "GenerateExclusivityManifestResponse\022\024\n\014c" + + "rd_manifest\030\001 \001(\t\022\023\n\013cr_manifest\030\002 \001(\t\"\371" + + "\001\n\021OperationMetadata\0224\n\013create_time\030\001 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n\010en" + + "d_time\030\002 \001(\0132\032.google.protobuf.Timestamp" + + "B\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\t" + + "B\003\340A\003\022\032\n\rstatus_detail\030\005 \001(\tB\003\340A\003\022\035\n\020can" + + "cel_requested\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030" + + "\007 \001(\tB\003\340A\0032\346\016\n\027GkeHubMembershipService\022\303" + + "\001\n\017ListMemberships\0223.google.cloud.gkehub" + + ".v1beta1.ListMembershipsRequest\0324.google" + + ".cloud.gkehub.v1beta1.ListMembershipsRes" + + "ponse\"E\202\323\344\223\0026\0224/v1beta1/{parent=projects" + + "/*/locations/*}/memberships\332A\006parent\022\260\001\n" + + "\rGetMembership\0221.google.cloud.gkehub.v1b" + + "eta1.GetMembershipRequest\032\'.google.cloud" + + ".gkehub.v1beta1.Membership\"C\202\323\344\223\0026\0224/v1b" + + "eta1/{name=projects/*/locations/*/member" + + "ships/*}\332A\004name\022\362\001\n\020CreateMembership\0224.g" + + "oogle.cloud.gkehub.v1beta1.CreateMembers" + + "hipRequest\032\035.google.longrunning.Operatio" + + "n\"\210\001\202\323\344\223\002@\"4/v1beta1/{parent=projects/*/" + + "locations/*}/memberships:\010resource\332A\035par" + + "ent,resource,membership_id\312A\037\n\nMembershi" + + "p\022\021OperationMetadata\022\331\001\n\020DeleteMembershi" + + "p\0224.google.cloud.gkehub.v1beta1.DeleteMe" + + "mbershipRequest\032\035.google.longrunning.Ope" + + "ration\"p\202\323\344\223\0026*4/v1beta1/{name=projects/" + + "*/locations/*/memberships/*}\332A\004name\312A*\n\025" + + "google.protobuf.Empty\022\021OperationMetadata" + + "\022\356\001\n\020UpdateMembership\0224.google.cloud.gke" + + "hub.v1beta1.UpdateMembershipRequest\032\035.go" + + "ogle.longrunning.Operation\"\204\001\202\323\344\223\002@24/v1" + + "beta1/{name=projects/*/locations/*/membe" + + "rships/*}:\010resource\332A\031name,resource,upda" + + "te_mask\312A\037\n\nMembership\022\021OperationMetadat" + + "a\022\352\001\n\027GenerateConnectManifest\022;.google.c" + + "loud.gkehub.v1beta1.GenerateConnectManif" + + "estRequest\032<.google.cloud.gkehub.v1beta1" + + ".GenerateConnectManifestResponse\"T\202\323\344\223\002N" + + "\022L/v1beta1/{name=projects/*/locations/*/" + + "memberships/*}:generateConnectManifest\022\332" + + "\001\n\023ValidateExclusivity\0227.google.cloud.gk" + + "ehub.v1beta1.ValidateExclusivityRequest\032" + + "8.google.cloud.gkehub.v1beta1.ValidateEx" + + "clusivityResponse\"P\202\323\344\223\002J\022H/v1beta1/{par" + + "ent=projects/*/locations/*}/memberships:" + + "validateExclusivity\022\372\001\n\033GenerateExclusiv" + + "ityManifest\022?.google.cloud.gkehub.v1beta" + + "1.GenerateExclusivityManifestRequest\032@.g" + + "oogle.cloud.gkehub.v1beta1.GenerateExclu" + + "sivityManifestResponse\"X\202\323\344\223\002R\022P/v1beta1" + + "/{name=projects/*/locations/*/membership" + + "s/*}:generateExclusivityManifest\032I\312A\025gke" + + "hub.googleapis.com\322A.https://www.googlea" + + "pis.com/auth/cloud-platformB\303\001\n\037com.goog" + + "le.cloud.gkehub.v1beta1P\001ZAgoogle.golang" + + ".org/genproto/googleapis/cloud/gkehub/v1" + + "beta1;gkehub\252\002\033Google.Cloud.GkeHub.V1Bet" + + "a1\312\002\033Google\\Cloud\\GkeHub\\V1beta1\352\002\036Googl" + + "e::Cloud::GkeHub::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -377,6 +403,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "GkeCluster", "OnPremCluster", "MultiCloudCluster", + "EdgeCluster", + "ApplianceCluster", "KubernetesMetadata", "KubernetesResource", "Type", @@ -419,7 +447,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_OnPremCluster_descriptor, new java.lang.String[] { - "ResourceLink", "ClusterMissing", "AdminCluster", + "ResourceLink", "ClusterMissing", "AdminCluster", "ClusterType", }); internal_static_google_cloud_gkehub_v1beta1_MultiCloudCluster_descriptor = getDescriptor().getMessageTypes().get(7); @@ -429,8 +457,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "ResourceLink", "ClusterMissing", }); - internal_static_google_cloud_gkehub_v1beta1_KubernetesMetadata_descriptor = + internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_descriptor = getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gkehub_v1beta1_EdgeCluster_descriptor, + new java.lang.String[] { + "ResourceLink", + }); + internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gkehub_v1beta1_ApplianceCluster_descriptor, + new java.lang.String[] { + "ResourceLink", + }); + internal_static_google_cloud_gkehub_v1beta1_KubernetesMetadata_descriptor = + getDescriptor().getMessageTypes().get(10); internal_static_google_cloud_gkehub_v1beta1_KubernetesMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_KubernetesMetadata_descriptor, @@ -443,7 +487,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UpdateTime", }); internal_static_google_cloud_gkehub_v1beta1_Authority_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_gkehub_v1beta1_Authority_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_Authority_descriptor, @@ -451,7 +495,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Issuer", "WorkloadIdentityPool", "IdentityProvider", "OidcJwks", }); internal_static_google_cloud_gkehub_v1beta1_MembershipState_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_gkehub_v1beta1_MembershipState_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_MembershipState_descriptor, @@ -459,7 +503,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Code", "Description", "UpdateTime", }); internal_static_google_cloud_gkehub_v1beta1_ListMembershipsRequest_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_gkehub_v1beta1_ListMembershipsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_ListMembershipsRequest_descriptor, @@ -467,7 +511,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "Filter", "OrderBy", }); internal_static_google_cloud_gkehub_v1beta1_ListMembershipsResponse_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_gkehub_v1beta1_ListMembershipsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_ListMembershipsResponse_descriptor, @@ -475,7 +519,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Resources", "NextPageToken", "Unreachable", }); internal_static_google_cloud_gkehub_v1beta1_GetMembershipRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_gkehub_v1beta1_GetMembershipRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_GetMembershipRequest_descriptor, @@ -483,7 +527,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_gkehub_v1beta1_CreateMembershipRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_gkehub_v1beta1_CreateMembershipRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_CreateMembershipRequest_descriptor, @@ -491,7 +535,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "MembershipId", "Resource", "RequestId", }); internal_static_google_cloud_gkehub_v1beta1_DeleteMembershipRequest_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(17); internal_static_google_cloud_gkehub_v1beta1_DeleteMembershipRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_DeleteMembershipRequest_descriptor, @@ -499,7 +543,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "RequestId", }); internal_static_google_cloud_gkehub_v1beta1_UpdateMembershipRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(18); internal_static_google_cloud_gkehub_v1beta1_UpdateMembershipRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_UpdateMembershipRequest_descriptor, @@ -507,7 +551,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "UpdateMask", "Resource", "RequestId", }); internal_static_google_cloud_gkehub_v1beta1_GenerateConnectManifestRequest_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_gkehub_v1beta1_GenerateConnectManifestRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_GenerateConnectManifestRequest_descriptor, @@ -515,7 +559,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "ConnectAgent", "Version", "IsUpgrade", "Registry", "ImagePullSecretContent", }); internal_static_google_cloud_gkehub_v1beta1_GenerateConnectManifestResponse_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_gkehub_v1beta1_GenerateConnectManifestResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_GenerateConnectManifestResponse_descriptor, @@ -523,7 +567,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Manifest", }); internal_static_google_cloud_gkehub_v1beta1_ConnectAgentResource_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_gkehub_v1beta1_ConnectAgentResource_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_ConnectAgentResource_descriptor, @@ -531,7 +575,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Type", "Manifest", }); internal_static_google_cloud_gkehub_v1beta1_TypeMeta_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_gkehub_v1beta1_TypeMeta_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_TypeMeta_descriptor, @@ -539,7 +583,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Kind", "ApiVersion", }); internal_static_google_cloud_gkehub_v1beta1_ConnectAgent_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(23); internal_static_google_cloud_gkehub_v1beta1_ConnectAgent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_ConnectAgent_descriptor, @@ -547,7 +591,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "Proxy", "Namespace", }); internal_static_google_cloud_gkehub_v1beta1_ValidateExclusivityRequest_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_gkehub_v1beta1_ValidateExclusivityRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_ValidateExclusivityRequest_descriptor, @@ -555,7 +599,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "CrManifest", "IntendedMembership", }); internal_static_google_cloud_gkehub_v1beta1_ValidateExclusivityResponse_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_gkehub_v1beta1_ValidateExclusivityResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_ValidateExclusivityResponse_descriptor, @@ -563,7 +607,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Status", }); internal_static_google_cloud_gkehub_v1beta1_GenerateExclusivityManifestRequest_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(26); internal_static_google_cloud_gkehub_v1beta1_GenerateExclusivityManifestRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_GenerateExclusivityManifestRequest_descriptor, @@ -571,7 +615,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "CrdManifest", "CrManifest", }); internal_static_google_cloud_gkehub_v1beta1_GenerateExclusivityManifestResponse_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_gkehub_v1beta1_GenerateExclusivityManifestResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_GenerateExclusivityManifestResponse_descriptor, @@ -579,7 +623,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CrdManifest", "CrManifest", }); internal_static_google_cloud_gkehub_v1beta1_OperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(28); internal_static_google_cloud_gkehub_v1beta1_OperationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkehub_v1beta1_OperationMetadata_descriptor, @@ -600,6 +644,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ClientProto.methodSignature); registry.add(com.google.api.ClientProto.oauthScopes); registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); registry.add(com.google.longrunning.OperationsProto.operationInfo); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipState.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipState.java index 39bcad7b..049f8cb6 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipState.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipState.java @@ -413,7 +413,7 @@ public com.google.cloud.gkehub.v1beta1.MembershipState.Code getCode() { * string description = 2 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.description is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=501 + * google/cloud/gkehub/v1beta1/membership.proto;l=522 * @return The description. */ @java.lang.Override @@ -439,7 +439,7 @@ public java.lang.String getDescription() { * string description = 2 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.description is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=501 + * google/cloud/gkehub/v1beta1/membership.proto;l=522 * @return The bytes for description. */ @java.lang.Override @@ -468,7 +468,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * .google.protobuf.Timestamp update_time = 3 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.update_time is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=504 + * google/cloud/gkehub/v1beta1/membership.proto;l=525 * @return Whether the updateTime field is set. */ @java.lang.Override @@ -486,7 +486,7 @@ public boolean hasUpdateTime() { * .google.protobuf.Timestamp update_time = 3 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.update_time is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=504 + * google/cloud/gkehub/v1beta1/membership.proto;l=525 * @return The updateTime. */ @java.lang.Override @@ -985,7 +985,7 @@ public Builder clearCode() { * string description = 2 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.description is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=501 + * google/cloud/gkehub/v1beta1/membership.proto;l=522 * @return The description. */ @java.lang.Deprecated @@ -1010,7 +1010,7 @@ public java.lang.String getDescription() { * string description = 2 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.description is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=501 + * google/cloud/gkehub/v1beta1/membership.proto;l=522 * @return The bytes for description. */ @java.lang.Deprecated @@ -1035,7 +1035,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * string description = 2 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.description is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=501 + * google/cloud/gkehub/v1beta1/membership.proto;l=522 * @param value The description to set. * @return This builder for chaining. */ @@ -1059,7 +1059,7 @@ public Builder setDescription(java.lang.String value) { * string description = 2 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.description is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=501 + * google/cloud/gkehub/v1beta1/membership.proto;l=522 * @return This builder for chaining. */ @java.lang.Deprecated @@ -1079,7 +1079,7 @@ public Builder clearDescription() { * string description = 2 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.description is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=501 + * google/cloud/gkehub/v1beta1/membership.proto;l=522 * @param value The bytes for description to set. * @return This builder for chaining. */ @@ -1111,7 +1111,7 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { * .google.protobuf.Timestamp update_time = 3 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.update_time is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=504 + * google/cloud/gkehub/v1beta1/membership.proto;l=525 * @return Whether the updateTime field is set. */ @java.lang.Deprecated @@ -1128,7 +1128,7 @@ public boolean hasUpdateTime() { * .google.protobuf.Timestamp update_time = 3 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.update_time is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=504 + * google/cloud/gkehub/v1beta1/membership.proto;l=525 * @return The updateTime. */ @java.lang.Deprecated diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipStateOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipStateOrBuilder.java index 23058c14..6ea22e38 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipStateOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MembershipStateOrBuilder.java @@ -62,7 +62,7 @@ public interface MembershipStateOrBuilder * string description = 2 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.description is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=501 + * google/cloud/gkehub/v1beta1/membership.proto;l=522 * @return The description. */ @java.lang.Deprecated @@ -77,7 +77,7 @@ public interface MembershipStateOrBuilder * string description = 2 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.description is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=501 + * google/cloud/gkehub/v1beta1/membership.proto;l=522 * @return The bytes for description. */ @java.lang.Deprecated @@ -93,7 +93,7 @@ public interface MembershipStateOrBuilder * .google.protobuf.Timestamp update_time = 3 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.update_time is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=504 + * google/cloud/gkehub/v1beta1/membership.proto;l=525 * @return Whether the updateTime field is set. */ @java.lang.Deprecated @@ -108,7 +108,7 @@ public interface MembershipStateOrBuilder * .google.protobuf.Timestamp update_time = 3 [deprecated = true]; * * @deprecated google.cloud.gkehub.v1beta1.MembershipState.update_time is deprecated. See - * google/cloud/gkehub/v1beta1/membership.proto;l=504 + * google/cloud/gkehub/v1beta1/membership.proto;l=525 * @return The updateTime. */ @java.lang.Deprecated diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MultiCloudCluster.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MultiCloudCluster.java index f4b2338e..84310747 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MultiCloudCluster.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MultiCloudCluster.java @@ -124,8 +124,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster.
-   * For example:
+   * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
+   * example:
    *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
    *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
    * 
@@ -150,8 +150,8 @@ public java.lang.String getResourceLink() { * * *
-   * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster.
-   * For example:
+   * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
+   * example:
    *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
    *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
    * 
@@ -531,8 +531,8 @@ public Builder mergeFrom( * * *
-     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster.
-     * For example:
+     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
+     * example:
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
      * 
@@ -556,8 +556,8 @@ public java.lang.String getResourceLink() { * * *
-     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster.
-     * For example:
+     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
+     * example:
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
      * 
@@ -581,8 +581,8 @@ public com.google.protobuf.ByteString getResourceLinkBytes() { * * *
-     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster.
-     * For example:
+     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
+     * example:
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
      * 
@@ -605,8 +605,8 @@ public Builder setResourceLink(java.lang.String value) { * * *
-     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster.
-     * For example:
+     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
+     * example:
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
      * 
@@ -625,8 +625,8 @@ public Builder clearResourceLink() { * * *
-     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster.
-     * For example:
+     * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
+     * example:
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
      *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
      * 
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MultiCloudClusterOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MultiCloudClusterOrBuilder.java index 34aab46b..a5b3445a 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MultiCloudClusterOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/MultiCloudClusterOrBuilder.java @@ -27,8 +27,8 @@ public interface MultiCloudClusterOrBuilder * * *
-   * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster.
-   * For example:
+   * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
+   * example:
    *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
    *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
    * 
@@ -42,8 +42,8 @@ public interface MultiCloudClusterOrBuilder * * *
-   * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster.
-   * For example:
+   * Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
+   * example:
    *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
    *  //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
    * 
diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OnPremCluster.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OnPremCluster.java index d11f3f8c..105a0ffe 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OnPremCluster.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OnPremCluster.java @@ -39,6 +39,7 @@ private OnPremCluster(com.google.protobuf.GeneratedMessageV3.Builder builder) private OnPremCluster() { resourceLink_ = ""; + clusterType_ = 0; } @java.lang.Override @@ -87,6 +88,13 @@ private OnPremCluster( adminCluster_ = input.readBool(); break; } + case 32: + { + int rawValue = input.readEnum(); + + clusterType_ = rawValue; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -123,14 +131,214 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.gkehub.v1beta1.OnPremCluster.Builder.class); } + /** + * + * + *
+   * ClusterType describes on prem cluster's type.
+   * 
+ * + * Protobuf enum {@code google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType} + */ + public enum ClusterType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The ClusterType is not set.
+     * 
+ * + * CLUSTERTYPE_UNSPECIFIED = 0; + */ + CLUSTERTYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The ClusterType is bootstrap cluster.
+     * 
+ * + * BOOTSTRAP = 1; + */ + BOOTSTRAP(1), + /** + * + * + *
+     * The ClusterType is baremetal hybrid cluster.
+     * 
+ * + * HYBRID = 2; + */ + HYBRID(2), + /** + * + * + *
+     * The ClusterType is baremetal standalone cluster.
+     * 
+ * + * STANDALONE = 3; + */ + STANDALONE(3), + /** + * + * + *
+     * The ClusterType is user cluster.
+     * 
+ * + * USER = 4; + */ + USER(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The ClusterType is not set.
+     * 
+ * + * CLUSTERTYPE_UNSPECIFIED = 0; + */ + public static final int CLUSTERTYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The ClusterType is bootstrap cluster.
+     * 
+ * + * BOOTSTRAP = 1; + */ + public static final int BOOTSTRAP_VALUE = 1; + /** + * + * + *
+     * The ClusterType is baremetal hybrid cluster.
+     * 
+ * + * HYBRID = 2; + */ + public static final int HYBRID_VALUE = 2; + /** + * + * + *
+     * The ClusterType is baremetal standalone cluster.
+     * 
+ * + * STANDALONE = 3; + */ + public static final int STANDALONE_VALUE = 3; + /** + * + * + *
+     * The ClusterType is user cluster.
+     * 
+ * + * USER = 4; + */ + public static final int USER_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ClusterType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ClusterType forNumber(int value) { + switch (value) { + case 0: + return CLUSTERTYPE_UNSPECIFIED; + case 1: + return BOOTSTRAP; + case 2: + return HYBRID; + case 3: + return STANDALONE; + case 4: + return USER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ClusterType findValueByNumber(int number) { + return ClusterType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.gkehub.v1beta1.OnPremCluster.getDescriptor().getEnumTypes().get(0); + } + + private static final ClusterType[] VALUES = values(); + + public static ClusterType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ClusterType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType) + } + public static final int RESOURCE_LINK_FIELD_NUMBER = 1; private volatile java.lang.Object resourceLink_; /** * * *
-   * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For
-   * example:
+   * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
    *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
    *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
    * 
@@ -155,8 +363,7 @@ public java.lang.String getResourceLink() { * * *
-   * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For
-   * example:
+   * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
    *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
    *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
    * 
@@ -216,6 +423,48 @@ public boolean getAdminCluster() { return adminCluster_; } + public static final int CLUSTER_TYPE_FIELD_NUMBER = 4; + private int clusterType_; + /** + * + * + *
+   * Immutable. The on prem cluster's type.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType cluster_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + @java.lang.Override + public int getClusterTypeValue() { + return clusterType_; + } + /** + * + * + *
+   * Immutable. The on prem cluster's type.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType cluster_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The clusterType. + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType getClusterType() { + @SuppressWarnings("deprecation") + com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType result = + com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType.valueOf(clusterType_); + return result == null + ? com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -239,6 +488,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (adminCluster_ != false) { output.writeBool(3, adminCluster_); } + if (clusterType_ + != com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType.CLUSTERTYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, clusterType_); + } unknownFields.writeTo(output); } @@ -257,6 +511,11 @@ public int getSerializedSize() { if (adminCluster_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, adminCluster_); } + if (clusterType_ + != com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType.CLUSTERTYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, clusterType_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -276,6 +535,7 @@ public boolean equals(final java.lang.Object obj) { if (!getResourceLink().equals(other.getResourceLink())) return false; if (getClusterMissing() != other.getClusterMissing()) return false; if (getAdminCluster() != other.getAdminCluster()) return false; + if (clusterType_ != other.clusterType_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -293,6 +553,8 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClusterMissing()); hash = (37 * hash) + ADMIN_CLUSTER_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAdminCluster()); + hash = (37 * hash) + CLUSTER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + clusterType_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -444,6 +706,8 @@ public Builder clear() { adminCluster_ = false; + clusterType_ = 0; + return this; } @@ -474,6 +738,7 @@ public com.google.cloud.gkehub.v1beta1.OnPremCluster buildPartial() { result.resourceLink_ = resourceLink_; result.clusterMissing_ = clusterMissing_; result.adminCluster_ = adminCluster_; + result.clusterType_ = clusterType_; onBuilt(); return result; } @@ -533,6 +798,9 @@ public Builder mergeFrom(com.google.cloud.gkehub.v1beta1.OnPremCluster other) { if (other.getAdminCluster() != false) { setAdminCluster(other.getAdminCluster()); } + if (other.clusterType_ != 0) { + setClusterTypeValue(other.getClusterTypeValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -567,8 +835,7 @@ public Builder mergeFrom( * * *
-     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For
-     * example:
+     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
      * 
@@ -592,8 +859,7 @@ public java.lang.String getResourceLink() { * * *
-     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For
-     * example:
+     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
      * 
@@ -617,8 +883,7 @@ public com.google.protobuf.ByteString getResourceLinkBytes() { * * *
-     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For
-     * example:
+     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
      * 
@@ -641,8 +906,7 @@ public Builder setResourceLink(java.lang.String value) { * * *
-     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For
-     * example:
+     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
      * 
@@ -661,8 +925,7 @@ public Builder clearResourceLink() { * * *
-     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For
-     * example:
+     * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
      *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
      * 
@@ -793,6 +1056,109 @@ public Builder clearAdminCluster() { return this; } + private int clusterType_ = 0; + /** + * + * + *
+     * Immutable. The on prem cluster's type.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType cluster_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + @java.lang.Override + public int getClusterTypeValue() { + return clusterType_; + } + /** + * + * + *
+     * Immutable. The on prem cluster's type.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType cluster_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for clusterType to set. + * @return This builder for chaining. + */ + public Builder setClusterTypeValue(int value) { + + clusterType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The on prem cluster's type.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType cluster_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The clusterType. + */ + @java.lang.Override + public com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType getClusterType() { + @SuppressWarnings("deprecation") + com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType result = + com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType.valueOf(clusterType_); + return result == null + ? com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Immutable. The on prem cluster's type.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType cluster_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The clusterType to set. + * @return This builder for chaining. + */ + public Builder setClusterType(com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType value) { + if (value == null) { + throw new NullPointerException(); + } + + clusterType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The on prem cluster's type.
+     * 
+ * + * + * .google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType cluster_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearClusterType() { + + clusterType_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OnPremClusterOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OnPremClusterOrBuilder.java index c62037a9..5bd21b43 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OnPremClusterOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OnPremClusterOrBuilder.java @@ -27,8 +27,7 @@ public interface OnPremClusterOrBuilder * * *
-   * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For
-   * example:
+   * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
    *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
    *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
    * 
@@ -42,8 +41,7 @@ public interface OnPremClusterOrBuilder * * *
-   * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For
-   * example:
+   * Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
    *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
    *  //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
    * 
@@ -81,4 +79,33 @@ public interface OnPremClusterOrBuilder * @return The adminCluster. */ boolean getAdminCluster(); + + /** + * + * + *
+   * Immutable. The on prem cluster's type.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType cluster_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for clusterType. + */ + int getClusterTypeValue(); + /** + * + * + *
+   * Immutable. The on prem cluster's type.
+   * 
+ * + * + * .google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType cluster_type = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The clusterType. + */ + com.google.cloud.gkehub.v1beta1.OnPremCluster.ClusterType getClusterType(); } diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OperationMetadata.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OperationMetadata.java index 5fe789a3..bb144260 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OperationMetadata.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OperationMetadata.java @@ -425,9 +425,8 @@ public com.google.protobuf.ByteString getStatusDetailBytes() { *
    * Output only. Identifies whether the user has requested cancellation
    * of the operation. Operations that have successfully been cancelled
-   * have [Operation.error][] value with a
-   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
-   * `Code.CANCELLED`.
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
    * 
* * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1639,9 +1638,8 @@ public Builder setStatusDetailBytes(com.google.protobuf.ByteString value) { *
      * Output only. Identifies whether the user has requested cancellation
      * of the operation. Operations that have successfully been cancelled
-     * have [Operation.error][] value with a
-     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
-     * `Code.CANCELLED`.
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
      * 
* * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1658,9 +1656,8 @@ public boolean getCancelRequested() { *
      * Output only. Identifies whether the user has requested cancellation
      * of the operation. Operations that have successfully been cancelled
-     * have [Operation.error][] value with a
-     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
-     * `Code.CANCELLED`.
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
      * 
* * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1680,9 +1677,8 @@ public Builder setCancelRequested(boolean value) { *
      * Output only. Identifies whether the user has requested cancellation
      * of the operation. Operations that have successfully been cancelled
-     * have [Operation.error][] value with a
-     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
-     * `Code.CANCELLED`.
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
      * 
* * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OperationMetadataOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OperationMetadataOrBuilder.java index 2aa62d2e..08872ec2 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OperationMetadataOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/OperationMetadataOrBuilder.java @@ -180,9 +180,8 @@ public interface OperationMetadataOrBuilder *
    * Output only. Identifies whether the user has requested cancellation
    * of the operation. Operations that have successfully been cancelled
-   * have [Operation.error][] value with a
-   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
-   * `Code.CANCELLED`.
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
    * 
* * bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ResourceOptions.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ResourceOptions.java index 95d76af8..c04cbb03 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ResourceOptions.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ResourceOptions.java @@ -132,9 +132,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * 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.
+   * 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]; @@ -157,9 +157,9 @@ public 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.
+   * 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]; @@ -206,8 +206,8 @@ public boolean getV1Beta1Crd() { * * *
-   * Optional. Major version of the Kubernetes cluster. This is only used to
-   * determine which version to use for the CustomResourceDefinition resources,
+   * 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`.
    * 
* @@ -231,8 +231,8 @@ public 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,
+   * 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`.
    * 
* @@ -606,9 +606,9 @@ public Builder mergeFrom( * * *
-     * 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.
+     * 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]; @@ -630,9 +630,9 @@ public 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.
+     * 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]; @@ -654,9 +654,9 @@ public com.google.protobuf.ByteString getConnectVersionBytes() { * * *
-     * 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.
+     * 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]; @@ -677,9 +677,9 @@ public Builder setConnectVersion(java.lang.String value) { * * *
-     * 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.
+     * 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]; @@ -696,9 +696,9 @@ public Builder clearConnectVersion() { * * *
-     * 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.
+     * 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]; @@ -783,8 +783,8 @@ public Builder clearV1Beta1Crd() { * * *
-     * Optional. Major version of the Kubernetes cluster. This is only used to
-     * determine which version to use for the CustomResourceDefinition resources,
+     * 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`.
      * 
* @@ -807,8 +807,8 @@ public 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,
+     * 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`.
      * 
* @@ -831,8 +831,8 @@ public com.google.protobuf.ByteString getK8SVersionBytes() { * * *
-     * Optional. Major version of the Kubernetes cluster. This is only used to
-     * determine which version to use for the CustomResourceDefinition resources,
+     * 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`.
      * 
* @@ -854,8 +854,8 @@ public Builder setK8SVersion(java.lang.String value) { * * *
-     * Optional. Major version of the Kubernetes cluster. This is only used to
-     * determine which version to use for the CustomResourceDefinition resources,
+     * 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`.
      * 
* @@ -873,8 +873,8 @@ public Builder clearK8SVersion() { * * *
-     * Optional. Major version of the Kubernetes cluster. This is only used to
-     * determine which version to use for the CustomResourceDefinition resources,
+     * 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`.
      * 
* diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ResourceOptionsOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ResourceOptionsOrBuilder.java index 631a1562..782caf1f 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ResourceOptionsOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ResourceOptionsOrBuilder.java @@ -27,9 +27,9 @@ public interface ResourceOptionsOrBuilder * * *
-   * 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.
+   * 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]; @@ -41,9 +41,9 @@ public interface ResourceOptionsOrBuilder * * *
-   * 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.
+   * 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]; @@ -72,8 +72,8 @@ public interface ResourceOptionsOrBuilder * * *
-   * Optional. Major version of the Kubernetes cluster. This is only used to
-   * determine which version to use for the CustomResourceDefinition resources,
+   * 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`.
    * 
* @@ -86,8 +86,8 @@ public interface ResourceOptionsOrBuilder * * *
-   * Optional. Major version of the Kubernetes cluster. This is only used to
-   * determine which version to use for the CustomResourceDefinition resources,
+   * 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`.
    * 
* diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/UpdateMembershipRequest.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/UpdateMembershipRequest.java index 330dee99..3ab8ba30 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/UpdateMembershipRequest.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/UpdateMembershipRequest.java @@ -162,7 +162,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * `projects/[project_id]/locations/global/memberships/[membership_id]` *
* - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -186,7 +188,9 @@ public java.lang.String getName() { * `projects/[project_id]/locations/global/memberships/[membership_id]` *
* - * 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. */ @@ -209,8 +213,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Required. Mask of fields to update. At least one field path must be
-   * specified in this mask.
+   * Required. Mask of fields to update. At least one field path must be specified in this
+   * mask.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -226,8 +230,8 @@ public boolean hasUpdateMask() { * * *
-   * Required. Mask of fields to update. At least one field path must be
-   * specified in this mask.
+   * Required. Mask of fields to update. At least one field path must be specified in this
+   * mask.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -243,8 +247,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
-   * Required. Mask of fields to update. At least one field path must be
-   * specified in this mask.
+   * Required. Mask of fields to update. At least one field path must be specified in this
+   * mask.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -799,7 +803,9 @@ public Builder mergeFrom( * `projects/[project_id]/locations/global/memberships/[membership_id]` *
* - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -822,7 +828,9 @@ public java.lang.String getName() { * `projects/[project_id]/locations/global/memberships/[membership_id]` *
* - * 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. */ @@ -845,7 +853,9 @@ public com.google.protobuf.ByteString getNameBytes() { * `projects/[project_id]/locations/global/memberships/[membership_id]` *
* - * 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. @@ -867,7 +877,9 @@ public Builder setName(java.lang.String value) { * `projects/[project_id]/locations/global/memberships/[membership_id]` *
* - * 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. */ @@ -885,7 +897,9 @@ public Builder clearName() { * `projects/[project_id]/locations/global/memberships/[membership_id]` *
* - * 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. @@ -911,8 +925,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. Mask of fields to update. At least one field path must be
-     * specified in this mask.
+     * Required. Mask of fields to update. At least one field path must be specified in this
+     * mask.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -927,8 +941,8 @@ public boolean hasUpdateMask() { * * *
-     * Required. Mask of fields to update. At least one field path must be
-     * specified in this mask.
+     * Required. Mask of fields to update. At least one field path must be specified in this
+     * mask.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -949,8 +963,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
-     * Required. Mask of fields to update. At least one field path must be
-     * specified in this mask.
+     * Required. Mask of fields to update. At least one field path must be specified in this
+     * mask.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -973,8 +987,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * * *
-     * Required. Mask of fields to update. At least one field path must be
-     * specified in this mask.
+     * Required. Mask of fields to update. At least one field path must be specified in this
+     * mask.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -994,8 +1008,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * * *
-     * Required. Mask of fields to update. At least one field path must be
-     * specified in this mask.
+     * Required. Mask of fields to update. At least one field path must be specified in this
+     * mask.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1020,8 +1034,8 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * * *
-     * Required. Mask of fields to update. At least one field path must be
-     * specified in this mask.
+     * Required. Mask of fields to update. At least one field path must be specified in this
+     * mask.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1042,8 +1056,8 @@ public Builder clearUpdateMask() { * * *
-     * Required. Mask of fields to update. At least one field path must be
-     * specified in this mask.
+     * Required. Mask of fields to update. At least one field path must be specified in this
+     * mask.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1058,8 +1072,8 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * * *
-     * Required. Mask of fields to update. At least one field path must be
-     * specified in this mask.
+     * Required. Mask of fields to update. At least one field path must be specified in this
+     * mask.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1078,8 +1092,8 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * * *
-     * Required. Mask of fields to update. At least one field path must be
-     * specified in this mask.
+     * Required. Mask of fields to update. At least one field path must be specified in this
+     * mask.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/UpdateMembershipRequestOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/UpdateMembershipRequestOrBuilder.java index 3151770e..cd2f0043 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/UpdateMembershipRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/UpdateMembershipRequestOrBuilder.java @@ -31,7 +31,9 @@ public interface UpdateMembershipRequestOrBuilder * `projects/[project_id]/locations/global/memberships/[membership_id]` *
* - * 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/[project_id]/locations/global/memberships/[membership_id]` *
* - * 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. */ @@ -54,8 +58,8 @@ public interface UpdateMembershipRequestOrBuilder * * *
-   * Required. Mask of fields to update. At least one field path must be
-   * specified in this mask.
+   * Required. Mask of fields to update. At least one field path must be specified in this
+   * mask.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -68,8 +72,8 @@ public interface UpdateMembershipRequestOrBuilder * * *
-   * Required. Mask of fields to update. At least one field path must be
-   * specified in this mask.
+   * Required. Mask of fields to update. At least one field path must be specified in this
+   * mask.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -82,8 +86,8 @@ public interface UpdateMembershipRequestOrBuilder * * *
-   * Required. Mask of fields to update. At least one field path must be
-   * specified in this mask.
+   * Required. Mask of fields to update. At least one field path must be specified in this
+   * mask.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ValidateExclusivityRequest.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ValidateExclusivityRequest.java index 92ecb3fb..e4de8f28 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ValidateExclusivityRequest.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ValidateExclusivityRequest.java @@ -136,11 +136,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The parent (project and location) where the Memberships will be
-   * created. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be created.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -160,11 +162,13 @@ public java.lang.String getParent() { * * *
-   * Required. The parent (project and location) where the Memberships will be
-   * created. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be created.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -187,8 +191,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-   * Optional. The YAML of the membership CR in the cluster. Empty if the
-   * membership CR does not exist.
+   * Optional. The YAML of the membership CR in the cluster. Empty if the membership
+   * CR does not exist.
    * 
* * string cr_manifest = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -211,8 +215,8 @@ public java.lang.String getCrManifest() { * * *
-   * Optional. The YAML of the membership CR in the cluster. Empty if the
-   * membership CR does not exist.
+   * Optional. The YAML of the membership CR in the cluster. Empty if the membership
+   * CR does not exist.
    * 
* * string cr_manifest = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -238,9 +242,8 @@ public com.google.protobuf.ByteString getCrManifestBytes() { * * *
-   * Required. The intended membership name under the `parent`. This method only
-   * does validation in anticipation of a CreateMembership call with the same
-   * name.
+   * Required. The intended membership name under the `parent`. This method only does
+   * validation in anticipation of a CreateMembership call with the same name.
    * 
* * string intended_membership = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -263,9 +266,8 @@ public java.lang.String getIntendedMembership() { * * *
-   * Required. The intended membership name under the `parent`. This method only
-   * does validation in anticipation of a CreateMembership call with the same
-   * name.
+   * Required. The intended membership name under the `parent`. This method only does
+   * validation in anticipation of a CreateMembership call with the same name.
    * 
* * string intended_membership = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -642,11 +644,13 @@ public Builder mergeFrom( * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -665,11 +669,13 @@ public java.lang.String getParent() { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -688,11 +694,13 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The parent to set. * @return This builder for chaining. @@ -710,11 +718,13 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -728,11 +738,13 @@ public Builder clearParent() { * * *
-     * Required. The parent (project and location) where the Memberships will be
-     * created. Specified in the format `projects/*/locations/*`.
+     * Required. The parent (project and location) where the Memberships will be created.
+     * Specified in the format `projects/*/locations/*`.
      * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for parent to set. * @return This builder for chaining. @@ -753,8 +765,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. The YAML of the membership CR in the cluster. Empty if the
-     * membership CR does not exist.
+     * Optional. The YAML of the membership CR in the cluster. Empty if the membership
+     * CR does not exist.
      * 
* * string cr_manifest = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -776,8 +788,8 @@ public java.lang.String getCrManifest() { * * *
-     * Optional. The YAML of the membership CR in the cluster. Empty if the
-     * membership CR does not exist.
+     * Optional. The YAML of the membership CR in the cluster. Empty if the membership
+     * CR does not exist.
      * 
* * string cr_manifest = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -799,8 +811,8 @@ public com.google.protobuf.ByteString getCrManifestBytes() { * * *
-     * Optional. The YAML of the membership CR in the cluster. Empty if the
-     * membership CR does not exist.
+     * Optional. The YAML of the membership CR in the cluster. Empty if the membership
+     * CR does not exist.
      * 
* * string cr_manifest = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -821,8 +833,8 @@ public Builder setCrManifest(java.lang.String value) { * * *
-     * Optional. The YAML of the membership CR in the cluster. Empty if the
-     * membership CR does not exist.
+     * Optional. The YAML of the membership CR in the cluster. Empty if the membership
+     * CR does not exist.
      * 
* * string cr_manifest = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -839,8 +851,8 @@ public Builder clearCrManifest() { * * *
-     * Optional. The YAML of the membership CR in the cluster. Empty if the
-     * membership CR does not exist.
+     * Optional. The YAML of the membership CR in the cluster. Empty if the membership
+     * CR does not exist.
      * 
* * string cr_manifest = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -864,9 +876,8 @@ public Builder setCrManifestBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. The intended membership name under the `parent`. This method only
-     * does validation in anticipation of a CreateMembership call with the same
-     * name.
+     * Required. The intended membership name under the `parent`. This method only does
+     * validation in anticipation of a CreateMembership call with the same name.
      * 
* * string intended_membership = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -888,9 +899,8 @@ public java.lang.String getIntendedMembership() { * * *
-     * Required. The intended membership name under the `parent`. This method only
-     * does validation in anticipation of a CreateMembership call with the same
-     * name.
+     * Required. The intended membership name under the `parent`. This method only does
+     * validation in anticipation of a CreateMembership call with the same name.
      * 
* * string intended_membership = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -912,9 +922,8 @@ public com.google.protobuf.ByteString getIntendedMembershipBytes() { * * *
-     * Required. The intended membership name under the `parent`. This method only
-     * does validation in anticipation of a CreateMembership call with the same
-     * name.
+     * Required. The intended membership name under the `parent`. This method only does
+     * validation in anticipation of a CreateMembership call with the same name.
      * 
* * string intended_membership = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -935,9 +944,8 @@ public Builder setIntendedMembership(java.lang.String value) { * * *
-     * Required. The intended membership name under the `parent`. This method only
-     * does validation in anticipation of a CreateMembership call with the same
-     * name.
+     * Required. The intended membership name under the `parent`. This method only does
+     * validation in anticipation of a CreateMembership call with the same name.
      * 
* * string intended_membership = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -954,9 +962,8 @@ public Builder clearIntendedMembership() { * * *
-     * Required. The intended membership name under the `parent`. This method only
-     * does validation in anticipation of a CreateMembership call with the same
-     * name.
+     * Required. The intended membership name under the `parent`. This method only does
+     * validation in anticipation of a CreateMembership call with the same name.
      * 
* * string intended_membership = 3 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ValidateExclusivityRequestOrBuilder.java b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ValidateExclusivityRequestOrBuilder.java index 77270e43..71e3fae3 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ValidateExclusivityRequestOrBuilder.java +++ b/proto-google-cloud-gkehub-v1beta1/src/main/java/com/google/cloud/gkehub/v1beta1/ValidateExclusivityRequestOrBuilder.java @@ -27,11 +27,13 @@ public interface ValidateExclusivityRequestOrBuilder * * *
-   * Required. The parent (project and location) where the Memberships will be
-   * created. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be created.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -40,11 +42,13 @@ public interface ValidateExclusivityRequestOrBuilder * * *
-   * Required. The parent (project and location) where the Memberships will be
-   * created. Specified in the format `projects/*/locations/*`.
+   * Required. The parent (project and location) where the Memberships will be created.
+   * Specified in the format `projects/*/locations/*`.
    * 
* - * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -54,8 +58,8 @@ public interface ValidateExclusivityRequestOrBuilder * * *
-   * Optional. The YAML of the membership CR in the cluster. Empty if the
-   * membership CR does not exist.
+   * Optional. The YAML of the membership CR in the cluster. Empty if the membership
+   * CR does not exist.
    * 
* * string cr_manifest = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -67,8 +71,8 @@ public interface ValidateExclusivityRequestOrBuilder * * *
-   * Optional. The YAML of the membership CR in the cluster. Empty if the
-   * membership CR does not exist.
+   * Optional. The YAML of the membership CR in the cluster. Empty if the membership
+   * CR does not exist.
    * 
* * string cr_manifest = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -81,9 +85,8 @@ public interface ValidateExclusivityRequestOrBuilder * * *
-   * Required. The intended membership name under the `parent`. This method only
-   * does validation in anticipation of a CreateMembership call with the same
-   * name.
+   * Required. The intended membership name under the `parent`. This method only does
+   * validation in anticipation of a CreateMembership call with the same name.
    * 
* * string intended_membership = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -95,9 +98,8 @@ public interface ValidateExclusivityRequestOrBuilder * * *
-   * Required. The intended membership name under the `parent`. This method only
-   * does validation in anticipation of a CreateMembership call with the same
-   * name.
+   * Required. The intended membership name under the `parent`. This method only does
+   * validation in anticipation of a CreateMembership call with the same name.
    * 
* * string intended_membership = 3 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-gkehub-v1beta1/src/main/proto/google/cloud/gkehub/v1beta1/membership.proto b/proto-google-cloud-gkehub-v1beta1/src/main/proto/google/cloud/gkehub/v1beta1/membership.proto index 932a650e..a8567263 100644 --- a/proto-google-cloud-gkehub-v1beta1/src/main/proto/google/cloud/gkehub/v1beta1/membership.proto +++ b/proto-google-cloud-gkehub-v1beta1/src/main/proto/google/cloud/gkehub/v1beta1/membership.proto @@ -33,8 +33,7 @@ option php_namespace = "Google\\Cloud\\GkeHub\\V1beta1"; option ruby_package = "Google::Cloud::GkeHub::V1beta1"; // The GKE Hub MembershipService handles the registration of many Kubernetes -// clusters to Google Cloud, represented with the -// [Membership][google.cloud.gkehub.v1beta1.Membership] resource. +// clusters to Google Cloud, represented with the [Membership][google.cloud.gkehub.v1beta1.Membership] resource. // // GKE Hub is currently only available in the global region. // @@ -43,12 +42,10 @@ option ruby_package = "Google::Cloud::GkeHub::V1beta1"; // with Membership resources. service GkeHubMembershipService { option (google.api.default_host) = "gkehub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Lists Memberships in a given project and location. - rpc ListMemberships(ListMembershipsRequest) - returns (ListMembershipsResponse) { + rpc ListMemberships(ListMembershipsRequest) returns (ListMembershipsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*/locations/*}/memberships" }; @@ -68,8 +65,7 @@ service GkeHubMembershipService { // **This is currently only supported for GKE clusters on Google Cloud**. // To register other clusters, follow the instructions at // https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster. - rpc CreateMembership(CreateMembershipRequest) - returns (google.longrunning.Operation) { + rpc CreateMembership(CreateMembershipRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/memberships" body: "resource" @@ -86,8 +82,7 @@ service GkeHubMembershipService { // **This is currently only supported for GKE clusters on Google Cloud**. // To unregister other clusters, follow the instructions at // https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster. - rpc DeleteMembership(DeleteMembershipRequest) - returns (google.longrunning.Operation) { + rpc DeleteMembership(DeleteMembershipRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/memberships/*}" }; @@ -99,8 +94,7 @@ service GkeHubMembershipService { } // Updates an existing Membership. - rpc UpdateMembership(UpdateMembershipRequest) - returns (google.longrunning.Operation) { + rpc UpdateMembership(UpdateMembershipRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{name=projects/*/locations/*/memberships/*}" body: "resource" @@ -116,8 +110,7 @@ service GkeHubMembershipService { // // **This method is used internally by Google-provided libraries.** // Most clients should not need to call this method directly. - rpc GenerateConnectManifest(GenerateConnectManifestRequest) - returns (GenerateConnectManifestResponse) { + rpc GenerateConnectManifest(GenerateConnectManifestRequest) returns (GenerateConnectManifestResponse) { option (google.api.http) = { get: "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateConnectManifest" }; @@ -125,8 +118,7 @@ service GkeHubMembershipService { // ValidateExclusivity validates the state of exclusivity in the cluster. // The validation does not depend on an existing Hub membership resource. - rpc ValidateExclusivity(ValidateExclusivityRequest) - returns (ValidateExclusivityResponse) { + rpc ValidateExclusivity(ValidateExclusivityRequest) returns (ValidateExclusivityResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*/locations/*}/memberships:validateExclusivity" }; @@ -144,8 +136,7 @@ service GkeHubMembershipService { // Hub API server begins serving a newer version of the CRD and // corresponding CR. The response will be the converted CRD and CR if there // are any differences between the versions. - rpc GenerateExclusivityManifest(GenerateExclusivityManifestRequest) - returns (GenerateExclusivityManifestResponse) { + rpc GenerateExclusivityManifest(GenerateExclusivityManifestRequest) returns (GenerateExclusivityManifestResponse) { option (google.api.http) = { get: "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateExclusivityManifest" }; @@ -178,9 +169,8 @@ message Membership { MULTI_CLOUD = 2; } - // Output only. The full, unique name of this Membership resource in the - // format `projects/*/locations/*/memberships/{membership_id}`, set during - // creation. + // Output only. The full, unique name of this Membership resource in the format + // `projects/*/locations/*/memberships/{membership_id}`, set during creation. // // `membership_id` must be a valid RFC 1123 compliant DNS label: // @@ -214,21 +204,17 @@ message Membership { Authority authority = 9 [(google.api.field_behavior) = OPTIONAL]; // Output only. When the Membership was created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When the Membership was last updated. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. When the Membership was deleted. - google.protobuf.Timestamp delete_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp delete_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. An externally-generated and managed ID for this Membership. This - // ID may be modified after creation, but this is not recommended. For GKE - // clusters, external_id is managed by the Hub API and updates will be - // ignored. + // Optional. An externally-generated and managed ID for this Membership. This ID may + // be modified after creation, but this is not recommended. For GKE clusters, + // external_id is managed by the Hub API and updates will be ignored. // // The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*` // @@ -236,22 +222,19 @@ message Membership { // set to the UID of the `kube-system` namespace object. string external_id = 10 [(google.api.field_behavior) = OPTIONAL]; - // Output only. For clusters using Connect, the timestamp of the most recent - // connection established with Google Cloud. This time is updated every - // several minutes, not continuously. For clusters that do not use GKE - // Connect, or that have never connected successfully, this field will be - // unset. - google.protobuf.Timestamp last_connection_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. For clusters using Connect, the timestamp of the most recent connection + // established with Google Cloud. This time is updated every several minutes, + // not continuously. For clusters that do not use GKE Connect, or that have + // never connected successfully, this field will be unset. + google.protobuf.Timestamp last_connection_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Google-generated UUID for this resource. This is unique across - // all Membership resources. If a Membership resource is deleted and another + // Output only. Google-generated UUID for this resource. This is unique across all + // Membership resources. If a Membership resource is deleted and another // resource with the same name is created, it gets a different unique_id. string unique_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. The infrastructure type this Membership is running on. - InfrastructureType infrastructure_type = 13 - [(google.api.field_behavior) = OPTIONAL]; + InfrastructureType infrastructure_type = 13 [(google.api.field_behavior) = OPTIONAL]; } // MembershipEndpoint contains information needed to contact a Kubernetes API, @@ -262,36 +245,41 @@ message MembershipEndpoint { // Optional. Specific information for a GKE-on-GCP cluster. GkeCluster gke_cluster = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Specific information for a GKE On-Prem cluster. + // Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster + // who has no resourceLink is not allowed to use this field, it should have + // a nil "type" instead. OnPremCluster on_prem_cluster = 7 [(google.api.field_behavior) = OPTIONAL]; // Optional. Specific information for a GKE Multi-Cloud cluster. - MultiCloudCluster multi_cloud_cluster = 8 - [(google.api.field_behavior) = OPTIONAL]; + MultiCloudCluster multi_cloud_cluster = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specific information for a Google Edge cluster. + EdgeCluster edge_cluster = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specific information for a GDC Edge Appliance cluster. + ApplianceCluster appliance_cluster = 10 [(google.api.field_behavior) = OPTIONAL]; } // Output only. Useful Kubernetes-specific metadata. - KubernetesMetadata kubernetes_metadata = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; + KubernetesMetadata kubernetes_metadata = 5 [(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: + // 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 = 6 - [(google.api.field_behavior) = OPTIONAL]; + KubernetesResource kubernetes_resource = 6 [(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. + // 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 @@ -299,16 +287,15 @@ message KubernetesResource { // 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. + // 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]; + repeated ResourceManifest membership_resources = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The Kubernetes resources for installing the GKE Connect agent // @@ -317,8 +304,7 @@ message KubernetesResource { // 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]; + 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]; @@ -326,9 +312,9 @@ message KubernetesResource { // 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. + // 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 @@ -337,8 +323,8 @@ message ResourceOptions { // <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, + // 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]; } @@ -366,15 +352,32 @@ message GkeCluster { // Zonal clusters are also supported. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE]; - // Output only. If cluster_missing is set then it denotes that the GKE cluster - // no longer exists in the GKE Control Plane. + // Output only. If cluster_missing is set then it denotes that the GKE cluster no longer + // exists in the GKE Control Plane. bool cluster_missing = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // OnPremCluster contains information specific to GKE On-Prem clusters. message OnPremCluster { - // Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For - // example: + // ClusterType describes on prem cluster's type. + enum ClusterType { + // The ClusterType is not set. + CLUSTERTYPE_UNSPECIFIED = 0; + + // The ClusterType is bootstrap cluster. + BOOTSTRAP = 1; + + // The ClusterType is baremetal hybrid cluster. + HYBRID = 2; + + // The ClusterType is baremetal standalone cluster. + STANDALONE = 3; + + // The ClusterType is user cluster. + USER = 4; + } + + // Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example: // // //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster // //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster @@ -387,12 +390,15 @@ message OnPremCluster { // Immutable. Whether the cluster is an admin cluster. bool admin_cluster = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The on prem cluster's type. + ClusterType cluster_type = 4 [(google.api.field_behavior) = IMMUTABLE]; } // MultiCloudCluster contains information specific to GKE Multi-Cloud clusters. message MultiCloudCluster { - // Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. - // For example: + // Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For + // example: // // //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster // //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster @@ -404,17 +410,34 @@ message MultiCloudCluster { bool cluster_missing = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// EdgeCluster contains information specific to Google Edge Clusters. +message EdgeCluster { + // Immutable. Self-link of the GCP resource for the Edge Cluster. For + // example: + // + // //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster + string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE]; +} + +// ApplianceCluster contains information specific to GDC Edge Appliance +// Clusters. +message ApplianceCluster { + // Immutable. Self-link of the GCP resource for the Appliance Cluster. For + // example: + // + // //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance + string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE]; +} + // KubernetesMetadata provides informational metadata for Memberships // representing Kubernetes clusters. message KubernetesMetadata { - // Output only. Kubernetes API server version string as reported by - // '/version'. - string kubernetes_api_server_version = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Node providerID as reported by the first node in the list of - // nodes on the Kubernetes endpoint. On Kubernetes platforms that support - // zero-node clusters (like GKE-on-GCP), the node_count will be zero and the + // Output only. Kubernetes API server version string as reported by '/version'. + string kubernetes_api_server_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Node providerID as reported by the first node in the list of nodes on + // the Kubernetes endpoint. On Kubernetes platforms that support zero-node + // clusters (like GKE-on-GCP), the node_count will be zero and the // node_provider_id will be empty. string node_provider_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -424,23 +447,22 @@ message KubernetesMetadata { // Output only. vCPU count as reported by Kubernetes nodes resources. int32 vcpu_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The total memory capacity as reported by the sum of all - // Kubernetes nodes resources, defined in MB. + // Output only. The total memory capacity as reported by the sum of all Kubernetes nodes + // resources, defined in MB. int32 memory_mb = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The time at which these details were last updated. This - // update_time is different from the Membership-level update_time since - // EndpointDetails are updated internally for API consumers. - google.protobuf.Timestamp update_time = 100 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The time at which these details were last updated. This update_time is + // different from the Membership-level update_time since EndpointDetails are + // updated internally for API consumers. + google.protobuf.Timestamp update_time = 100 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Authority encodes how Google will recognize identities from this Membership. // See the workload identity documentation for more details: // https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity message Authority { - // Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with - // `https://` and be a valid URL with length <2000 characters. + // Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and + // be a valid URL with length <2000 characters. // // If set, then Google will allow valid OIDC tokens from this issuer to // authenticate within the workload_identity_pool. OIDC discovery will be @@ -451,8 +473,8 @@ message Authority { // a new issuer (and re-enabling Workload Identity). string issuer = 1 [(google.api.field_behavior) = OPTIONAL]; - // Output only. The name of the workload identity pool in which `issuer` will - // be recognized. + // Output only. The name of the workload identity pool in which `issuer` will be + // recognized. // // There is a single Workload Identity Pool per Hub that is shared // between all Memberships that belong to that Hub. For a Hub hosted in @@ -460,12 +482,11 @@ message Authority { // although this is subject to change in newer versions of this API. string workload_identity_pool = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. An identity provider that reflects the `issuer` in the - // workload identity pool. + // Output only. An identity provider that reflects the `issuer` in the workload identity + // pool. string identity_provider = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. OIDC verification keys for this Membership in JWKS format (RFC - // 7517). + // Optional. OIDC verification keys for this Membership in JWKS format (RFC 7517). // // When this field is set, OIDC discovery will NOT be performed on `issuer`, // and instead OIDC tokens will be validated using this field. @@ -507,13 +528,18 @@ message MembershipState { // Request message for `GkeHubMembershipService.ListMemberships` method. message ListMembershipsRequest { - // Required. The parent (project and location) where the Memberships will be - // listed. Specified in the format `projects/*/locations/*`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. When requesting a 'page' of resources, `page_size` specifies - // number of resources to return. If unspecified or set to 0, all resources - // will be returned. + // Required. The parent (project and location) where the Memberships will be listed. + // Specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gkehub.googleapis.com/Membership" + } + ]; + + // Optional. When requesting a 'page' of resources, `page_size` specifies number of + // resources to return. If unspecified or set to 0, all resources will + // be returned. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. Token returned by previous call to `ListMemberships` which @@ -521,8 +547,8 @@ message ListMembershipsRequest { // resources. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Lists Memberships that match the filter expression, following the - // syntax outlined in https://google.aip.dev/160. + // Optional. Lists Memberships that match the filter expression, following the syntax + // outlined in https://google.aip.dev/160. // // Examples: // @@ -566,17 +592,27 @@ message ListMembershipsResponse { message GetMembershipRequest { // 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" + } + ]; } // Request message for the `GkeHubMembershipService.CreateMembership` method. message CreateMembershipRequest { - // Required. The parent (project and location) where the Memberships will be - // created. Specified in the format `projects/*/locations/*`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Client chosen ID for the membership. `membership_id` must be a - // valid RFC 1123 compliant DNS label: + // Required. The parent (project and location) where the Memberships will be created. + // Specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gkehub.googleapis.com/Membership" + } + ]; + + // Required. Client chosen ID for the membership. `membership_id` must be a valid RFC + // 1123 compliant DNS label: // // 1. At most 63 characters in length // 2. It must consist of lower case alphanumeric characters or `-` @@ -609,7 +645,12 @@ message CreateMembershipRequest { message DeleteMembershipRequest { // 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" + } + ]; // Optional. A request ID to identify requests. Specify a unique request ID // so that if you must retry your request, the server will know to ignore @@ -631,12 +672,16 @@ message DeleteMembershipRequest { message UpdateMembershipRequest { // Required. The membership resource name in the format: // `projects/[project_id]/locations/global/memberships/[membership_id]` - 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. At least one field path must be - // specified in this mask. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; + // Required. Mask of fields to update. At least one field path must be specified in this + // mask. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; // 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 @@ -668,15 +713,19 @@ message UpdateMembershipRequest { // method. // . 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]; + // Required. The Membership resource name the Agent will associate with, in the format + // `projects/*/locations/*/memberships/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gkehub.googleapis.com/Membership" + } + ]; // Optional. The connect agent to generate manifest for. ConnectAgent connect_agent = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The Connect agent version to use. Defaults to the most current - // version. + // Optional. The Connect agent version to use. Defaults to the most current version. string version = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. If true, generate the resources for upgrade only. Some resources @@ -724,15 +773,14 @@ message ConnectAgent { // Do not set. string name = 1 [deprecated = true]; - // Optional. URI of a proxy if connectivity from the agent to - // gkeconnect.googleapis.com requires the use of a proxy. Format must be in - // the form `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol + // Optional. URI of a proxy if connectivity from the agent to gkeconnect.googleapis.com + // requires the use of a proxy. Format must be in the form + // `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol // supported by the proxy. This will direct the connect agent's outbound // traffic through a HTTP(S) proxy. bytes proxy = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Namespace for GKE Connect agent resources. Defaults to - // `gke-connect`. + // Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`. // // The Connect Agent is authorized automatically when run in the default // namespace. Otherwise, explicit authorization must be granted with an @@ -743,17 +791,21 @@ message ConnectAgent { // The request to validate the existing state of the membership CR in the // cluster. message ValidateExclusivityRequest { - // Required. The parent (project and location) where the Memberships will be - // created. Specified in the format `projects/*/locations/*`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The YAML of the membership CR in the cluster. Empty if the - // membership CR does not exist. + // Required. The parent (project and location) where the Memberships will be created. + // Specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gkehub.googleapis.com/Membership" + } + ]; + + // Optional. The YAML of the membership CR in the cluster. Empty if the membership + // CR does not exist. string cr_manifest = 2 [(google.api.field_behavior) = OPTIONAL]; - // Required. The intended membership name under the `parent`. This method only - // does validation in anticipation of a CreateMembership call with the same - // name. + // Required. The intended membership name under the `parent`. This method only does + // validation in anticipation of a CreateMembership call with the same name. string intended_membership = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -772,7 +824,12 @@ message ValidateExclusivityResponse { message GenerateExclusivityManifestRequest { // 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" + } + ]; // Optional. The YAML manifest of the membership CRD retrieved by // `kubectl get customresourcedefinitions membership`. @@ -799,12 +856,10 @@ message GenerateExclusivityManifestResponse { // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server-defined resource path for the target of the operation. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -817,9 +872,8 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation.