Skip to content

Commit da717a5

Browse files
zimegClaude
andauthored
chore(release): version 3.48.0 (#2074)
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 4482fe7 commit da717a5

25 files changed

Lines changed: 1627 additions & 98 deletions

‎docs/reference/audit_logs/async_client.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
327327
message = f&#34;Failed to parse the response body: {str(e)}&#34;
328328
raise SlackApiError(message, res)
329329

330-
if res.status == 429:
330+
if res.status &gt;= 400:
331331
for handler in self.retry_handlers:
332332
if await handler.can_retry_async(
333333
state=retry_state,
@@ -337,7 +337,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
337337
if self.logger.level &lt;= logging.DEBUG:
338338
self.logger.info(
339339
f&#34;A retry handler found: {type(handler).__name__} &#34;
340-
f&#34;for {http_verb} {url} - rate_limited&#34;
340+
f&#34;for {http_verb} {url} - status: {res.status}&#34;
341341
)
342342
await handler.prepare_for_next_attempt_async(
343343
state=retry_state,

‎docs/reference/audit_logs/v1/async_client.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
329329
message = f&#34;Failed to parse the response body: {str(e)}&#34;
330330
raise SlackApiError(message, res)
331331

332-
if res.status == 429:
332+
if res.status &gt;= 400:
333333
for handler in self.retry_handlers:
334334
if await handler.can_retry_async(
335335
state=retry_state,
@@ -339,7 +339,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
339339
if self.logger.level &lt;= logging.DEBUG:
340340
self.logger.info(
341341
f&#34;A retry handler found: {type(handler).__name__} &#34;
342-
f&#34;for {http_verb} {url} - rate_limited&#34;
342+
f&#34;for {http_verb} {url} - status: {res.status}&#34;
343343
)
344344
await handler.prepare_for_next_attempt_async(
345345
state=retry_state,

‎docs/reference/index.html‎

Lines changed: 297 additions & 0 deletions
Large diffs are not rendered by default.

‎docs/reference/models/basic_objects.html‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@ <h3>Ancestors</h3>
116116
Raises:
117117
SlackObjectFormationError: if the object was not valid
118118
&#34;&#34;&#34;
119-
for attribute in (func for func in dir(self) if not func.startswith(&#34;__&#34;)):
120-
method = getattr(self, attribute, None)
121-
if callable(method) and hasattr(method, &#34;validator&#34;):
122-
method()
119+
instance_attribute_names = (name for name in vars(self) if not name.startswith(&#34;__&#34;))
120+
candidate_names = _class_validator_names(type(self)).union(instance_attribute_names)
121+
for name in sorted(candidate_names):
122+
attribute: Any = getattr(self, name, None)
123+
if _is_validator(attribute):
124+
attribute()
123125

124126
def get_object_attribute(self, key: str):
125127
return getattr(self, key, None)
@@ -376,10 +378,12 @@ <h3>Methods</h3>
376378
Raises:
377379
SlackObjectFormationError: if the object was not valid
378380
&#34;&#34;&#34;
379-
for attribute in (func for func in dir(self) if not func.startswith(&#34;__&#34;)):
380-
method = getattr(self, attribute, None)
381-
if callable(method) and hasattr(method, &#34;validator&#34;):
382-
method()</code></pre>
381+
instance_attribute_names = (name for name in vars(self) if not name.startswith(&#34;__&#34;))
382+
candidate_names = _class_validator_names(type(self)).union(instance_attribute_names)
383+
for name in sorted(candidate_names):
384+
attribute: Any = getattr(self, name, None)
385+
if _is_validator(attribute):
386+
attribute()</code></pre>
383387
</details>
384388
<div class="desc"><p>Validate this object against its attribute validators.</p>
385389
<dl>

‎docs/reference/models/index.html‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,12 @@ <h3>Ancestors</h3>
221221
Raises:
222222
SlackObjectFormationError: if the object was not valid
223223
&#34;&#34;&#34;
224-
for attribute in (func for func in dir(self) if not func.startswith(&#34;__&#34;)):
225-
method = getattr(self, attribute, None)
226-
if callable(method) and hasattr(method, &#34;validator&#34;):
227-
method()
224+
instance_attribute_names = (name for name in vars(self) if not name.startswith(&#34;__&#34;))
225+
candidate_names = _class_validator_names(type(self)).union(instance_attribute_names)
226+
for name in sorted(candidate_names):
227+
attribute: Any = getattr(self, name, None)
228+
if _is_validator(attribute):
229+
attribute()
228230

229231
def get_object_attribute(self, key: str):
230232
return getattr(self, key, None)
@@ -481,10 +483,12 @@ <h3>Methods</h3>
481483
Raises:
482484
SlackObjectFormationError: if the object was not valid
483485
&#34;&#34;&#34;
484-
for attribute in (func for func in dir(self) if not func.startswith(&#34;__&#34;)):
485-
method = getattr(self, attribute, None)
486-
if callable(method) and hasattr(method, &#34;validator&#34;):
487-
method()</code></pre>
486+
instance_attribute_names = (name for name in vars(self) if not name.startswith(&#34;__&#34;))
487+
candidate_names = _class_validator_names(type(self)).union(instance_attribute_names)
488+
for name in sorted(candidate_names):
489+
attribute: Any = getattr(self, name, None)
490+
if _is_validator(attribute):
491+
attribute()</code></pre>
488492
</details>
489493
<div class="desc"><p>Validate this object against its attribute validators.</p>
490494
<dl>

‎docs/reference/models/views/index.html‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ <h3>Inherited members</h3>
258258
if actions is None:
259259
continue
260260
elif isinstance(actions, dict):
261-
new_actions: Dict[str, Union[ViewStateValue, dict]] = copy.copy(actions)
261+
new_actions: Dict[str, ViewStateValue] = {}
262262
for action_id, v in actions.items():
263263
if isinstance(v, dict):
264264
d = copy.copy(v)
@@ -269,9 +269,9 @@ <h3>Inherited members</h3>
269269
self._show_warning_about_unknown(v)
270270
continue
271271
new_actions[action_id] = value_object
272-
value_objects[block_id] = new_actions # type: ignore[assignment]
272+
value_objects[block_id] = new_actions
273273
else:
274-
self._show_warning_about_unknown(v)
274+
self._show_warning_about_unknown(actions)
275275
self.values = value_objects
276276

277277
def to_dict(self, *args) -&gt; Dict[str, Dict[str, Dict[str, dict]]]:
@@ -316,7 +316,7 @@ <h3>Inherited members</h3>
316316
</dd>
317317
<dt id="slack_sdk.models.views.ViewStateValue"><code class="flex name class">
318318
<span>class <span class="ident">ViewStateValue</span></span>
319-
<span>(</span><span>*,<br>type: str | None = None,<br>value: str | None = None,<br>selected_date: str | None = None,<br>selected_time: str | None = None,<br>selected_conversation: str | None = None,<br>selected_channel: str | None = None,<br>selected_user: str | None = None,<br>selected_option: dict | <a title="slack_sdk.models.blocks.basic_components.Option" href="../blocks/basic_components.html#slack_sdk.models.blocks.basic_components.Option">Option</a> | None = None,<br>selected_conversations: Sequence[str] | None = None,<br>selected_channels: Sequence[str] | None = None,<br>selected_users: Sequence[str] | None = None,<br>selected_options: Sequence[dict | <a title="slack_sdk.models.blocks.basic_components.Option" href="../blocks/basic_components.html#slack_sdk.models.blocks.basic_components.Option">Option</a>] | None = None)</span>
319+
<span>(</span><span>*,<br>type: str | None = None,<br>value: str | None = None,<br>selected_date: str | None = None,<br>selected_time: str | None = None,<br>selected_conversation: str | None = None,<br>selected_channel: str | None = None,<br>selected_user: str | None = None,<br>selected_option: dict | <a title="slack_sdk.models.blocks.basic_components.Option" href="../blocks/basic_components.html#slack_sdk.models.blocks.basic_components.Option">Option</a> | None = None,<br>selected_conversations: Sequence[str] | None = None,<br>selected_channels: Sequence[str] | None = None,<br>selected_users: Sequence[str] | None = None,<br>selected_options: Sequence[dict | <a title="slack_sdk.models.blocks.basic_components.Option" href="../blocks/basic_components.html#slack_sdk.models.blocks.basic_components.Option">Option</a>] | None = None,<br>selected_date_time: int | None = None,<br>timezone: str | None = None,<br>rich_text_value: <a title="slack_sdk.models.blocks.blocks.RichTextBlock" href="../blocks/blocks.html#slack_sdk.models.blocks.blocks.RichTextBlock">RichTextBlock</a> | dict | None = None,<br>files: Sequence[dict] | None = None,<br>**kwargs)</span>
320320
</code></dt>
321321
<dd>
322322
<details class="source">
@@ -337,6 +337,10 @@ <h3>Inherited members</h3>
337337
&#34;selected_channels&#34;,
338338
&#34;selected_users&#34;,
339339
&#34;selected_options&#34;,
340+
&#34;selected_date_time&#34;,
341+
&#34;timezone&#34;,
342+
&#34;rich_text_value&#34;,
343+
&#34;files&#34;,
340344
}
341345

342346
def __init__(
@@ -354,6 +358,11 @@ <h3>Inherited members</h3>
354358
selected_channels: Optional[Sequence[str]] = None,
355359
selected_users: Optional[Sequence[str]] = None,
356360
selected_options: Optional[Sequence[Union[dict, Option]]] = None,
361+
selected_date_time: Optional[int] = None,
362+
timezone: Optional[str] = None,
363+
rich_text_value: Optional[Union[dict, RichTextBlock]] = None,
364+
files: Optional[Sequence[dict]] = None,
365+
**kwargs,
357366
):
358367
self.type = type
359368
self.value = value
@@ -366,6 +375,10 @@ <h3>Inherited members</h3>
366375
self.selected_conversations = selected_conversations
367376
self.selected_channels = selected_channels
368377
self.selected_users = selected_users
378+
self.selected_date_time = selected_date_time
379+
self.timezone = timezone
380+
self.rich_text_value = rich_text_value
381+
self.files = files
369382

370383
if isinstance(selected_options, list):
371384
self.selected_options = []
@@ -375,7 +388,8 @@ <h3>Inherited members</h3>
375388
elif isinstance(option, dict):
376389
self.selected_options.append(Option(**option))
377390
else:
378-
self.selected_options = selected_options # type: ignore[assignment]</code></pre>
391+
self.selected_options = selected_options # type: ignore[assignment]
392+
self.additional_attributes = kwargs</code></pre>
379393
</details>
380394
<div class="desc"><p>The base class for JSON serializable class objects.</p></div>
381395
<h3>Ancestors</h3>

‎docs/reference/oauth/installation_store/async_cacheable_installation_store.html‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ <h2 class="section-title" id="header-classes">Classes</h2>
7979
key = f&#34;{installation.enterprise_id or &#39;&#39;}-{installation.team_id or &#39;&#39;}&#34;
8080
if key in self.cached_bots:
8181
self.cached_bots.pop(key)
82-
key = f&#34;{installation.enterprise_id or &#39;&#39;}-{installation.team_id or &#39;&#39;}-{installation.user_id or &#39;&#39;}&#34;
83-
if key in self.cached_installations:
84-
self.cached_installations.pop(key)
82+
key_prefix = f&#34;{installation.enterprise_id or &#39;&#39;}-{installation.team_id or &#39;&#39;}-&#34;
83+
for key in list(self.cached_installations.keys()):
84+
if key.startswith(key_prefix):
85+
self.cached_installations.pop(key)
8586
return await self.underlying.async_save(installation)
8687

8788
async def async_save_bot(self, bot: Bot):

‎docs/reference/oauth/installation_store/cacheable_installation_store.html‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ <h2 class="section-title" id="header-classes">Classes</h2>
7979
key = f&#34;{installation.enterprise_id or &#39;&#39;}-{installation.team_id or &#39;&#39;}&#34;
8080
if key in self.cached_bots:
8181
self.cached_bots.pop(key)
82-
key = f&#34;{installation.enterprise_id or &#39;&#39;}-{installation.team_id or &#39;&#39;}-{installation.user_id or &#39;&#39;}&#34;
83-
if key in self.cached_installations:
84-
self.cached_installations.pop(key)
82+
key_prefix = f&#34;{installation.enterprise_id or &#39;&#39;}-{installation.team_id or &#39;&#39;}-&#34;
83+
for key in list(self.cached_installations.keys()):
84+
if key.startswith(key_prefix):
85+
self.cached_installations.pop(key)
8586

8687
return self.underlying.save(installation)
8788

‎docs/reference/oauth/installation_store/sqlite3/index.html‎

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
579579
self.logger.warning(message)
580580
return None
581581

582+
async def async_delete_bot(self, *, enterprise_id: Optional[str], team_id: Optional[str]) -&gt; None:
583+
return self.delete_bot(enterprise_id=enterprise_id, team_id=team_id)
584+
582585
def delete_bot(self, *, enterprise_id: Optional[str], team_id: Optional[str]) -&gt; None:
583586
try:
584587
with self.connect() as conn:
@@ -604,6 +607,15 @@ <h2 class="section-title" id="header-classes">Classes</h2>
604607
else:
605608
self.logger.warning(message)
606609

610+
async def async_delete_installation(
611+
self,
612+
*,
613+
enterprise_id: Optional[str],
614+
team_id: Optional[str],
615+
user_id: Optional[str] = None,
616+
) -&gt; None:
617+
return self.delete_installation(enterprise_id=enterprise_id, team_id=team_id, user_id=user_id)
618+
607619
def delete_installation(
608620
self,
609621
*,
@@ -626,7 +638,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
626638
and
627639
team_id = ?
628640
&#34;&#34;&#34;,
629-
[self.client_id, enterprise_id or &#34;&#34;, team_id],
641+
[self.client_id, enterprise_id or &#34;&#34;, team_id or &#34;&#34;],
630642
)
631643
else:
632644
conn.execute(
@@ -643,7 +655,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
643655
and
644656
user_id = ?
645657
&#34;&#34;&#34;,
646-
[self.client_id, enterprise_id or &#34;&#34;, team_id, user_id],
658+
[self.client_id, enterprise_id or &#34;&#34;, team_id or &#34;&#34;, user_id],
647659
)
648660
conn.commit()
649661
except Exception as e:
@@ -828,10 +840,18 @@ <h3>Inherited members</h3>
828840
</li>
829841
<li><code><b><a title="slack_sdk.oauth.installation_store.installation_store.InstallationStore" href="../installation_store.html#slack_sdk.oauth.installation_store.installation_store.InstallationStore">InstallationStore</a></b></code>:
830842
<ul class="hlist">
831-
<li><code><a title="slack_sdk.oauth.installation_store.installation_store.InstallationStore.delete_all" href="../installation_store.html#slack_sdk.oauth.installation_store.installation_store.InstallationStore.delete_all">delete_all</a></code></li>
843+
<li><code><a title="slack_sdk.oauth.installation_store.installation_store.InstallationStore.find_installation" href="../installation_store.html#slack_sdk.oauth.installation_store.installation_store.InstallationStore.find_installation">find_installation</a></code></li>
844+
</ul>
845+
</li>
846+
<li><code><b><a title="slack_sdk.oauth.installation_store.installation_store.InstallationStore" href="../installation_store.html#slack_sdk.oauth.installation_store.installation_store.InstallationStore">InstallationStore</a></b></code>:
847+
<ul class="hlist">
832848
<li><code><a title="slack_sdk.oauth.installation_store.installation_store.InstallationStore.delete_bot" href="../installation_store.html#slack_sdk.oauth.installation_store.installation_store.InstallationStore.delete_bot">delete_bot</a></code></li>
849+
</ul>
850+
</li>
851+
<li><code><b><a title="slack_sdk.oauth.installation_store.installation_store.InstallationStore" href="../installation_store.html#slack_sdk.oauth.installation_store.installation_store.InstallationStore">InstallationStore</a></b></code>:
852+
<ul class="hlist">
853+
<li><code><a title="slack_sdk.oauth.installation_store.installation_store.InstallationStore.delete_all" href="../installation_store.html#slack_sdk.oauth.installation_store.installation_store.InstallationStore.delete_all">delete_all</a></code></li>
833854
<li><code><a title="slack_sdk.oauth.installation_store.installation_store.InstallationStore.delete_installation" href="../installation_store.html#slack_sdk.oauth.installation_store.installation_store.InstallationStore.delete_installation">delete_installation</a></code></li>
834-
<li><code><a title="slack_sdk.oauth.installation_store.installation_store.InstallationStore.find_installation" href="../installation_store.html#slack_sdk.oauth.installation_store.installation_store.InstallationStore.find_installation">find_installation</a></code></li>
835855
</ul>
836856
</li>
837857
<li><code><b><a title="slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore" href="../async_installation_store.html#slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore">AsyncInstallationStore</a></b></code>:
@@ -852,11 +872,19 @@ <h3>Inherited members</h3>
852872
</li>
853873
<li><code><b><a title="slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore" href="../async_installation_store.html#slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore">AsyncInstallationStore</a></b></code>:
854874
<ul class="hlist">
855-
<li><code><a title="slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore.async_delete_all" href="../async_installation_store.html#slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore.async_delete_all">async_delete_all</a></code></li>
856875
<li><code><a title="slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore.async_delete_bot" href="../async_installation_store.html#slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore.async_delete_bot">async_delete_bot</a></code></li>
876+
</ul>
877+
</li>
878+
<li><code><b><a title="slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore" href="../async_installation_store.html#slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore">AsyncInstallationStore</a></b></code>:
879+
<ul class="hlist">
857880
<li><code><a title="slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore.async_delete_installation" href="../async_installation_store.html#slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore.async_delete_installation">async_delete_installation</a></code></li>
858881
</ul>
859882
</li>
883+
<li><code><b><a title="slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore" href="../async_installation_store.html#slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore">AsyncInstallationStore</a></b></code>:
884+
<ul class="hlist">
885+
<li><code><a title="slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore.async_delete_all" href="../async_installation_store.html#slack_sdk.oauth.installation_store.async_installation_store.AsyncInstallationStore.async_delete_all">async_delete_all</a></code></li>
886+
</ul>
887+
</li>
860888
</ul>
861889
</dd>
862890
</dl>

0 commit comments

Comments
 (0)