|
12 | 12 | */ |
13 | 13 |
|
14 | 14 | /* |
15 | | - * IBM OpenAPI SDK Code Generator Version: 3.45.0-05af0f12-20220209-193923 |
| 15 | + * IBM OpenAPI SDK Code Generator Version: 3.46.0-a4e29da0-20220224-210428 |
16 | 16 | */ |
17 | 17 |
|
18 | 18 | package com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1; |
|
28 | 28 | import com.ibm.cloud.sdk.core.util.ResponseConverterUtils; |
29 | 29 | import com.ibm.cloud.secrets_manager_sdk.common.SdkCommon; |
30 | 30 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.CreateConfigElementOptions; |
| 31 | +import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.CreateNotificationsRegistrationOptions; |
31 | 32 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.CreateSecret; |
32 | 33 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.CreateSecretGroupOptions; |
33 | 34 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.CreateSecretOptions; |
34 | 35 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.DeleteConfigElementOptions; |
| 36 | +import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.DeleteNotificationsRegistrationOptions; |
35 | 37 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.DeleteSecretGroupOptions; |
36 | 38 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.DeleteSecretOptions; |
37 | 39 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetConfig; |
38 | 40 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetConfigElementOptions; |
39 | 41 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetConfigElements; |
40 | 42 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetConfigElementsOptions; |
41 | 43 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetConfigOptions; |
| 44 | +import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetNotificationsRegistrationOptions; |
| 45 | +import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetNotificationsSettings; |
42 | 46 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetPolicyOptions; |
43 | 47 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetSecret; |
44 | 48 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetSecretGroupOptions; |
|
60 | 64 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.PutPolicyOptions; |
61 | 65 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.SecretGroupDef; |
62 | 66 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.SecretMetadataRequest; |
| 67 | +import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.SendTestNotificationOptions; |
63 | 68 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.UpdateConfigElementOptions; |
64 | 69 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.UpdateSecretGroupMetadataOptions; |
65 | 70 | import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.UpdateSecretMetadataOptions; |
@@ -416,6 +421,7 @@ public ServiceCall<GetSecret> getSecret(GetSecretOptions getSecretOptions) { |
416 | 421 | * <p> |
417 | 422 | * - `rotate`: Replace the value of a secret. |
418 | 423 | * - `restore`: Restore a previous version of an `iam_credentials` secret. |
| 424 | + * - `revoke`: Revoke a private certificate. |
419 | 425 | * - `delete_credentials`: Delete the API key that is associated with an `iam_credentials` secret. |
420 | 426 | * |
421 | 427 | * @param updateSecretOptions the {@link UpdateSecretOptions} containing the options for the call |
@@ -737,7 +743,15 @@ public ServiceCall<GetConfig> getConfig(GetConfigOptions getConfigOptions) { |
737 | 743 | * Adds a configuration element to the specified secret type. |
738 | 744 | * <p> |
739 | 745 | * Use this method to define the configurations that are required to enable the public certificates (`public_cert`) |
740 | | - * engine. You can add up to 10 certificate authority and DNS provider configurations for your instance. |
| 746 | + * engine and the private certificates (`private_cert`) engine. |
| 747 | + * <p> |
| 748 | + * You can add multiple configurations for your instance as follows: |
| 749 | + * <p> |
| 750 | + * - Up to 10 public certificate authority configurations |
| 751 | + * - Up to 10 DNS provider configurations |
| 752 | + * - Up to 10 private root certifiate authority configurations |
| 753 | + * - Up to 10 private intermediate certifiate authority configurations |
| 754 | + * - Up to 10 certificate templates. |
741 | 755 | * |
742 | 756 | * @param createConfigElementOptions the {@link CreateConfigElementOptions} containing the options for the call |
743 | 757 | * @return a {@link ServiceCall} with a result of type {@link GetSingleConfigElement} |
@@ -873,4 +887,143 @@ public ServiceCall<Void> deleteConfigElement(DeleteConfigElementOptions deleteCo |
873 | 887 | return createServiceCall(builder.build(), responseConverter); |
874 | 888 | } |
875 | 889 |
|
| 890 | + /** |
| 891 | + * Register with Event Notifications. |
| 892 | + * <p> |
| 893 | + * Creates a registration between a Secrets Manager instance and [Event |
| 894 | + * Notifications](https://cloud.ibm.com/apidocs/event-notifications). |
| 895 | + * <p> |
| 896 | + * A successful request adds Secrets Manager as a source that you can reference from your Event Notifications |
| 897 | + * instance. For more information about enabling notifications for Secrets Manager, check out the |
| 898 | + * [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-event-notifications). |
| 899 | + * |
| 900 | + * @param createNotificationsRegistrationOptions the {@link CreateNotificationsRegistrationOptions} containing the options for the call |
| 901 | + * @return a {@link ServiceCall} with a result of type {@link GetNotificationsSettings} |
| 902 | + */ |
| 903 | + public ServiceCall<GetNotificationsSettings> createNotificationsRegistration(CreateNotificationsRegistrationOptions createNotificationsRegistrationOptions) { |
| 904 | + com.ibm.cloud.sdk.core.util.Validator.notNull(createNotificationsRegistrationOptions, |
| 905 | + "createNotificationsRegistrationOptions cannot be null"); |
| 906 | + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/api/v1/notifications/registration")); |
| 907 | + Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("secrets_manager", "v1", "createNotificationsRegistration"); |
| 908 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 909 | + builder.header(header.getKey(), header.getValue()); |
| 910 | + } |
| 911 | + builder.header("Accept", "application/json"); |
| 912 | + final JsonObject contentJson = new JsonObject(); |
| 913 | + contentJson.addProperty("event_notifications_instance_crn", createNotificationsRegistrationOptions.eventNotificationsInstanceCrn()); |
| 914 | + contentJson.addProperty("event_notifications_source_name", createNotificationsRegistrationOptions.eventNotificationsSourceName()); |
| 915 | + if (createNotificationsRegistrationOptions.eventNotificationsSourceDescription() != null) { |
| 916 | + contentJson.addProperty("event_notifications_source_description", createNotificationsRegistrationOptions.eventNotificationsSourceDescription()); |
| 917 | + } |
| 918 | + builder.bodyJson(contentJson); |
| 919 | + ResponseConverter<GetNotificationsSettings> responseConverter = |
| 920 | + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<GetNotificationsSettings>() { |
| 921 | + }.getType()); |
| 922 | + return createServiceCall(builder.build(), responseConverter); |
| 923 | + } |
| 924 | + |
| 925 | + /** |
| 926 | + * Get Event Notifications registration details. |
| 927 | + * <p> |
| 928 | + * Retrieves the details of an existing registration between a Secrets Manager instance and Event Notifications. |
| 929 | + * |
| 930 | + * @param getNotificationsRegistrationOptions the {@link GetNotificationsRegistrationOptions} containing the options for the call |
| 931 | + * @return a {@link ServiceCall} with a result of type {@link GetNotificationsSettings} |
| 932 | + */ |
| 933 | + public ServiceCall<GetNotificationsSettings> getNotificationsRegistration(GetNotificationsRegistrationOptions getNotificationsRegistrationOptions) { |
| 934 | + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/api/v1/notifications/registration")); |
| 935 | + Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("secrets_manager", "v1", "getNotificationsRegistration"); |
| 936 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 937 | + builder.header(header.getKey(), header.getValue()); |
| 938 | + } |
| 939 | + builder.header("Accept", "application/json"); |
| 940 | + ResponseConverter<GetNotificationsSettings> responseConverter = |
| 941 | + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<GetNotificationsSettings>() { |
| 942 | + }.getType()); |
| 943 | + return createServiceCall(builder.build(), responseConverter); |
| 944 | + } |
| 945 | + |
| 946 | + /** |
| 947 | + * Get Event Notifications registration details. |
| 948 | + * <p> |
| 949 | + * Retrieves the details of an existing registration between a Secrets Manager instance and Event Notifications. |
| 950 | + * |
| 951 | + * @return a {@link ServiceCall} with a result of type {@link GetNotificationsSettings} |
| 952 | + */ |
| 953 | + public ServiceCall<GetNotificationsSettings> getNotificationsRegistration() { |
| 954 | + return getNotificationsRegistration(null); |
| 955 | + } |
| 956 | + |
| 957 | + /** |
| 958 | + * Unregister from Event Notifications. |
| 959 | + * <p> |
| 960 | + * Deletes a registration between a Secrets Manager instance and Event Notifications. |
| 961 | + * <p> |
| 962 | + * A successful request removes your Secrets Manager instance as a source in Event Notifications. |
| 963 | + * |
| 964 | + * @param deleteNotificationsRegistrationOptions the {@link DeleteNotificationsRegistrationOptions} containing the options for the call |
| 965 | + * @return a {@link ServiceCall} with a void result |
| 966 | + */ |
| 967 | + public ServiceCall<Void> deleteNotificationsRegistration(DeleteNotificationsRegistrationOptions deleteNotificationsRegistrationOptions) { |
| 968 | + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/api/v1/notifications/registration")); |
| 969 | + Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("secrets_manager", "v1", "deleteNotificationsRegistration"); |
| 970 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 971 | + builder.header(header.getKey(), header.getValue()); |
| 972 | + } |
| 973 | + ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid(); |
| 974 | + return createServiceCall(builder.build(), responseConverter); |
| 975 | + } |
| 976 | + |
| 977 | + /** |
| 978 | + * Unregister from Event Notifications. |
| 979 | + * <p> |
| 980 | + * Deletes a registration between a Secrets Manager instance and Event Notifications. |
| 981 | + * <p> |
| 982 | + * A successful request removes your Secrets Manager instance as a source in Event Notifications. |
| 983 | + * |
| 984 | + * @return a {@link ServiceCall} with a void result |
| 985 | + */ |
| 986 | + public ServiceCall<Void> deleteNotificationsRegistration() { |
| 987 | + return deleteNotificationsRegistration(null); |
| 988 | + } |
| 989 | + |
| 990 | + /** |
| 991 | + * Send test event. |
| 992 | + * <p> |
| 993 | + * Send a test event from a Secrets Manager instance to a configured [Event |
| 994 | + * Notifications](https://cloud.ibm.com/apidocs/event-notifications) instance. |
| 995 | + * <p> |
| 996 | + * A successful request sends a test event to the Event Notifications instance. For more information about enabling |
| 997 | + * notifications for Secrets Manager, check out the |
| 998 | + * [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-event-notifications). |
| 999 | + * |
| 1000 | + * @param sendTestNotificationOptions the {@link SendTestNotificationOptions} containing the options for the call |
| 1001 | + * @return a {@link ServiceCall} with a void result |
| 1002 | + */ |
| 1003 | + public ServiceCall<Void> sendTestNotification(SendTestNotificationOptions sendTestNotificationOptions) { |
| 1004 | + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/api/v1/notifications/test")); |
| 1005 | + Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("secrets_manager", "v1", "sendTestNotification"); |
| 1006 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 1007 | + builder.header(header.getKey(), header.getValue()); |
| 1008 | + } |
| 1009 | + ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid(); |
| 1010 | + return createServiceCall(builder.build(), responseConverter); |
| 1011 | + } |
| 1012 | + |
| 1013 | + /** |
| 1014 | + * Send test event. |
| 1015 | + * <p> |
| 1016 | + * Send a test event from a Secrets Manager instance to a configured [Event |
| 1017 | + * Notifications](https://cloud.ibm.com/apidocs/event-notifications) instance. |
| 1018 | + * <p> |
| 1019 | + * A successful request sends a test event to the Event Notifications instance. For more information about enabling |
| 1020 | + * notifications for Secrets Manager, check out the |
| 1021 | + * [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-event-notifications). |
| 1022 | + * |
| 1023 | + * @return a {@link ServiceCall} with a void result |
| 1024 | + */ |
| 1025 | + public ServiceCall<Void> sendTestNotification() { |
| 1026 | + return sendTestNotification(null); |
| 1027 | + } |
| 1028 | + |
876 | 1029 | } |
0 commit comments