NotificationRestClient class
Base class that should be used (derived from) to make requests to VSS REST apis
- Extends
Constructors
Notification |
Methods
create |
Create a new subscription. |
delete |
Delete a subscription. |
get |
Get a specific event type. |
get |
|
get |
|
get |
Get delivery preferences of a notifications subscriber. |
get |
Get a notification subscription by its ID. |
get |
Get the diagnostics settings for a subscription. |
get |
Get available subscription templates. |
list |
List available event types for this service. Optionally filter by only event types for the specified publisher. |
list |
Get a list of diagnostic logs for this service. |
list |
|
list |
Get a list of notification subscriptions, either by subscription IDs or by all subscriptions for a given user or group. |
perform |
|
publish |
Publish an event. This request must be directed to the service "extmgmt". |
publish |
Publish an event. This request is only for the Token service since it's a deploy only service. |
query |
|
query |
Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions. |
transform |
Tranform a notification event. |
update |
|
update |
Update delivery preferences of a notifications subscriber. |
update |
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. |
update |
Update the diagnostics settings for a subscription. |
update |
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)
Method Details
createSubscription(NotificationSubscriptionCreateParameters)
Create a new subscription.
function createSubscription(createParameters: NotificationSubscriptionCreateParameters): Promise<NotificationSubscription>
Parameters
- createParameters
- NotificationSubscriptionCreateParameters
Returns
Promise<NotificationSubscription>
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
Promise<NotificationEventType>
getNotificationReasons(number)
function getNotificationReasons(notificationId: number): Promise<NotificationReason>
Parameters
- notificationId
-
number
Returns
Promise<NotificationReason>
getSettings()
function getSettings(): Promise<NotificationAdminSettings>
Returns
Promise<NotificationAdminSettings>
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
Promise<NotificationSubscriber>
getSubscription(string, SubscriptionQueryFlags)
Get a notification subscription by its ID.
function getSubscription(subscriptionId: string, queryFlags?: SubscriptionQueryFlags): Promise<NotificationSubscription>
Parameters
- subscriptionId
-
string
- queryFlags
- SubscriptionQueryFlags
Returns
Promise<NotificationSubscription>
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
Promise<SubscriptionDiagnostics>
getSubscriptionTemplates()
Get available subscription templates.
function getSubscriptionTemplates(): Promise<NotificationSubscriptionTemplate[]>
Returns
Promise<NotificationSubscriptionTemplate[]>
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
Promise<NotificationEventType[]>
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
Promise<INotificationDiagnosticLog[]>
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
- queryFlags
- SubscriptionQueryFlags
Returns
Promise<NotificationSubscription[]>
performBatchNotificationOperations(BatchNotificationOperation)
function performBatchNotificationOperations(operation: BatchNotificationOperation): Promise<void>
Parameters
- operation
- BatchNotificationOperation
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
Promise<VssNotificationEvent>
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
Promise<VssNotificationEvent>
queryEventTypes(FieldValuesQuery, string)
function queryEventTypes(inputValuesQuery: FieldValuesQuery, eventType: string): Promise<NotificationEventField[]>
Parameters
- inputValuesQuery
- FieldValuesQuery
- eventType
-
string
Returns
Promise<NotificationEventField[]>
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
Promise<NotificationSubscription[]>
transformEvent(EventTransformRequest)
Tranform a notification event.
function transformEvent(transformRequest: EventTransformRequest): Promise<EventTransformResult>
Parameters
- transformRequest
- EventTransformRequest
Object to be transformed.
Returns
Promise<EventTransformResult>
updateSettings(NotificationAdminSettingsUpdateParameters)
function updateSettings(updateParameters: NotificationAdminSettingsUpdateParameters): Promise<NotificationAdminSettings>
Parameters
- updateParameters
- NotificationAdminSettingsUpdateParameters
Returns
Promise<NotificationAdminSettings>
updateSubscriber(NotificationSubscriberUpdateParameters, string)
Update delivery preferences of a notifications subscriber.
function updateSubscriber(updateParameters: NotificationSubscriberUpdateParameters, subscriberId: string): Promise<NotificationSubscriber>
Parameters
- updateParameters
- NotificationSubscriberUpdateParameters
- subscriberId
-
string
ID of the user or group.
Returns
Promise<NotificationSubscriber>
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
- updateParameters
- NotificationSubscriptionUpdateParameters
- subscriptionId
-
string
Returns
Promise<NotificationSubscription>
updateSubscriptionDiagnostics(UpdateSubscripitonDiagnosticsParameters, string)
Update the diagnostics settings for a subscription.
function updateSubscriptionDiagnostics(updateParameters: UpdateSubscripitonDiagnosticsParameters, subscriptionId: string): Promise<SubscriptionDiagnostics>
Parameters
- updateParameters
- UpdateSubscripitonDiagnosticsParameters
- subscriptionId
-
string
The id of the notifications subscription.
Returns
Promise<SubscriptionDiagnostics>
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
- userSettings
- SubscriptionUserSettings
- subscriptionId
-
string
- userId
-
string
ID of the user
Returns
Promise<SubscriptionUserSettings>