Skip to content

Commit 112dcb9

Browse files
authored
Merge pull request #33 from IBM/shacharn-3495-include-noti
Release 1.0.37
2 parents 0a83152 + d4bc2bf commit 112dcb9

File tree

275 files changed

+23866
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+23866
-33
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ Service name | Imported class name
4444
<dependency>
4545
<groupId>com.ibm.cloud</groupId>
4646
<artifactId>secrets-manager</artifactId>
47-
<version>1.0.3</version>
47+
<version>1.0.37</version>
4848
</dependency>
4949
```
5050

5151
##### Gradle
5252

5353
```gradle
54-
'com.ibm.cloud:secrets-manager:1.0.3'
54+
'com.ibm.cloud:secrets-manager:1.0.37'
5555
```
5656

5757
## Authentication

modules/common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>secrets-manager-sdk</artifactId>
88
<groupId>com.ibm.cloud</groupId>
9-
<version>1.0.3</version>
9+
<version>1.0.37</version>
1010
<relativePath>../..</relativePath>
1111
</parent>
1212

modules/coverage-reports/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>secrets-manager-sdk</artifactId>
55
<groupId>com.ibm.cloud</groupId>
6-
<version>1.0.3</version>
6+
<version>1.0.37</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

modules/secrets-manager/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>secrets-manager-sdk</artifactId>
77
<groupId>com.ibm.cloud</groupId>
8-
<version>1.0.3</version>
8+
<version>1.0.37</version>
99
<relativePath>../..</relativePath>
1010
</parent>
1111

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v1/SecretsManager.java

Lines changed: 155 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
/*
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
1616
*/
1717

1818
package com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1;
@@ -28,17 +28,21 @@
2828
import com.ibm.cloud.sdk.core.util.ResponseConverterUtils;
2929
import com.ibm.cloud.secrets_manager_sdk.common.SdkCommon;
3030
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;
3132
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.CreateSecret;
3233
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.CreateSecretGroupOptions;
3334
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.CreateSecretOptions;
3435
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;
3537
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.DeleteSecretGroupOptions;
3638
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.DeleteSecretOptions;
3739
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetConfig;
3840
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetConfigElementOptions;
3941
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetConfigElements;
4042
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetConfigElementsOptions;
4143
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;
4246
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetPolicyOptions;
4347
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetSecret;
4448
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.GetSecretGroupOptions;
@@ -60,6 +64,7 @@
6064
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.PutPolicyOptions;
6165
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.SecretGroupDef;
6266
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;
6368
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.UpdateConfigElementOptions;
6469
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.UpdateSecretGroupMetadataOptions;
6570
import com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model.UpdateSecretMetadataOptions;
@@ -416,6 +421,7 @@ public ServiceCall<GetSecret> getSecret(GetSecretOptions getSecretOptions) {
416421
* <p>
417422
* - `rotate`: Replace the value of a secret.
418423
* - `restore`: Restore a previous version of an `iam_credentials` secret.
424+
* - `revoke`: Revoke a private certificate.
419425
* - `delete_credentials`: Delete the API key that is associated with an `iam_credentials` secret.
420426
*
421427
* @param updateSecretOptions the {@link UpdateSecretOptions} containing the options for the call
@@ -737,7 +743,15 @@ public ServiceCall<GetConfig> getConfig(GetConfigOptions getConfigOptions) {
737743
* Adds a configuration element to the specified secret type.
738744
* <p>
739745
* 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.
741755
*
742756
* @param createConfigElementOptions the {@link CreateConfigElementOptions} containing the options for the call
743757
* @return a {@link ServiceCall} with a result of type {@link GetSingleConfigElement}
@@ -873,4 +887,143 @@ public ServiceCall<Void> deleteConfigElement(DeleteConfigElementOptions deleteCo
873887
return createServiceCall(builder.build(), responseConverter);
874888
}
875889

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+
8761029
}

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v1/model/ArbitrarySecretResource.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public interface SecretType {
4545
* public_cert.
4646
*/
4747
String PUBLIC_CERT = "public_cert";
48+
/**
49+
* private_cert.
50+
*/
51+
String PRIVATE_CERT = "private_cert";
4852
/**
4953
* kv.
5054
*/

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v1/model/CertificateSecretResource.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public interface SecretType {
4444
* public_cert.
4545
*/
4646
String PUBLIC_CERT = "public_cert";
47+
/**
48+
* private_cert.
49+
*/
50+
String PRIVATE_CERT = "private_cert";
4751
/**
4852
* kv.
4953
*/

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v1/model/ConfigElementDef.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ public interface Type {
3939
* classic_infrastructure.
4040
*/
4141
String CLASSIC_INFRASTRUCTURE = "classic_infrastructure";
42+
/**
43+
* root_certificate_authority.
44+
*/
45+
String ROOT_CERTIFICATE_AUTHORITY = "root_certificate_authority";
46+
/**
47+
* intermediate_certificate_authority.
48+
*/
49+
String INTERMEDIATE_CERTIFICATE_AUTHORITY = "intermediate_certificate_authority";
50+
/**
51+
* certificate_template.
52+
*/
53+
String CERTIFICATE_TEMPLATE = "certificate_template";
4254
}
4355

4456
protected String name;

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v1/model/ConfigElementDefConfig.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ public String cisApikey() {
9191
* <p>
9292
* The username that is associated with your classic infrastructure account.
9393
* <p>
94-
* In most cases, your classic infrastructure username is your `&lt;account_id&gt;_&lt;email_address&gt;`. In the
95-
* console, you can find your username by going to **Manage &gt; Access (IAM) &gt; Users &gt; name &gt; VPN
96-
* password.** For more information, see the
97-
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-prepare-order-certificates#authorize-classic-infrastructure).
94+
* In most cases, your classic infrastructure username is your `&lt;account_id&gt;_&lt;email_address&gt;`. For more
95+
* information, see the [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).
9896
*
9997
* @return the classicInfrastructureUsername
10098
*/
@@ -107,9 +105,8 @@ public String classicInfrastructureUsername() {
107105
* <p>
108106
* Your classic infrastructure API key.
109107
* <p>
110-
* In the console, you can view or create a classic infrastructure API key by going to **Manage &gt; Access (IAM)
111-
* &gt; Users &gt; name &gt; API keys.** For more information, see the
112-
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-prepare-order-certificates#authorize-classic-infrastructure).
108+
* For information about viewing and accessing your classic infrastructure API key, see the
109+
* [docs](https://cloud.ibm.com/docs/account?topic=account-classic_keys).
113110
*
114111
* @return the classicInfrastructurePassword
115112
*/

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v1/model/ConfigElementMetadata.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ public interface Type {
3939
* classic_infrastructure.
4040
*/
4141
String CLASSIC_INFRASTRUCTURE = "classic_infrastructure";
42+
/**
43+
* root_certificate_authority.
44+
*/
45+
String ROOT_CERTIFICATE_AUTHORITY = "root_certificate_authority";
46+
/**
47+
* intermediate_certificate_authority.
48+
*/
49+
String INTERMEDIATE_CERTIFICATE_AUTHORITY = "intermediate_certificate_authority";
50+
/**
51+
* certificate_template.
52+
*/
53+
String CERTIFICATE_TEMPLATE = "certificate_template";
4254
}
4355

4456
protected String name;

0 commit comments

Comments
 (0)