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
64 changes: 55 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ For custom email supported template type values: smtp_custom.invitation, smtp_cu

```java
TemplateConfigOneOfSlackTemplateConfig slackTemplateConfig = new TemplateConfigOneOfSlackTemplateConfig.Builder()
.body("base 64 encoded html content")
.body("base 64 encoded json content")
.build();

CreateTemplateOptions createTemplateInvitationOptions = new CreateTemplateOptions.Builder()
Expand All @@ -553,7 +553,7 @@ For slack supported template type values: slack.notification

```java
TemplateConfigOneOfWebhookTemplateConfig webhookTemplateConfig = new TemplateConfigOneOfWebhookTemplateConfig.Builder()
.body("base 64 encoded html content")
.body("base 64 encoded json content")
.build();

CreateTemplateOptions createWebhookTemplateNotificationOptions = new CreateTemplateOptions.Builder()
Expand All @@ -573,7 +573,7 @@ For Webhook template supported template type value: webhook.notification

```java
TemplateConfigOneOfPagerdutyTemplateConfig pagerdutyTemplateConfig = new TemplateConfigOneOfPagerdutyTemplateConfig.Builder()
.body("base 64 encoded html content")
.body("base 64 encoded json content")
.build();

CreateTemplateOptions createPagerDutyTemplateNotificationOptions = new CreateTemplateOptions.Builder()
Expand All @@ -589,6 +589,26 @@ Response<TemplateResponse> pagerdutyTemplateResponse = eventNotificationsService

For PagerDuty template supported template type value: pagerduty.notification

#### EventStreams Template

```java
TemplateConfigOneOfEventStreamsTemplateConfig eventStreamsTemplateConfig = new TemplateConfigOneOfEventStreamsTemplateConfig.Builder()
.body("base 64 encoded html content")
.build();

CreateTemplateOptions createEventStreamsTemplateNotificationOptions = new CreateTemplateOptions.Builder()
.instanceId(<instanceId>)
.name(<name>)
.description(<description>)
.type(<template-type>)
.params(eventStreamsTemplateConfig)
.build();

Response<TemplateResponse> eventStreamsTemplateResponse = eventNotificationsService.createTemplate(createEventStreamsTemplateNotificationOptions).execute();
```

For EventStreams template supported template type value: event_streams.notification

### List Templates

```java
Expand Down Expand Up @@ -641,7 +661,7 @@ For custom email supported template type values: smtp_custom.invitation, smtp_cu

```java
TemplateConfigOneOfSlackTemplateConfig slackTemplateConfig = new TemplateConfigOneOfSlackTemplateConfig.Builder()
.body("base 64 encoded html content")
.body("base 64 encoded json content")
.build();

ReplaceTemplateOptions updateSlackTemplateOptions = new ReplaceTemplateOptions.Builder()
Expand All @@ -662,7 +682,7 @@ For slack supported template type values: slack.notification

```java
TemplateConfigOneOfWebhookTemplateConfig webhookTemplateConfig = new TemplateConfigOneOfWebhookTemplateConfig.Builder()
.body("base 64 encoded html content")
.body("base 64 encoded json content")
.build();

ReplaceTemplateOptions updateWebhookTemplateOptions = new ReplaceTemplateOptions.Builder()
Expand All @@ -683,7 +703,7 @@ For webhook supported template type values: webhook.notification

```java
TemplateConfigOneOfPagerdutyTemplateConfig pagerdutyTemplateConfig = new TemplateConfigOneOfPagerdutyTemplateConfig.Builder()
.body("base 64 encoded html content")
.body("base 64 encoded json content")
.build();

ReplaceTemplateOptions updatePagerDutyTemplateOptions = new ReplaceTemplateOptions.Builder()
Expand All @@ -700,6 +720,27 @@ Response<Template> pagerdutyTemplateResponse = service.replaceTemplate(updatePag

For pagerduty supported template type values: pagerduty.notification

#### EventStreams Template

```java
TemplateConfigOneOfEventStreamsTemplateConfig eventStreamsTemplateConfig = new TemplateConfigOneOfEventStreamsTemplateConfig.Builder()
.body("base 64 encoded json content")
.build();

