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

feat: Update osconfig v1 protos #437

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.cloud.osconfig.v1.stub.OsConfigServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -1145,6 +1146,293 @@ public final void deletePatchDeployment(PatchDeployments.DeletePatchDeploymentRe
return stub.deletePatchDeploymentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Update an OS Config patch deployment.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* PatchDeployments.PatchDeployment patchDeployment =
* PatchDeployments.PatchDeployment.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* PatchDeployments.PatchDeployment response =
* osConfigServiceClient.updatePatchDeployment(patchDeployment, updateMask);
* }
* }</pre>
*
* @param patchDeployment Required. The patch deployment to Update.
* @param updateMask Optional. Field mask that controls which fields of the patch deployment
* should be updated.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final PatchDeployments.PatchDeployment updatePatchDeployment(
PatchDeployments.PatchDeployment patchDeployment, FieldMask updateMask) {
PatchDeployments.UpdatePatchDeploymentRequest request =
PatchDeployments.UpdatePatchDeploymentRequest.newBuilder()
.setPatchDeployment(patchDeployment)
.setUpdateMask(updateMask)
.build();
return updatePatchDeployment(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Update an OS Config patch deployment.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* PatchDeployments.UpdatePatchDeploymentRequest request =
* PatchDeployments.UpdatePatchDeploymentRequest.newBuilder()
* .setPatchDeployment(PatchDeployments.PatchDeployment.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* PatchDeployments.PatchDeployment response =
* osConfigServiceClient.updatePatchDeployment(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final PatchDeployments.PatchDeployment updatePatchDeployment(
PatchDeployments.UpdatePatchDeploymentRequest request) {
return updatePatchDeploymentCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Update an OS Config patch deployment.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* PatchDeployments.UpdatePatchDeploymentRequest request =
* PatchDeployments.UpdatePatchDeploymentRequest.newBuilder()
* .setPatchDeployment(PatchDeployments.PatchDeployment.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<PatchDeployments.PatchDeployment> future =
* osConfigServiceClient.updatePatchDeploymentCallable().futureCall(request);
* // Do something.
* PatchDeployments.PatchDeployment response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<
PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
updatePatchDeploymentCallable() {
return stub.updatePatchDeploymentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate
* patch jobs.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* PatchDeploymentName name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]");
* PatchDeployments.PatchDeployment response = osConfigServiceClient.pausePatchDeployment(name);
* }
* }</pre>
*
* @param name Required. The resource name of the patch deployment in the form
* `projects/&#42;/patchDeployments/&#42;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final PatchDeployments.PatchDeployment pausePatchDeployment(PatchDeploymentName name) {
PatchDeployments.PausePatchDeploymentRequest request =
PatchDeployments.PausePatchDeploymentRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return pausePatchDeployment(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate
* patch jobs.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* String name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString();
* PatchDeployments.PatchDeployment response = osConfigServiceClient.pausePatchDeployment(name);
* }
* }</pre>
*
* @param name Required. The resource name of the patch deployment in the form
* `projects/&#42;/patchDeployments/&#42;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final PatchDeployments.PatchDeployment pausePatchDeployment(String name) {
PatchDeployments.PausePatchDeploymentRequest request =
PatchDeployments.PausePatchDeploymentRequest.newBuilder().setName(name).build();
return pausePatchDeployment(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate
* patch jobs.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* PatchDeployments.PausePatchDeploymentRequest request =
* PatchDeployments.PausePatchDeploymentRequest.newBuilder()
* .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString())
* .build();
* PatchDeployments.PatchDeployment response =
* osConfigServiceClient.pausePatchDeployment(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final PatchDeployments.PatchDeployment pausePatchDeployment(
PatchDeployments.PausePatchDeploymentRequest request) {
return pausePatchDeploymentCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate
* patch jobs.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* PatchDeployments.PausePatchDeploymentRequest request =
* PatchDeployments.PausePatchDeploymentRequest.newBuilder()
* .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString())
* .build();
* ApiFuture<PatchDeployments.PatchDeployment> future =
* osConfigServiceClient.pausePatchDeploymentCallable().futureCall(request);
* // Do something.
* PatchDeployments.PatchDeployment response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<
PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
pausePatchDeploymentCallable() {
return stub.pausePatchDeploymentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues
* to generate patch jobs.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* PatchDeploymentName name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]");
* PatchDeployments.PatchDeployment response = osConfigServiceClient.resumePatchDeployment(name);
* }
* }</pre>
*
* @param name Required. The resource name of the patch deployment in the form
* `projects/&#42;/patchDeployments/&#42;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final PatchDeployments.PatchDeployment resumePatchDeployment(PatchDeploymentName name) {
PatchDeployments.ResumePatchDeploymentRequest request =
PatchDeployments.ResumePatchDeploymentRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return resumePatchDeployment(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues
* to generate patch jobs.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* String name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString();
* PatchDeployments.PatchDeployment response = osConfigServiceClient.resumePatchDeployment(name);
* }
* }</pre>
*
* @param name Required. The resource name of the patch deployment in the form
* `projects/&#42;/patchDeployments/&#42;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final PatchDeployments.PatchDeployment resumePatchDeployment(String name) {
PatchDeployments.ResumePatchDeploymentRequest request =
PatchDeployments.ResumePatchDeploymentRequest.newBuilder().setName(name).build();
return resumePatchDeployment(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues
* to generate patch jobs.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* PatchDeployments.ResumePatchDeploymentRequest request =
* PatchDeployments.ResumePatchDeploymentRequest.newBuilder()
* .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString())
* .build();
* PatchDeployments.PatchDeployment response =
* osConfigServiceClient.resumePatchDeployment(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final PatchDeployments.PatchDeployment resumePatchDeployment(
PatchDeployments.ResumePatchDeploymentRequest request) {
return resumePatchDeploymentCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues
* to generate patch jobs.
*
* <p>Sample code:
*
* <pre>{@code
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
* PatchDeployments.ResumePatchDeploymentRequest request =
* PatchDeployments.ResumePatchDeploymentRequest.newBuilder()
* .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString())
* .build();
* ApiFuture<PatchDeployments.PatchDeployment> future =
* osConfigServiceClient.resumePatchDeploymentCallable().futureCall(request);
* // Do something.
* PatchDeployments.PatchDeployment response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<
PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
resumePatchDeploymentCallable() {
return stub.resumePatchDeploymentCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,27 @@ public UnaryCallSettings<PatchJobs.GetPatchJobRequest, PatchJobs.PatchJob> getPa
return ((OsConfigServiceStubSettings) getStubSettings()).deletePatchDeploymentSettings();
}

/** Returns the object with the settings used for calls to updatePatchDeployment. */
public UnaryCallSettings<
PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
updatePatchDeploymentSettings() {
return ((OsConfigServiceStubSettings) getStubSettings()).updatePatchDeploymentSettings();
}

/** Returns the object with the settings used for calls to pausePatchDeployment. */
public UnaryCallSettings<
PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
pausePatchDeploymentSettings() {
return ((OsConfigServiceStubSettings) getStubSettings()).pausePatchDeploymentSettings();
}

/** Returns the object with the settings used for calls to resumePatchDeployment. */
public UnaryCallSettings<
PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
resumePatchDeploymentSettings() {
return ((OsConfigServiceStubSettings) getStubSettings()).resumePatchDeploymentSettings();
}

public static final OsConfigServiceSettings create(OsConfigServiceStubSettings stub)
throws IOException {
return new OsConfigServiceSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -298,6 +319,27 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().deletePatchDeploymentSettings();
}

/** Returns the builder for the settings used for calls to updatePatchDeployment. */
public UnaryCallSettings.Builder<
PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
updatePatchDeploymentSettings() {
return getStubSettingsBuilder().updatePatchDeploymentSettings();
}

/** Returns the builder for the settings used for calls to pausePatchDeployment. */
public UnaryCallSettings.Builder<
PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
pausePatchDeploymentSettings() {
return getStubSettingsBuilder().pausePatchDeploymentSettings();
}

/** Returns the builder for the settings used for calls to resumePatchDeployment. */
public UnaryCallSettings.Builder<
PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
resumePatchDeploymentSettings() {
return getStubSettingsBuilder().resumePatchDeploymentSettings();
}

@Override
public OsConfigServiceSettings build() throws IOException {
return new OsConfigServiceSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
},
"ListPatchJobs": {
"methods": ["listPatchJobs", "listPatchJobs", "listPatchJobs", "listPatchJobsPagedCallable", "listPatchJobsCallable"]
},
"PausePatchDeployment": {
"methods": ["pausePatchDeployment", "pausePatchDeployment", "pausePatchDeployment", "pausePatchDeploymentCallable"]
},
"ResumePatchDeployment": {
"methods": ["resumePatchDeployment", "resumePatchDeployment", "resumePatchDeployment", "resumePatchDeploymentCallable"]
},
"UpdatePatchDeployment": {
"methods": ["updatePatchDeployment", "updatePatchDeployment", "updatePatchDeploymentCallable"]
}
}
}
Expand Down
Loading