|
29 | 29 | import com.google.cloud.osconfig.v1.stub.OsConfigServiceStubSettings; |
30 | 30 | import com.google.common.util.concurrent.MoreExecutors; |
31 | 31 | import com.google.protobuf.Empty; |
| 32 | +import com.google.protobuf.FieldMask; |
32 | 33 | import java.io.IOException; |
33 | 34 | import java.util.List; |
34 | 35 | import java.util.concurrent.TimeUnit; |
@@ -1145,6 +1146,293 @@ public final void deletePatchDeployment(PatchDeployments.DeletePatchDeploymentRe |
1145 | 1146 | return stub.deletePatchDeploymentCallable(); |
1146 | 1147 | } |
1147 | 1148 |
|
| 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/*/patchDeployments/*`. |
| 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/*/patchDeployments/*`. |
| 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/*/patchDeployments/*`. |
| 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/*/patchDeployments/*`. |
| 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 | + |
1148 | 1436 | @Override |
1149 | 1437 | public final void close() { |
1150 | 1438 | stub.close(); |
|
0 commit comments