ReplaceTemplateOptions updateEventStreamsTemplateOptions = new ReplaceTemplateOptions.Builder()
.instanceId(<instanceId>)
.id(<pagerdutyTemplateID>)
.name(<name>)
.description(<description>)
.type(<template-type>)
.params(eventStreamsTemplateConfig)
.build();

Response<Template> eventStreamsTemplateResponse = service.replaceTemplate(updateEventStreamsTemplateOptions).execute();
```

For EventStreams supported template type values: event_streams.notification

### Delete Template

```java
Expand Down Expand Up @@ -1261,10 +1302,15 @@ Find `event_notifications.env.hide` in the repo and rename it to `event_notifica
- `EVENT_NOTIFICATIONS_MS_TEAMS_URL` - msteams webhook url
- `EVENT_NOTIFICATIONS_PD_ROUTING_KEY` - pagerduty routing key
- `EVENT_NOTIFICATIONS_PD_API_KEY` - pagerduty api key
- `EVENT_NOTIFICATIONS_TEMPLATE_BODY` - base 64 encoded html content
- `EVENT_NOTIFICATIONS_SLACK_TEMPLATE_BODY` - base 64 encoded json body
- `EVENT_NOTIFICATIONS_WEBHOOK_TEMPLATE_BODY` - base 64 encoded json body
- `EVENT_NOTIFICATIONS_TEMPLATE_BODY` - base 64 encoded html content for Email
- `EVENT_NOTIFICATIONS_SLACK_TEMPLATE_BODY` - base 64 encoded json body for slack destination
- `EVENT_NOTIFICATIONS_WEBHOOK_TEMPLATE_BODY` - base 64 encoded json body for webhook destination
- `EVENT_NOTIFICATIONS_SCHEDULER_SOURCE_ID` - periodic timer source id
- `EVENT_NOTIFICATIONS_PAGERDUTY_TEMPLATE_BODY` - base 64 encoded json body for pagerduty destination
- `EVENT_NOTIFICATIONS_EVENT_STREAMS_TEMPLATE_BODY` - base 64 encoded json body for event streams destination
- `EVENT_NOTIFICATIONS_EVENT_STREAMS_CRN` - Event Streams instance CRN
- `EVENT_NOTIFICATIONS_EVENT_STREAMS_TOPIC` - Event Streams instance Topic name
- `EVENT_NOTIFICATIONS_EVENT_STREAMS_ENDPOINT` - Event streams end point

## Questions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public interface Type {
String SMTP_CUSTOM = "smtp_custom";
/** sms_custom. */
String SMS_CUSTOM = "sms_custom";
/** event_streams. */
String EVENT_STREAMS = "event_streams";
}

protected String instanceId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Destination extends GenericModel {

/**
* Destination type
* Email/SMS/Webhook/FCM/Slack/MSTeams/PagerDuty/IBMCodeEngine/ServiceNow/IBMCloudObjectStorage/Huawei.
* Email/SMS/Webhook/FCM/Slack/MSTeams/PagerDuty/IBMCodeEngine/ServiceNow/IBMCloudObjectStorage/Huawei/CustomEmail/CustomSMS/EventStreams.
*/
public interface Type {
/** webhook. */
Expand Down Expand Up @@ -58,6 +58,8 @@ public interface Type {
String SMTP_CUSTOM = "smtp_custom";
/** sms_custom. */
String SMS_CUSTOM = "sms_custom";
/** event_streams. */
String EVENT_STREAMS = "event_streams";
}

protected String id;
Expand Down Expand Up @@ -113,7 +115,7 @@ public String getDescription() {
* Gets the type.
*
* Destination type
* Email/SMS/Webhook/FCM/Slack/MSTeams/PagerDuty/IBMCodeEngine/ServiceNow/IBMCloudObjectStorage/Huawei.
* Email/SMS/Webhook/FCM/Slack/MSTeams/PagerDuty/IBMCodeEngine/ServiceNow/IBMCloudObjectStorage/Huawei/CustomEmail/CustomSMS/EventStreams.
*
* @return the type
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* - DestinationConfigOneOfServiceNowDestinationConfig
* - DestinationConfigOneOfIBMCloudObjectStorageDestinationConfig
* - DestinationConfigOneOfHuaweiDestinationConfig
* - DestinationConfigOneOfEventStreamsDestinationConfig
*/
public class DestinationConfigOneOf extends GenericModel {

Expand Down Expand Up @@ -124,6 +125,8 @@ public interface Type {
@SerializedName("instance_id")
protected String instanceId;
protected String endpoint;
protected String crn;
protected String topic;

protected DestinationConfigOneOf() { }

Expand Down Expand Up @@ -537,5 +540,27 @@ public String instanceId() {
public String endpoint() {
return endpoint;
}

/**
* Gets the crn.
*
* CRN of the Event Streans instance.
*
* @return the crn
*/
public String crn() {
return crn;
}

/**
* Gets the topic.
*
* Topic of Event Streams.
*
* @return the topic
*/
public String topic() {
return topic;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
* (C) Copyright IBM Corp. 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.cloud.eventnotifications.event_notifications.v1.model;

/**
* Payload describing a Event Streams destination configuration.
*/
public class DestinationConfigOneOfEventStreamsDestinationConfig extends DestinationConfigOneOf {


/**
* Builder.
*/
public static class Builder {
private String crn;
private String endpoint;
private String topic;

/**
* Instantiates a new Builder from an existing DestinationConfigOneOfEventStreamsDestinationConfig instance.
*
* @param destinationConfigOneOfEventStreamsDestinationConfig the instance to initialize the Builder with
*/
public Builder(DestinationConfigOneOf destinationConfigOneOfEventStreamsDestinationConfig) {
this.crn = destinationConfigOneOfEventStreamsDestinationConfig.crn;
this.endpoint = destinationConfigOneOfEventStreamsDestinationConfig.endpoint;
this.topic = destinationConfigOneOfEventStreamsDestinationConfig.topic;
}

/**
* Instantiates a new builder.
*/
public Builder() {
}

/**
* Instantiates a new builder with required properties.
*
* @param crn the crn
* @param endpoint the endpoint
* @param topic the topic
*/
public Builder(String crn, String endpoint, String topic) {
this.crn = crn;
this.endpoint = endpoint;
this.topic = topic;
}

/**
* Builds a DestinationConfigOneOfEventStreamsDestinationConfig.
*
* @return the new DestinationConfigOneOfEventStreamsDestinationConfig instance
*/
public DestinationConfigOneOfEventStreamsDestinationConfig build() {
return new DestinationConfigOneOfEventStreamsDestinationConfig(this);
}

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

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

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

protected DestinationConfigOneOfEventStreamsDestinationConfig() { }

protected DestinationConfigOneOfEventStreamsDestinationConfig(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn,
"crn cannot be null");
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.endpoint,
"endpoint cannot be null");
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.topic,
"topic cannot be null");
crn = builder.crn;
endpoint = builder.endpoint;
topic = builder.topic;
}

/**
* New builder.
*
* @return a DestinationConfigOneOfEventStreamsDestinationConfig builder
*/
public Builder newBuilder() {
return new Builder(this);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public interface Type {
String SMTP_CUSTOM = "smtp_custom";
/** sms_custom. */
String SMS_CUSTOM = "sms_custom";
/** event_streams. */
String EVENT_STREAMS = "event_streams";
}

protected String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public interface Type {
String SMTP_CUSTOM = "smtp_custom";
/** sms_custom. */
String SMS_CUSTOM = "sms_custom";
/** event_streams. */
String EVENT_STREAMS = "event_streams";
}

protected String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public interface DestinationType {
String SMTP_CUSTOM = "smtp_custom";
/** sms_custom. */
String SMS_CUSTOM = "sms_custom";
/** event_streams. */
String EVENT_STREAMS = "event_streams";
}

@SerializedName("id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* - SubscriptionAttributesPagerDutyAttributesResponse
* - SubscriptionAttributesSlackDirectMessageAttributesResponse
* - SubscriptionAttributesServiceNowAttributesResponse
* - SubscriptionAttributesEventStreamsAttributesResponse
*/
public class SubscriptionAttributes extends DynamicModel<Object> {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* (C) Copyright IBM Corp. 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.cloud.eventnotifications.event_notifications.v1.model;

/**
* The attributes for a Event Streams response.
*/
public class SubscriptionAttributesEventStreamsAttributesResponse extends SubscriptionAttributes {


public SubscriptionAttributesEventStreamsAttributesResponse() {
super();
}
}
Loading
Loading