From 2b32b86194388c7ff881cdc7c26e9ff3b5ad96db Mon Sep 17 00:00:00 2001 From: ThibaultBee Date: Wed, 24 Apr 2024 09:28:54 +0000 Subject: [PATCH] Feature/java rate limit --- README.md | 20 +++++++++- docs/AdvancedAuthenticationApi.md | 4 ++ docs/AnalyticsApi.md | 8 +++- docs/CaptionsApi.md | 12 +++++- docs/ChaptersApi.md | 10 ++++- docs/LiveStreamsApi.md | 16 +++++++- docs/PlayerThemesApi.md | 16 +++++++- docs/UploadTokensApi.md | 10 ++++- docs/VideosApi.md | 20 +++++++++- docs/WatermarksApi.md | 8 +++- docs/WebhooksApi.md | 10 ++++- .../api/client/api/clients/VideosApi.java | 40 +++++++++++++++---- .../api/upload/IProgressiveUploadSession.java | 26 +++++++----- 13 files changed, 172 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 55bff46..3c123cf 100644 --- a/README.md +++ b/README.md @@ -412,7 +412,25 @@ Method | HTTP request | Description - [WebhooksListResponse](https://github.com/apivideo/api.video-java-client/blob/main/docs/WebhooksListResponse.md) -### Documentation for Authorization +### Rate Limiting + +api.video implements rate limiting to ensure fair usage and stability of the service. The API provides the rate limit values in the response headers for any API requests you make. The /auth endpoint is the only route without rate limitation. + +In this client, you can access these headers by using the `*WithHttpInfo()` or `*Async` versions of the methods. These methods return the `ApiResponse` that contains the response body and the headers, allowing you to check the `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Retry-After` headers to understand your current rate limit status. +Read more about these response headers in the [API reference](https://docs.api.video/reference#limitation). + +Here is an example of how to use these methods: + +```java +ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); +ApiResponse