@ibm-cloud/platform-services
Version:
Node.js client library for IBM Cloud Platform Services
879 lines (878 loc) • 48.2 kB
TypeScript
/**
* (C) Copyright IBM Corp. 2026.
*
* 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.
*/
/// <reference types="node" />
import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http';
import { AbortSignal, BaseService, UserOptions } from 'ibm-cloud-sdk-core';
/**
* API for IBM Cloud account notifications, providing capabilities to:
* - View notifications
* - Get and update acknowledgements
* - Manage user communication preferences
* - Manage notification distribution lists
*
* API Version: 1.0.0
*/
declare class PlatformNotificationsV1 extends BaseService {
static DEFAULT_SERVICE_URL: string;
static DEFAULT_SERVICE_NAME: string;
/*************************
* Factory method
************************/
/**
* Constructs an instance of PlatformNotificationsV1 with passed in options and external configuration.
*
* @param {UserOptions} [options] - The parameters to send to the service.
* @param {string} [options.serviceName] - The name of the service to configure
* @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service
* @param {string} [options.serviceUrl] - The base URL for the service
* @returns {PlatformNotificationsV1}
*/
static newInstance(options: UserOptions): PlatformNotificationsV1;
/**
* Construct a PlatformNotificationsV1 object.
*
* @param {Object} options - Options for the service.
* @param {string} [options.serviceUrl] - The base URL for the service
* @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service.
* @param {Authenticator} options.authenticator - The Authenticator object used to authenticate requests to the service
* @constructor
* @returns {PlatformNotificationsV1}
*/
constructor(options: UserOptions);
/*************************
* notifications
************************/
/**
* Get user notifications.
*
* Retrieve all notifications for the requested user.
*
* @param {Object} [params] - The parameters to send to the service.
* @param {string} [params.accountId] - The IBM Cloud account ID. If not provided, the account ID from the bearer
* token will be used.
* @param {string} [params.start] - An opaque page token that specifies the resource to start the page on or after. If
* unspecified, the first page of results is returned.
* @param {number} [params.limit] - The maximum number of items to return per page. If unspecified, a default limit of
* 50 is used.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.NotificationCollection>>}
*/
listNotifications(params?: PlatformNotificationsV1.ListNotificationsParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.NotificationCollection>>;
/**
* Get acknowledgement.
*
* Retrieve the ID of the last notification acknowledged by the user for a specific account.
*
* @param {Object} [params] - The parameters to send to the service.
* @param {string} [params.accountId] - The IBM Cloud account ID. If not provided, the account ID from the bearer
* token will be used.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgement>>}
*/
getAcknowledgement(params?: PlatformNotificationsV1.GetAcknowledgementParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgement>>;
/**
* Update acknowledgement.
*
* Update the ID of the last notification acknowledged by the user for a specific account.
*
* @param {Object} params - The parameters to send to the service.
* @param {number} params.lastAcknowledged - The timestamp of the last acknowledgement.
* @param {string} [params.accountId] - The IBM Cloud account ID. If not provided, the account ID from the bearer
* token will be used.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgement>>}
*/
replaceNotificationAcknowledgement(params: PlatformNotificationsV1.ReplaceNotificationAcknowledgementParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgement>>;
/*************************
* distributionLists
************************/
/**
* Get all destination entries.
*
* Retrieve all destinations in the distribution list for the specified account.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.accountId - The IBM Cloud account ID.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.AddDestinationCollection>>}
*/
listDistributionListDestinations(params: PlatformNotificationsV1.ListDistributionListDestinationsParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.AddDestinationCollection>>;
/**
* Add a destination entry.
*
* Add a destination entry to the distribution list. A maximum of 10 destination entries per destination type. In
* terms of enterprise accounts, you can provide an Event Notifications destination that is from a different account
* than the distribution list account, provided these two accounts are from the same enterprise and the user has
* permission to manage the Event Notifications destinations on both accounts.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.accountId - The IBM Cloud account ID.
* @param {AddDestinationPrototype} params.addDestinationPrototype -
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.AddDestination>>}
*/
createDistributionListDestination(params: PlatformNotificationsV1.CreateDistributionListDestinationParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.AddDestination>>;
/**
* Get a destination entry.
*
* Retrieve a specific destination from the distribution list of the account.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.accountId - The IBM Cloud account ID.
* @param {string} params.destinationId - The ID of the destination.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.AddDestination>>}
*/
getDistributionListDestination(params: PlatformNotificationsV1.GetDistributionListDestinationParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.AddDestination>>;
/**
* Delete a destination entry.
*
* Remove a destination entry.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.accountId - The IBM Cloud account ID.
* @param {string} params.destinationId - The ID of the destination.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.EmptyObject>>}
*/
deleteDistributionListDestination(params: PlatformNotificationsV1.DeleteDistributionListDestinationParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.EmptyObject>>;
/**
* Test a destination entry.
*
* Send a test notification to a destination in the distribution list. This allows you to verify that the destination
* is properly configured and can receive notifications.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.accountId - The IBM Cloud account ID.
* @param {string} params.destinationId - The ID of the destination.
* @param {TestDestinationRequestBodyPrototype} params.testDestinationRequestBodyPrototype -
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.TestDestinationResponseBody>>}
*/
testDistributionListDestination(params: PlatformNotificationsV1.TestDistributionListDestinationParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.TestDestinationResponseBody>>;
/*************************
* userPreferences
************************/
/**
* Get all communication preferences.
*
* Retrieve all communication preferences of a user in an account.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.iamId - The IAM ID of the user. Must match the IAM ID in the bearer token.
* @param {string} [params.accountId] - The IBM Cloud account ID. If not provided, the account ID from the bearer
* token will be used.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.PreferencesObject>>}
*/
getPreferences(params: PlatformNotificationsV1.GetPreferencesParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.PreferencesObject>>;
/**
* Create communication preferences.
*
* Create communication preferences for the specified account.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.iamId - The IAM ID of the user. Must match the IAM ID in the bearer token.
* @param {PreferenceValueWithUpdates} [params.incidentSeverity1] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.incidentSeverity2] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.incidentSeverity3] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.incidentSeverity4] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.maintenanceHigh] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.maintenanceMedium] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.maintenanceLow] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithoutUpdates} [params.announcementsMajor] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.announcementsMinor] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.securityNormal] - Preference settings for notification types that do
* not support updates.
* @param {PreferenceValueWithoutUpdates} [params.accountNormal] - Preference settings for notification types that do
* not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsageOrder] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsageInvoices] - Preference settings for notification
* types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsagePayments] - Preference settings for notification
* types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsageSubscriptionsAndPromoCodes] - Preference settings for
* notification types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsageSpendingAlerts] - Preference settings for
* notification types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.resourceactivityNormal] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.orderingReview] - Preference settings for notification types that do
* not support updates.
* @param {PreferenceValueWithoutUpdates} [params.orderingApproved] - Preference settings for notification types that
* do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.orderingApprovedVsi] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.orderingApprovedServer] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.provisioningReloadComplete] - Preference settings for notification
* types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.provisioningCompleteVsi] - Preference settings for notification
* types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.provisioningCompleteServer] - Preference settings for notification
* types that do not support updates.
* @param {string} [params.accountId] - The IBM Cloud account ID. If not provided, the account ID from the bearer
* token will be used.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.PreferencesObject>>}
*/
createPreferences(params: PlatformNotificationsV1.CreatePreferencesParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.PreferencesObject>>;
/**
* Update communication preferences.
*
* Update communication preferences for the specified account.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.iamId - The IAM ID of the user. Must match the IAM ID in the bearer token.
* @param {PreferenceValueWithUpdates} [params.incidentSeverity1] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.incidentSeverity2] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.incidentSeverity3] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.incidentSeverity4] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.maintenanceHigh] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.maintenanceMedium] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithUpdates} [params.maintenanceLow] - Preference settings for notification types that
* support updates.
* @param {PreferenceValueWithoutUpdates} [params.announcementsMajor] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.announcementsMinor] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.securityNormal] - Preference settings for notification types that do
* not support updates.
* @param {PreferenceValueWithoutUpdates} [params.accountNormal] - Preference settings for notification types that do
* not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsageOrder] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsageInvoices] - Preference settings for notification
* types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsagePayments] - Preference settings for notification
* types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsageSubscriptionsAndPromoCodes] - Preference settings for
* notification types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.billingAndUsageSpendingAlerts] - Preference settings for
* notification types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.resourceactivityNormal] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.orderingReview] - Preference settings for notification types that do
* not support updates.
* @param {PreferenceValueWithoutUpdates} [params.orderingApproved] - Preference settings for notification types that
* do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.orderingApprovedVsi] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.orderingApprovedServer] - Preference settings for notification types
* that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.provisioningReloadComplete] - Preference settings for notification
* types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.provisioningCompleteVsi] - Preference settings for notification
* types that do not support updates.
* @param {PreferenceValueWithoutUpdates} [params.provisioningCompleteServer] - Preference settings for notification
* types that do not support updates.
* @param {string} [params.accountId] - The IBM Cloud account ID. If not provided, the account ID from the bearer
* token will be used.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.PreferencesObject>>}
*/
replaceNotificationPreferences(params: PlatformNotificationsV1.ReplaceNotificationPreferencesParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.PreferencesObject>>;
/**
* Reset all preferences to their default values.
*
* Delete all communication preferences for the specified account, and reset all preferences to their default values.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.iamId - The IAM ID of the user. Must match the IAM ID in the bearer token.
* @param {string} [params.accountId] - The IBM Cloud account ID. If not provided, the account ID from the bearer
* token will be used.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.EmptyObject>>}
*/
deleteNotificationPreferences(params: PlatformNotificationsV1.DeleteNotificationPreferencesParams): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.EmptyObject>>;
}
/*************************
* interfaces
************************/
declare namespace PlatformNotificationsV1 {
/** An operation response. */
export interface Response<T = any> {
result: T;
status: number;
statusText: string;
headers: IncomingHttpHeaders;
}
/** The callback for a service request. */
export type Callback<T> = (error: any, response?: Response<T>) => void;
/** The body of a service request that returns no response data. */
export interface EmptyObject {
}
/** A standard JS object, defined to avoid the limitations of `Object` and `object` */
export interface JsonObject {
[]: any;
}
/*************************
* request interfaces
************************/
interface DefaultParams {
headers?: OutgoingHttpHeaders;
signal?: AbortSignal;
}
/** Parameters for the `listNotifications` operation. */
export interface ListNotificationsParams extends DefaultParams {
/** The IBM Cloud account ID. If not provided, the account ID from the bearer token will be used. */
accountId?: string;
/** An opaque page token that specifies the resource to start the page on or after. If unspecified, the first
* page of results is returned.
*/
start?: string;
/** The maximum number of items to return per page. If unspecified, a default limit of 50 is used. */
limit?: number;
}
/** Parameters for the `getAcknowledgement` operation. */
export interface GetAcknowledgementParams extends DefaultParams {
/** The IBM Cloud account ID. If not provided, the account ID from the bearer token will be used. */
accountId?: string;
}
/** Parameters for the `replaceNotificationAcknowledgement` operation. */
export interface ReplaceNotificationAcknowledgementParams extends DefaultParams {
/** The timestamp of the last acknowledgement. */
lastAcknowledged: number;
/** The IBM Cloud account ID. If not provided, the account ID from the bearer token will be used. */
accountId?: string;
}
/** Parameters for the `listDistributionListDestinations` operation. */
export interface ListDistributionListDestinationsParams extends DefaultParams {
/** The IBM Cloud account ID. */
accountId: string;
}
/** Parameters for the `createDistributionListDestination` operation. */
export interface CreateDistributionListDestinationParams extends DefaultParams {
/** The IBM Cloud account ID. */
accountId: string;
addDestinationPrototype: AddDestinationPrototype;
}
/** Parameters for the `getDistributionListDestination` operation. */
export interface GetDistributionListDestinationParams extends DefaultParams {
/** The IBM Cloud account ID. */
accountId: string;
/** The ID of the destination. */
destinationId: string;
}
/** Parameters for the `deleteDistributionListDestination` operation. */
export interface DeleteDistributionListDestinationParams extends DefaultParams {
/** The IBM Cloud account ID. */
accountId: string;
/** The ID of the destination. */
destinationId: string;
}
/** Parameters for the `testDistributionListDestination` operation. */
export interface TestDistributionListDestinationParams extends DefaultParams {
/** The IBM Cloud account ID. */
accountId: string;
/** The ID of the destination. */
destinationId: string;
testDestinationRequestBodyPrototype: TestDestinationRequestBodyPrototype;
}
/** Parameters for the `getPreferences` operation. */
export interface GetPreferencesParams extends DefaultParams {
/** The IAM ID of the user. Must match the IAM ID in the bearer token. */
iamId: string;
/** The IBM Cloud account ID. If not provided, the account ID from the bearer token will be used. */
accountId?: string;
}
/** Parameters for the `createPreferences` operation. */
export interface CreatePreferencesParams extends DefaultParams {
/** The IAM ID of the user. Must match the IAM ID in the bearer token. */
iamId: string;
/** Preference settings for notification types that support updates. */
incidentSeverity1?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
incidentSeverity2?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
incidentSeverity3?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
incidentSeverity4?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
maintenanceHigh?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
maintenanceMedium?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
maintenanceLow?: PreferenceValueWithUpdates;
/** Preference settings for notification types that do not support updates. */
announcementsMajor?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
announcementsMinor?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
securityNormal?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
accountNormal?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsageOrder?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsageInvoices?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsagePayments?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsageSubscriptionsAndPromoCodes?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsageSpendingAlerts?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
resourceactivityNormal?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
orderingReview?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
orderingApproved?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
orderingApprovedVsi?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
orderingApprovedServer?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
provisioningReloadComplete?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
provisioningCompleteVsi?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
provisioningCompleteServer?: PreferenceValueWithoutUpdates;
/** The IBM Cloud account ID. If not provided, the account ID from the bearer token will be used. */
accountId?: string;
}
/** Parameters for the `replaceNotificationPreferences` operation. */
export interface ReplaceNotificationPreferencesParams extends DefaultParams {
/** The IAM ID of the user. Must match the IAM ID in the bearer token. */
iamId: string;
/** Preference settings for notification types that support updates. */
incidentSeverity1?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
incidentSeverity2?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
incidentSeverity3?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
incidentSeverity4?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
maintenanceHigh?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
maintenanceMedium?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
maintenanceLow?: PreferenceValueWithUpdates;
/** Preference settings for notification types that do not support updates. */
announcementsMajor?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
announcementsMinor?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
securityNormal?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
accountNormal?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsageOrder?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsageInvoices?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsagePayments?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsageSubscriptionsAndPromoCodes?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billingAndUsageSpendingAlerts?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
resourceactivityNormal?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
orderingReview?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
orderingApproved?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
orderingApprovedVsi?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
orderingApprovedServer?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
provisioningReloadComplete?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
provisioningCompleteVsi?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
provisioningCompleteServer?: PreferenceValueWithoutUpdates;
/** The IBM Cloud account ID. If not provided, the account ID from the bearer token will be used. */
accountId?: string;
}
/** Parameters for the `deleteNotificationPreferences` operation. */
export interface DeleteNotificationPreferencesParams extends DefaultParams {
/** The IAM ID of the user. Must match the IAM ID in the bearer token. */
iamId: string;
/** The IBM Cloud account ID. If not provided, the account ID from the bearer token will be used. */
accountId?: string;
}
/*************************
* model interfaces
************************/
/**
* Status indicating whether the user has unread notifications.
*/
export interface Acknowledgement {
/** Indicates whether the user has unread notifications. */
has_unread: boolean;
/** The timestamp of the last acknowledgement. */
last_acknowledged: number;
}
/**
* AddDestination.
*/
export interface AddDestination {
}
/**
* List of destinations in the distribution list.
*/
export interface AddDestinationCollection {
/** Array of destination entries. */
destinations: AddDestination[];
}
/**
* AddDestinationPrototype.
*/
export interface AddDestinationPrototype {
}
/**
* A notification entry.
*/
export interface Notification {
/** The title of the notification. */
title: string;
/** The body content of the notification. */
body: string;
/** The unique identifier for the notification. */
id: string;
/** The category of the notification. */
category: Notification.Constants.Category | string;
/** Array of component/service names affected by this notification. */
component_names: string[];
/** The start time of the notification in Unix timestamp (seconds). */
start_time?: number;
/** Indicates if the notification is global. */
is_global: boolean;
/** The current state of the notification. */
state?: Notification.Constants.State | string;
/** Array of region identifiers affected by this notification. */
regions: string[];
/** Array of CRN masks that define the scope of affected resources. */
crn_masks: string[];
/** The record identifier for tracking purposes. */
record_id?: string;
/** The source identifier of the notification. */
source_id?: string;
/** The completion code of the notification. */
completion_code?: Notification.Constants.CompletionCode | string;
/** The end time of the notification in Unix timestamp (seconds). */
end_time?: number;
/** The last update time of the notification in Unix timestamp (seconds). */
update_time?: number;
/** The severity level of the notification (0-3). The display value depends on the notification type:
*
* **Incidents:**
* - 1 = Severity 1
* - 2 = Severity 2
* - 3 = Severity 3
* - 0 = Severity 4
*
* **Maintenance:**
* - 1 = High
* - 2 = Medium
* - 3 = Low
*
* **Announcements:**
* - 1 = Major
* - 0 = Minor.
*/
severity: number;
/** Lucene query string for filtering affected resources. Only present when instance targets are specified and
* resource_link is not available. Mutually exclusive with resource_link.
*/
lucene_query?: string;
/** Link to additional resource information or documentation. Takes precedence over lucene_query when both are
* available. Mutually exclusive with lucene_query.
*/
resource_link?: string;
/** The timestamp when the notification was created. */
creation_timestamp: number;
}
export namespace Notification {
namespace Constants {
/** The category of the notification. */
enum Category {
INCIDENT = "incident",
MAINTENANCE = "maintenance",
ANNOUNCEMENTS = "announcements",
SECURITY_BULLETINS = "security_bulletins",
SECURITY = "security",
RESOURCE = "resource",
BILLING_AND_USAGE = "billing_and_usage",
ORDERING = "ordering",
PROVISIONING = "provisioning",
ACCOUNT = "account"
}
/** The current state of the notification. */
enum State {
NEW = "new",
IN_PROGRESS = "in-progress",
COMPLETE = "complete",
RESOLVED = "resolved"
}
/** The completion code of the notification. */
enum CompletionCode {
SUCCESSFUL = "successful",
FAILED = "failed",
CANCELLED = "cancelled"
}
}
}
/**
* Collection of user notifications with token-based pagination metadata.
*/
export interface NotificationCollection {
/** The maximum number of items returned in this response. */
limit: number;
/** The total number of notifications in the collection. */
total_count: number;
/** A pagination link object containing the URL to a page. */
first: PaginationLink;
/** A pagination link object with a page token. Used for next, previous, and last page links. */
previous?: PaginationLinkWithToken;
/** A pagination link object with a page token. Used for next, previous, and last page links. */
next?: PaginationLinkWithToken;
/** A pagination link object with a page token. Used for next, previous, and last page links. */
last?: PaginationLinkWithToken;
/** Array of notification entries. */
notifications: Notification[];
}
/**
* A pagination link object containing the URL to a page.
*/
export interface PaginationLink {
/** The full URL path to the page. */
href: string;
}
/**
* A pagination link object with a page token. Used for next, previous, and last page links.
*/
export interface PaginationLinkWithToken {
/** Complete URL to the page. */
href: string;
/** Opaque page token that can be used to retrieve the page. */
start: string;
}
/**
* Preference settings for notification types that support updates.
*/
export interface PreferenceValueWithUpdates {
/** Array of communication channels for this preference. */
channels: PreferenceValueWithUpdates.Constants.Channels[] | string[];
/** Whether to receive updates for this preference. Optional, defaults to false if not provided. */
updates?: boolean;
}
export namespace PreferenceValueWithUpdates {
namespace Constants {
/** Array of communication channels for this preference. */
enum Channels {
EMAIL = "email"
}
}
}
/**
* Preference settings for notification types that do not support updates.
*/
export interface PreferenceValueWithoutUpdates {
/** Array of communication channels for this preference. */
channels: PreferenceValueWithoutUpdates.Constants.Channels[] | string[];
}
export namespace PreferenceValueWithoutUpdates {
namespace Constants {
/** Array of communication channels for this preference. */
enum Channels {
EMAIL = "email"
}
}
}
/**
* User communication preferences object. Only include preferences where communication is desired; absence of a key
* means no communication for that preference type.
*/
export interface PreferencesObject {
/** Preference settings for notification types that support updates. */
incident_severity1?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
incident_severity2?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
incident_severity3?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
incident_severity4?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
maintenance_high?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
maintenance_medium?: PreferenceValueWithUpdates;
/** Preference settings for notification types that support updates. */
maintenance_low?: PreferenceValueWithUpdates;
/** Preference settings for notification types that do not support updates. */
announcements_major?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
announcements_minor?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
security_normal?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
account_normal?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billing_and_usage_order?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billing_and_usage_invoices?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billing_and_usage_payments?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billing_and_usage_subscriptions_and_promo_codes?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
billing_and_usage_spending_alerts?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
resourceactivity_normal?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
ordering_review?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
ordering_approved?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
ordering_approved_vsi?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
ordering_approved_server?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
provisioning_reload_complete?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
provisioning_complete_vsi?: PreferenceValueWithoutUpdates;
/** Preference settings for notification types that do not support updates. */
provisioning_complete_server?: PreferenceValueWithoutUpdates;
}
/**
* TestDestinationRequestBodyPrototype.
*/
export interface TestDestinationRequestBodyPrototype {
}
/**
* Response from the test notification endpoint.
*/
export interface TestDestinationResponseBody {
/** The status message that indicates the test result. */
message: string;
}
/**
* Prototype for creating an Event Notifications destination entry.
*/
export interface AddDestinationPrototypeEventNotificationDestinationPrototype extends AddDestinationPrototype {
/** The GUID of the Event Notifications instance. */
destination_id: string;
/** The type of the destination. */
destination_type: AddDestinationPrototypeEventNotificationDestinationPrototype.Constants.DestinationType | string;
}
export namespace AddDestinationPrototypeEventNotificationDestinationPrototype {
namespace Constants {
/** The type of the destination. */
enum DestinationType {
EVENT_NOTIFICATIONS = "event_notifications"
}
}
}
/**
* An Event Notifications destination entry in the distribution list.
*/
export interface AddDestinationEventNotificationDestination extends AddDestination {
/** The GUID of the Event Notifications instance. */
destination_id: string;
/** The type of the destination. */
destination_type: AddDestinationEventNotificationDestination.Constants.DestinationType | string;
}
export namespace AddDestinationEventNotificationDestination {
namespace Constants {
/** The type of the destination. */
enum DestinationType {
EVENT_NOTIFICATIONS = "event_notifications"
}
}
}
/**
* Request body for testing an Event Notifications destination.
*/
export interface TestDestinationRequestBodyPrototypeTestEventNotificationDestinationRequestBodyPrototype extends TestDestinationRequestBodyPrototype {
/** The type of the destination. */
destination_type: TestDestinationRequestBodyPrototypeTestEventNotificationDestinationRequestBodyPrototype.Constants.DestinationType | string;
/** The type of the notification to test. */
notification_type: TestDestinationRequestBodyPrototypeTestEventNotificationDestinationRequestBodyPrototype.Constants.NotificationType | string;
}
export namespace TestDestinationRequestBodyPrototypeTestEventNotificationDestinationRequestBodyPrototype {
namespace Constants {
/** The type of the destination. */
enum DestinationType {
EVENT_NOTIFICATIONS = "event_notifications"
}
/** The type of the notification to test. */
enum NotificationType {
INCIDENT = "incident",
ANNOUNCEMENTS = "announcements",
MAINTENANCE = "maintenance",
SECURITY_BULLETINS = "security_bulletins",
RESOURCE = "resource",
BILLING_AND_USAGE = "billing_and_usage"
}
}
}
/*************************
* pager classes
************************/
/**
* NotificationsPager can be used to simplify the use of listNotifications().
*/
export class NotificationsPager {
protected _hasNext: boolean;
protected pageContext: any;
protected client: PlatformNotificationsV1;
protected params: PlatformNotificationsV1.ListNotificationsParams;
/**
* Construct a NotificationsPager object.
*
* @param {PlatformNotificationsV1} client - The service client instance used to invoke listNotifications()
* @param {Object} [params] - The parameters to be passed to listNotifications()
* @constructor
* @returns {NotificationsPager}
*/
constructor(client: PlatformNotificationsV1, params?: PlatformNotificationsV1.ListNotificationsParams);
/**
* Returns true if there are potentially more results to be retrieved by invoking getNext().
* @returns {boolean}
*/
hasNext(): boolean;
/**
* Returns the next page of results by invoking listNotifications().
* @returns {Promise<PlatformNotificationsV1.Notification[]>}
*/
getNext(): Promise<PlatformNotificationsV1.Notification[]>;
/**
* Returns all results by invoking listNotifications() repeatedly until all pages of results have been retrieved.
* @returns {Promise<PlatformNotificationsV1.Notification[]>}
*/
getAll(): Promise<PlatformNotificationsV1.Notification[]>;
}
export {};
}
export = PlatformNotificationsV1;