Skip to content
Permalink
Browse files
feat: add resource names, fix pagination settings (#33)
  • Loading branch information
chingor13 committed May 5, 2020
1 parent 5d5e1a4 commit 980bbb26c838e30644bcc3de04b5fc4afc25e798
Showing with 2,362 additions and 441 deletions.
  1. +859 −35 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceClient.java
  2. +28 −10 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceSettings.java
  3. +2 −2 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/package-info.java
  4. +39 −0 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigServiceStub.java
  5. +20 −0 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigServiceStub.java
  6. +259 −22 ...-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigServiceStubSettings.java
  7. +124 −60 google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/OsConfigServiceClientTest.java
  8. +8 −0 proto-google-cloud-os-config-v1/pom.xml
  9. +204 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InstanceName.java
  10. +58 −52 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigProto.java
  11. +184 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/PatchDeploymentName.java
  12. +64 −111 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/PatchDeployments.java
  13. +182 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/PatchJobName.java
  14. +134 −122 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/PatchJobs.java
  15. +162 −0 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ProjectName.java
  16. +5 −0 proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_service.proto
  17. +6 −10 proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/patch_deployments.proto
  18. +20 −13 proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/patch_jobs.proto
  19. +4 −4 synth.metadata

Large diffs are not rendered by default.

@@ -15,6 +15,10 @@
*/
package com.google.cloud.osconfig.v1;

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.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GoogleCredentialsProvider;
@@ -23,6 +27,7 @@
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.PatchDeployments.CreatePatchDeploymentRequest;
@@ -60,16 +65,16 @@
* <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 executePatchJob to 30 seconds:
* <p>For example, to set the total timeout of getPatchJob to 30 seconds:
*
* <pre>
* <code>
* OsConfigServiceSettings.Builder osConfigServiceSettingsBuilder =
* OsConfigServiceSettings.newBuilder();
* osConfigServiceSettingsBuilder
* .executePatchJobSettings()
* .getPatchJobSettings()
* .setRetrySettings(
* osConfigServiceSettingsBuilder.executePatchJobSettings().getRetrySettings().toBuilder()
* osConfigServiceSettingsBuilder.getPatchJobSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* OsConfigServiceSettings osConfigServiceSettings = osConfigServiceSettingsBuilder.build();
@@ -95,12 +100,16 @@ public UnaryCallSettings<CancelPatchJobRequest, PatchJob> cancelPatchJobSettings
}

/** Returns the object with the settings used for calls to listPatchJobs. */
public UnaryCallSettings<ListPatchJobsRequest, ListPatchJobsResponse> listPatchJobsSettings() {
public PagedCallSettings<ListPatchJobsRequest, ListPatchJobsResponse, ListPatchJobsPagedResponse>
listPatchJobsSettings() {
return ((OsConfigServiceStubSettings) getStubSettings()).listPatchJobsSettings();
}

/** Returns the object with the settings used for calls to listPatchJobInstanceDetails. */
public UnaryCallSettings<ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsResponse>
public PagedCallSettings<
ListPatchJobInstanceDetailsRequest,
ListPatchJobInstanceDetailsResponse,
ListPatchJobInstanceDetailsPagedResponse>
listPatchJobInstanceDetailsSettings() {
return ((OsConfigServiceStubSettings) getStubSettings()).listPatchJobInstanceDetailsSettings();
}
@@ -118,7 +127,10 @@ public UnaryCallSettings<ListPatchJobsRequest, ListPatchJobsResponse> listPatchJ
}

/** Returns the object with the settings used for calls to listPatchDeployments. */
public UnaryCallSettings<ListPatchDeploymentsRequest, ListPatchDeploymentsResponse>
public PagedCallSettings<
ListPatchDeploymentsRequest,
ListPatchDeploymentsResponse,
ListPatchDeploymentsPagedResponse>
listPatchDeploymentsSettings() {
return ((OsConfigServiceStubSettings) getStubSettings()).listPatchDeploymentsSettings();
}
@@ -241,14 +253,17 @@ public UnaryCallSettings.Builder<CancelPatchJobRequest, PatchJob> cancelPatchJob
}

/** Returns the builder for the settings used for calls to listPatchJobs. */
public UnaryCallSettings.Builder<ListPatchJobsRequest, ListPatchJobsResponse>
public PagedCallSettings.Builder<
ListPatchJobsRequest, ListPatchJobsResponse, ListPatchJobsPagedResponse>
listPatchJobsSettings() {
return getStubSettingsBuilder().listPatchJobsSettings();
}

/** Returns the builder for the settings used for calls to listPatchJobInstanceDetails. */
public UnaryCallSettings.Builder<
ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsResponse>
public PagedCallSettings.Builder<
ListPatchJobInstanceDetailsRequest,
ListPatchJobInstanceDetailsResponse,
ListPatchJobInstanceDetailsPagedResponse>
listPatchJobInstanceDetailsSettings() {
return getStubSettingsBuilder().listPatchJobInstanceDetailsSettings();
}
@@ -266,7 +281,10 @@ public UnaryCallSettings.Builder<CancelPatchJobRequest, PatchJob> cancelPatchJob
}

