NotificationRestClient class

Base class that should be used (derived from) to make requests to VSS REST apis

Extends

Constructors

NotificationRestClient(IVssRestClientOptions)

Methods

createSubscription(NotificationSubscriptionCreateParameters)

Create a new subscription.

deleteSubscription(string)

Delete a subscription.

getEventType(string)

Get a specific event type.

getNotificationReasons(number)
getSettings()
getSubscriber(string)

Get delivery preferences of a notifications subscriber.

getSubscription(string, SubscriptionQueryFlags)

Get a notification subscription by its ID.

getSubscriptionDiagnostics(string)

Get the diagnostics settings for a subscription.

getSubscriptionTemplates()

Get available subscription templates.

listEventTypes(string)

List available event types for this service. Optionally filter by only event types for the specified publisher.

listLogs(string, string, Date, Date)

Get a list of diagnostic logs for this service.

listNotificationReasons(number)
listSubscriptions(string, string[], SubscriptionQueryFlags)

Get a list of notification subscriptions, either by subscription IDs or by all subscriptions for a given user or group.

performBatchNotificationOperations(BatchNotificationOperation)
publishEvent(VssNotificationEvent)

Publish an event. This request must be directed to the service "extmgmt".

publishTokenEvent(VssNotificationEvent)

Publish an event. This request is only for the Token service since it's a deploy only service.

queryEventTypes(FieldValuesQuery, string)
querySubscriptions(SubscriptionQuery)

Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions.

transformEvent(EventTransformRequest)

Tranform a notification event.

updateSettings(NotificationAdminSettingsUpdateParameters)
updateSubscriber(NotificationSubscriberUpdateParameters, string)

Update delivery preferences of a notifications subscriber.

updateSubscription(NotificationSubscriptionUpdateParameters, string)

Update an existing subscription. Depending on the type of subscription and permissions, the caller can update the description, filter settings, channel (delivery) settings and more.

updateSubscriptionDiagnostics(UpdateSubscripitonDiagnosticsParameters, string)

Update the diagnostics settings for a subscription.

updateSubscriptionUserSettings(SubscriptionUserSettings, string, string)

Update the specified user's settings for the specified subscription. This API is typically used to opt in or out of a shared subscription. User settings can only be applied to shared subscriptions, like team subscriptions or default subscriptions.

Constructor Details

NotificationRestClient(IVssRestClientOptions)

new NotificationRestClient(options: IVssRestClientOptions)

Parameters

Method Details

createSubscription(NotificationSubscriptionCreateParameters)

Create a new subscription.

function createSubscription(createParameters: NotificationSubscriptionCreateParameters): Promise<NotificationSubscription>

Parameters

Returns

deleteSubscription(string)

Delete a subscription.

function deleteSubscription(subscriptionId: string): Promise<void>

Parameters

subscriptionId

string

Returns

Promise<void>

getEventType(string)

Get a specific event type.

function getEventType(eventType: string): Promise<NotificationEventType>

Parameters

eventType

string

The ID of the event type.

Returns

getNotificationReasons(number)

function getNotificationReasons(notificationId: number): Promise<NotificationReason>

Parameters

notificationId

number

Returns

getSettings()

function getSettings(): Promise<NotificationAdminSettings>

Returns

getSubscriber(string)

Get delivery preferences of a notifications subscriber.

function getSubscriber(subscriberId: string): Promise<NotificationSubscriber>

Parameters

subscriberId

string

ID of the user or group.

Returns

getSubscription(string, SubscriptionQueryFlags)

Get a notification subscription by its ID.

function getSubscription(subscriptionId: string, queryFlags?: SubscriptionQueryFlags): Promise<NotificationSubscription>

Parameters

subscriptionId

string

Returns

getSubscriptionDiagnostics(string)

Get the diagnostics settings for a subscription.

function getSubscriptionDiagnostics(subscriptionId: string): Promise<SubscriptionDiagnostics>

Parameters

subscriptionId

string

The id of the notifications subscription.

Returns

getSubscriptionTemplates()

Get available subscription templates.

function getSubscriptionTemplates(): Promise<NotificationSubscriptionTemplate[]>

Returns

listEventTypes(string)

List available event types for this service. Optionally filter by only event types for the specified publisher.

function listEventTypes(publisherId?: string): Promise<NotificationEventType[]>

Parameters

publisherId

string

