Skip to content
Permalink
Browse files
feat: add OSConfigZonalService API Committer: @jaiminsh (#356)
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 394704298

Source-Link: googleapis/googleapis@31d2d34

Source-Link: https://github.com/googleapis/googleapis-gen/commit/aa3ce0901f686a71b68e427c6bb7a611b151b540
  • Loading branch information
gcf-owl-bot[bot] committed Sep 13, 2021
1 parent 4a36b96 commit b68ebde5f9a9a5a9e57d089bd3df4cea8e11dc35
Showing with 27,943 additions and 4,533 deletions.
  1. +901 −0 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java
  2. +232 −0 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceSettings.java
  3. +21 −0 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/gapic_metadata.json
  4. +17 −0 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/package-info.java
  5. +113 −0 ...nfig/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceCallableFactory.java
  6. +302 −0 ...cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceStub.java
  7. +74 −0 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStub.java
  8. +520 −0 ...d-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStubSettings.java
  9. +59 −0 google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalService.java
  10. +145 −0 google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalServiceImpl.java
  11. +434 −0 ...le-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClientTest.java
  12. +754 −0 ...oogle-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceGrpc.java
  13. +3,131 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3.java
  14. +287 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3OrBuilder.java
  15. +843 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequest.java
  16. +91 −0 ...e-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequestOrBuilder.java
  17. +686 −0 ...-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequest.java
  18. +64 −0 ...-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequestOrBuilder.java
  19. +340 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InstanceName.java
  20. +152 −87 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventories.java
  21. +4,919 −4,424 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventory.java
  22. +223 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryName.java
  23. +67 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryOrBuilder.java
  24. +178 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryView.java
  25. +1,294 −0 ...-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequest.java
  26. +154 −0 ...loud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequestOrBuilder.java
  27. +1,131 −0 ...google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponse.java
  28. +102 −0 ...oud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponseOrBuilder.java
  29. +1,140 −0 ...loud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequest.java
  30. +127 −0 ...onfig-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequestOrBuilder.java
  31. +1,179 −0 ...oud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponse.java
  32. +105 −0 ...nfig-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponseOrBuilder.java
  33. +6 −4 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigProto.java
  34. +100 −0 ...ogle-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceProto.java
  35. +252 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityProto.java
  36. +6,888 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReport.java
  37. +225 −0 ...google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportName.java
  38. +159 −0 ...e-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportOrBuilder.java
  39. +117 −18 proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/inventory.proto
  40. +1 −0 proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_service.proto
  41. +74 −0 proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_zonal_service.proto
  42. +336 −0 proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/vulnerability.proto

Large diffs are not rendered by default.

@@ -0,0 +1,232 @@
/*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.osconfig.v1;

import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListInventoriesPagedResponse;
import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListVulnerabilityReportsPagedResponse;

import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.osconfig.v1.stub.OsConfigZonalServiceStubSettings;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Settings class to configure an instance of {@link OsConfigZonalServiceClient}.
*
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (osconfig.googleapis.com) and default port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
*
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
* <p>For example, to set the total timeout of getInventory to 30 seconds:
*
* <pre>{@code
* OsConfigZonalServiceSettings.Builder osConfigZonalServiceSettingsBuilder =
* OsConfigZonalServiceSettings.newBuilder();
* osConfigZonalServiceSettingsBuilder
* .getInventorySettings()
* .setRetrySettings(
* osConfigZonalServiceSettingsBuilder
* .getInventorySettings()
* .getRetrySettings()
* .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* OsConfigZonalServiceSettings osConfigZonalServiceSettings =
* osConfigZonalServiceSettingsBuilder.build();
* }</pre>
*/
@Generated("by gapic-generator-java")
public class OsConfigZonalServiceSettings extends ClientSettings<OsConfigZonalServiceSettings> {

/** Returns the object with the settings used for calls to getInventory. */
public UnaryCallSettings<GetInventoryRequest, Inventory> getInventorySettings() {
return ((OsConfigZonalServiceStubSettings) getStubSettings()).getInventorySettings();
}

/** Returns the object with the settings used for calls to listInventories. */
public PagedCallSettings<
ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse>
listInventoriesSettings() {
return ((OsConfigZonalServiceStubSettings) getStubSettings()).listInventoriesSettings();
}

/** Returns the object with the settings used for calls to getVulnerabilityReport. */
public UnaryCallSettings<GetVulnerabilityReportRequest, VulnerabilityReport>
getVulnerabilityReportSettings() {
return ((OsConfigZonalServiceStubSettings) getStubSettings()).getVulnerabilityReportSettings();
}

/** Returns the object with the settings used for calls to listVulnerabilityReports. */
public PagedCallSettings<
ListVulnerabilityReportsRequest,
ListVulnerabilityReportsResponse,
ListVulnerabilityReportsPagedResponse>
listVulnerabilityReportsSettings() {
return ((OsConfigZonalServiceStubSettings) getStubSettings())
.listVulnerabilityReportsSettings();
}

public static final OsConfigZonalServiceSettings create(OsConfigZonalServiceStubSettings stub)
throws IOException {
return new OsConfigZonalServiceSettings.Builder(stub.toBuilder()).build();
}

/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return OsConfigZonalServiceStubSettings.defaultExecutorProviderBuilder();
}

/** Returns the default service endpoint. */
public static String getDefaultEndpoint() {
return OsConfigZonalServiceStubSettings.getDefaultEndpoint();
}

/** Returns the default service scopes. */
public static List<String> getDefaultServiceScopes() {
return OsConfigZonalServiceStubSettings.getDefaultServiceScopes();
}

/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
return OsConfigZonalServiceStubSettings.defaultCredentialsProviderBuilder();
}

