Skip to content

Commit

Permalink
version 3.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Sep 12, 2023
1 parent ea70807 commit d9a49fd
Show file tree
Hide file tree
Showing 53 changed files with 5,170 additions and 143 deletions.
6 changes: 3 additions & 3 deletions docs/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
http-equiv="Content-Type"
content="text/html; charset=utf-8"
/>
<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>About &mdash; Python Slack SDK</title>

Expand Down Expand Up @@ -212,9 +212,9 @@
<!-- <div class="section-title">About</div> -->
<div class="card">
<section id="about">
<h1>About<a class="headerlink" href="#about" title="Permalink to this heading"></a></h1>
<h1>About<a class="headerlink" href="#about" title="Link to this heading"></a></h1>
<section id="product-name">
<h2>Python Slack SDK<a class="headerlink" href="#product-name" title="Permalink to this heading"></a></h2>
<h2>Python Slack SDK<a class="headerlink" href="#product-name" title="Link to this heading"></a></h2>
<p>Access the Slack Platform from your Python app. Python Slack SDK lets you build on the Slack Web APIs pythonically.</p>
<p>Python Slack SDK is proudly maintained with 💖 by the Slack Developer Tools team</p>
<ul class="simple">
Expand Down
4 changes: 4 additions & 0 deletions docs/api-docs/slack_sdk/audit_logs/async_client.html
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ <h2 id="args">Args</h2>
)
except aiohttp.ContentTypeError:
self.logger.debug(f&#34;No response data returned from the following API call: {url}.&#34;)
retry_response = RetryHttpResponse(
status_code=res.status,
headers=res.headers,
)
except json.decoder.JSONDecodeError as e:
message = f&#34;Failed to parse the response body: {str(e)}&#34;
raise SlackApiError(message, res)
Expand Down
8 changes: 8 additions & 0 deletions docs/api-docs/slack_sdk/audit_logs/v1/async_client.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ <h1 class="title">Module <code>slack_sdk.audit_logs.v1.async_client</code></h1>
)
except aiohttp.ContentTypeError:
self.logger.debug(f&#34;No response data returned from the following API call: {url}.&#34;)
retry_response = RetryHttpResponse(
status_code=res.status,
headers=res.headers,
)
except json.decoder.JSONDecodeError as e:
message = f&#34;Failed to parse the response body: {str(e)}&#34;
raise SlackApiError(message, res)
Expand Down Expand Up @@ -697,6 +701,10 @@ <h2 id="args">Args</h2>
)
except aiohttp.ContentTypeError:
self.logger.debug(f&#34;No response data returned from the following API call: {url}.&#34;)
retry_response = RetryHttpResponse(
status_code=res.status,
headers=res.headers,
)
except json.decoder.JSONDecodeError as e:
message = f&#34;Failed to parse the response body: {str(e)}&#34;
raise SlackApiError(message, res)
Expand Down
292 changes: 289 additions & 3 deletions docs/api-docs/slack_sdk/audit_logs/v1/logs.html

Large diffs are not rendered by default.

90 changes: 86 additions & 4 deletions docs/api-docs/slack_sdk/http_retry/builtin_async_handlers.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ <h1 class="title">Module <code>slack_sdk.http_retry.builtin_async_handlers</code
*,
state: RetryState,
request: HttpRequest,
response: Optional[HttpResponse],
error: Optional[Exception],
response: Optional[HttpResponse] = None,
error: Optional[Exception] = None,
) -&gt; bool:
return response is not None and response.status_code == 429

Expand Down Expand Up @@ -114,6 +114,27 @@ <h1 class="title">Module <code>slack_sdk.http_retry.builtin_async_handlers</code
state.increment_current_attempt()


class AsyncServerErrorRetryHandler(AsyncRetryHandler):
&#34;&#34;&#34;RetryHandler that does retries for server errors.&#34;&#34;&#34;

def __init__(
self,
max_retry_count: int = 1,
interval_calculator: RetryIntervalCalculator = default_interval_calculator,
):
super().__init__(max_retry_count, interval_calculator)

async def _can_retry_async(
self,
*,
state: RetryState,
request: HttpRequest,
response: Optional[HttpResponse] = None,
error: Optional[Exception] = None,
) -&gt; bool:
return response is not None and response.status_code in [500, 503]


def async_default_handlers() -&gt; List[AsyncRetryHandler]:
return [AsyncConnectionErrorRetryHandler()]</code></pre>
</details>
Expand Down Expand Up @@ -236,8 +257,8 @@ <h2 id="args">Args</h2>
*,
state: RetryState,
request: HttpRequest,
response: Optional[HttpResponse],
error: Optional[Exception],
response: Optional[HttpResponse] = None,
error: Optional[Exception] = None,
) -&gt; bool:
return response is not None and response.status_code == 429

