ServiceHooksRestClient class
Base class that should be used (derived from) to make requests to VSS REST apis
- Extends
Constructors
Service |
Methods
create |
Create a subscription. |
create |
Query for service hook subscriptions. |
create |
Sends a test notification. This is useful for verifying the configuration of an updated or new service hooks subscription. |
delete |
Delete a specific service hooks subscription. |
get |
Get a specific consumer service. Optionally filter out consumer actions that do not support any event types for the specified publisher. |
get |
Get details about a specific consumer action. |
get |
Get a specific event type. |
get |
Get a specific notification for a subscription. |
get |
Get a list of notifications for a specific subscription. A notification includes details about the event, the request to and the response from the consumer service. |
get |
Get a specific service hooks publisher. |
get |
Get a specific service hooks subscription. |
get |
|
list |
Get a list of consumer actions for a specific consumer. |
list |
Get a list of available service hook consumer services. Optionally filter by consumers that support at least one event type from the specific publisher. |
list |
Get the event types for a specific publisher. |
list |
Get a list of publishers. |
list |
Get a list of subscriptions. |
publish |
Publish an external event. |
query |
|
query |
Query for notifications. A notification includes details about the event, the request to and the response from the consumer service. |
query |
Query for service hook publishers. |
replace |
Update a subscription. <param name="subscriptionId">ID for a subscription that you wish to update.</param> |
update |
Constructor Details
ServiceHooksRestClient(IVssRestClientOptions)
Method Details
createSubscription(Subscription)
Create a subscription.
function createSubscription(subscription: Subscription): Promise<Subscription>
Parameters
- subscription
- Subscription
Subscription to be created.
Returns
Promise<Subscription>
createSubscriptionsQuery(SubscriptionsQuery)
Query for service hook subscriptions.
function createSubscriptionsQuery(query: SubscriptionsQuery): Promise<SubscriptionsQuery>
Parameters
- query
- SubscriptionsQuery
Returns
Promise<SubscriptionsQuery>
createTestNotification(Notification, boolean)
Sends a test notification. This is useful for verifying the configuration of an updated or new service hooks subscription.
function createTestNotification(testNotification: Notification, useRealData?: boolean): Promise<Notification>
Parameters
- testNotification
- Notification
- useRealData
-
boolean
Only allow testing with real data in existing subscriptions.
Returns
Promise<Notification>
deleteSubscription(string)
Delete a specific service hooks subscription.
function deleteSubscription(subscriptionId: string): Promise<void>
Parameters
- subscriptionId
-
string
ID for a subscription.
Returns
Promise<void>
getConsumer(string, string)
Get a specific consumer service. Optionally filter out consumer actions that do not support any event types for the specified publisher.
function getConsumer(consumerId: string, publisherId?: string): Promise<Consumer>
Parameters
- consumerId
-
string
ID for a consumer.
- publisherId
-
string
Returns
Promise<Consumer>
getConsumerAction(string, string, string)
Get details about a specific consumer action.
function getConsumerAction(consumerId: string, consumerActionId: string, publisherId?: string): Promise<ConsumerAction>
Parameters
- consumerId
-
string
ID for a consumer.
- consumerActionId
-
string
ID for a consumerActionId.
- publisherId
-
string
Returns
Promise<ConsumerAction>
getEventType(string, string)
Get a specific event type.
function getEventType(publisherId: string, eventTypeId: string): Promise<EventTypeDescriptor>
Parameters
- publisherId
-
string
ID for a publisher.
- eventTypeId
-
string
Returns
Promise<EventTypeDescriptor>
getNotification(string, number)
Get a specific notification for a subscription.
function getNotification(subscriptionId: string, notificationId: number): Promise<Notification>
Parameters
- subscriptionId
-
string
ID for a subscription.
- notificationId
-
number
Returns
Promise<Notification>
getNotifications(string, number, NotificationStatus, NotificationResult)
Get a list of notifications for a specific subscription. A notification includes details about the event, the request to and the response from the consumer service.
function getNotifications(subscriptionId: string, maxResults?: number, status?: NotificationStatus, result?: NotificationResult): Promise<Notification[]>
Parameters
- subscriptionId
-
string
ID for a subscription.
- maxResults
-
number
Maximum number of notifications to return. Default is 100.
- status
- NotificationStatus
Get only notifications with this status.
- result
- NotificationResult
Get only notifications with this result type.
Returns
Promise<Notification[]>
getPublisher(string)
Get a specific service hooks publisher.
function getPublisher(publisherId: string): Promise<Publisher>
Parameters
- publisherId
-
string
ID for a publisher.
Returns
Promise<Publisher>
getSubscription(string)
Get a specific service hooks subscription.
function getSubscription(subscriptionId: string): Promise<Subscription>
Parameters
- subscriptionId
-
string
ID for a subscription.
Returns
Promise<Subscription>
getSubscriptionDiagnostics(string)
function getSubscriptionDiagnostics(subscriptionId: string): Promise<SubscriptionDiagnostics>
Parameters
- subscriptionId
-
string
Returns
Promise<SubscriptionDiagnostics>
listConsumerActions(string, string)
Get a list of consumer actions for a specific consumer.
function listConsumerActions(consumerId: string, publisherId?: string): Promise<ConsumerAction[]>
Parameters
- consumerId
-
string
ID for a consumer.
- publisherId
-
string
Returns
Promise<ConsumerAction[]>
listConsumers(string)
Get a list of available service hook consumer services. Optionally filter by consumers that support at least one event type from the specific publisher.
function listConsumers(publisherId?: string): Promise<Consumer[]>
Parameters
- publisherId
-
string
Returns
Promise<Consumer[]>
listEventTypes(string)
Get the event types for a specific publisher.
function listEventTypes(publisherId: string): Promise<EventTypeDescriptor[]>
Parameters
- publisherId
-
string
ID for a publisher.
Returns
Promise<EventTypeDescriptor[]>
listPublishers()
Get a list of publishers.
function listPublishers(): Promise<Publisher[]>
Returns
Promise<Publisher[]>
listSubscriptions(string, string, string, string)
Get a list of subscriptions.
function listSubscriptions(publisherId?: string, eventType?: string, consumerId?: string, consumerActionId?: string): Promise<Subscription[]>
Parameters
- publisherId
-
string
ID for a subscription.
- eventType
-
string
The event type to filter on (if any).
- consumerId
-
string
ID for a consumer.
- consumerActionId
-
string
ID for a consumerActionId.
Returns
Promise<Subscription[]>
publishExternalEvent(string, string)
Publish an external event.
function publishExternalEvent(publisherId: string, channelId?: string): Promise<PublisherEvent[]>
Parameters
- publisherId
-
string
- channelId
-
string
Returns
Promise<PublisherEvent[]>
queryInputValues(InputValuesQuery, string)
function queryInputValues(inputValuesQuery: InputValuesQuery, publisherId: string): Promise<InputValuesQuery>
Parameters
- inputValuesQuery
- InputValuesQuery
- publisherId
-
string
Returns
Promise<InputValuesQuery>
queryNotifications(NotificationsQuery)
Query for notifications. A notification includes details about the event, the request to and the response from the consumer service.
function queryNotifications(query: NotificationsQuery): Promise<NotificationsQuery>
Parameters
- query
- NotificationsQuery
Returns
Promise<NotificationsQuery>
queryPublishers(PublishersQuery)
Query for service hook publishers.
function queryPublishers(query: PublishersQuery): Promise<PublishersQuery>
Parameters
- query
- PublishersQuery
Returns
Promise<PublishersQuery>
replaceSubscription(Subscription, string)
Update a subscription. <param name="subscriptionId">ID for a subscription that you wish to update.</param>
function replaceSubscription(subscription: Subscription, subscriptionId?: string): Promise<Subscription>
Parameters
- subscription
- Subscription
- subscriptionId
-
string
Returns
Promise<Subscription>
updateSubscriptionDiagnostics(UpdateSubscripitonDiagnosticsParameters, string)
function updateSubscriptionDiagnostics(updateParameters: UpdateSubscripitonDiagnosticsParameters, subscriptionId: string): Promise<SubscriptionDiagnostics>
Parameters
- updateParameters
- UpdateSubscripitonDiagnosticsParameters
- subscriptionId
-
string
Returns
Promise<SubscriptionDiagnostics>