From 79c6d7b4c5d93b136ef7d4b6807f68092de243a5 Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Thu, 11 Apr 2024 09:36:51 +0000 Subject: [PATCH] Add API rate limiting to the OAS --- README.md | 1 + docs/Model/TooManyRequests.md | 11 ++ src/Api/AnalyticsApi.php | 4 +- src/Api/CaptionsApi.php | 8 +- src/Api/ChaptersApi.php | 6 +- src/Api/LiveStreamsApi.php | 12 +- src/Api/PlayerThemesApi.php | 10 +- src/Api/UploadTokensApi.php | 6 +- src/Api/VideosApi.php | 18 +-- src/Api/WatermarksApi.php | 4 +- src/Api/WebhooksApi.php | 6 +- src/Model/TooManyRequests.php | 211 ++++++++++++++++++++++++++++++++++ 12 files changed, 260 insertions(+), 37 deletions(-) create mode 100644 docs/Model/TooManyRequests.md create mode 100644 src/Model/TooManyRequests.php diff --git a/README.md b/README.md index d59831a..eb1e566 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/Model/TooManyRequests.md b/docs/Model/TooManyRequests.md new file mode 100644 index 0000000..fd6dd31 --- /dev/null +++ b/docs/Model/TooManyRequests.md @@ -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) diff --git a/src/Api/AnalyticsApi.php b/src/Api/AnalyticsApi.php index 449c242..9c0229f 100644 --- a/src/Api/AnalyticsApi.php +++ b/src/Api/AnalyticsApi.php @@ -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 { @@ -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 { diff --git a/src/Api/CaptionsApi.php b/src/Api/CaptionsApi.php index 5617817..a6198cb 100644 --- a/src/Api/CaptionsApi.php +++ b/src/Api/CaptionsApi.php @@ -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 { @@ -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 { @@ -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 { @@ -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 { diff --git a/src/Api/ChaptersApi.php b/src/Api/ChaptersApi.php index c8ddb34..57d5cbd 100644 --- a/src/Api/ChaptersApi.php +++ b/src/Api/ChaptersApi.php @@ -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 { @@ -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 { @@ -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 { diff --git a/src/Api/LiveStreamsApi.php b/src/Api/LiveStreamsApi.php index d01ae81..fe36863 100644 --- a/src/Api/LiveStreamsApi.php +++ b/src/Api/LiveStreamsApi.php @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { diff --git a/src/Api/PlayerThemesApi.php b/src/Api/PlayerThemesApi.php index 043a25a..d4577fc 100644 --- a/src/Api/PlayerThemesApi.php +++ b/src/Api/PlayerThemesApi.php @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { diff --git a/src/Api/UploadTokensApi.php b/src/Api/UploadTokensApi.php index 2da45e2..37d873d 100644 --- a/src/Api/UploadTokensApi.php +++ b/src/Api/UploadTokensApi.php @@ -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 { @@ -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 { @@ -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 { diff --git a/src/Api/VideosApi.php b/src/Api/VideosApi.php index 1c6a1e2..16021c3 100644 --- a/src/Api/VideosApi.php +++ b/src/Api/VideosApi.php @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { diff --git a/src/Api/WatermarksApi.php b/src/Api/WatermarksApi.php index 280fab9..d96ba4b 100644 --- a/src/Api/WatermarksApi.php +++ b/src/Api/WatermarksApi.php @@ -49,7 +49,7 @@ public function __construct(BaseClient $client) * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\Watermark|\ApiVideo\Client\Model\BadRequest + * @return \ApiVideo\Client\Model\Watermark|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests */ public function upload(\SplFileObject $file): \ApiVideo\Client\Model\Watermark { @@ -186,7 +186,7 @@ private function buildDeleteRequest(string $watermarkId): Request * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\WatermarksListResponse|\ApiVideo\Client\Model\BadRequest + * @return \ApiVideo\Client\Model\WatermarksListResponse|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests */ public function list(array $queryParams = []): \ApiVideo\Client\Model\WatermarksListResponse { diff --git a/src/Api/WebhooksApi.php b/src/Api/WebhooksApi.php index 8342a51..8b6633c 100644 --- a/src/Api/WebhooksApi.php +++ b/src/Api/WebhooksApi.php @@ -49,7 +49,7 @@ public function __construct(BaseClient $client) * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\Webhook|\ApiVideo\Client\Model\BadRequest + * @return \ApiVideo\Client\Model\Webhook|\ApiVideo\Client\Model\BadRequest|\ApiVideo\Client\Model\TooManyRequests */ public function create(\ApiVideo\Client\Model\WebhooksCreationPayload $webhooksCreationPayload): \ApiVideo\Client\Model\Webhook { @@ -108,7 +108,7 @@ private function buildCreateRequest(\ApiVideo\Client\Model\WebhooksCreationPaylo * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\Webhook + * @return \ApiVideo\Client\Model\Webhook|\ApiVideo\Client\Model\TooManyRequests */ public function get(string $webhookId): \ApiVideo\Client\Model\Webhook { @@ -234,7 +234,7 @@ private function buildDeleteRequest(string $webhookId): Request * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\WebhooksListResponse + * @return \ApiVideo\Client\Model\WebhooksListResponse|\ApiVideo\Client\Model\TooManyRequests */ public function list(array $queryParams = []): \ApiVideo\Client\Model\WebhooksListResponse { diff --git a/src/Model/TooManyRequests.php b/src/Model/TooManyRequests.php new file mode 100644 index 0000000..c626292 --- /dev/null +++ b/src/Model/TooManyRequests.php @@ -0,0 +1,211 @@ + 'string', + 'title' => 'string', + 'status' => 'int' + ], + [ + 'type' => null, + 'title' => null, + 'status' => null + ], + [ + 'type' => 'type', + 'title' => 'title', + 'status' => 'status' + ], + [ + 'type' => 'setType', + 'title' => 'setTitle', + 'status' => 'setStatus' + ], + [ + 'type' => 'getType', + 'title' => 'getTitle', + 'status' => 'getStatus' + ], + [ + 'type' => null, + 'title' => null, + 'status' => null + ], + null + ); + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = $data['type'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['status'] = $data['status'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type A link to the error documentation. + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title A description of the error that occurred. + * + * @return self + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status The HTTP status code. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + +