Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API rate limiting to the OAS #79

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Sources/Models/RestreamsRequestObject.swift
Sources/Models/RestreamsResponseObject.swift
Sources/Models/TokenCreationPayload.swift
Sources/Models/TokenListResponse.swift
Sources/Models/TooManyRequests.swift
Sources/Models/UploadToken.swift
Sources/Models/Video.swift
Sources/Models/VideoAssets.swift
Expand Down Expand Up @@ -151,6 +152,7 @@ docs/RestreamsRequestObject.md
docs/RestreamsResponseObject.md
docs/TokenCreationPayload.md
docs/TokenListResponse.md
docs/TooManyRequests.md
docs/UploadToken.md
docs/UploadTokensAPI.md
docs/Video.md
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/oas_apivideo.yaml-defaut-cli.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5678c55d78ebee898e89b47215b59cb855d1997cdda9202292548ec786d8e9f5
d7b342ceb1a4805da9e3d6355384e34c1a99e1300d01cac3ae3218c5738f11f1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ Method | HTTP request | Description
- [RestreamsResponseObject](https://github.com/apivideo/api.video-swift-client/blob/main/docs/RestreamsResponseObject.md)
- [TokenCreationPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TokenCreationPayload.md)
- [TokenListResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TokenListResponse.md)
- [TooManyRequests](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TooManyRequests.md)
- [UploadToken](https://github.com/apivideo/api.video-swift-client/blob/main/docs/UploadToken.md)
- [Video](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Video.md)
- [VideoAssets](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoAssets.md)
Expand Down
2 changes: 2 additions & 0 deletions Sources/APIs/AnalyticsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ open class AnalyticsAPI {
Get play events for live stream
- GET /analytics/live-streams/plays
- Retrieve filtered analytics about the number of plays for your live streams in a project.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter from: (query) Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.
- parameter dimension: (query) Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`.
- parameter to: (query) Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional)
Expand Down Expand Up @@ -129,6 +130,7 @@ open class AnalyticsAPI {
Get play events for video
- GET /analytics/videos/plays
- Retrieve filtered analytics about the number of plays for your videos in a project.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter from: (query) Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.
- parameter dimension: (query) Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`.
- parameter to: (query) Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional)
Expand Down
5 changes: 5 additions & 0 deletions Sources/APIs/CaptionsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ open class CaptionsAPI {
Upload a caption
- POST /videos/{videoId}/captions/{language}
- Upload a VTT file to add captions to your video. More information can be found [here](https://docs.api.video/vod/add-captions)
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter videoId: (path) The unique identifier for the video you want to add a caption to.
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
- parameter file: (form) The video text track (VTT) you want to upload.
Expand Down Expand Up @@ -99,6 +100,7 @@ open class CaptionsAPI {
- Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found.

Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/captions).
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter videoId: (path) The unique identifier for the video you want captions for.
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
- returns: RequestBuilder<Caption>
Expand Down Expand Up @@ -154,6 +156,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt
Update a caption
- PATCH /videos/{videoId}/captions/{language}
- To have the captions on automatically, use this method to set default: true.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter videoId: (path) The unique identifier for the video you want to have automatic captions for.
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like &#x60;en&#x60; (English), extended subtags like &#x60;fr-CA&#x60; (French, Canada), or region subtags like &#x60;zh-Hans-CN&#x60; (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example &#x60;fr-CA&#x60;. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
- parameter captionsUpdatePayload: (body)
Expand Down Expand Up @@ -209,6 +212,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt
Delete a caption
- DELETE /videos/{videoId}/captions/{language}
- Delete a caption in a specific language by by video id.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter videoId: (path) The unique identifier for the video you want to delete a caption from.
- parameter language: (path) A valid language identifier using IETF language tags. You can use primary subtags like &#x60;en&#x60; (English), extended subtags like &#x60;fr-CA&#x60; (French, Canada), or region subtags like &#x60;zh-Hans-CN&#x60; (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example &#x60;fr-CA&#x60;. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags).
- returns: RequestBuilder<Void>
Expand Down Expand Up @@ -264,6 +268,7 @@ Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/capt
List video captions
- GET /videos/{videoId}/captions
- Retrieve a list of available captions by video id.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter videoId: (path) The unique identifier for the video you want to retrieve a list of captions for.
- parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1)
- parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25)
Expand Down
4 changes: 4 additions & 0 deletions Sources/APIs/ChaptersAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ open class ChaptersAPI {
Upload a chapter
- POST /videos/{videoId}/chapters/{language}
- Upload a VTT file to add chapters to your video. Chapters help break the video into sections. Read our [tutorial](https://api.video/blog/tutorials/adding-chapters-to-your-videos/) for more details.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter videoId: (path) The unique identifier for the video you want to upload a chapter for.
- parameter language: (path) A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
- parameter file: (form) The VTT file describing the chapters you want to upload.
Expand Down Expand Up @@ -97,6 +98,7 @@ open class ChaptersAPI {
Retrieve a chapter
- GET /videos/{videoId}/chapters/{language}
- Retrieve a chapter for by video id in a specific language.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter videoId: (path) The unique identifier for the video you want to show a chapter for.
- parameter language: (path) A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
- returns: RequestBuilder<Chapter>
Expand Down Expand Up @@ -151,6 +153,7 @@ open class ChaptersAPI {
Delete a chapter
- DELETE /videos/{videoId}/chapters/{language}
- Delete a chapter in a specific language by providing the video ID for the video you want to delete the chapter from and the language the chapter is in.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter videoId: (path) The unique identifier for the video you want to delete a chapter from.
- parameter language: (path) A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
- returns: RequestBuilder<Void>
Expand Down Expand Up @@ -206,6 +209,7 @@ open class ChaptersAPI {
List video chapters
- GET /videos/{videoId}/chapters
- Retrieve a list of all chapters for by video id.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter videoId: (path) The unique identifier for the video you want to retrieve a list of chapters for.
- parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1)
- parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25)
Expand Down
7 changes: 7 additions & 0 deletions Sources/APIs/LiveStreamsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ open class LiveStreamsAPI {
Create live stream
- POST /live-streams
- Creates a livestream object.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter liveStreamCreationPayload: (body)
- returns: RequestBuilder<LiveStream>
*/
Expand Down Expand Up @@ -82,6 +83,7 @@ open class LiveStreamsAPI {
Retrieve live stream
- GET /live-streams/{liveStreamId}
- Get a livestream by id.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter liveStreamId: (path) The unique ID for the live stream you want to watch.
- returns: RequestBuilder<LiveStream>
*/
Expand Down Expand Up @@ -132,6 +134,7 @@ open class LiveStreamsAPI {
Update a live stream
- PATCH /live-streams/{liveStreamId}
- Updates the livestream object.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter liveStreamId: (path) The unique ID for the live stream that you want to update information for such as player details.
- parameter liveStreamUpdatePayload: (body)
- returns: RequestBuilder<LiveStream>
Expand Down Expand Up @@ -182,6 +185,7 @@ open class LiveStreamsAPI {
Delete a live stream
- DELETE /live-streams/{liveStreamId}
- If you do not need a live stream any longer, you can send a request to delete it. All you need is the liveStreamId.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter liveStreamId: (path) The unique ID for the live stream that you want to remove.
- returns: RequestBuilder<Void>
*/
Expand Down Expand Up @@ -253,6 +257,7 @@ open class LiveStreamsAPI {
List all live streams
- GET /live-streams
- Get the list of livestreams on the workspace.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter streamKey: (query) The unique stream key that allows you to stream videos. (optional)
- parameter name: (query) You can filter live streams by their name or a part of their name. (optional)
- parameter sortBy: (query) Enables you to sort live stream results. Allowed attributes: &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;. &#x60;name&#x60; - the name of the live stream. &#x60;createdAt&#x60; - the time a live stream was created. &#x60;updatedAt&#x60; - the time a live stream was last updated. When using &#x60;createdAt&#x60; or &#x60;updatedAt&#x60;, the API sorts the results based on the ISO-8601 time format. (optional)
Expand Down Expand Up @@ -313,6 +318,7 @@ open class LiveStreamsAPI {
Upload a thumbnail
- POST /live-streams/{liveStreamId}/thumbnail
- Upload the thumbnail for the livestream.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter liveStreamId: (path) The unique ID for the live stream you want to upload.
- parameter file: (form) The image to be added as a thumbnail. The mime type should be image/jpeg, image/png or image/webp. The max allowed size is 8 MiB.
- returns: RequestBuilder<LiveStream>
Expand Down Expand Up @@ -367,6 +373,7 @@ open class LiveStreamsAPI {
Delete a thumbnail
- DELETE /live-streams/{liveStreamId}/thumbnail
- Send the unique identifier for a live stream to delete its thumbnail.
- responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)]
- parameter liveStreamId: (path) The unique identifier of the live stream whose thumbnail you want to delete.
- returns: RequestBuilder<LiveStream>
*/
Expand Down
Loading
Loading