Skip to content

Commit

Permalink
Merge pull request #87 from apivideo/api-rate-limiting-oas
Browse files Browse the repository at this point in the history
Add API rate limiting to the OAS
  • Loading branch information
bot-api-video authored Apr 18, 2024
2 parents 03ed6fb + 79c6d7b commit 9e11fa1
Show file tree
Hide file tree
Showing 12 changed files with 260 additions and 37 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ Method | Description | HTTP request
- [RestreamsResponseObject](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/RestreamsResponseObject.md)
- [TokenCreationPayload](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/TokenCreationPayload.md)
- [TokenListResponse](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/TokenListResponse.md)
- [TooManyRequests](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/TooManyRequests.md)
- [UploadToken](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/UploadToken.md)
- [Video](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/Video.md)
- [VideoAssets](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoAssets.md)
Expand Down
11 changes: 11 additions & 0 deletions docs/Model/TooManyRequests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# # TooManyRequests

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | A link to the error documentation. | [optional]
**title** | **string** | A description of the error that occurred. | [optional]
**status** | **int** | The HTTP status code. | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
4 changes: 2 additions & 2 deletions src/Api/AnalyticsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(BaseClient $client)
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\AnalyticsPlaysResponse|\ApiVideo\Client\Model\AnalyticsPlays400Error|\ApiVideo\Client\Model\Model403ErrorSchema|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\AnalyticsPlaysResponse|\ApiVideo\Client\Model\AnalyticsPlays400Error|\ApiVideo\Client\Model\Model403ErrorSchema|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function getLiveStreamsPlays(\DateTime $from, string $dimension, array $queryParams = []): \ApiVideo\Client\Model\AnalyticsPlaysResponse
{
Expand Down Expand Up @@ -157,7 +157,7 @@ private function buildGetLiveStreamsPlaysRequest(\DateTime $from, string $dimens
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\AnalyticsPlaysResponse|\ApiVideo\Client\Model\AnalyticsPlays400Error|\ApiVideo\Client\Model\Model403ErrorSchema|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\AnalyticsPlaysResponse|\ApiVideo\Client\Model\AnalyticsPlays400Error|\ApiVideo\Client\Model\Model403ErrorSchema|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function getVideosPlays(\DateTime $from, string $dimension, array $queryParams = []): \ApiVideo\Client\Model\AnalyticsPlaysResponse
{
Expand Down
8 changes: 4 additions & 4 deletions src/Api/CaptionsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(BaseClient $client)
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Caption|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Caption|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function upload(string $videoId, string $language, \SplFileObject $file): \ApiVideo\Client\Model\Caption
{
Expand Down Expand Up @@ -157,7 +157,7 @@ private function buildUploadRequest(string $videoId, string $language, \SplFileO
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Caption|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Caption|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function get(string $videoId, string $language): \ApiVideo\Client\Model\Caption
{
Expand Down Expand Up @@ -238,7 +238,7 @@ private function buildGetRequest(string $videoId, string $language): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Caption|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Caption|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function update(string $videoId, string $language, \ApiVideo\Client\Model\CaptionsUpdatePayload $captionsUpdatePayload): \ApiVideo\Client\Model\Caption
{
Expand Down Expand Up @@ -406,7 +406,7 @@ private function buildDeleteRequest(string $videoId, string $language): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\CaptionsListResponse|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\CaptionsListResponse|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function list(string $videoId, array $queryParams = []): \ApiVideo\Client\Model\CaptionsListResponse
{
Expand Down
6 changes: 3 additions & 3 deletions src/Api/ChaptersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(BaseClient $client)
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Chapter|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Chapter|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function upload(string $videoId, string $language, \SplFileObject $file): \ApiVideo\Client\Model\Chapter
{
Expand Down Expand Up @@ -157,7 +157,7 @@ private function buildUploadRequest(string $videoId, string $language, \SplFileO
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Chapter|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Chapter|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function get(string $videoId, string $language): \ApiVideo\Client\Model\Chapter
{
Expand Down Expand Up @@ -315,7 +315,7 @@ private function buildDeleteRequest(string $videoId, string $language): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\ChaptersListResponse|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\ChaptersListResponse|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function list(string $videoId, array $queryParams = []): \ApiVideo\Client\Model\ChaptersListResponse
{
Expand Down
12 changes: 6 additions & 6 deletions src/Api/LiveStreamsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(BaseClient $client)
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\LiveStream|\ApiVideo\Client\Model\BadRequest
* @return \ApiVideo\Client\Model\LiveStream|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests
*/
public function create(\ApiVideo\Client\Model\LiveStreamCreationPayload $liveStreamCreationPayload): \ApiVideo\Client\Model\LiveStream
{
Expand Down Expand Up @@ -108,7 +108,7 @@ private function buildCreateRequest(\ApiVideo\Client\Model\LiveStreamCreationPay
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\LiveStream
* @return \ApiVideo\Client\Model\LiveStream|\ApiVideo\Client\Model\TooManyRequests
*/
public function get(string $liveStreamId): \ApiVideo\Client\Model\LiveStream
{
Expand Down Expand Up @@ -173,7 +173,7 @@ private function buildGetRequest(string $liveStreamId): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\LiveStream|\ApiVideo\Client\Model\BadRequest
* @return \ApiVideo\Client\Model\LiveStream|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests
*/
public function update(string $liveStreamId, \ApiVideo\Client\Model\LiveStreamUpdatePayload $liveStreamUpdatePayload): \ApiVideo\Client\Model\LiveStream
{
Expand Down Expand Up @@ -309,7 +309,7 @@ private function buildDeleteRequest(string $liveStreamId): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\LiveStreamListResponse
* @return \ApiVideo\Client\Model\LiveStreamListResponse|\ApiVideo\Client\Model\TooManyRequests
*/
public function list(array $queryParams = []): \ApiVideo\Client\Model\LiveStreamListResponse
{
Expand Down Expand Up @@ -398,7 +398,7 @@ private function buildListRequest(array $queryParams = []): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\LiveStream|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\LiveStream|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function uploadThumbnail(string $liveStreamId, \SplFileObject $file): \ApiVideo\Client\Model\LiveStream
{
Expand Down Expand Up @@ -488,7 +488,7 @@ private function buildUploadThumbnailRequest(string $liveStreamId, \SplFileObjec
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\LiveStream|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\LiveStream|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function deleteThumbnail(string $liveStreamId): \ApiVideo\Client\Model\LiveStream
{
Expand Down
10 changes: 5 additions & 5 deletions src/Api/PlayerThemesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(BaseClient $client)
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\PlayerTheme
* @return \ApiVideo\Client\Model\PlayerTheme|\ApiVideo\Client\Model\TooManyRequests
*/
public function create(\ApiVideo\Client\Model\PlayerThemeCreationPayload $playerThemeCreationPayload): \ApiVideo\Client\Model\PlayerTheme
{
Expand Down Expand Up @@ -108,7 +108,7 @@ private function buildCreateRequest(\ApiVideo\Client\Model\PlayerThemeCreationPa
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\PlayerTheme|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\PlayerTheme|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function get(string $playerId): \ApiVideo\Client\Model\PlayerTheme
{
Expand Down Expand Up @@ -173,7 +173,7 @@ private function buildGetRequest(string $playerId): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\PlayerTheme|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\PlayerTheme|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function update(string $playerId, \ApiVideo\Client\Model\PlayerThemeUpdatePayload $playerThemeUpdatePayload): \ApiVideo\Client\Model\PlayerTheme
{
Expand Down Expand Up @@ -309,7 +309,7 @@ private function buildDeleteRequest(string $playerId): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\PlayerThemesListResponse|\ApiVideo\Client\Model\BadRequest
* @return \ApiVideo\Client\Model\PlayerThemesListResponse|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests
*/
public function list(array $queryParams = []): \ApiVideo\Client\Model\PlayerThemesListResponse
{
Expand Down Expand Up @@ -387,7 +387,7 @@ private function buildListRequest(array $queryParams = []): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\PlayerTheme|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\PlayerTheme|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function uploadLogo(string $playerId, \SplFileObject $file, string $link = null): \ApiVideo\Client\Model\PlayerTheme
{
Expand Down
6 changes: 3 additions & 3 deletions src/Api/UploadTokensApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(BaseClient $client)
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\UploadToken|\ApiVideo\Client\Model\BadRequest
* @return \ApiVideo\Client\Model\UploadToken|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests
*/
public function createToken(\ApiVideo\Client\Model\TokenCreationPayload $tokenCreationPayload): \ApiVideo\Client\Model\UploadToken
{
Expand Down Expand Up @@ -108,7 +108,7 @@ private function buildCreateTokenRequest(\ApiVideo\Client\Model\TokenCreationPay
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\UploadToken|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\UploadToken|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function getToken(string $uploadToken): \ApiVideo\Client\Model\UploadToken
{
Expand Down Expand Up @@ -234,7 +234,7 @@ private function buildDeleteTokenRequest(string $uploadToken): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\TokenListResponse
* @return \ApiVideo\Client\Model\TokenListResponse|\ApiVideo\Client\Model\TooManyRequests
*/
public function list(array $queryParams = []): \ApiVideo\Client\Model\TokenListResponse
{
Expand Down
18 changes: 9 additions & 9 deletions src/Api/VideosApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(BaseClient $client)
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests
*/
public function create(\ApiVideo\Client\Model\VideoCreationPayload $videoCreationPayload): \ApiVideo\Client\Model\Video
{
Expand Down Expand Up @@ -110,7 +110,7 @@ private function buildCreateRequest(\ApiVideo\Client\Model\VideoCreationPayload
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function upload(string $videoId, \SplFileObject $file, string $contentRange = null): \ApiVideo\Client\Model\Video
{
Expand Down Expand Up @@ -225,7 +225,7 @@ public function createUploadProgressiveSession(string $videoId) {
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests
*/
public function uploadWithUploadToken(string $token, \SplFileObject $file, string $contentRange = null, string $videoId = null): \ApiVideo\Client\Model\Video
{
Expand Down Expand Up @@ -339,7 +339,7 @@ public function createUploadWithUploadTokenProgressiveSession(string $token, str
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function get(string $videoId): \ApiVideo\Client\Model\Video
{
Expand Down Expand Up @@ -404,7 +404,7 @@ private function buildGetRequest(string $videoId): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function update(string $videoId, \ApiVideo\Client\Model\VideoUpdatePayload $videoUpdatePayload): \ApiVideo\Client\Model\Video
{
Expand Down Expand Up @@ -540,7 +540,7 @@ private function buildDeleteRequest(string $videoId): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\VideosListResponse|\ApiVideo\Client\Model\BadRequest
* @return \ApiVideo\Client\Model\VideosListResponse|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests
*/
public function list(array $queryParams = []): \ApiVideo\Client\Model\VideosListResponse
{
Expand Down Expand Up @@ -655,7 +655,7 @@ private function buildListRequest(array $queryParams = []): Request
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function uploadThumbnail(string $videoId, \SplFileObject $file): \ApiVideo\Client\Model\Video
{
Expand Down Expand Up @@ -746,7 +746,7 @@ private function buildUploadThumbnailRequest(string $videoId, \SplFileObject $fi
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\Video|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function pickThumbnail(string $videoId, \ApiVideo\Client\Model\VideoThumbnailPickPayload $videoThumbnailPickPayload): \ApiVideo\Client\Model\Video
{
Expand Down Expand Up @@ -820,7 +820,7 @@ private function buildPickThumbnailRequest(string $videoId, \ApiVideo\Client\Mod
*
* @throws \ApiVideo\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ApiVideo\Client\Model\VideoStatus|\ApiVideo\Client\Model\NotFound
* @return \ApiVideo\Client\Model\VideoStatus|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests
*/
public function getStatus(string $videoId): \ApiVideo\Client\Model\VideoStatus
{
Expand Down
Loading

0 comments on commit 9e11fa1

Please sign in to comment.