diff --git a/docs/api/WebhooksApi.md b/docs/api/WebhooksApi.md index 17c585c..c5cdfb5 100644 --- a/docs/api/WebhooksApi.md +++ b/docs/api/WebhooksApi.md @@ -16,13 +16,17 @@ All URIs are relative to *https://ws.api.video* 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. +* `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.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. +* `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. +* `video.source.recorded` This event occurs when a live stream is recorded and submitted for encoding. + +* `video.caption.generated` This event occurs when an automatic caption has been generated. + +* `video.summary.generated` This event occurs when an automatic summary has been generated. ### Parameters diff --git a/docs/model/Webhook.md b/docs/model/Webhook.md index 73f1796..9c1fa21 100644 --- a/docs/model/Webhook.md +++ b/docs/model/Webhook.md @@ -7,9 +7,22 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **webhookId** | **string** | A unique identifier of the webhook you subscribed to. | [optional] **createdAt** | **Date** | The time and date when you created this webhook subscription, in ATOM UTC format. | [optional] -**events** | **Array<string>** | A list of events that you subscribed to. When these events occur, the API triggers a webhook call to the URL you provided. | [optional] +**events** | [**Array<WebhookEventsEnum>**](#Array<WebhookEventsEnum>) | A list of events that you subscribed to. When these events occur, the API triggers a webhook call to the URL you provided. | [optional] **url** | **string** | The URL where the API sends the webhook. | [optional] **signatureSecret** | **string** | A secret key for the webhook you subscribed to. You can use it to verify the origin of the webhook call that you receive. | [optional] +## Enum: Array<WebhookEventsEnum> + +Name | Value +---- | ----- +LiveStreamBroadcastStarted | 'live-stream.broadcast.started' +LiveStreamBroadcastEnded | 'live-stream.broadcast.ended' +VideoSourceRecorded | 'video.source.recorded' +VideoEncodingQualityCompleted | 'video.encoding.quality.completed' +VideoCaptionGenerated | 'video.caption.generated' +VideoSummaryGenerated | 'video.summary.generated' + + + diff --git a/docs/model/WebhooksCreationPayload.md b/docs/model/WebhooksCreationPayload.md index 32b0429..aabf74a 100644 --- a/docs/model/WebhooksCreationPayload.md +++ b/docs/model/WebhooksCreationPayload.md @@ -5,8 +5,21 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**events** | **Array<string>** | A list of the webhooks that you are subscribing to. There are Currently four webhook options: * ```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``` Occurs when a live stream is recorded and submitted for encoding. | +**events** | [**Array<WebhooksCreationPayloadEventsEnum>**](#Array<WebhooksCreationPayloadEventsEnum>) | An array of webhook events that you want to subscribe to. | **url** | **string** | The the url to which HTTP notifications are sent. It could be any http or https URL. | +## Enum: Array<WebhooksCreationPayloadEventsEnum> + +Name | Value +---- | ----- +LiveStreamBroadcastStarted | 'live-stream.broadcast.started' +LiveStreamBroadcastEnded | 'live-stream.broadcast.ended' +VideoSourceRecorded | 'video.source.recorded' +VideoEncodingQualityCompleted | 'video.encoding.quality.completed' +VideoCaptionGenerated | 'video.caption.generated' +VideoSummaryGenerated | 'video.summary.generated' + + + diff --git a/src/ObjectSerializer.ts b/src/ObjectSerializer.ts index 1091b42..cbe18e5 100644 --- a/src/ObjectSerializer.ts +++ b/src/ObjectSerializer.ts @@ -135,6 +135,8 @@ const enumsMap: Set = new Set([ 'VideoStatusIngestStatusEnum', 'VideoUpdatePayloadLanguageEnum', 'VideoUpdatePayloadTranscriptSummaryAttributesEnum', + 'WebhookEventsEnum', + 'WebhooksCreationPayloadEventsEnum', ]); const typeMap: { [index: string]: any } = { diff --git a/src/api/WebhooksApi.ts b/src/api/WebhooksApi.ts index 5dcc9ee..14d9a71 100644 --- a/src/api/WebhooksApi.ts +++ b/src/api/WebhooksApi.ts @@ -27,7 +27,7 @@ export default class WebhooksApi { } /** - * 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. + * 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. * `video.caption.generated` This event occurs when an automatic caption has been generated. * `video.summary.generated` This event occurs when an automatic summary has been generated. * Create Webhook * @param webhooksCreationPayload */ @@ -40,7 +40,7 @@ export default class WebhooksApi { } /** - * 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. + * 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. * `video.caption.generated` This event occurs when an automatic caption has been generated. * `video.summary.generated` This event occurs when an automatic summary has been generated. * Create Webhook * @param webhooksCreationPayload */ diff --git a/src/model/Webhook.ts b/src/model/Webhook.ts index ee1e9a1..65354ab 100644 --- a/src/model/Webhook.ts +++ b/src/model/Webhook.ts @@ -23,7 +23,7 @@ export default class Webhook { /** * A list of events that you subscribed to. When these events occur, the API triggers a webhook call to the URL you provided. */ - 'events'?: Array; + 'events'?: Array; /** * The URL where the API sends the webhook. */ @@ -51,7 +51,7 @@ export default class Webhook { { name: 'events', baseName: 'events', - type: 'Array', + type: 'Array', format: '', }, { @@ -72,3 +72,11 @@ export default class Webhook { return Webhook.attributeTypeMap; } } + +export type WebhookEventsEnum = + | 'live-stream.broadcast.started' + | 'live-stream.broadcast.ended' + | 'video.source.recorded' + | 'video.encoding.quality.completed' + | 'video.caption.generated' + | 'video.summary.generated'; diff --git a/src/model/WebhooksCreationPayload.ts b/src/model/WebhooksCreationPayload.ts index 728905e..4954c98 100644 --- a/src/model/WebhooksCreationPayload.ts +++ b/src/model/WebhooksCreationPayload.ts @@ -13,9 +13,9 @@ import AttributeType from './AttributeType.js'; export default class WebhooksCreationPayload { /** - * A list of the webhooks that you are subscribing to. There are Currently four webhook options: * ```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``` Occurs when a live stream is recorded and submitted for encoding. + * An array of webhook events that you want to subscribe to. */ - 'events': Array; + 'events': Array; /** * The the url to which HTTP notifications are sent. It could be any http or https URL. */ @@ -27,7 +27,7 @@ export default class WebhooksCreationPayload { { name: 'events', baseName: 'events', - type: 'Array', + type: 'Array', format: '', }, { @@ -42,3 +42,11 @@ export default class WebhooksCreationPayload { return WebhooksCreationPayload.attributeTypeMap; } } + +export type WebhooksCreationPayloadEventsEnum = + | 'live-stream.broadcast.started' + | 'live-stream.broadcast.ended' + | 'video.source.recorded' + | 'video.encoding.quality.completed' + | 'video.caption.generated' + | 'video.summary.generated';