Limit to event types for this publisher

Returns

listLogs(string, string, Date, Date)

Get a list of diagnostic logs for this service.

function listLogs(source: string, entryId?: string, startTime?: Date, endTime?: Date): Promise<INotificationDiagnosticLog[]>

Parameters

source

string

ID specifying which type of logs to check diagnostics for.

entryId

string

The ID of the specific log to query for.

startTime

Date

Start time for the time range to query in.

endTime

Date

End time for the time range to query in.

Returns

listNotificationReasons(number)

function listNotificationReasons(notificationIds?: number): Promise<NotificationReason[]>

Parameters

notificationIds

number

Returns

Promise<NotificationReason[]>

listSubscriptions(string, string[], SubscriptionQueryFlags)

Get a list of notification subscriptions, either by subscription IDs or by all subscriptions for a given user or group.

function listSubscriptions(targetId?: string, ids?: string[], queryFlags?: SubscriptionQueryFlags): Promise<NotificationSubscription[]>

Parameters

targetId

string

User or Group ID

ids

string[]

List of subscription IDs

Returns

performBatchNotificationOperations(BatchNotificationOperation)

function performBatchNotificationOperations(operation: BatchNotificationOperation): Promise<void>

Parameters

Returns

Promise<void>

publishEvent(VssNotificationEvent)

Publish an event. This request must be directed to the service "extmgmt".

function publishEvent(notificationEvent: VssNotificationEvent): Promise<VssNotificationEvent>

Parameters

notificationEvent
VssNotificationEvent

Returns

publishTokenEvent(VssNotificationEvent)

Publish an event. This request is only for the Token service since it's a deploy only service.

function publishTokenEvent(notificationEvent: VssNotificationEvent): Promise<VssNotificationEvent>

Parameters

notificationEvent
VssNotificationEvent

Returns

queryEventTypes(FieldValuesQuery, string)

function queryEventTypes(inputValuesQuery: FieldValuesQuery, eventType: string): Promise<NotificationEventField[]>

Parameters

inputValuesQuery
FieldValuesQuery
eventType

string

Returns

querySubscriptions(SubscriptionQuery)

Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions.

function querySubscriptions(subscriptionQuery: SubscriptionQuery): Promise<NotificationSubscription[]>

Parameters

subscriptionQuery
SubscriptionQuery

Returns

transformEvent(EventTransformRequest)

Tranform a notification event.

function transformEvent(transformRequest: EventTransformRequest): Promise<EventTransformResult>

Parameters

transformRequest
EventTransformRequest

Object to be transformed.

Returns

updateSettings(NotificationAdminSettingsUpdateParameters)

function updateSettings(updateParameters: NotificationAdminSettingsUpdateParameters): Promise<NotificationAdminSettings>

Parameters

Returns

updateSubscriber(NotificationSubscriberUpdateParameters, string)

Update delivery preferences of a notifications subscriber.

function updateSubscriber(updateParameters: NotificationSubscriberUpdateParameters, subscriberId: string): Promise<NotificationSubscriber>

Parameters

subscriberId

string

ID of the user or group.

Returns

updateSubscription(NotificationSubscriptionUpdateParameters, string)

Update an existing subscription. Depending on the type of subscription and permissions, the caller can update the description, filter settings, channel (delivery) settings and more.

function updateSubscription(updateParameters: NotificationSubscriptionUpdateParameters, subscriptionId: string): Promise<NotificationSubscription>

Parameters

subscriptionId

string

Returns

updateSubscriptionDiagnostics(UpdateSubscripitonDiagnosticsParameters, string)

Update the diagnostics settings for a subscription.

function updateSubscriptionDiagnostics(updateParameters: UpdateSubscripitonDiagnosticsParameters, subscriptionId: string): Promise<SubscriptionDiagnostics>

Parameters

subscriptionId

string

The id of the notifications subscription.

Returns

updateSubscriptionUserSettings(SubscriptionUserSettings, string, string)

Update the specified user's settings for the specified subscription. This API is typically used to opt in or out of a shared subscription. User settings can only be applied to shared subscriptions, like team subscriptions or default subscriptions.

function updateSubscriptionUserSettings(userSettings: SubscriptionUserSettings, subscriptionId: string, userId: string): Promise<SubscriptionUserSettings>

Parameters

subscriptionId

string

userId

string

ID of the user

Returns