Skip to content

Commit 60b02d6

Browse files
committed
version 3.27.0
1 parent 74febaf commit 60b02d6

File tree

10 files changed

+1149
-82
lines changed

10 files changed

+1149
-82
lines changed

docs/api-docs/slack_sdk/audit_logs/v1/logs.html

Lines changed: 964 additions & 30 deletions
Large diffs are not rendered by default.

docs/api-docs/slack_sdk/models/basic_objects.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ <h3>Subclasses</h3>
292292
<li><a title="slack_sdk.models.blocks.basic_components.DispatchActionConfig" href="blocks/basic_components.html#slack_sdk.models.blocks.basic_components.DispatchActionConfig">DispatchActionConfig</a></li>
293293
<li><a title="slack_sdk.models.blocks.basic_components.Option" href="blocks/basic_components.html#slack_sdk.models.blocks.basic_components.Option">Option</a></li>
294294
<li><a title="slack_sdk.models.blocks.basic_components.OptionGroup" href="blocks/basic_components.html#slack_sdk.models.blocks.basic_components.OptionGroup">OptionGroup</a></li>
295+
<li><a title="slack_sdk.models.blocks.basic_components.SlackFile" href="blocks/basic_components.html#slack_sdk.models.blocks.basic_components.SlackFile">SlackFile</a></li>
295296
<li><a title="slack_sdk.models.blocks.basic_components.TextObject" href="blocks/basic_components.html#slack_sdk.models.blocks.basic_components.TextObject">TextObject</a></li>
296297
<li><a title="slack_sdk.models.blocks.basic_components.Workflow" href="blocks/basic_components.html#slack_sdk.models.blocks.basic_components.Workflow">Workflow</a></li>
297298
<li><a title="slack_sdk.models.blocks.basic_components.WorkflowTrigger" href="blocks/basic_components.html#slack_sdk.models.blocks.basic_components.WorkflowTrigger">WorkflowTrigger</a></li>