/** Returns the builder for the settings used for calls to listPatchDeployments. */
public UnaryCallSettings.Builder<ListPatchDeploymentsRequest, ListPatchDeploymentsResponse>
public PagedCallSettings.Builder<
ListPatchDeploymentsRequest,
ListPatchDeploymentsResponse,
ListPatchDeploymentsPagedResponse>
listPatchDeploymentsSettings() {
return getStubSettingsBuilder().listPatchDeploymentsSettings();
}
@@ -31,8 +31,8 @@
* <pre>
* <code>
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* ExecutePatchJobRequest request = ExecutePatchJobRequest.newBuilder().build();
* PatchJob response = osConfigServiceClient.executePatchJob(request);
* PatchJobName name = PatchJobName.of("[PROJECT]", "[PATCH_JOB]");
* PatchJob response = osConfigServiceClient.getPatchJob(name);
* }
* </code>
* </pre>
@@ -15,6 +15,10 @@
*/
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.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
@@ -148,15 +152,22 @@ public class GrpcOsConfigServiceStub extends OsConfigServiceStub {
private final UnaryCallable<GetPatchJobRequest, PatchJob> getPatchJobCallable;
private final UnaryCallable<CancelPatchJobRequest, PatchJob> cancelPatchJobCallable;
private final UnaryCallable<ListPatchJobsRequest, ListPatchJobsResponse> listPatchJobsCallable;
private final UnaryCallable<ListPatchJobsRequest, ListPatchJobsPagedResponse>
listPatchJobsPagedCallable;
private final UnaryCallable<
ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsResponse>
listPatchJobInstanceDetailsCallable;
private final UnaryCallable<
ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsPagedResponse>
listPatchJobInstanceDetailsPagedCallable;
private final UnaryCallable<CreatePatchDeploymentRequest, PatchDeployment>
createPatchDeploymentCallable;
private final UnaryCallable<GetPatchDeploymentRequest, PatchDeployment>
getPatchDeploymentCallable;
private final UnaryCallable<ListPatchDeploymentsRequest, ListPatchDeploymentsResponse>
listPatchDeploymentsCallable;
private final UnaryCallable<ListPatchDeploymentsRequest, ListPatchDeploymentsPagedResponse>
listPatchDeploymentsPagedCallable;
private final UnaryCallable<DeletePatchDeploymentRequest, Empty> deletePatchDeploymentCallable;

private final GrpcStubCallableFactory callableFactory;
@@ -337,11 +348,19 @@ public Map<String, String> extract(DeletePatchDeploymentRequest request) {
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,
@@ -357,6 +376,11 @@ public Map<String, String> extract(DeletePatchDeploymentRequest request) {
listPatchDeploymentsTransportSettings,
settings.listPatchDeploymentsSettings(),
clientContext);
this.listPatchDeploymentsPagedCallable =
callableFactory.createPagedCallable(
listPatchDeploymentsTransportSettings,
settings.listPatchDeploymentsSettings(),
clientContext);
this.deletePatchDeploymentCallable =
callableFactory.createUnaryCallable(
deletePatchDeploymentTransportSettings,
@@ -378,10 +402,20 @@ public UnaryCallable<CancelPatchJobRequest, PatchJob> cancelPatchJobCallable() {
return cancelPatchJobCallable;
}

public UnaryCallable<ListPatchJobsRequest, ListPatchJobsPagedResponse>
listPatchJobsPagedCallable() {
return listPatchJobsPagedCallable;
}

public UnaryCallable<ListPatchJobsRequest, ListPatchJobsResponse> listPatchJobsCallable() {
return listPatchJobsCallable;
}

public UnaryCallable<ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsPagedResponse>
listPatchJobInstanceDetailsPagedCallable() {
return listPatchJobInstanceDetailsPagedCallable;
}

public UnaryCallable<ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsResponse>
listPatchJobInstanceDetailsCallable() {
return listPatchJobInstanceDetailsCallable;
@@ -396,6 +430,11 @@ public UnaryCallable<GetPatchDeploymentRequest, PatchDeployment> getPatchDeploym
return getPatchDeploymentCallable;
}

public UnaryCallable<ListPatchDeploymentsRequest, ListPatchDeploymentsPagedResponse>
listPatchDeploymentsPagedCallable() {
return listPatchDeploymentsPagedCallable;
}

public UnaryCallable<ListPatchDeploymentsRequest, ListPatchDeploymentsResponse>
listPatchDeploymentsCallable() {
return listPatchDeploymentsCallable;
@@ -15,6 +15,10 @@
*/
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.gax.core.BackgroundResource;
import com.google.api.gax.rpc.UnaryCallable;
@@ -57,10 +61,21 @@ public UnaryCallable<CancelPatchJobRequest, PatchJob> cancelPatchJobCallable() {
throw new UnsupportedOperationException("Not implemented: cancelPatchJobCallable()");
}

public UnaryCallable<ListPatchJobsRequest, ListPatchJobsPagedResponse>
listPatchJobsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listPatchJobsPagedCallable()");
}

public UnaryCallable<ListPatchJobsRequest, ListPatchJobsResponse> listPatchJobsCallable() {
throw new UnsupportedOperationException("Not implemented: listPatchJobsCallable()");
}

public UnaryCallable<ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsPagedResponse>
listPatchJobInstanceDetailsPagedCallable() {
throw new UnsupportedOperationException(
"Not implemented: listPatchJobInstanceDetailsPagedCallable()");
}

public UnaryCallable<ListPatchJobInstanceDetailsRequest, ListPatchJobInstanceDetailsResponse>
listPatchJobInstanceDetailsCallable() {
throw new UnsupportedOperationException(
@@ -76,6 +91,11 @@ public UnaryCallable<GetPatchDeploymentRequest, PatchDeployment> getPatchDeploym
throw new UnsupportedOperationException("Not implemented: getPatchDeploymentCallable()");
}

public UnaryCallable<ListPatchDeploymentsRequest, ListPatchDeploymentsPagedResponse>
listPatchDeploymentsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listPatchDeploymentsPagedCallable()");
}

public UnaryCallable<ListPatchDeploymentsRequest, ListPatchDeploymentsResponse>
listPatchDeploymentsCallable() {
throw new UnsupportedOperationException("Not implemented: listPatchDeploymentsCallable()");

0 comments on commit 980bbb2

Please sign in to comment.