Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

feat: add resource names, fix pagination settings #33

Merged
merged 1 commit into from May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

Large diffs are not rendered by default.

Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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();
}
Expand All @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand Down
Expand Up @@ -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>
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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;
Expand All @@ -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;
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand All @@ -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()");
Expand Down