/** Returns a builder for the default ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return OsConfigZonalServiceStubSettings.defaultGrpcTransportProviderBuilder();
}

public static TransportChannelProvider defaultTransportChannelProvider() {
return OsConfigZonalServiceStubSettings.defaultTransportChannelProvider();
}

@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
return OsConfigZonalServiceStubSettings.defaultApiClientHeaderProviderBuilder();
}

/** Returns a new builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}

/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
}

/** Returns a builder containing all the values of this settings class. */
public Builder toBuilder() {
return new Builder(this);
}

protected OsConfigZonalServiceSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
}

/** Builder for OsConfigZonalServiceSettings. */
public static class Builder
extends ClientSettings.Builder<OsConfigZonalServiceSettings, Builder> {

protected Builder() throws IOException {
this(((ClientContext) null));
}

protected Builder(ClientContext clientContext) {
super(OsConfigZonalServiceStubSettings.newBuilder(clientContext));
}

protected Builder(OsConfigZonalServiceSettings settings) {
super(settings.getStubSettings().toBuilder());
}

protected Builder(OsConfigZonalServiceStubSettings.Builder stubSettings) {
super(stubSettings);
}

private static Builder createDefault() {
return new Builder(OsConfigZonalServiceStubSettings.newBuilder());
}

public OsConfigZonalServiceStubSettings.Builder getStubSettingsBuilder() {
return ((OsConfigZonalServiceStubSettings.Builder) getStubSettings());
}

/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
}

/** Returns the builder for the settings used for calls to getInventory. */
public UnaryCallSettings.Builder<GetInventoryRequest, Inventory> getInventorySettings() {
return getStubSettingsBuilder().getInventorySettings();
}

/** Returns the builder for the settings used for calls to listInventories. */
public PagedCallSettings.Builder<
ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse>
listInventoriesSettings() {
return getStubSettingsBuilder().listInventoriesSettings();
}

/** Returns the builder for the settings used for calls to getVulnerabilityReport. */
public UnaryCallSettings.Builder<GetVulnerabilityReportRequest, VulnerabilityReport>
getVulnerabilityReportSettings() {
return getStubSettingsBuilder().getVulnerabilityReportSettings();
}

/** Returns the builder for the settings used for calls to listVulnerabilityReports. */
public PagedCallSettings.Builder<
ListVulnerabilityReportsRequest,
ListVulnerabilityReportsResponse,
ListVulnerabilityReportsPagedResponse>
listVulnerabilityReportsSettings() {
return getStubSettingsBuilder().listVulnerabilityReportsSettings();
}

