diff --git a/DO_OPENAPI_COMMIT_SHA.txt b/DO_OPENAPI_COMMIT_SHA.txt index b89ad147..b4fc75b0 100644 --- a/DO_OPENAPI_COMMIT_SHA.txt +++ b/DO_OPENAPI_COMMIT_SHA.txt @@ -1 +1 @@ -dad52ee +555f840 diff --git a/requirements.txt b/requirements.txt index f5657107..51192b88 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,51 +1,29 @@ -aiohttp==3.8.3; python_version >= "3.6" -aiosignal==1.3.1; python_version >= "3.7" -alabaster==0.7.12; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -async-timeout==4.0.2; python_version >= "3.6" -asynctest==0.13.0; python_version < "3.8" and python_version >= "3.6" -attrs==22.1.0; python_version >= "3.6" -azure-core==1.26.1; python_version >= "3.7" -azure-identity==1.12.0; python_version >= "3.7" -babel==2.11.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -certifi==2022.9.24; python_version >= "3.7" and python_version < "4" -cffi==1.15.1; python_version >= "3.7" -charset-normalizer==2.1.1; python_full_version >= "3.6.0" and python_version >= "3.7" and python_version < "4" -colorama==0.4.6; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") or sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.7.0" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") -cryptography==38.0.3; python_version >= "3.7" -docutils==0.17.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6" -frozenlist==1.3.3; python_version >= "3.7" -idna==3.4; python_version >= "3.7" and python_version < "4" -imagesize==1.4.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -importlib-metadata==5.0.0; python_version < "3.10" and python_version >= "3.7" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") -isodate==0.6.1 -jinja2==3.1.2; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.7" -markupsafe==2.1.1; python_version >= "3.7" -msal-extensions==1.0.0; python_version >= "3.7" -msal==1.20.0; python_version >= "3.7" -msrest==0.7.1; python_version >= "3.6" -multidict==6.0.2; python_version >= "3.7" -oauthlib==3.2.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -packaging==21.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -portalocker==2.6.0 -pycparser==2.21; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.7" -pygments==2.13.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -pyjwt==2.6.0; python_version >= "3.7" -pyparsing==3.0.9; python_full_version >= "3.6.8" and python_version >= "3.6" -pytz==2022.6; python_version >= "3.6" -pywin32==305; python_version >= "3.7" and platform_system == "Windows" -requests-oauthlib==1.3.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -requests==2.28.1; python_version >= "3.7" and python_version < "4" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") -six==1.16.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.7" -snowballstemmer==2.2.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -sphinx-rtd-theme==1.1.1; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0") -sphinx==5.3.0; python_version >= "3.6" -sphinxcontrib-applehelp==1.0.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -sphinxcontrib-devhelp==1.0.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -sphinxcontrib-htmlhelp==2.0.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -sphinxcontrib-jsmath==1.0.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -sphinxcontrib-qthelp==1.0.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -sphinxcontrib-serializinghtml==1.1.5; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" -typing-extensions==4.4.0; python_version >= "3.7" -urllib3==1.26.12; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.7" -yarl==1.8.1; python_version >= "3.7" -zipp==3.10.0; python_version < "3.10" and python_version >= "3.7" +aiohttp==3.8.3 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +aiosignal==1.3.1 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +async-timeout==4.0.2 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +asynctest==0.13.0 ; python_full_version >= "3.7.2" and python_version < "3.8" +attrs==22.1.0 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +azure-core==1.26.1 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +azure-identity==1.12.0 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +certifi==2022.9.24 ; python_full_version >= "3.7.2" and python_version < "4" +cffi==1.15.1 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +charset-normalizer==2.1.1 ; python_full_version >= "3.7.2" and python_version < "4" +cryptography==38.0.3 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +frozenlist==1.3.3 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +idna==3.4 ; python_full_version >= "3.7.2" and python_version < "4" +isodate==0.6.1 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +msal-extensions==1.0.0 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +msal==1.20.0 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +msrest==0.7.1 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +multidict==6.0.2 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +oauthlib==3.2.2 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +portalocker==2.6.0 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +pycparser==2.21 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +pyjwt[crypto]==2.6.0 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +pywin32==305 ; python_full_version >= "3.7.2" and platform_system == "Windows" and python_full_version < "4.0.0" +requests-oauthlib==1.3.1 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +requests==2.28.1 ; python_full_version >= "3.7.2" and python_version < "4" +six==1.16.0 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +typing-extensions==4.4.0 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" +urllib3==1.26.12 ; python_full_version >= "3.7.2" and python_version < "4" +yarl==1.8.1 ; python_full_version >= "3.7.2" and python_full_version < "4.0.0" diff --git a/src/pydo/_client.py b/src/pydo/_client.py index 58cbf789..4b92d86c 100644 --- a/src/pydo/_client.py +++ b/src/pydo/_client.py @@ -325,6 +325,12 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too value is given in `Unix epoch time `_. See below for more information about how request limits expire. + More rate limiting information is returned only within burst limit error response headers: + + + * **retry-after**\ : The number of seconds to wait before making another request when rate + limited. + As long as the ``ratelimit-remaining`` count is above zero, you will be able to make additional requests. @@ -345,10 +351,14 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too move an entire hour into the future. If the ``ratelimit-remaining`` reaches zero, subsequent requests will receive - a 429 error code until the request reset has been reached. You can see the - format of the response in the examples. ``ratelimit-remaining`` reaching zero - can also indicate that the 250 requests per minute limit was met, even if - the 5,000 requests per hour limit was not. + a 429 error code until the request reset has been reached. + + ``ratelimit-remaining`` reaching zero can also indicate that the "burst limit" of 250 + requests per minute limit was met, even if the 5,000 requests per hour limit was not. + In this case, the 429 error response will include a retry-after header to indicate how + long to wait (in seconds) until the request may be retried. + + You can see the format of the response in the examples. **Note:** The following endpoints have special rate limit requirements that are independent of the limits defined above. @@ -377,6 +387,18 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too rateLimit-reset: 1402425459 . . . + Sample Rate Limit Headers When Burst Limit is Reached: + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + .. code-block:: + + . . . + ratelimit-limit: 5000 + ratelimit-remaining: 0 + rateLimit-reset: 1402425459 + retry-after: 29 + . . . + Sample Rate Exceeded Response ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/pydo/aio/_client.py b/src/pydo/aio/_client.py index 386aca23..5d9001a7 100644 --- a/src/pydo/aio/_client.py +++ b/src/pydo/aio/_client.py @@ -325,6 +325,12 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too value is given in `Unix epoch time `_. See below for more information about how request limits expire. + More rate limiting information is returned only within burst limit error response headers: + + + * **retry-after**\ : The number of seconds to wait before making another request when rate + limited. + As long as the ``ratelimit-remaining`` count is above zero, you will be able to make additional requests. @@ -345,10 +351,14 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too move an entire hour into the future. If the ``ratelimit-remaining`` reaches zero, subsequent requests will receive - a 429 error code until the request reset has been reached. You can see the - format of the response in the examples. ``ratelimit-remaining`` reaching zero - can also indicate that the 250 requests per minute limit was met, even if - the 5,000 requests per hour limit was not. + a 429 error code until the request reset has been reached. + + ``ratelimit-remaining`` reaching zero can also indicate that the "burst limit" of 250 + requests per minute limit was met, even if the 5,000 requests per hour limit was not. + In this case, the 429 error response will include a retry-after header to indicate how + long to wait (in seconds) until the request may be retried. + + You can see the format of the response in the examples. **Note:** The following endpoints have special rate limit requirements that are independent of the limits defined above. @@ -377,6 +387,18 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too rateLimit-reset: 1402425459 . . . + Sample Rate Limit Headers When Burst Limit is Reached: + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + .. code-block:: + + . . . + ratelimit-limit: 5000 + ratelimit-remaining: 0 + rateLimit-reset: 1402425459 + retry-after: 29 + . . . + Sample Rate Exceeded Response ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^