@@ -112,6 +112,7 @@ class EventNotificationsV1 extends BaseService {
112112 * @param {string } params.gte - GTE (greater than equal), start timestamp in UTC.
113113 * @param {string } params.lte - LTE (less than equal), end timestamp in UTC.
114114 * @param {string } [params.destinationId] - Unique identifier for Destination.
115+ * @param {string } [params.subscriptionId] - Unique identifier for Subscription.
115116 * @param {string } [params.sourceId] - Unique identifier for Source.
116117 * @param {string } [params.emailTo] - Receiver email id.
117118 * @param {string } [params.notificationId] - Notification Id.
@@ -130,6 +131,7 @@ class EventNotificationsV1 extends BaseService {
130131 'gte' ,
131132 'lte' ,
132133 'destinationId' ,
134+ 'subscriptionId' ,
133135 'sourceId' ,
134136 'emailTo' ,
135137 'notificationId' ,
@@ -146,6 +148,7 @@ class EventNotificationsV1 extends BaseService {
146148 'gte' : _params . gte ,
147149 'lte' : _params . lte ,
148150 'destination_id' : _params . destinationId ,
151+ 'subscription_id' : _params . subscriptionId ,
149152 'source_id' : _params . sourceId ,
150153 'email_to' : _params . emailTo ,
151154 'notification_id' : _params . notificationId ,
@@ -179,6 +182,98 @@ class EventNotificationsV1 extends BaseService {
179182
180183 return this . createRequest ( parameters ) ;
181184 }
185+
186+ /**
187+ * Get bounce metrics.
188+ *
189+ * Get bounce metrics.
190+ *
191+ * @param {Object } params - The parameters to send to the service.
192+ * @param {string } params.instanceId - Unique identifier for IBM Cloud Event Notifications instance.
193+ * @param {string } params.destinationType - Destination type. Allowed values are [smtp_custom].
194+ * @param {string } params.gte - GTE (greater than equal), start timestamp in UTC.
195+ * @param {string } params.lte - LTE (less than equal), end timestamp in UTC.
196+ * @param {string } [params.destinationId] - Unique identifier for Destination.
197+ * @param {string } [params.subscriptionId] - Unique identifier for Subscription.
198+ * @param {string } [params.sourceId] - Unique identifier for Source.
199+ * @param {string } [params.emailTo] - Receiver email id.
200+ * @param {string } [params.notificationId] - Notification Id.
201+ * @param {string } [params.subject] - Email subject.
202+ * @param {number } [params.limit] - Page limit for paginated results.
203+ * @param {number } [params.offset] - offset for paginated results.
204+ * @param {OutgoingHttpHeaders } [params.headers] - Custom request headers
205+ * @returns {Promise<EventNotificationsV1.Response<EventNotificationsV1.BounceMetrics>> }
206+ */
207+ public getBounceMetrics (
208+ params : EventNotificationsV1 . GetBounceMetricsParams
209+ ) : Promise < EventNotificationsV1 . Response < EventNotificationsV1 . BounceMetrics > > {
210+ const _params = { ...params } ;
211+ const _requiredParams = [ 'instanceId' , 'destinationType' , 'gte' , 'lte' ] ;
212+ const _validParams = [
213+ 'instanceId' ,
214+ 'destinationType' ,
215+ 'gte' ,
216+ 'lte' ,
217+ 'destinationId' ,
218+ 'subscriptionId' ,
219+ 'sourceId' ,
220+ 'emailTo' ,
221+ 'notificationId' ,
222+ 'subject' ,
223+ 'limit' ,
224+ 'offset' ,
225+ 'headers' ,
226+ ] ;
227+ const _validationErrors = validateParams ( _params , _requiredParams , _validParams ) ;
228+ if ( _validationErrors ) {
229+ return Promise . reject ( _validationErrors ) ;
230+ }
231+
232+ const query = {
233+ 'destination_type' : _params . destinationType ,
234+ 'gte' : _params . gte ,
235+ 'lte' : _params . lte ,
236+ 'destination_id' : _params . destinationId ,
237+ 'subscription_id' : _params . subscriptionId ,
238+ 'source_id' : _params . sourceId ,
239+ 'email_to' : _params . emailTo ,
240+ 'notification_id' : _params . notificationId ,
241+ 'subject' : _params . subject ,
242+ 'limit' : _params . limit ,
243+ 'offset' : _params . offset ,
244+ } ;
245+
246+ const path = {
247+ 'instance_id' : _params . instanceId ,
248+ } ;
249+
250+ const sdkHeaders = getSdkHeaders (
251+ EventNotificationsV1 . DEFAULT_SERVICE_NAME ,
252+ 'v1' ,
253+ 'getBounceMetrics'
254+ ) ;
255+
256+ const parameters = {
257+ options : {
258+ url : '/v1/instances/{instance_id}/metrics/bounce' ,
259+ method : 'GET' ,
260+ qs : query ,
261+ path,
262+ } ,
263+ defaultOptions : extend ( true , { } , this . baseOptions , {
264+ headers : extend (
265+ true ,
266+ sdkHeaders ,
267+ {
268+ 'Accept' : 'application/json' ,
269+ } ,
270+ _params . headers
271+ ) ,
272+ } ) ,
273+ } ;
274+
275+ return this . createRequest ( parameters ) ;
276+ }
182277 /*************************
183278 * sendNotifications
184279 ************************/
@@ -3391,6 +3486,8 @@ namespace EventNotificationsV1 {
33913486 lte : string ;
33923487 /** Unique identifier for Destination. */
33933488 destinationId ?: string ;
3489+ /** Unique identifier for Subscription. */
3490+ subscriptionId ?: string ;
33943491 /** Unique identifier for Source. */
33953492 sourceId ?: string ;
33963493 /** Receiver email id. */
@@ -3410,6 +3507,43 @@ namespace EventNotificationsV1 {
34103507 }
34113508 }
34123509
3510+ /** Parameters for the `getBounceMetrics` operation. */
3511+ export interface GetBounceMetricsParams {
3512+ /** Unique identifier for IBM Cloud Event Notifications instance. */
3513+ instanceId : string ;
3514+ /** Destination type. Allowed values are [smtp_custom]. */
3515+ destinationType : GetBounceMetricsConstants . DestinationType | string ;
3516+ /** GTE (greater than equal), start timestamp in UTC. */
3517+ gte : string ;
3518+ /** LTE (less than equal), end timestamp in UTC. */
3519+ lte : string ;
3520+ /** Unique identifier for Destination. */
3521+ destinationId ?: string ;
3522+ /** Unique identifier for Subscription. */
3523+ subscriptionId ?: string ;
3524+ /** Unique identifier for Source. */
3525+ sourceId ?: string ;
3526+ /** Receiver email id. */
3527+ emailTo ?: string ;
3528+ /** Notification Id. */
3529+ notificationId ?: string ;
3530+ /** Email subject. */
3531+ subject ?: string ;
3532+ /** Page limit for paginated results. */
3533+ limit ?: number ;
3534+ /** offset for paginated results. */
3535+ offset ?: number ;
3536+ headers ?: OutgoingHttpHeaders ;
3537+ }
3538+
3539+ /** Constants for the `getBounceMetrics` operation. */
3540+ export namespace GetBounceMetricsConstants {
3541+ /** Destination type. Allowed values are [smtp_custom]. */
3542+ export enum DestinationType {
3543+ SMTP_CUSTOM = 'smtp_custom' ,
3544+ }
3545+ }
3546+
34133547 /** Parameters for the `sendNotifications` operation. */
34143548 export interface SendNotificationsParams {
34153549 /** Unique identifier for IBM Cloud Event Notifications instance. */
@@ -4114,6 +4248,30 @@ namespace EventNotificationsV1 {
41144248 * model interfaces
41154249 ************************/
41164250
4251+ /** Bounce metric object. */
4252+ export interface BounceMetricItem {
4253+ /** Email address. */
4254+ email_address : string ;
4255+ /** Subject. */
4256+ subject : string ;
4257+ /** Error message. */
4258+ error_message : string ;
4259+ /** IP address. */
4260+ ip_address ?: string ;
4261+ /** Subscription ID. */
4262+ subscription_id ?: string ;
4263+ /** Bounced at. */
4264+ timestamp : string ;
4265+ }
4266+
4267+ /** Payload describing bounce metrics. */
4268+ export interface BounceMetrics {
4269+ /** array of bounce metrics. */
4270+ metrics : BounceMetricItem [ ] ;
4271+ /** total number of bounce metrics. */
4272+ total_count : number ;
4273+ }
4274+
41174275 /** Bucket object. */
41184276 export interface Buckets {
41194277 /** Total count. */
0 commit comments