docs/api-docs/slack_sdk/models/blocks/basic_components.html

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,35 @@ <h1 class="title">Module <code>slack_sdk.models.blocks.basic_components</code></
586586
json[&#34;trigger&#34;] = self._trigger.to_dict()
587587
else:
588588
json[&#34;trigger&#34;] = self._trigger
589+
return json
590+
591+
592+
class SlackFile(JsonObject):
593+
attributes = {&#34;id&#34;, &#34;url&#34;}
594+
595+
def __init__(
596+
self,
597+
*,
598+
id: Optional[str] = None,
599+
url: Optional[str] = None,
600+
):
601+
&#34;&#34;&#34;An object containing Slack file information to be used in an image block or image element.
602+
https://api.slack.com/reference/block-kit/composition-objects#slack_file
603+
604+
Args:
605+
id: Slack ID of the file.
606+
url: This URL can be the url_private or the permalink of the Slack file.
607+
&#34;&#34;&#34;
608+
self._id = id
609+
self._url = url
610+
611+
def to_dict(self) -&gt; Dict[str, Any]: # skipcq: PYL-W0221
612+
self.validate_json()
613+
json = {}
614+
if self._id is not None:
615+
json[&#34;id&#34;] = self._id
616+
if self._url is not None:
617+
json[&#34;url&#34;] = self._url
589618
return json</code></pre>
590619
</details>
591620
</section>
@@ -1706,6 +1735,70 @@ <h3>Inherited members</h3>
17061735
</li>
17071736
</ul>
17081737
</dd>
1738+
<dt id="slack_sdk.models.blocks.basic_components.SlackFile"><code class="flex name class">
1739+
<span>class <span class="ident">SlackFile</span></span>
1740+
<span>(</span><span>*, id: Optional[str] = None, url: Optional[str] = None)</span>
1741+
</code></dt>
1742+
<dd>
1743+
<div class="desc"><p>The base class for JSON serializable class objects</p>
1744+
<p>An object containing Slack file information to be used in an image block or image element.
1745+
<a href="https://api.slack.com/reference/block-kit/composition-objects#slack_file">https://api.slack.com/reference/block-kit/composition-objects#slack_file</a></p>
1746+
<h2 id="args">Args</h2>
1747+
<dl>
1748+
<dt><strong><code>id</code></strong></dt>
1749+
<dd>Slack ID of the file.</dd>
1750+
<dt><strong><code>url</code></strong></dt>
1751+
<dd>This URL can be the url_private or the permalink of the Slack file.</dd>
1752+
</dl></div>
1753+
<details class="source">
1754+
<summary>
1755+
<span>Expand source code</span>
1756+
</summary>
1757+
<pre><code class="python">class SlackFile(JsonObject):
1758+
attributes = {&#34;id&#34;, &#34;url&#34;}
1759+
1760+
def __init__(
1761+
self,
1762+
*,
1763+
id: Optional[str] = None,
1764+
url: Optional[str] = None,
1765+
):
1766+
&#34;&#34;&#34;An object containing Slack file information to be used in an image block or image element.
1767+
https://api.slack.com/reference/block-kit/composition-objects#slack_file
1768+
1769+
Args:
1770+
id: Slack ID of the file.
1771+
url: This URL can be the url_private or the permalink of the Slack file.
1772+
&#34;&#34;&#34;
1773+
self._id = id
1774+
self._url = url
1775+
1776+
def to_dict(self) -&gt; Dict[str, Any]: # skipcq: PYL-W0221
1777+
self.validate_json()
1778+
json = {}
1779+
if self._id is not None:
1780+
json[&#34;id&#34;] = self._id
1781+
if self._url is not None:
1782+
json[&#34;url&#34;] = self._url
1783+
return json</code></pre>
1784+
</details>
1785+
<h3>Ancestors</h3>
1786+
<ul class="hlist">
1787+
<li><a title="slack_sdk.models.basic_objects.JsonObject" href="../basic_objects.html#slack_sdk.models.basic_objects.JsonObject">JsonObject</a></li>
1788+
<li><a title="slack_sdk.models.basic_objects.BaseObject" href="../basic_objects.html#slack_sdk.models.basic_objects.BaseObject">BaseObject</a></li>
1789+
</ul>
1790+
<h3>Inherited members</h3>
1791+
<ul class="hlist">
1792+
<li><code><b><a title="slack_sdk.models.basic_objects.JsonObject" href="../basic_objects.html#slack_sdk.models.basic_objects.JsonObject">JsonObject</a></b></code>:
1793+
<ul class="hlist">
1794+
<li><code><a title="slack_sdk.models.basic_objects.JsonObject.attributes" href="../basic_objects.html#slack_sdk.models.basic_objects.JsonObject.attributes">attributes</a></code></li>
1795+
<li><code><a title="slack_sdk.models.basic_objects.JsonObject.get_non_null_attributes" href="../basic_objects.html#slack_sdk.models.basic_objects.JsonObject.get_non_null_attributes">get_non_null_attributes</a></code></li>
1796+
<li><code><a title="slack_sdk.models.basic_objects.JsonObject.to_dict" href="../basic_objects.html#slack_sdk.models.basic_objects.JsonObject.to_dict">to_dict</a></code></li>
1797+
<li><code><a title="slack_sdk.models.basic_objects.JsonObject.validate_json" href="../basic_objects.html#slack_sdk.models.basic_objects.JsonObject.validate_json">validate_json</a></code></li>
1798+
</ul>
1799+
</li>
1800+
</ul>
1801+
</dd>
17091802
<dt id="slack_sdk.models.blocks.basic_components.TextObject"><code class="flex name class">
17101803
<span>class <span class="ident">TextObject</span></span>
17111804
<span>(</span><span>text: str, type: Optional[str] = None, subtype: Optional[str] = None, emoji: Optional[bool] = None, **kwargs)</span>
@@ -2022,6 +2115,9 @@ <h4><code><a title="slack_sdk.models.blocks.basic_components.PlainTextObject" hr
20222115
</ul>
20232116
</li>
20242117
<li>
2118+
<h4><code><a title="slack_sdk.models.blocks.basic_components.SlackFile" href="#slack_sdk.models.blocks.basic_components.SlackFile">SlackFile</a></code></h4>
2119+
</li>
2120+
<li>
20252121
<h4><code><a title="slack_sdk.models.blocks.basic_components.TextObject" href="#slack_sdk.models.blocks.basic_components.TextObject">TextObject</a></code></h4>
20262122
<ul class="">
20272123
<li><code><a title="slack_sdk.models.blocks.basic_components.TextObject.logger" href="#slack_sdk.models.blocks.basic_components.TextObject.logger">logger</a></code></li>

docs/api-docs/slack_sdk/models/blocks/block_elements.html

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h1 class="title">Module <code>slack_sdk.models.blocks.block_elements</code></h1
3939
JsonValidator,
4040
EnumValidator,
4141
)
42-
from .basic_components import ButtonStyles, Workflow
42+
from .basic_components import ButtonStyles, Workflow, SlackFile
4343
from .basic_components import ConfirmObject
4444
from .basic_components import DispatchActionConfig
4545
from .basic_components import MarkdownTextObject
@@ -579,13 +579,14 @@ <h1 class="title">Module <code>slack_sdk.models.blocks.block_elements</code></h1
579579

580580
@property
581581
def attributes(self) -&gt; Set[str]:
582-
return super().attributes.union({&#34;alt_text&#34;, &#34;image_url&#34;})
582+
return super().attributes.union({&#34;alt_text&#34;, &#34;image_url&#34;, &#34;slack_file&#34;})
583583

584584
def __init__(
585585
self,
586586
*,
587-
image_url: Optional[str] = None,
588587
alt_text: Optional[str] = None,
588+
image_url: Optional[str] = None,
589+
slack_file: Optional[Union[Dict[str, Any], SlackFile]] = None,
589590
**others: dict,
590591
):
591592
&#34;&#34;&#34;An element to insert an image - this element can be used in section and
@@ -594,18 +595,20 @@ <h1 class="title">Module <code>slack_sdk.models.blocks.block_elements</code></h1
594595
https://api.slack.com/reference/block-kit/block-elements#image
595596

596597
Args:
597-
image_url (required): The URL of the image to be displayed.
598598
alt_text (required): A plain-text summary of the image. This should not contain any markup.
599+
image_url: The URL of the image to be displayed.
600+
slack_file: A Slack image file object that defines the source of the image.
599601
&#34;&#34;&#34;
600602
super().__init__(type=self.type)
601603
show_unknown_key_warning(self, others)
602604

603605
self.image_url = image_url
604606
self.alt_text = alt_text
607+
self.slack_file = slack_file if slack_file is None or isinstance(slack_file, SlackFile) else SlackFile(**slack_file)
605608

606609
@JsonValidator(f&#34;image_url attribute cannot exceed {image_url_max_length} characters&#34;)
607610
def _validate_image_url_length(self) -&gt; bool:
608-
return len(self.image_url) &lt;= self.image_url_max_length
611+
return self.image_url is None or len(self.image_url) &lt;= self.image_url_max_length
609612

610613
@JsonValidator(f&#34;alt_text attribute cannot exceed {alt_text_max_length} characters&#34;)
611614
def _validate_alt_text_length(self) -&gt; bool:
@@ -3974,7 +3977,7 @@ <h3>Inherited members</h3>
39743977
</dd>
39753978
<dt id="slack_sdk.models.blocks.block_elements.ImageElement"><code class="flex name class">
39763979
<span>class <span class="ident">ImageElement</span></span>
3977-
<span>(</span><span>*, image_url: Optional[str] = None, alt_text: Optional[str] = None, **others: dict)</span>
3980+
<span>(</span><span>*, alt_text: Optional[str] = None, image_url: Optional[str] = None, slack_file: Union[Dict[str, Any], <a title="slack_sdk.models.blocks.basic_components.SlackFile" href="basic_components.html#slack_sdk.models.blocks.basic_components.SlackFile">SlackFile</a>, ForwardRef(None)] = None, **others: dict)</span>
39783981
</code></dt>
39793982
<dd>
39803983
<div class="desc"><p>Block Elements are things that exists inside of your Blocks.
@@ -3985,10 +3988,12 @@ <h3>Inherited members</h3>
39853988
<a href="https://api.slack.com/reference/block-kit/block-elements#image">https://api.slack.com/reference/block-kit/block-elements#image</a></p>
39863989
<h2 id="args">Args</h2>
39873990
<dl>
3988-
<dt><strong><code>image_url</code></strong> :&ensp;<code>required</code></dt>
3989-
<dd>The URL of the image to be displayed.</dd>
39903991
<dt><strong><code>alt_text</code></strong> :&ensp;<code>required</code></dt>
39913992
<dd>A plain-text summary of the image. This should not contain any markup.</dd>
3993+
<dt><strong><code>image_url</code></strong></dt>
3994+
<dd>The URL of the image to be displayed.</dd>
3995+
<dt><strong><code>slack_file</code></strong></dt>
3996+
<dd>A Slack image file object that defines the source of the image.</dd>
39923997
</dl></div>
39933998
<details class="source">
39943999
<summary>
@@ -4001,13 +4006,14 @@ <h2 id="args">Args</h2>
40014006

40024007
@property
40034008
def attributes(self) -&gt; Set[str]:
4004-
return super().attributes.union({&#34;alt_text&#34;, &#34;image_url&#34;})
4009+
return super().attributes.union({&#34;alt_text&#34;, &#34;image_url&#34;, &#34;slack_file&#34;})
40054010

40064011
def __init__(
40074012
self,
40084013
*,
4009-
image_url: Optional[str] = None,
40104014
alt_text: Optional[str] = None,
4015+
image_url: Optional[str] = None,
4016+
slack_file: Optional[Union[Dict[str, Any], SlackFile]] = None,
40114017
**others: dict,
40124018
):
40134019
&#34;&#34;&#34;An element to insert an image - this element can be used in section and
@@ -4016,18 +4022,20 @@ <h2 id="args">Args</h2>
40164022
https://api.slack.com/reference/block-kit/block-elements#image
40174023

40184024
Args:
4019-
image_url (required): The URL of the image to be displayed.
40204025
alt_text (required): A plain-text summary of the image. This should not contain any markup.
4026+
image_url: The URL of the image to be displayed.
4027+
slack_file: A Slack image file object that defines the source of the image.
40214028
&#34;&#34;&#34;
40224029
super().__init__(type=self.type)
40234030
show_unknown_key_warning(self, others)
40244031

40254032
self.image_url = image_url
40264033
self.alt_text = alt_text
4034+
self.slack_file = slack_file if slack_file is None or isinstance(slack_file, SlackFile) else SlackFile(**slack_file)
40274035

40284036
@JsonValidator(f&#34;image_url attribute cannot exceed {image_url_max_length} characters&#34;)
40294037
def _validate_image_url_length(self) -&gt; bool:
4030-
return len(self.image_url) &lt;= self.image_url_max_length
4038+
return self.image_url is None or len(self.image_url) &lt;= self.image_url_max_length
40314039

40324040
@JsonValidator(f&#34;alt_text attribute cannot exceed {alt_text_max_length} characters&#34;)
40334041
def _validate_alt_text_length(self) -&gt; bool:
@@ -4067,7 +4075,7 @@ <h3>Instance variables</h3>
40674075
</summary>
40684076
<pre><code class="python">@property
40694077
def attributes(self) -&gt; Set[str]:
4070-
return super().attributes.union({&#34;alt_text&#34;, &#34;image_url&#34;})</code></pre>
4078+
return super().attributes.union({&#34;alt_text&#34;, &#34;image_url&#34;, &#34;slack_file&#34;})</code></pre>
40714079
</details>
40724080
</dd>
40734081
</dl>

0 commit comments

Comments
 (0)