@Override
public OsConfigZonalServiceSettings build() throws IOException {
return new OsConfigZonalServiceSettings(this);
}
}
}
@@ -40,6 +40,27 @@
}
}
}
},
"OsConfigZonalService": {
"clients": {
"grpc": {
"libraryClient": "OsConfigZonalServiceClient",
"rpcs": {
"GetInventory": {
"methods": ["getInventory", "getInventory", "getInventory", "getInventoryCallable"]
},
"GetVulnerabilityReport": {
"methods": ["getVulnerabilityReport", "getVulnerabilityReport", "getVulnerabilityReport", "getVulnerabilityReportCallable"]
},
"ListInventories": {
"methods": ["listInventories", "listInventories", "listInventories", "listInventoriesPagedCallable", "listInventoriesCallable"]
},
"ListVulnerabilityReports": {
"methods": ["listVulnerabilityReports", "listVulnerabilityReports", "listVulnerabilityReports", "listVulnerabilityReportsPagedCallable", "listVulnerabilityReportsCallable"]
}
}
}
}
}
}
}
@@ -42,6 +42,23 @@
* PatchJobs.PatchJob response = osConfigServiceClient.executePatchJob(request);
* }
* }</pre>
*
* <p>======================= OsConfigZonalServiceClient =======================
*
* <p>Service Description: Zonal OS Config API
*
* <p>The OS Config service is the server-side component that allows users to manage package
* installations and patch jobs for Compute Engine VM instances.
*
* <p>Sample for OsConfigZonalServiceClient:
*
* <pre>{@code
* try (OsConfigZonalServiceClient osConfigZonalServiceClient =
* OsConfigZonalServiceClient.create()) {
* InventoryName name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
* Inventory response = osConfigZonalServiceClient.getInventory(name);
* }
* }</pre>
*/
@Generated("by gapic-generator-java")
package com.google.cloud.osconfig.v1;
@@ -0,0 +1,113 @@
/*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.osconfig.v1.stub;

import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcCallableFactory;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.BatchingCallSettings;
import com.google.api.gax.rpc.BidiStreamingCallable;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientStreamingCallable;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.ServerStreamingCallSettings;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.StreamingCallSettings;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* gRPC callable factory implementation for the OsConfigZonalService service API.
*
* <p>This class is for advanced usage.
*/
@Generated("by gapic-generator-java")
public class GrpcOsConfigZonalServiceCallableFactory implements GrpcStubCallableFactory {

@Override
public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUnaryCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
UnaryCallSettings<RequestT, ResponseT> callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext);
}

@Override
public <RequestT, ResponseT, PagedListResponseT>
UnaryCallable<RequestT, PagedListResponseT> createPagedCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
PagedCallSettings<RequestT, ResponseT, PagedListResponseT> callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext);
}

@Override
public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
BatchingCallSettings<RequestT, ResponseT> callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createBatchingCallable(
grpcCallSettings, callSettings, clientContext);
}

@Override
public <RequestT, ResponseT, MetadataT>
OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(
GrpcCallSettings<RequestT, Operation> grpcCallSettings,
OperationCallSettings<RequestT, ResponseT, MetadataT> callSettings,
ClientContext clientContext,
OperationsStub operationsStub) {
return GrpcCallableFactory.createOperationCallable(
grpcCallSettings, callSettings, clientContext, operationsStub);
}

@Override
public <RequestT, ResponseT>
BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
StreamingCallSettings<RequestT, ResponseT> callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createBidiStreamingCallable(
grpcCallSettings, callSettings, clientContext);
}

@Override
public <RequestT, ResponseT>
ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
ServerStreamingCallSettings<RequestT, ResponseT> callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createServerStreamingCallable(
grpcCallSettings, callSettings, clientContext);
}

@Override
public <RequestT, ResponseT>
ClientStreamingCallable<RequestT, ResponseT> createClientStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
StreamingCallSettings<RequestT, ResponseT> callSettings,
ClientContext clientContext) {
return GrpcCallableFactory.createClientStreamingCallable(
grpcCallSettings, callSettings, clientContext);
}
}

0 comments on commit b68ebde

Please sign in to comment.