Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2025-09-25T01:16:58Z",
"generated_at": "2025-10-28T04:20:32Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -142,7 +142,7 @@
}
]
},
"version": "0.13.1+ibm.62.dss",
"version": "0.13.1+ibm.64.dss",
"word_list": {
"file": null,
"hash": null
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ SDK Methods to consume
- [SMTP Configurations](#SMTPConfigurations)
- [Create SMTP Configuration](#create-smtp-configuration)
- [Create SMTP User](#create-smtp-user)
- [Clone SMTP User](#clone-smtp-user)
- [Get SMTP Configuration](#get-smtp-configuration)
- [Get SMTP User](#get-smtp-user)
- [Get SMTP Allowed Ips](#get-smtp-allowed-ips)
Expand Down Expand Up @@ -1193,6 +1194,21 @@ SMTPUserResponse responseObj = response.getResult();

```

### Clone SMTP User

```java

CreateSmtpUserOptions createSmtpUserOptionsModel = new CreateSmtpUserOptions.Builder()
.instanceId(<instanceId>)
.id(<smtpConfigID>)
.usernameToClone(<smtpUserToClone>)
.build();

Response<SMTPUserResponse> response = eventNotificationsService.createSmtpUser(createSmtpUserOptionsModel).execute();
SMTPUserResponse responseObj = response.getResult();

```

### Get SMTP Configuration

```java
Expand Down Expand Up @@ -1513,6 +1529,7 @@ Find `event_notifications.env.hide` in the repo and rename it to `event_notifica
- `EVENT_NOTIFICATIONS_CODE_ENGINE_JOB_TEMPLATE_BODY` - base 64 encoded json body for Code Engine Job
- `EVENT_NOTIFICATIONS_APP_CONFIG_CRN` - CRN of App Configuration instance
- `EVENT_NOTIFICATIONS_APP_CONFIG_TEMPLATE_BODY` - base 64 encoded json body for App Configuration
- `EVENT_NOTIFICATIONS_SMTP_USER_TO_CLONE` - SMTP username to be cloned

## Questions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,9 @@ public ServiceCall<SMTPUserResponse> createSmtpUser(CreateSmtpUserOptions create
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
if (createSmtpUserOptions.usernameToClone() != null) {
builder.query("username_to_clone", String.valueOf(createSmtpUserOptions.usernameToClone()));
}
final JsonObject contentJson = new JsonObject();
if (createSmtpUserOptions.description() != null) {
contentJson.addProperty("description", createSmtpUserOptions.description());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class CreateSmtpUserOptions extends GenericModel {
protected String instanceId;
protected String id;
protected String description;
protected String usernameToClone;

/**
* Builder.
Expand All @@ -30,6 +31,7 @@ public static class Builder {
private String instanceId;
private String id;
private String description;
private String usernameToClone;

/**
* Instantiates a new Builder from an existing CreateSmtpUserOptions instance.
Expand All @@ -40,6 +42,7 @@ private Builder(CreateSmtpUserOptions createSmtpUserOptions) {
this.instanceId = createSmtpUserOptions.instanceId;
this.id = createSmtpUserOptions.id;
this.description = createSmtpUserOptions.description;
this.usernameToClone = createSmtpUserOptions.usernameToClone;
}

/**
Expand Down Expand Up @@ -100,6 +103,17 @@ public Builder description(String description) {
this.description = description;
return this;
}

/**
* Set the usernameToClone.
*
* @param usernameToClone the usernameToClone
* @return the CreateSmtpUserOptions builder
*/
public Builder usernameToClone(String usernameToClone) {
this.usernameToClone = usernameToClone;
return this;
}
}

protected CreateSmtpUserOptions() { }
Expand All @@ -112,6 +126,7 @@ protected CreateSmtpUserOptions(Builder builder) {
instanceId = builder.instanceId;
id = builder.id;
description = builder.description;
usernameToClone = builder.usernameToClone;
}

/**
Expand Down Expand Up @@ -155,5 +170,16 @@ public String id() {
public String description() {
return description;
}

/**
* Gets the usernameToClone.
*
* provide name of the user to clone.
*
* @return the usernameToClone
*/
public String usernameToClone() {
return usernameToClone;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public String getUsername() {
/**
* Gets the password.
*
* password.
* Password for SMTP user; Cloned SMTP user response do not include a password.
*
* @return the password
*/
Expand Down
Loading
Loading