Expand Down Expand Up @@ -322,6 +343,60 @@ <h3>Methods</h3>
</dd>
</dl>
</dd>
<dt id="slack_sdk.http_retry.builtin_async_handlers.AsyncServerErrorRetryHandler"><code class="flex name class">
<span>class <span class="ident">AsyncServerErrorRetryHandler</span></span>
<span>(</span><span>max_retry_count: int = 1, interval_calculator: <a title="slack_sdk.http_retry.interval_calculator.RetryIntervalCalculator" href="interval_calculator.html#slack_sdk.http_retry.interval_calculator.RetryIntervalCalculator">RetryIntervalCalculator</a> = &lt;slack_sdk.http_retry.builtin_interval_calculators.BackoffRetryIntervalCalculator object&gt;)</span>
</code></dt>
<dd>
<div class="desc"><p>RetryHandler that does retries for server errors.</p>
<p>RetryHandler interface.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>max_retry_count</code></strong></dt>
<dd>The maximum times to do retries</dd>
<dt><strong><code>interval_calculator</code></strong></dt>
<dd>Pass an interval calculator for customizing the logic</dd>
</dl></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class AsyncServerErrorRetryHandler(AsyncRetryHandler):
&#34;&#34;&#34;RetryHandler that does retries for server errors.&#34;&#34;&#34;

def __init__(
self,
max_retry_count: int = 1,
interval_calculator: RetryIntervalCalculator = default_interval_calculator,
):
super().__init__(max_retry_count, interval_calculator)

async def _can_retry_async(
self,
*,
state: RetryState,
request: HttpRequest,
response: Optional[HttpResponse] = None,
error: Optional[Exception] = None,
) -&gt; bool:
return response is not None and response.status_code in [500, 503]</code></pre>
</details>
<h3>Ancestors</h3>
<ul class="hlist">
<li>slack_sdk.http_retry.async_handler.AsyncRetryHandler</li>
</ul>
<h3>Class variables</h3>
<dl>
<dt id="slack_sdk.http_retry.builtin_async_handlers.AsyncServerErrorRetryHandler.interval_calculator"><code class="name">var <span class="ident">interval_calculator</span><a title="slack_sdk.http_retry.interval_calculator.RetryIntervalCalculator" href="interval_calculator.html#slack_sdk.http_retry.interval_calculator.RetryIntervalCalculator">RetryIntervalCalculator</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="slack_sdk.http_retry.builtin_async_handlers.AsyncServerErrorRetryHandler.max_retry_count"><code class="name">var <span class="ident">max_retry_count</span> : int</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
Expand Down Expand Up @@ -358,6 +433,13 @@ <h4><code><a title="slack_sdk.http_retry.builtin_async_handlers.AsyncRateLimitEr
<li><code><a title="slack_sdk.http_retry.builtin_async_handlers.AsyncRateLimitErrorRetryHandler.prepare_for_next_attempt_async" href="#slack_sdk.http_retry.builtin_async_handlers.AsyncRateLimitErrorRetryHandler.prepare_for_next_attempt_async">prepare_for_next_attempt_async</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="slack_sdk.http_retry.builtin_async_handlers.AsyncServerErrorRetryHandler" href="#slack_sdk.http_retry.builtin_async_handlers.AsyncServerErrorRetryHandler">AsyncServerErrorRetryHandler</a></code></h4>
<ul class="">
<li><code><a title="slack_sdk.http_retry.builtin_async_handlers.AsyncServerErrorRetryHandler.interval_calculator" href="#slack_sdk.http_retry.builtin_async_handlers.AsyncServerErrorRetryHandler.interval_calculator">interval_calculator</a></code></li>
<li><code><a title="slack_sdk.http_retry.builtin_async_handlers.AsyncServerErrorRetryHandler.max_retry_count" href="#slack_sdk.http_retry.builtin_async_handlers.AsyncServerErrorRetryHandler.max_retry_count">max_retry_count</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
Expand Down
84 changes: 83 additions & 1 deletion docs/api-docs/slack_sdk/http_retry/builtin_handlers.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,28 @@ <h1 class="title">Module <code>slack_sdk.http_retry.builtin_handlers</code></h1>
else:
duration = int(response.headers.get(retry_after_header_name)[0]) + random.random()
time.sleep(duration)
state.increment_current_attempt()</code></pre>
state.increment_current_attempt()


class ServerErrorRetryHandler(RetryHandler):
&#34;&#34;&#34;RetryHandler that does retries for server errors.&#34;&#34;&#34;

def __init__(
self,
max_retry_count: int = 1,
interval_calculator: RetryIntervalCalculator = default_interval_calculator,
):
super().__init__(max_retry_count, interval_calculator)

