diff --git a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceClient.java b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceClient.java
index 107dc0c9d8e8..3312e93ee6c1 100644
--- a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceClient.java
+++ b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceClient.java
@@ -114,6 +114,21 @@
* OsConfigServiceClient.create(osConfigServiceSettings);
* }
*
+ * 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.
+ * OsConfigServiceSettings osConfigServiceSettings =
+ * OsConfigServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * OsConfigServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * OsConfigServiceClient osConfigServiceClient =
+ * OsConfigServiceClient.create(osConfigServiceSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
diff --git a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceSettings.java b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceSettings.java
index e61e21433dea..d984e7eb27a6 100644
--- a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceSettings.java
+++ b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceSettings.java
@@ -25,6 +25,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;
@@ -184,11 +185,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return OsConfigServiceStubSettings.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 OsConfigServiceStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return OsConfigServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return OsConfigServiceStubSettings.defaultTransportChannelProvider();
}
@@ -198,11 +206,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return OsConfigServiceStubSettings.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);
@@ -240,6 +254,11 @@ private static Builder createDefault() {
return new Builder(OsConfigServiceStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(OsConfigServiceStubSettings.newHttpJsonBuilder());
+ }
+
public OsConfigServiceStubSettings.Builder getStubSettingsBuilder() {
return ((OsConfigServiceStubSettings.Builder) getStubSettings());
}
diff --git a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java
index dbcb9aef889e..779813c44aa0 100644
--- a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java
+++ b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java
@@ -19,6 +19,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
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;
@@ -30,7 +31,6 @@
import com.google.cloud.osconfig.v1.stub.OsConfigZonalServiceStubSettings;
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,13 +110,29 @@
* OsConfigZonalServiceClient.create(osConfigZonalServiceSettings);
* }
*
+ *
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.
+ * OsConfigZonalServiceSettings osConfigZonalServiceSettings =
+ * OsConfigZonalServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * OsConfigZonalServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * OsConfigZonalServiceClient osConfigZonalServiceClient =
+ * OsConfigZonalServiceClient.create(osConfigZonalServiceSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class OsConfigZonalServiceClient implements BackgroundResource {
private final OsConfigZonalServiceSettings settings;
private final OsConfigZonalServiceStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of OsConfigZonalServiceClient with default settings. */
public static final OsConfigZonalServiceClient create() throws IOException {
@@ -148,13 +164,17 @@ public static final OsConfigZonalServiceClient create(OsConfigZonalServiceStub s
protected OsConfigZonalServiceClient(OsConfigZonalServiceSettings settings) throws IOException {
this.settings = settings;
this.stub = ((OsConfigZonalServiceStubSettings) 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());
}
protected OsConfigZonalServiceClient(OsConfigZonalServiceStub 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 OsConfigZonalServiceSettings getSettings() {
@@ -169,10 +189,18 @@ public OsConfigZonalServiceStub 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.
/**
* Create an OS policy assignment.
diff --git a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceSettings.java b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceSettings.java
index a9f891867d58..31ebc4ccbbf5 100644
--- a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceSettings.java
+++ b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceSettings.java
@@ -27,6 +27,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;
@@ -219,11 +220,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return OsConfigZonalServiceStubSettings.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 OsConfigZonalServiceStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return OsConfigZonalServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return OsConfigZonalServiceStubSettings.defaultTransportChannelProvider();
}
@@ -233,11 +241,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return OsConfigZonalServiceStubSettings.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);
@@ -276,6 +290,11 @@ private static Builder createDefault() {
return new Builder(OsConfigZonalServiceStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(OsConfigZonalServiceStubSettings.newHttpJsonBuilder());
+ }
+
public OsConfigZonalServiceStubSettings.Builder getStubSettingsBuilder() {
return ((OsConfigZonalServiceStubSettings.Builder) getStubSettings());
}
diff --git a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigServiceCallableFactory.java b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigServiceCallableFactory.java
new file mode 100644
index 000000000000..878cde9b4224
--- /dev/null
+++ b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigServiceCallableFactory.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.osconfig.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 OsConfigService service API.
+ *
+ *
This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonOsConfigServiceCallableFactory
+ 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/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigServiceStub.java b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigServiceStub.java
new file mode 100644
index 000000000000..29c595e68678
--- /dev/null
+++ b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigServiceStub.java
@@ -0,0 +1,930 @@
+/*
+ * 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.osconfig.v1.stub;
+
+import static com.google.cloud.osconfig.v1.OsConfigServiceClient.ListPatchDeploymentsPagedResponse;
+import static com.google.cloud.osconfig.v1.OsConfigServiceClient.ListPatchJobInstanceDetailsPagedResponse;
+import static com.google.cloud.osconfig.v1.OsConfigServiceClient.ListPatchJobsPagedResponse;
+
+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.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.rpc.ClientContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.osconfig.v1.PatchDeployments;
+import com.google.cloud.osconfig.v1.PatchJobs;
+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 OsConfigService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonOsConfigServiceStub extends OsConfigServiceStub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor
+ executePatchJobMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/ExecutePatchJob")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*}/patchJobs:execute",
+ 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();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PatchJobs.PatchJob.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getPatchJobMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/GetPatchJob")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/patchJobs/*}",
+ 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(PatchJobs.PatchJob.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ cancelPatchJobMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/CancelPatchJob")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/patchJobs/*}:cancel",
+ 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 ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PatchJobs.PatchJob.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse>
+ listPatchJobsMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/ListPatchJobs")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*}/patchJobs",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PatchJobs.ListPatchJobsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ PatchJobs.ListPatchJobInstanceDetailsRequest,
+ PatchJobs.ListPatchJobInstanceDetailsResponse>
+ listPatchJobInstanceDetailsMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigService/ListPatchJobInstanceDetails")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/patchJobs/*}/instanceDetails",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser
+ .newBuilder()
+ .setDefaultInstance(
+ PatchJobs.ListPatchJobInstanceDetailsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ PatchDeployments.CreatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ createPatchDeploymentMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/CreatePatchDeployment")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*}/patchDeployments",
+ 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, "patchDeploymentId", request.getPatchDeploymentId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("patchDeployment", request.getPatchDeployment()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PatchDeployments.PatchDeployment.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ PatchDeployments.GetPatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ getPatchDeploymentMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/GetPatchDeployment")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/patchDeployments/*}",
+ 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(PatchDeployments.PatchDeployment.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ PatchDeployments.ListPatchDeploymentsRequest,
+ PatchDeployments.ListPatchDeploymentsResponse>
+ listPatchDeploymentsMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/ListPatchDeployments")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*}/patchDeployments",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser
+ .newBuilder()
+ .setDefaultInstance(
+ PatchDeployments.ListPatchDeploymentsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deletePatchDeploymentMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/DeletePatchDeployment")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/patchDeployments/*}",
+ 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(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ updatePatchDeploymentMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/UpdatePatchDeployment")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1/{patchDeployment.name=projects/*/patchDeployments/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer
+ serializer = ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields,
+ "patchDeployment.name",
+ request.getPatchDeployment().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("patchDeployment", request.getPatchDeployment()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PatchDeployments.PatchDeployment.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ pausePatchDeploymentMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/PausePatchDeployment")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/patchDeployments/*}:pause",
+ 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 ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PatchDeployments.PatchDeployment.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ resumePatchDeploymentMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigService/ResumePatchDeployment")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/patchDeployments/*}:resume",
+ 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 ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PatchDeployments.PatchDeployment.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private final UnaryCallable
+ executePatchJobCallable;
+ private final UnaryCallable getPatchJobCallable;
+ private final UnaryCallable
+ cancelPatchJobCallable;
+ private final UnaryCallable
+ listPatchJobsCallable;
+ private final UnaryCallable
+ listPatchJobsPagedCallable;
+ private final UnaryCallable<
+ PatchJobs.ListPatchJobInstanceDetailsRequest,
+ PatchJobs.ListPatchJobInstanceDetailsResponse>
+ listPatchJobInstanceDetailsCallable;
+ private final UnaryCallable<
+ PatchJobs.ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsPagedResponse>
+ listPatchJobInstanceDetailsPagedCallable;
+ private final UnaryCallable<
+ PatchDeployments.CreatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ createPatchDeploymentCallable;
+ private final UnaryCallable<
+ PatchDeployments.GetPatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ getPatchDeploymentCallable;
+ private final UnaryCallable<
+ PatchDeployments.ListPatchDeploymentsRequest,
+ PatchDeployments.ListPatchDeploymentsResponse>
+ listPatchDeploymentsCallable;
+ private final UnaryCallable<
+ PatchDeployments.ListPatchDeploymentsRequest, ListPatchDeploymentsPagedResponse>
+ listPatchDeploymentsPagedCallable;
+ private final UnaryCallable
+ deletePatchDeploymentCallable;
+ private final UnaryCallable<
+ PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ updatePatchDeploymentCallable;
+ private final UnaryCallable<
+ PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ pausePatchDeploymentCallable;
+ private final UnaryCallable<
+ PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ resumePatchDeploymentCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonOsConfigServiceStub create(OsConfigServiceStubSettings settings)
+ throws IOException {
+ return new HttpJsonOsConfigServiceStub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonOsConfigServiceStub create(ClientContext clientContext)
+ throws IOException {
+ return new HttpJsonOsConfigServiceStub(
+ OsConfigServiceStubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonOsConfigServiceStub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonOsConfigServiceStub(
+ OsConfigServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonOsConfigServiceStub, 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 HttpJsonOsConfigServiceStub(
+ OsConfigServiceStubSettings settings, ClientContext clientContext) throws IOException {
+ this(settings, clientContext, new HttpJsonOsConfigServiceCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonOsConfigServiceStub, 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 HttpJsonOsConfigServiceStub(
+ OsConfigServiceStubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+
+ HttpJsonCallSettings
+ executePatchJobTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(executePatchJobMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ getPatchJobTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getPatchJobMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ cancelPatchJobTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(cancelPatchJobMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ listPatchJobsTransportSettings =
+ HttpJsonCallSettings
+ .newBuilder()
+ .setMethodDescriptor(listPatchJobsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings<
+ PatchJobs.ListPatchJobInstanceDetailsRequest,
+ PatchJobs.ListPatchJobInstanceDetailsResponse>
+ listPatchJobInstanceDetailsTransportSettings =
+ HttpJsonCallSettings
+ .
+ newBuilder()
+ .setMethodDescriptor(listPatchJobInstanceDetailsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings<
+ PatchDeployments.CreatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ createPatchDeploymentTransportSettings =
+ HttpJsonCallSettings
+ .
+ newBuilder()
+ .setMethodDescriptor(createPatchDeploymentMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings<
+ PatchDeployments.GetPatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ getPatchDeploymentTransportSettings =
+ HttpJsonCallSettings
+ .
+ newBuilder()
+ .setMethodDescriptor(getPatchDeploymentMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings<
+ PatchDeployments.ListPatchDeploymentsRequest,
+ PatchDeployments.ListPatchDeploymentsResponse>
+ listPatchDeploymentsTransportSettings =
+ HttpJsonCallSettings
+ .
+ newBuilder()
+ .setMethodDescriptor(listPatchDeploymentsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ deletePatchDeploymentTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deletePatchDeploymentMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings<
+ PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ updatePatchDeploymentTransportSettings =
+ HttpJsonCallSettings
+ .
+ newBuilder()
+ .setMethodDescriptor(updatePatchDeploymentMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings<
+ PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ pausePatchDeploymentTransportSettings =
+ HttpJsonCallSettings
+ .
+ newBuilder()
+ .setMethodDescriptor(pausePatchDeploymentMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings<
+ PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ resumePatchDeploymentTransportSettings =
+ HttpJsonCallSettings
+ .
+ newBuilder()
+ .setMethodDescriptor(resumePatchDeploymentMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+
+ this.executePatchJobCallable =
+ callableFactory.createUnaryCallable(
+ executePatchJobTransportSettings, settings.executePatchJobSettings(), clientContext);
+ this.getPatchJobCallable =
+ callableFactory.createUnaryCallable(
+ getPatchJobTransportSettings, settings.getPatchJobSettings(), clientContext);
+ this.cancelPatchJobCallable =
+ callableFactory.createUnaryCallable(
+ cancelPatchJobTransportSettings, settings.cancelPatchJobSettings(), clientContext);
+ this.listPatchJobsCallable =
+ callableFactory.createUnaryCallable(
+ listPatchJobsTransportSettings, settings.listPatchJobsSettings(), clientContext);
+ this.listPatchJobsPagedCallable =
+ callableFactory.createPagedCallable(
+ listPatchJobsTransportSettings, settings.listPatchJobsSettings(), clientContext);
+ this.listPatchJobInstanceDetailsCallable =
+ callableFactory.createUnaryCallable(
+ listPatchJobInstanceDetailsTransportSettings,
+ settings.listPatchJobInstanceDetailsSettings(),
+ clientContext);
+ this.listPatchJobInstanceDetailsPagedCallable =
+ callableFactory.createPagedCallable(
+ listPatchJobInstanceDetailsTransportSettings,
+ settings.listPatchJobInstanceDetailsSettings(),
+ clientContext);
+ this.createPatchDeploymentCallable =
+ callableFactory.createUnaryCallable(
+ createPatchDeploymentTransportSettings,
+ settings.createPatchDeploymentSettings(),
+ clientContext);
+ this.getPatchDeploymentCallable =
+ callableFactory.createUnaryCallable(
+ getPatchDeploymentTransportSettings,
+ settings.getPatchDeploymentSettings(),
+ clientContext);
+ this.listPatchDeploymentsCallable =
+ callableFactory.createUnaryCallable(
+ listPatchDeploymentsTransportSettings,
+ settings.listPatchDeploymentsSettings(),
+ clientContext);
+ this.listPatchDeploymentsPagedCallable =
+ callableFactory.createPagedCallable(
+ listPatchDeploymentsTransportSettings,
+ settings.listPatchDeploymentsSettings(),
+ clientContext);
+ this.deletePatchDeploymentCallable =
+ callableFactory.createUnaryCallable(
+ deletePatchDeploymentTransportSettings,
+ settings.deletePatchDeploymentSettings(),
+ clientContext);
+ this.updatePatchDeploymentCallable =
+ callableFactory.createUnaryCallable(
+ updatePatchDeploymentTransportSettings,
+ settings.updatePatchDeploymentSettings(),
+ clientContext);
+ this.pausePatchDeploymentCallable =
+ callableFactory.createUnaryCallable(
+ pausePatchDeploymentTransportSettings,
+ settings.pausePatchDeploymentSettings(),
+ clientContext);
+ this.resumePatchDeploymentCallable =
+ callableFactory.createUnaryCallable(
+ resumePatchDeploymentTransportSettings,
+ settings.resumePatchDeploymentSettings(),
+ clientContext);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(executePatchJobMethodDescriptor);
+ methodDescriptors.add(getPatchJobMethodDescriptor);
+ methodDescriptors.add(cancelPatchJobMethodDescriptor);
+ methodDescriptors.add(listPatchJobsMethodDescriptor);
+ methodDescriptors.add(listPatchJobInstanceDetailsMethodDescriptor);
+ methodDescriptors.add(createPatchDeploymentMethodDescriptor);
+ methodDescriptors.add(getPatchDeploymentMethodDescriptor);
+ methodDescriptors.add(listPatchDeploymentsMethodDescriptor);
+ methodDescriptors.add(deletePatchDeploymentMethodDescriptor);
+ methodDescriptors.add(updatePatchDeploymentMethodDescriptor);
+ methodDescriptors.add(pausePatchDeploymentMethodDescriptor);
+ methodDescriptors.add(resumePatchDeploymentMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ @Override
+ public UnaryCallable
+ executePatchJobCallable() {
+ return executePatchJobCallable;
+ }
+
+ @Override
+ public UnaryCallable getPatchJobCallable() {
+ return getPatchJobCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ cancelPatchJobCallable() {
+ return cancelPatchJobCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listPatchJobsCallable() {
+ return listPatchJobsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listPatchJobsPagedCallable() {
+ return listPatchJobsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ PatchJobs.ListPatchJobInstanceDetailsRequest,
+ PatchJobs.ListPatchJobInstanceDetailsResponse>
+ listPatchJobInstanceDetailsCallable() {
+ return listPatchJobInstanceDetailsCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ PatchJobs.ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsPagedResponse>
+ listPatchJobInstanceDetailsPagedCallable() {
+ return listPatchJobInstanceDetailsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ PatchDeployments.CreatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ createPatchDeploymentCallable() {
+ return createPatchDeploymentCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ getPatchDeploymentCallable() {
+ return getPatchDeploymentCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ PatchDeployments.ListPatchDeploymentsRequest,
+ PatchDeployments.ListPatchDeploymentsResponse>
+ listPatchDeploymentsCallable() {
+ return listPatchDeploymentsCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ PatchDeployments.ListPatchDeploymentsRequest, ListPatchDeploymentsPagedResponse>
+ listPatchDeploymentsPagedCallable() {
+ return listPatchDeploymentsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ deletePatchDeploymentCallable() {
+ return deletePatchDeploymentCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ updatePatchDeploymentCallable() {
+ return updatePatchDeploymentCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ pausePatchDeploymentCallable() {
+ return pausePatchDeploymentCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
+ resumePatchDeploymentCallable() {
+ return resumePatchDeploymentCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigZonalServiceCallableFactory.java b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigZonalServiceCallableFactory.java
new file mode 100644
index 000000000000..d5b8ad3361dd
--- /dev/null
+++ b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigZonalServiceCallableFactory.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.osconfig.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 OsConfigZonalService service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonOsConfigZonalServiceCallableFactory
+ 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/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigZonalServiceStub.java b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigZonalServiceStub.java
new file mode 100644
index 000000000000..dcb753e28ba0
--- /dev/null
+++ b/java-os-config/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/HttpJsonOsConfigZonalServiceStub.java
@@ -0,0 +1,1004 @@
+/*
+ * 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.osconfig.v1.stub;
+
+import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListInventoriesPagedResponse;
+import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListOSPolicyAssignmentReportsPagedResponse;
+import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListOSPolicyAssignmentRevisionsPagedResponse;
+import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListOSPolicyAssignmentsPagedResponse;
+import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListVulnerabilityReportsPagedResponse;
+
+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.osconfig.v1.CreateOSPolicyAssignmentRequest;
+import com.google.cloud.osconfig.v1.DeleteOSPolicyAssignmentRequest;
+import com.google.cloud.osconfig.v1.GetInventoryRequest;
+import com.google.cloud.osconfig.v1.GetOSPolicyAssignmentReportRequest;
+import com.google.cloud.osconfig.v1.GetOSPolicyAssignmentRequest;
+import com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest;
+import com.google.cloud.osconfig.v1.Inventory;
+import com.google.cloud.osconfig.v1.ListInventoriesRequest;
+import com.google.cloud.osconfig.v1.ListInventoriesResponse;
+import com.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsRequest;
+import com.google.cloud.osconfig.v1.ListOSPolicyAssignmentReportsResponse;
+import com.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsRequest;
+import com.google.cloud.osconfig.v1.ListOSPolicyAssignmentRevisionsResponse;
+import com.google.cloud.osconfig.v1.ListOSPolicyAssignmentsRequest;
+import com.google.cloud.osconfig.v1.ListOSPolicyAssignmentsResponse;
+import com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest;
+import com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse;
+import com.google.cloud.osconfig.v1.OSPolicyAssignment;
+import com.google.cloud.osconfig.v1.OSPolicyAssignmentOperationMetadata;
+import com.google.cloud.osconfig.v1.OSPolicyAssignmentReport;
+import com.google.cloud.osconfig.v1.UpdateOSPolicyAssignmentRequest;
+import com.google.cloud.osconfig.v1.VulnerabilityReport;
+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 OsConfigZonalService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonOsConfigZonalServiceStub extends OsConfigZonalServiceStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(Empty.getDescriptor())
+ .add(OSPolicyAssignmentOperationMetadata.getDescriptor())
+ .add(OSPolicyAssignment.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createOSPolicyAssignmentMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigZonalService/CreateOSPolicyAssignment")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/osPolicyAssignments",
+ 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, "osPolicyAssignmentId", request.getOsPolicyAssignmentId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("osPolicyAssignment", request.getOsPolicyAssignment()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateOSPolicyAssignmentRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateOSPolicyAssignmentMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigZonalService/UpdateOSPolicyAssignment")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{osPolicyAssignment.name=projects/*/locations/*/osPolicyAssignments/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields,
+ "osPolicyAssignment.name",
+ request.getOsPolicyAssignment().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("osPolicyAssignment", request.getOsPolicyAssignment()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateOSPolicyAssignmentRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ getOSPolicyAssignmentMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigZonalService/GetOSPolicyAssignment")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}",
+ 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(OSPolicyAssignment.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ ListOSPolicyAssignmentsRequest, ListOSPolicyAssignmentsResponse>
+ listOSPolicyAssignmentsMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigZonalService/ListOSPolicyAssignments")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/osPolicyAssignments",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListOSPolicyAssignmentsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ ListOSPolicyAssignmentRevisionsRequest, ListOSPolicyAssignmentRevisionsResponse>
+ listOSPolicyAssignmentRevisionsMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigZonalService/ListOSPolicyAssignmentRevisions")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(
+ ListOSPolicyAssignmentRevisionsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteOSPolicyAssignmentMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigZonalService/DeleteOSPolicyAssignment")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}",
+ 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(
+ (DeleteOSPolicyAssignmentRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor<
+ GetOSPolicyAssignmentReportRequest, OSPolicyAssignmentReport>
+ getOSPolicyAssignmentReportMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigZonalService/GetOSPolicyAssignmentReport")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}",
+ 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(OSPolicyAssignmentReport.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ ListOSPolicyAssignmentReportsRequest, ListOSPolicyAssignmentReportsResponse>
+ listOSPolicyAssignmentReportsMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigZonalService/ListOSPolicyAssignmentReports")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(
+ ListOSPolicyAssignmentReportsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getInventoryMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigZonalService/GetInventory")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/instances/*/inventory}",
+ 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, "view", request.getView());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Inventory.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listInventoriesMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.osconfig.v1.OsConfigZonalService/ListInventories")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/instances/*}/inventories",
+ 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, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(fields, "view", request.getView());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListInventoriesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getVulnerabilityReportMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.osconfig.v1.OsConfigZonalService/GetVulnerabilityReport")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map