Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NotificationsApiV1

notifications-api interfaces

Hierarchy

  • BaseService
    • NotificationsApiV1

Index

Constructors

constructor

  • Construct a NotificationsApiV1 object.

    constructor

    Parameters

    Name Type Attribute Description
    options UserOptions

    Options for the service.

    Returns NotificationsApiV1

Properties

Protected baseOptions

baseOptions: BaseServiceOptions

Static DEFAULT_SERVICE_NAME

DEFAULT_SERVICE_NAME: string = "notifications_api"

Static DEFAULT_SERVICE_URL

DEFAULT_SERVICE_URL: string = "https://us-south.secadvisor.cloud.ibm.com/notifications"

Methods

Protected configureService

  • configureService(serviceName: string): void
  • Configure the service using external configuration

    Parameters

    Name Type Attribute Description
    serviceName string

    The name of the service. Will be used to read from external configuration.

    Returns void

createNotificationChannel

  • create notification channel.

    create notification channel.

    Parameters

    Name Type Attribute Description
    params CreateNotificationChannelParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    accountId string Account ID.
    endpoint string The callback URL which receives the notification.
    name string
    type Type | string Type of callback URL.
    alert_source NotificationChannelAlertSourceItem[] Optional
    description string Optional A one sentence description of this `Channel`.
    enabled boolean Optional Channel is enabled or not. Default is disabled.
    headers OutgoingHttpHeaders Optional
    severity Severity | string[] Optional Severity of the notification to be received.

    Returns Promise<Response<CreateChannelsResponse>>

Protected createRequest

  • createRequest(parameters: any): Promise<any>
  • Wrapper around sendRequest that enforces the request will be authenticated.

    Parameters

    Name Type Attribute Description
    parameters any

    Service request options passed in by user.

    Returns Promise<any>

deleteNotificationChannel

deleteNotificationChannels

getAuthenticator

  • getAuthenticator(): any
  • Get the instance of the authenticator set on the service.

    Returns any

getNotificationChannel

  • get the details of a specific channel.

    get the details of a specific channel.

    Parameters

    Name Type Attribute Description
    params GetNotificationChannelParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    accountId string Account ID.
    channelId string Channel ID.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<GetChannelResponse>>

getPublicKey

  • fetch notifications public key.

    fetch public key to decrypt messages in notification payload.

    Parameters

    Name Type Attribute Description
    params GetPublicKeyParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    accountId string Account ID.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<PublicKeyResponse>>

listAllChannels

  • list all channels.

    list all channels under this account.

    Parameters

    Name Type Attribute Description
    params ListAllChannelsParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    accountId string Account ID.
    headers OutgoingHttpHeaders Optional
    limit number Optional Limit the number of the returned documents to the specified number.
    skip number Optional The offset is the index of the item from which you want to start returning data from. Default is 0.

    Returns Promise<Response<ListChannelsResponse>>

setEnableGzipCompression

  • setEnableGzipCompression(setting: boolean): void
  • Turn request body compression on or off.

    Parameters

    Name Type Attribute Description
    setting boolean

    Will turn it on if 'true', off if 'false'.

    Returns void

setServiceUrl

  • setServiceUrl(url: string): void
  • Set the service URL to send requests to.

    Parameters

    Name Type Attribute Description
    url string

    The base URL for the service.

    Returns void

testNotificationChannel

  • test notification channel.

    test a nofication channel under this account.

    Parameters

    Name Type Attribute Description
    params TestNotificationChannelParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    accountId string Account ID.
    channelId string Channel ID.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<TestChannelResponse>>

updateNotificationChannel

  • update notification channel.

    update notification channel.

    Parameters

    Name Type Attribute Description
    params UpdateNotificationChannelParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    accountId string Account ID.
    channelId string Channel ID.
    endpoint string The callback URL which receives the notification.
    name string
    type Type | string Type of callback URL.
    alert_source NotificationChannelAlertSourceItem[] Optional
    description string Optional A one sentence description of this `Channel`.
    enabled boolean Optional Channel is enabled or not. Default is disabled.
    headers OutgoingHttpHeaders Optional
    severity Severity | string[] Optional Severity of the notification to be received.

    Returns Promise<Response<UpdateChannelResponse>>

Static newInstance

  • Constructs an instance of NotificationsApiV1 with passed in options and external configuration.

    Parameters

    Name Type Attribute Description
    options UserOptions

    Returns NotificationsApiV1

Generated using TypeDoc