Skip to content

Commit

Permalink
verison 1.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Apr 26, 2023
1 parent 9970748 commit 515684e
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 9 deletions.
69 changes: 65 additions & 4 deletions docs/api-docs/slack_bolt/authorization/authorize_result.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,16 @@ <h1 class="title">Module <code>slack_bolt.authorization.authorize_result</code><

enterprise_id: Optional[str]
team_id: Optional[str]
team: Optional[str] # since v1.18
url: Optional[str] # since v1.18

bot_id: Optional[str]
bot_user_id: Optional[str]
bot_token: Optional[str]
bot_scopes: Optional[List[str]] # since v1.17

user_id: Optional[str]
user: Optional[str] # since v1.18
user_token: Optional[str]
user_scopes: Optional[List[str]] # since v1.17

Expand All @@ -49,30 +54,38 @@ <h1 class="title">Module <code>slack_bolt.authorization.authorize_result</code><
*,
enterprise_id: Optional[str],
team_id: Optional[str],
team: Optional[str] = None,
url: Optional[str] = None,
# bot
bot_user_id: Optional[str] = None,
bot_id: Optional[str] = None,
bot_token: Optional[str] = None,
bot_scopes: Optional[Union[List[str], str]] = None,
# user
user_id: Optional[str] = None,
user: Optional[str] = None,
user_token: Optional[str] = None,
user_scopes: Optional[Union[List[str], str]] = None,
):
&#34;&#34;&#34;
Args:
enterprise_id: Organization ID (Enterprise Grid) starting with `E`
team_id: Workspace ID starting with `T`
team: Workspace name
url: Workspace slack.com URL
bot_user_id: Bot user&#39;s User ID starting with either `U` or `W`
bot_id: Bot ID starting with `B`
bot_token: Bot user access token starting with `xoxb-`
bot_scopes: The scopes associated with the bot token
user_id: The request user ID
user: The request user&#39;s name
user_token: User access token starting with `xoxp-`
user_scopes: The scopes associated wth the user token
&#34;&#34;&#34;
self[&#34;enterprise_id&#34;] = self.enterprise_id = enterprise_id
self[&#34;team_id&#34;] = self.team_id = team_id
self[&#34;team&#34;] = self.team = team
self[&#34;url&#34;] = self.url = url
# bot
self[&#34;bot_user_id&#34;] = self.bot_user_id = bot_user_id
self[&#34;bot_id&#34;] = self.bot_id = bot_id
Expand All @@ -82,6 +95,7 @@ <h1 class="title">Module <code>slack_bolt.authorization.authorize_result</code><
self[&#34;bot_scopes&#34;] = self.bot_scopes = bot_scopes # type: ignore
# user
self[&#34;user_id&#34;] = self.user_id = user_id
self[&#34;user&#34;] = self.user = user
self[&#34;user_token&#34;] = self.user_token = user_token
if user_scopes is not None and isinstance(user_scopes, str):
user_scopes = [scope.strip() for scope in user_scopes.split(&#34;,&#34;)]
Expand All @@ -104,17 +118,21 @@ <h1 class="title">Module <code>slack_bolt.authorization.authorize_result</code><
user_id: Optional[str] = ( # type:ignore
auth_test_response.get(&#34;user_id&#34;) if auth_test_response.get(&#34;bot_id&#34;) is None else None
)
# Since v1.28, user_id can be set when user_token w/ its auth.test response exists
user_name = auth_test_response.get(&#34;user&#34;)
if user_id is None and user_auth_test_response is not None:
user_id: Optional[str] = user_auth_test_response.get(&#34;user_id&#34;) # type:ignore
user_name: Optional[str] = user_auth_test_response.get(&#34;user&#34;) # type:ignore

return AuthorizeResult(
enterprise_id=auth_test_response.get(&#34;enterprise_id&#34;),
team_id=auth_test_response.get(&#34;team_id&#34;),
team=auth_test_response.get(&#34;team&#34;),
url=auth_test_response.get(&#34;url&#34;),
bot_id=auth_test_response.get(&#34;bot_id&#34;),
bot_user_id=bot_user_id,
bot_scopes=bot_scopes,
user_id=user_id,
user=user_name,
bot_token=bot_token,
user_token=user_token,
user_scopes=user_scopes,
Expand All @@ -132,7 +150,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="slack_bolt.authorization.authorize_result.AuthorizeResult"><code class="flex name class">
<span>class <span class="ident">AuthorizeResult</span></span>
<span>(</span><span>*, enterprise_id: Optional[str], team_id: Optional[str], bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_id: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None)</span>
<span>(</span><span>*, enterprise_id: Optional[str], team_id: Optional[str], team: Optional[str] = None, url: Optional[str] = None, bot_user_id: Optional[str] = None, bot_id: Optional[str] = None, bot_token: Optional[str] = None, bot_scopes: Union[List[str], str, ForwardRef(None)] = None, user_id: Optional[str] = None, user: Optional[str] = None, user_token: Optional[str] = None, user_scopes: Union[List[str], str, ForwardRef(None)] = None)</span>
</code></dt>
<dd>
<div class="desc"><p>Authorize function call result</p>
Expand All @@ -142,6 +160,10 @@ <h2 id="args">Args</h2>
<dd>Organization ID (Enterprise Grid) starting with <code>E</code></dd>
<dt><strong><code>team_id</code></strong></dt>
<dd>Workspace ID starting with <code>T</code></dd>
<dt><strong><code>team</code></strong></dt>
<dd>Workspace name</dd>
<dt><strong><code>url</code></strong></dt>
<dd>Workspace slack.com URL</dd>
<dt><strong><code>bot_user_id</code></strong></dt>
<dd>Bot user's User ID starting with either <code>U</code> or <code>W</code></dd>
<dt><strong><code>bot_id</code></strong></dt>
Expand All @@ -152,6 +174,8 @@ <h2 id="args">Args</h2>
<dd>The scopes associated with the bot token</dd>
<dt><strong><code>user_id</code></strong></dt>
<dd>The request user ID</dd>
<dt><strong><code>user</code></strong></dt>
<dd>The request user's name</dd>
<dt><strong><code>user_token</code></strong></dt>
<dd>User access token starting with <code>xoxp-</code></dd>
<dt><strong><code>user_scopes</code></strong></dt>
Expand All @@ -166,11 +190,16 @@ <h2 id="args">Args</h2>

enterprise_id: Optional[str]
team_id: Optional[str]
team: Optional[str] # since v1.18
url: Optional[str] # since v1.18

bot_id: Optional[str]
bot_user_id: Optional[str]
bot_token: Optional[str]
bot_scopes: Optional[List[str]] # since v1.17

user_id: Optional[str]
user: Optional[str] # since v1.18
user_token: Optional[str]
user_scopes: Optional[List[str]] # since v1.17

Expand All @@ -179,30 +208,38 @@ <h2 id="args">Args</h2>
*,
enterprise_id: Optional[str],
team_id: Optional[str],
team: Optional[str] = None,
url: Optional[str] = None,
# bot
bot_user_id: Optional[str] = None,
bot_id: Optional[str] = None,
bot_token: Optional[str] = None,
bot_scopes: Optional[Union[List[str], str]] = None,
# user
user_id: Optional[str] = None,
user: Optional[str] = None,
user_token: Optional[str] = None,
user_scopes: Optional[Union[List[str], str]] = None,
):
&#34;&#34;&#34;
Args:
enterprise_id: Organization ID (Enterprise Grid) starting with `E`
team_id: Workspace ID starting with `T`
team: Workspace name
url: Workspace slack.com URL
bot_user_id: Bot user&#39;s User ID starting with either `U` or `W`
bot_id: Bot ID starting with `B`
bot_token: Bot user access token starting with `xoxb-`
bot_scopes: The scopes associated with the bot token
user_id: The request user ID
user: The request user&#39;s name
user_token: User access token starting with `xoxp-`
user_scopes: The scopes associated wth the user token
&#34;&#34;&#34;
self[&#34;enterprise_id&#34;] = self.enterprise_id = enterprise_id
self[&#34;team_id&#34;] = self.team_id = team_id
self[&#34;team&#34;] = self.team = team
self[&#34;url&#34;] = self.url = url
# bot
self[&#34;bot_user_id&#34;] = self.bot_user_id = bot_user_id
self[&#34;bot_id&#34;] = self.bot_id = bot_id
Expand All @@ -212,6 +249,7 @@ <h2 id="args">Args</h2>
self[&#34;bot_scopes&#34;] = self.bot_scopes = bot_scopes # type: ignore
# user
self[&#34;user_id&#34;] = self.user_id = user_id
self[&#34;user&#34;] = self.user = user
self[&#34;user_token&#34;] = self.user_token = user_token
if user_scopes is not None and isinstance(user_scopes, str):
user_scopes = [scope.strip() for scope in user_scopes.split(&#34;,&#34;)]
Expand All @@ -234,17 +272,21 @@ <h2 id="args">Args</h2>
user_id: Optional[str] = ( # type:ignore
auth_test_response.get(&#34;user_id&#34;) if auth_test_response.get(&#34;bot_id&#34;) is None else None
)
# Since v1.28, user_id can be set when user_token w/ its auth.test response exists
user_name = auth_test_response.get(&#34;user&#34;)
if user_id is None and user_auth_test_response is not None:
user_id: Optional[str] = user_auth_test_response.get(&#34;user_id&#34;) # type:ignore
user_name: Optional[str] = user_auth_test_response.get(&#34;user&#34;) # type:ignore

return AuthorizeResult(
enterprise_id=auth_test_response.get(&#34;enterprise_id&#34;),
team_id=auth_test_response.get(&#34;team_id&#34;),
team=auth_test_response.get(&#34;team&#34;),
url=auth_test_response.get(&#34;url&#34;),
bot_id=auth_test_response.get(&#34;bot_id&#34;),
bot_user_id=bot_user_id,
bot_scopes=bot_scopes,
user_id=user_id,
user=user_name,
bot_token=bot_token,
user_token=user_token,
user_scopes=user_scopes,
Expand Down Expand Up @@ -276,10 +318,22 @@ <h3>Class variables</h3>
<dd>
<div class="desc"></div>
</dd>
<dt id="slack_bolt.authorization.authorize_result.AuthorizeResult.team"><code class="name">var <span class="ident">team</span> : Optional[str]</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="slack_bolt.authorization.authorize_result.AuthorizeResult.team_id"><code class="name">var <span class="ident">team_id</span> : Optional[str]</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="slack_bolt.authorization.authorize_result.AuthorizeResult.url"><code class="name">var <span class="ident">url</span> : Optional[str]</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="slack_bolt.authorization.authorize_result.AuthorizeResult.user"><code class="name">var <span class="ident">user</span> : Optional[str]</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="slack_bolt.authorization.authorize_result.AuthorizeResult.user_id"><code class="name">var <span class="ident">user_id</span> : Optional[str]</code></dt>
<dd>
<div class="desc"></div>
Expand Down Expand Up @@ -321,17 +375,21 @@ <h3>Static methods</h3>
user_id: Optional[str] = ( # type:ignore
auth_test_response.get(&#34;user_id&#34;) if auth_test_response.get(&#34;bot_id&#34;) is None else None
)
# Since v1.28, user_id can be set when user_token w/ its auth.test response exists
user_name = auth_test_response.get(&#34;user&#34;)
if user_id is None and user_auth_test_response is not None:
user_id: Optional[str] = user_auth_test_response.get(&#34;user_id&#34;) # type:ignore
user_name: Optional[str] = user_auth_test_response.get(&#34;user&#34;) # type:ignore

return AuthorizeResult(
enterprise_id=auth_test_response.get(&#34;enterprise_id&#34;),
team_id=auth_test_response.get(&#34;team_id&#34;),
team=auth_test_response.get(&#34;team&#34;),
url=auth_test_response.get(&#34;url&#34;),
bot_id=auth_test_response.get(&#34;bot_id&#34;),
bot_user_id=bot_user_id,
bot_scopes=bot_scopes,
user_id=user_id,
user=user_name,
bot_token=bot_token,
user_token=user_token,
user_scopes=user_scopes,
Expand Down Expand Up @@ -365,7 +423,10 @@ <h4><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult" h
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.bot_user_id" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.bot_user_id">bot_user_id</a></code></li>
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.enterprise_id" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.enterprise_id">enterprise_id</a></code></li>
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.from_auth_test_response" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.from_auth_test_response">from_auth_test_response</a></code></li>
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.team" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.team">team</a></code></li>
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.team_id" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.team_id">team_id</a></code></li>
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.url" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.url">url</a></code></li>
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.user" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.user">user</a></code></li>
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.user_id" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.user_id">user_id</a></code></li>
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.user_scopes" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.user_scopes">user_scopes</a></code></li>
<li><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult.user_token" href="#slack_bolt.authorization.authorize_result.AuthorizeResult.user_token">user_token</a></code></li>
Expand Down
Loading

0 comments on commit 515684e

Please sign in to comment.