|
28 | 28 | import com.google.cloud.logging.v2.stub.ConfigServiceV2Stub; |
29 | 29 | import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings; |
30 | 30 | import com.google.common.util.concurrent.MoreExecutors; |
| 31 | +import com.google.logging.v2.CmekSettings; |
31 | 32 | import com.google.logging.v2.CreateExclusionRequest; |
32 | 33 | import com.google.logging.v2.CreateSinkRequest; |
33 | 34 | import com.google.logging.v2.DeleteExclusionRequest; |
34 | 35 | import com.google.logging.v2.DeleteSinkRequest; |
35 | 36 | import com.google.logging.v2.ExclusionName; |
| 37 | +import com.google.logging.v2.GetCmekSettingsRequest; |
36 | 38 | import com.google.logging.v2.GetExclusionRequest; |
37 | 39 | import com.google.logging.v2.GetSinkRequest; |
38 | 40 | import com.google.logging.v2.ListExclusionsRequest; |
|
43 | 45 | import com.google.logging.v2.LogSink; |
44 | 46 | import com.google.logging.v2.ParentName; |
45 | 47 | import com.google.logging.v2.SinkName; |
| 48 | +import com.google.logging.v2.UpdateCmekSettingsRequest; |
46 | 49 | import com.google.logging.v2.UpdateExclusionRequest; |
47 | 50 | import com.google.logging.v2.UpdateSinkRequest; |
48 | 51 | import com.google.protobuf.Empty; |
@@ -1435,6 +1438,118 @@ public final UnaryCallable<DeleteExclusionRequest, Empty> deleteExclusionCallabl |
1435 | 1438 | return stub.deleteExclusionCallable(); |
1436 | 1439 | } |
1437 | 1440 |
|
| 1441 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 1442 | + /** |
| 1443 | + * Gets the Logs Router CMEK settings for the given resource. |
| 1444 | + * |
| 1445 | + * <p>Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once |
| 1446 | + * configured, it applies to all projects and folders in the GCP organization. |
| 1447 | + * |
| 1448 | + * <p>See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more |
| 1449 | + * information. |
| 1450 | + * |
| 1451 | + * <p>Sample code: |
| 1452 | + * |
| 1453 | + * <pre><code> |
| 1454 | + * try (ConfigClient configClient = ConfigClient.create()) { |
| 1455 | + * GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder().build(); |
| 1456 | + * CmekSettings response = configClient.getCmekSettings(request); |
| 1457 | + * } |
| 1458 | + * </code></pre> |
| 1459 | + * |
| 1460 | + * @param request The request object containing all of the parameters for the API call. |
| 1461 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 1462 | + */ |
| 1463 | + public final CmekSettings getCmekSettings(GetCmekSettingsRequest request) { |
| 1464 | + return getCmekSettingsCallable().call(request); |
| 1465 | + } |
| 1466 | + |
| 1467 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 1468 | + /** |
| 1469 | + * Gets the Logs Router CMEK settings for the given resource. |
| 1470 | + * |
| 1471 | + * <p>Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once |
| 1472 | + * configured, it applies to all projects and folders in the GCP organization. |
| 1473 | + * |
| 1474 | + * <p>See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more |
| 1475 | + * information. |
| 1476 | + * |
| 1477 | + * <p>Sample code: |
| 1478 | + * |
| 1479 | + * <pre><code> |
| 1480 | + * try (ConfigClient configClient = ConfigClient.create()) { |
| 1481 | + * GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder().build(); |
| 1482 | + * ApiFuture<CmekSettings> future = configClient.getCmekSettingsCallable().futureCall(request); |
| 1483 | + * // Do something |
| 1484 | + * CmekSettings response = future.get(); |
| 1485 | + * } |
| 1486 | + * </code></pre> |
| 1487 | + */ |
| 1488 | + public final UnaryCallable<GetCmekSettingsRequest, CmekSettings> getCmekSettingsCallable() { |
| 1489 | + return stub.getCmekSettingsCallable(); |
| 1490 | + } |
| 1491 | + |
| 1492 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 1493 | + /** |
| 1494 | + * Updates the Logs Router CMEK settings for the given resource. |
| 1495 | + * |
| 1496 | + * <p>Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once |
| 1497 | + * configured, it applies to all projects and folders in the GCP organization. |
| 1498 | + * |
| 1499 | + * <p>[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] will fail if 1) |
| 1500 | + * `kms_key_name` is invalid, or 2) the associated service account does not have the required |
| 1501 | + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key |
| 1502 | + * is disabled. |
| 1503 | + * |
| 1504 | + * <p>See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more |
| 1505 | + * information. |
| 1506 | + * |
| 1507 | + * <p>Sample code: |
| 1508 | + * |
| 1509 | + * <pre><code> |
| 1510 | + * try (ConfigClient configClient = ConfigClient.create()) { |
| 1511 | + * UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder().build(); |
| 1512 | + * CmekSettings response = configClient.updateCmekSettings(request); |
| 1513 | + * } |
| 1514 | + * </code></pre> |
| 1515 | + * |
| 1516 | + * @param request The request object containing all of the parameters for the API call. |
| 1517 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 1518 | + */ |
| 1519 | + public final CmekSettings updateCmekSettings(UpdateCmekSettingsRequest request) { |
| 1520 | + return updateCmekSettingsCallable().call(request); |
| 1521 | + } |
| 1522 | + |
| 1523 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 1524 | + /** |
| 1525 | + * Updates the Logs Router CMEK settings for the given resource. |
| 1526 | + * |
| 1527 | + * <p>Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once |
| 1528 | + * configured, it applies to all projects and folders in the GCP organization. |
| 1529 | + * |
| 1530 | + * <p>[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] will fail if 1) |
| 1531 | + * `kms_key_name` is invalid, or 2) the associated service account does not have the required |
| 1532 | + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key |
| 1533 | + * is disabled. |
| 1534 | + * |
| 1535 | + * <p>See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more |
| 1536 | + * information. |
| 1537 | + * |
| 1538 | + * <p>Sample code: |
| 1539 | + * |
| 1540 | + * <pre><code> |
| 1541 | + * try (ConfigClient configClient = ConfigClient.create()) { |
| 1542 | + * UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder().build(); |
| 1543 | + * ApiFuture<CmekSettings> future = configClient.updateCmekSettingsCallable().futureCall(request); |
| 1544 | + * // Do something |
| 1545 | + * CmekSettings response = future.get(); |
| 1546 | + * } |
| 1547 | + * </code></pre> |
| 1548 | + */ |
| 1549 | + public final UnaryCallable<UpdateCmekSettingsRequest, CmekSettings> updateCmekSettingsCallable() { |
| 1550 | + return stub.updateCmekSettingsCallable(); |
| 1551 | + } |
| 1552 | + |
1438 | 1553 | @Override |
1439 | 1554 | public final void close() { |
1440 | 1555 | stub.close(); |
|
0 commit comments