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

Commit 5bc7869

Browse files
feat: Update osconfig v1 protos (#437)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 427050266 Source-Link: googleapis/googleapis@010716c Source-Link: https://github.com/googleapis/googleapis-gen/commit/95161e21a033345c5fe13542bb8a82d4b1d08690 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTUxNjFlMjFhMDMzMzQ1YzVmZTEzNTQyYmI4YTgyZDRiMWQwODY5MCJ9
1 parent 8f49906 commit 5bc7869

20 files changed

Lines changed: 5003 additions & 386 deletions

File tree

google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceClient.java

Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.google.cloud.osconfig.v1.stub.OsConfigServiceStubSettings;
3030
import com.google.common.util.concurrent.MoreExecutors;
3131
import com.google.protobuf.Empty;
32+
import com.google.protobuf.FieldMask;
3233
import java.io.IOException;
3334
import java.util.List;
3435
import java.util.concurrent.TimeUnit;
@@ -1145,6 +1146,293 @@ public final void deletePatchDeployment(PatchDeployments.DeletePatchDeploymentRe
11451146
return stub.deletePatchDeploymentCallable();
11461147
}
11471148

1149+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1150+
/**
1151+
* Update an OS Config patch deployment.
1152+
*
1153+
* <p>Sample code:
1154+
*
1155+
* <pre>{@code
1156+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1157+
* PatchDeployments.PatchDeployment patchDeployment =
1158+
* PatchDeployments.PatchDeployment.newBuilder().build();
1159+
* FieldMask updateMask = FieldMask.newBuilder().build();
1160+
* PatchDeployments.PatchDeployment response =
1161+
* osConfigServiceClient.updatePatchDeployment(patchDeployment, updateMask);
1162+
* }
1163+
* }</pre>
1164+
*
1165+
* @param patchDeployment Required. The patch deployment to Update.
1166+
* @param updateMask Optional. Field mask that controls which fields of the patch deployment
1167+
* should be updated.
1168+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1169+
*/
1170+
public final PatchDeployments.PatchDeployment updatePatchDeployment(
1171+
PatchDeployments.PatchDeployment patchDeployment, FieldMask updateMask) {
1172+
PatchDeployments.UpdatePatchDeploymentRequest request =
1173+
PatchDeployments.UpdatePatchDeploymentRequest.newBuilder()
1174+
.setPatchDeployment(patchDeployment)
1175+
.setUpdateMask(updateMask)
1176+
.build();
1177+
return updatePatchDeployment(request);
1178+
}
1179+
1180+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1181+
/**
1182+
* Update an OS Config patch deployment.
1183+
*
1184+
* <p>Sample code:
1185+
*
1186+
* <pre>{@code
1187+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1188+
* PatchDeployments.UpdatePatchDeploymentRequest request =
1189+
* PatchDeployments.UpdatePatchDeploymentRequest.newBuilder()
1190+
* .setPatchDeployment(PatchDeployments.PatchDeployment.newBuilder().build())
1191+
* .setUpdateMask(FieldMask.newBuilder().build())
1192+
* .build();
1193+
* PatchDeployments.PatchDeployment response =
1194+
* osConfigServiceClient.updatePatchDeployment(request);
1195+
* }
1196+
* }</pre>
1197+
*
1198+
* @param request The request object containing all of the parameters for the API call.
1199+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1200+
*/
1201+
public final PatchDeployments.PatchDeployment updatePatchDeployment(
1202+
PatchDeployments.UpdatePatchDeploymentRequest request) {
1203+
return updatePatchDeploymentCallable().call(request);
1204+
}
1205+
1206+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1207+
/**
1208+
* Update an OS Config patch deployment.
1209+
*
1210+
* <p>Sample code:
1211+
*
1212+
* <pre>{@code
1213+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1214+
* PatchDeployments.UpdatePatchDeploymentRequest request =
1215+
* PatchDeployments.UpdatePatchDeploymentRequest.newBuilder()
1216+
* .setPatchDeployment(PatchDeployments.PatchDeployment.newBuilder().build())
1217+
* .setUpdateMask(FieldMask.newBuilder().build())
1218+
* .build();
1219+
* ApiFuture<PatchDeployments.PatchDeployment> future =
1220+
* osConfigServiceClient.updatePatchDeploymentCallable().futureCall(request);
1221+
* // Do something.
1222+
* PatchDeployments.PatchDeployment response = future.get();
1223+
* }
1224+
* }</pre>
1225+
*/
1226+
public final UnaryCallable<
1227+
PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
1228+
updatePatchDeploymentCallable() {
1229+
return stub.updatePatchDeploymentCallable();
1230+
}
1231+
1232+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1233+
/**
1234+
* Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate
1235+
* patch jobs.
1236+
*
1237+
* <p>Sample code:
1238+
*
1239+
* <pre>{@code
1240+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1241+
* PatchDeploymentName name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]");
1242+
* PatchDeployments.PatchDeployment response = osConfigServiceClient.pausePatchDeployment(name);
1243+
* }
1244+
* }</pre>
1245+
*
1246+
* @param name Required. The resource name of the patch deployment in the form
1247+
* `projects/&#42;/patchDeployments/&#42;`.
1248+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1249+
*/
1250+
public final PatchDeployments.PatchDeployment pausePatchDeployment(PatchDeploymentName name) {
1251+
PatchDeployments.PausePatchDeploymentRequest request =
1252+
PatchDeployments.PausePatchDeploymentRequest.newBuilder()
1253+
.setName(name == null ? null : name.toString())
1254+
.build();
1255+
return pausePatchDeployment(request);
1256+
}
1257+
1258+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1259+
/**
1260+
* Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate
1261+
* patch jobs.
1262+
*
1263+
* <p>Sample code:
1264+
*
1265+
* <pre>{@code
1266+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1267+
* String name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString();
1268+
* PatchDeployments.PatchDeployment response = osConfigServiceClient.pausePatchDeployment(name);
1269+
* }
1270+
* }</pre>
1271+
*
1272+
* @param name Required. The resource name of the patch deployment in the form
1273+
* `projects/&#42;/patchDeployments/&#42;`.
1274+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1275+
*/
1276+
public final PatchDeployments.PatchDeployment pausePatchDeployment(String name) {
1277+
PatchDeployments.PausePatchDeploymentRequest request =
1278+
PatchDeployments.PausePatchDeploymentRequest.newBuilder().setName(name).build();
1279+
return pausePatchDeployment(request);
1280+
}
1281+
1282+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1283+
/**
1284+
* Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate
1285+
* patch jobs.
1286+
*
1287+
* <p>Sample code:
1288+
*
1289+
* <pre>{@code
1290+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1291+
* PatchDeployments.PausePatchDeploymentRequest request =
1292+
* PatchDeployments.PausePatchDeploymentRequest.newBuilder()
1293+
* .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString())
1294+
* .build();
1295+
* PatchDeployments.PatchDeployment response =
1296+
* osConfigServiceClient.pausePatchDeployment(request);
1297+
* }
1298+
* }</pre>
1299+
*
1300+
* @param request The request object containing all of the parameters for the API call.
1301+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1302+
*/
1303+
public final PatchDeployments.PatchDeployment pausePatchDeployment(
1304+
PatchDeployments.PausePatchDeploymentRequest request) {
1305+
return pausePatchDeploymentCallable().call(request);
1306+
}
1307+
1308+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1309+
/**
1310+
* Change state of patch deployment to "PAUSED". Patch deployment in paused state doesn't generate
1311+
* patch jobs.
1312+
*
1313+
* <p>Sample code:
1314+
*
1315+
* <pre>{@code
1316+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1317+
* PatchDeployments.PausePatchDeploymentRequest request =
1318+
* PatchDeployments.PausePatchDeploymentRequest.newBuilder()
1319+
* .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString())
1320+
* .build();
1321+
* ApiFuture<PatchDeployments.PatchDeployment> future =
1322+
* osConfigServiceClient.pausePatchDeploymentCallable().futureCall(request);
1323+
* // Do something.
1324+
* PatchDeployments.PatchDeployment response = future.get();
1325+
* }
1326+
* }</pre>
1327+
*/
1328+
public final UnaryCallable<
1329+
PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
1330+
pausePatchDeploymentCallable() {
1331+
return stub.pausePatchDeploymentCallable();
1332+
}
1333+
1334+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1335+
/**
1336+
* Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues
1337+
* to generate patch jobs.
1338+
*
1339+
* <p>Sample code:
1340+
*
1341+
* <pre>{@code
1342+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1343+
* PatchDeploymentName name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]");
1344+
* PatchDeployments.PatchDeployment response = osConfigServiceClient.resumePatchDeployment(name);
1345+
* }
1346+
* }</pre>
1347+
*
1348+
* @param name Required. The resource name of the patch deployment in the form
1349+
* `projects/&#42;/patchDeployments/&#42;`.
1350+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1351+
*/
1352+
public final PatchDeployments.PatchDeployment resumePatchDeployment(PatchDeploymentName name) {
1353+
PatchDeployments.ResumePatchDeploymentRequest request =
1354+
PatchDeployments.ResumePatchDeploymentRequest.newBuilder()
1355+
.setName(name == null ? null : name.toString())
1356+
.build();
1357+
return resumePatchDeployment(request);
1358+
}
1359+
1360+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1361+
/**
1362+
* Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues
1363+
* to generate patch jobs.
1364+
*
1365+
* <p>Sample code:
1366+
*
1367+
* <pre>{@code
1368+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1369+
* String name = PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString();
1370+
* PatchDeployments.PatchDeployment response = osConfigServiceClient.resumePatchDeployment(name);
1371+
* }
1372+
* }</pre>
1373+
*
1374+
* @param name Required. The resource name of the patch deployment in the form
1375+
* `projects/&#42;/patchDeployments/&#42;`.
1376+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1377+
*/
1378+
public final PatchDeployments.PatchDeployment resumePatchDeployment(String name) {
1379+
PatchDeployments.ResumePatchDeploymentRequest request =
1380+
PatchDeployments.ResumePatchDeploymentRequest.newBuilder().setName(name).build();
1381+
return resumePatchDeployment(request);
1382+
}
1383+
1384+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1385+
/**
1386+
* Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues
1387+
* to generate patch jobs.
1388+
*
1389+
* <p>Sample code:
1390+
*
1391+
* <pre>{@code
1392+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1393+
* PatchDeployments.ResumePatchDeploymentRequest request =
1394+
* PatchDeployments.ResumePatchDeploymentRequest.newBuilder()
1395+
* .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString())
1396+
* .build();
1397+
* PatchDeployments.PatchDeployment response =
1398+
* osConfigServiceClient.resumePatchDeployment(request);
1399+
* }
1400+
* }</pre>
1401+
*
1402+
* @param request The request object containing all of the parameters for the API call.
1403+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1404+
*/
1405+
public final PatchDeployments.PatchDeployment resumePatchDeployment(
1406+
PatchDeployments.ResumePatchDeploymentRequest request) {
1407+
return resumePatchDeploymentCallable().call(request);
1408+
}
1409+
1410+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1411+
/**
1412+
* Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues
1413+
* to generate patch jobs.
1414+
*
1415+
* <p>Sample code:
1416+
*
1417+
* <pre>{@code
1418+
* try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
1419+
* PatchDeployments.ResumePatchDeploymentRequest request =
1420+
* PatchDeployments.ResumePatchDeploymentRequest.newBuilder()
1421+
* .setName(PatchDeploymentName.of("[PROJECT]", "[PATCH_DEPLOYMENT]").toString())
1422+
* .build();
1423+
* ApiFuture<PatchDeployments.PatchDeployment> future =
1424+
* osConfigServiceClient.resumePatchDeploymentCallable().futureCall(request);
1425+
* // Do something.
1426+
* PatchDeployments.PatchDeployment response = future.get();
1427+
* }
1428+
* }</pre>
1429+
*/
1430+
public final UnaryCallable<
1431+
PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
1432+
resumePatchDeploymentCallable() {
1433+
return stub.resumePatchDeploymentCallable();
1434+
}
1435+
11481436
@Override
11491437
public final void close() {
11501438
stub.close();

google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigServiceSettings.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,27 @@ public UnaryCallSettings<PatchJobs.GetPatchJobRequest, PatchJobs.PatchJob> getPa
136136
return ((OsConfigServiceStubSettings) getStubSettings()).deletePatchDeploymentSettings();
137137
}
138138

139+
/** Returns the object with the settings used for calls to updatePatchDeployment. */
140+
public UnaryCallSettings<
141+
PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
142+
updatePatchDeploymentSettings() {
143+
return ((OsConfigServiceStubSettings) getStubSettings()).updatePatchDeploymentSettings();
144+
}
145+
146+
/** Returns the object with the settings used for calls to pausePatchDeployment. */
147+
public UnaryCallSettings<
148+
PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
149+
pausePatchDeploymentSettings() {
150+
return ((OsConfigServiceStubSettings) getStubSettings()).pausePatchDeploymentSettings();
151+
}
152+
153+
/** Returns the object with the settings used for calls to resumePatchDeployment. */
154+
public UnaryCallSettings<
155+
PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
156+
resumePatchDeploymentSettings() {
157+
return ((OsConfigServiceStubSettings) getStubSettings()).resumePatchDeploymentSettings();
158+
}
159+
139160
public static final OsConfigServiceSettings create(OsConfigServiceStubSettings stub)
140161
throws IOException {
141162
return new OsConfigServiceSettings.Builder(stub.toBuilder()).build();
@@ -298,6 +319,27 @@ public Builder applyToAllUnaryMethods(
298319
return getStubSettingsBuilder().deletePatchDeploymentSettings();
299320
}
300321

322+
/** Returns the builder for the settings used for calls to updatePatchDeployment. */
323+
public UnaryCallSettings.Builder<
324+
PatchDeployments.UpdatePatchDeploymentRequest, PatchDeployments.PatchDeployment>
325+
updatePatchDeploymentSettings() {
326+
return getStubSettingsBuilder().updatePatchDeploymentSettings();
327+
}
328+
329+
/** Returns the builder for the settings used for calls to pausePatchDeployment. */
330+
public UnaryCallSettings.Builder<
331+
PatchDeployments.PausePatchDeploymentRequest, PatchDeployments.PatchDeployment>
332+
pausePatchDeploymentSettings() {
333+
return getStubSettingsBuilder().pausePatchDeploymentSettings();
334+
}
335+
336+
/** Returns the builder for the settings used for calls to resumePatchDeployment. */
337+
public UnaryCallSettings.Builder<
338+
PatchDeployments.ResumePatchDeploymentRequest, PatchDeployments.PatchDeployment>
339+
resumePatchDeploymentSettings() {
340+
return getStubSettingsBuilder().resumePatchDeploymentSettings();
341+
}
342+
301343
@Override
302344
public OsConfigServiceSettings build() throws IOException {
303345
return new OsConfigServiceSettings(this);

google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/gapic_metadata.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@
3636
},
3737
"ListPatchJobs": {
3838
"methods": ["listPatchJobs", "listPatchJobs", "listPatchJobs", "listPatchJobsPagedCallable", "listPatchJobsCallable"]
39+
},
40+
"PausePatchDeployment": {
41+
"methods": ["pausePatchDeployment", "pausePatchDeployment", "pausePatchDeployment", "pausePatchDeploymentCallable"]
42+
},
43+
"ResumePatchDeployment": {
44+
"methods": ["resumePatchDeployment", "resumePatchDeployment", "resumePatchDeployment", "resumePatchDeploymentCallable"]
45+
},
46+
"UpdatePatchDeployment": {
47+
"methods": ["updatePatchDeployment", "updatePatchDeployment", "updatePatchDeploymentCallable"]
3948
}
4049
}
4150
}

0 commit comments

Comments
 (0)