/** * @api.video/nodejs-client * api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes. * * The version of the OpenAPI document: 1 * * * NOTE: This class is auto generated. * Do not edit the class manually. */ import HttpClient, { ApiResponseHeaders } from '../HttpClient'; import Webhook from '../model/Webhook'; import WebhooksCreationPayload from '../model/WebhooksCreationPayload'; import WebhooksListResponse from '../model/WebhooksListResponse'; /** * no description */ export default class WebhooksApi { private httpClient; constructor(httpClient: HttpClient); /** * Webhooks can push notifications to your server, rather than polling api.video for changes. We currently offer four events: * ```video.encoding.quality.completed``` Occurs when a new video is uploaded into your account, it will be encoded into several different HLS and mp4 qualities. When each version is encoded, your webhook will get a notification. It will look like ```{ \"type\": \"video.encoding.quality.completed\", \"emittedAt\": \"2021-01-29T16:46:25.217+01:00\", \"videoId\": \"viXXXXXXXX\", \"encoding\": \"hls\", \"quality\": \"720p\"} ```. This request says that the 720p HLS encoding was completed. * ```live-stream.broadcast.started``` When a live stream begins broadcasting, the broadcasting parameter changes from false to true, and this webhook fires. * ```live-stream.broadcast.ended``` This event fires when a live stream has finished broadcasting. * ```video.source.recorded``` This event occurs when a live stream is recorded and submitted for encoding. * Create Webhook * @param webhooksCreationPayload */ create(webhooksCreationPayload: WebhooksCreationPayload): Promise; /** * Webhooks can push notifications to your server, rather than polling api.video for changes. We currently offer four events: * ```video.encoding.quality.completed``` Occurs when a new video is uploaded into your account, it will be encoded into several different HLS and mp4 qualities. When each version is encoded, your webhook will get a notification. It will look like ```{ \"type\": \"video.encoding.quality.completed\", \"emittedAt\": \"2021-01-29T16:46:25.217+01:00\", \"videoId\": \"viXXXXXXXX\", \"encoding\": \"hls\", \"quality\": \"720p\"} ```. This request says that the 720p HLS encoding was completed. * ```live-stream.broadcast.started``` When a live stream begins broadcasting, the broadcasting parameter changes from false to true, and this webhook fires. * ```live-stream.broadcast.ended``` This event fires when a live stream has finished broadcasting. * ```video.source.recorded``` This event occurs when a live stream is recorded and submitted for encoding. * Create Webhook * @param webhooksCreationPayload */ createWithResponseHeaders(webhooksCreationPayload: WebhooksCreationPayload): Promise<{ headers: ApiResponseHeaders; body: Webhook; }>; /** * Retrieve webhook details by id. * Retrieve Webhook details * @param webhookId The unique webhook you wish to retreive details on. */ get(webhookId: string): Promise; /** * Retrieve webhook details by id. * Retrieve Webhook details * @param webhookId The unique webhook you wish to retreive details on. */ getWithResponseHeaders(webhookId: string): Promise<{ headers: ApiResponseHeaders; body: Webhook; }>; /** * This method will delete the indicated webhook. * Delete a Webhook * @param webhookId The webhook you wish to delete. */ delete(webhookId: string): Promise; /** * This method will delete the indicated webhook. * Delete a Webhook * @param webhookId The webhook you wish to delete. */ deleteWithResponseHeaders(webhookId: string): Promise<{ headers: ApiResponseHeaders; body: void; }>; /** * Thie method returns a list of your webhooks (with all their details). You can filter what the webhook list that the API returns using the parameters described below. * List all webhooks * @param {Object} searchParams * @param { string } searchParams.events The webhook event that you wish to filter on. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ list(args?: { events?: string; currentPage?: number; pageSize?: number; }): Promise; /** * Thie method returns a list of your webhooks (with all their details). You can filter what the webhook list that the API returns using the parameters described below. * List all webhooks * @param {Object} searchParams * @param { string } searchParams.events The webhook event that you wish to filter on. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ listWithResponseHeaders({ events, currentPage, pageSize, }?: { events?: string; currentPage?: number; pageSize?: number; }): Promise<{ headers: ApiResponseHeaders; body: WebhooksListResponse; }>; }