def _can_retry(
self,
*,
state: RetryState,
request: HttpRequest,
response: Optional[HttpResponse] = None,
error: Optional[Exception] = None,
) -&gt; bool:
return response is not None and response.status_code in [500, 503]</code></pre>
</details>
</section>
<section>
Expand Down Expand Up @@ -309,6 +330,60 @@ <h3>Methods</h3>
</dd>
</dl>
</dd>
<dt id="slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler"><code class="flex name class">
<span>class <span class="ident">ServerErrorRetryHandler</span></span>
<span>(</span><span>max_retry_count: int = 1, interval_calculator: <a title="slack_sdk.http_retry.interval_calculator.RetryIntervalCalculator" href="interval_calculator.html#slack_sdk.http_retry.interval_calculator.RetryIntervalCalculator">RetryIntervalCalculator</a> = &lt;slack_sdk.http_retry.builtin_interval_calculators.BackoffRetryIntervalCalculator object&gt;)</span>
</code></dt>
<dd>
<div class="desc"><p>RetryHandler that does retries for server errors.</p>
<p>RetryHandler interface.</p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>max_retry_count</code></strong></dt>
<dd>The maximum times to do retries</dd>
<dt><strong><code>interval_calculator</code></strong></dt>
<dd>Pass an interval calculator for customizing the logic</dd>
</dl></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class ServerErrorRetryHandler(RetryHandler):
&#34;&#34;&#34;RetryHandler that does retries for server errors.&#34;&#34;&#34;

def __init__(
self,
max_retry_count: int = 1,
interval_calculator: RetryIntervalCalculator = default_interval_calculator,
):
super().__init__(max_retry_count, interval_calculator)

def _can_retry(
self,
*,
state: RetryState,
request: HttpRequest,
response: Optional[HttpResponse] = None,
error: Optional[Exception] = None,
) -&gt; bool:
return response is not None and response.status_code in [500, 503]</code></pre>
</details>
<h3>Ancestors</h3>
<ul class="hlist">
<li><a title="slack_sdk.http_retry.handler.RetryHandler" href="handler.html#slack_sdk.http_retry.handler.RetryHandler">RetryHandler</a></li>
</ul>
<h3>Class variables</h3>
<dl>
<dt id="slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler.interval_calculator"><code class="name">var <span class="ident">interval_calculator</span><a title="slack_sdk.http_retry.interval_calculator.RetryIntervalCalculator" href="interval_calculator.html#slack_sdk.http_retry.interval_calculator.RetryIntervalCalculator">RetryIntervalCalculator</a></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler.max_retry_count"><code class="name">var <span class="ident">max_retry_count</span> : int</code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
Expand Down Expand Up @@ -340,6 +415,13 @@ <h4><code><a title="slack_sdk.http_retry.builtin_handlers.RateLimitErrorRetryHan
<li><code><a title="slack_sdk.http_retry.builtin_handlers.RateLimitErrorRetryHandler.prepare_for_next_attempt" href="#slack_sdk.http_retry.builtin_handlers.RateLimitErrorRetryHandler.prepare_for_next_attempt">prepare_for_next_attempt</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler" href="#slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler">ServerErrorRetryHandler</a></code></h4>
<ul class="">
<li><code><a title="slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler.interval_calculator" href="#slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler.interval_calculator">interval_calculator</a></code></li>
<li><code><a title="slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler.max_retry_count" href="#slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler.max_retry_count">max_retry_count</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions docs/api-docs/slack_sdk/http_retry/handler.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ <h3>Subclasses</h3>
<ul class="hlist">
<li><a title="slack_sdk.http_retry.builtin_handlers.ConnectionErrorRetryHandler" href="builtin_handlers.html#slack_sdk.http_retry.builtin_handlers.ConnectionErrorRetryHandler">ConnectionErrorRetryHandler</a></li>
<li><a title="slack_sdk.http_retry.builtin_handlers.RateLimitErrorRetryHandler" href="builtin_handlers.html#slack_sdk.http_retry.builtin_handlers.RateLimitErrorRetryHandler">RateLimitErrorRetryHandler</a></li>
<li><a title="slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler" href="builtin_handlers.html#slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler">ServerErrorRetryHandler</a></li>
</ul>
<h3>Class variables</h3>
<dl>
Expand Down
1 change: 1 addition & 0 deletions docs/api-docs/slack_sdk/http_retry/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ <h3>Subclasses</h3>
<ul class="hlist">
<li><a title="slack_sdk.http_retry.builtin_handlers.ConnectionErrorRetryHandler" href="builtin_handlers.html#slack_sdk.http_retry.builtin_handlers.ConnectionErrorRetryHandler">ConnectionErrorRetryHandler</a></li>
<li><a title="slack_sdk.http_retry.builtin_handlers.RateLimitErrorRetryHandler" href="builtin_handlers.html#slack_sdk.http_retry.builtin_handlers.RateLimitErrorRetryHandler">RateLimitErrorRetryHandler</a></li>
<li><a title="slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler" href="builtin_handlers.html#slack_sdk.http_retry.builtin_handlers.ServerErrorRetryHandler">ServerErrorRetryHandler</a></li>
</ul>
<h3>Class variables</h3>
<dl>
Expand Down

0 comments on commit d9a49fd

Please sign in to comment.