@@ -36,11 +36,16 @@ <h1 class="title">Module <code>slack_bolt.authorization.authorize_result</code><
3636
3737 enterprise_id: Optional[str]
3838 team_id: Optional[str]
39+ team: Optional[str] # since v1.18
40+ url: Optional[str] # since v1.18
41+
3942 bot_id: Optional[str]
4043 bot_user_id: Optional[str]
4144 bot_token: Optional[str]
4245 bot_scopes: Optional[List[str]] # since v1.17
46+
4347 user_id: Optional[str]
48+ user: Optional[str] # since v1.18
4449 user_token: Optional[str]
4550 user_scopes: Optional[List[str]] # since v1.17
4651
@@ -49,30 +54,38 @@ <h1 class="title">Module <code>slack_bolt.authorization.authorize_result</code><
4954 *,
5055 enterprise_id: Optional[str],
5156 team_id: Optional[str],
57+ team: Optional[str] = None,
58+ url: Optional[str] = None,
5259 # bot
5360 bot_user_id: Optional[str] = None,
5461 bot_id: Optional[str] = None,
5562 bot_token: Optional[str] = None,
5663 bot_scopes: Optional[Union[List[str], str]] = None,
5764 # user
5865 user_id: Optional[str] = None,
66+ user: Optional[str] = None,
5967 user_token: Optional[str] = None,
6068 user_scopes: Optional[Union[List[str], str]] = None,
6169 ):
6270 """
6371 Args:
6472 enterprise_id: Organization ID (Enterprise Grid) starting with `E`
6573 team_id: Workspace ID starting with `T`
74+ team: Workspace name
75+ url: Workspace slack.com URL
6676 bot_user_id: Bot user's User ID starting with either `U` or `W`
6777 bot_id: Bot ID starting with `B`
6878 bot_token: Bot user access token starting with `xoxb-`
6979 bot_scopes: The scopes associated with the bot token
7080 user_id: The request user ID
81+ user: The request user's name
7182 user_token: User access token starting with `xoxp-`
7283 user_scopes: The scopes associated wth the user token
7384 """
7485 self["enterprise_id"] = self.enterprise_id = enterprise_id
7586 self["team_id"] = self.team_id = team_id
87+ self["team"] = self.team = team
88+ self["url"] = self.url = url
7689 # bot
7790 self["bot_user_id"] = self.bot_user_id = bot_user_id
7891 self["bot_id"] = self.bot_id = bot_id
@@ -82,6 +95,7 @@ <h1 class="title">Module <code>slack_bolt.authorization.authorize_result</code><
8295 self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore
8396 # user
8497 self["user_id"] = self.user_id = user_id
98+ self["user"] = self.user = user
8599 self["user_token"] = self.user_token = user_token
86100 if user_scopes is not None and isinstance(user_scopes, str):
87101 user_scopes = [scope.strip() for scope in user_scopes.split(",")]
@@ -104,17 +118,21 @@ <h1 class="title">Module <code>slack_bolt.authorization.authorize_result</code><
104118 user_id: Optional[str] = ( # type:ignore
105119 auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None
106120 )
107- # Since v1.28, user_id can be set when user_token w/ its auth.test response exists
121+ user_name = auth_test_response.get("user")
108122 if user_id is None and user_auth_test_response is not None:
109123 user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore
124+ user_name: Optional[str] = user_auth_test_response.get("user") # type:ignore
110125
111126 return AuthorizeResult(
112127 enterprise_id=auth_test_response.get("enterprise_id"),
113128 team_id=auth_test_response.get("team_id"),
129+ team=auth_test_response.get("team"),
130+ url=auth_test_response.get("url"),
114131 bot_id=auth_test_response.get("bot_id"),
115132 bot_user_id=bot_user_id,
116133 bot_scopes=bot_scopes,
117134 user_id=user_id,
135+ user=user_name,
118136 bot_token=bot_token,
119137 user_token=user_token,
120138 user_scopes=user_scopes,
@@ -132,7 +150,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
132150< dl >
133151< dt id ="slack_bolt.authorization.authorize_result.AuthorizeResult "> < code class ="flex name class ">
134152< span > class < span class ="ident "> AuthorizeResult</ span > </ span >
135- < 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 >
153+ < 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 >
136154</ code > </ dt >
137155< dd >
138156< div class ="desc "> < p > Authorize function call result</ p >
@@ -142,6 +160,10 @@ <h2 id="args">Args</h2>
142160< dd > Organization ID (Enterprise Grid) starting with < code > E</ code > </ dd >
143161< dt > < strong > < code > team_id</ code > </ strong > </ dt >
144162< dd > Workspace ID starting with < code > T</ code > </ dd >
163+ < dt > < strong > < code > team</ code > </ strong > </ dt >
164+ < dd > Workspace name</ dd >
165+ < dt > < strong > < code > url</ code > </ strong > </ dt >
166+ < dd > Workspace slack.com URL</ dd >
145167< dt > < strong > < code > bot_user_id</ code > </ strong > </ dt >
146168< dd > Bot user's User ID starting with either < code > U</ code > or < code > W</ code > </ dd >
147169< dt > < strong > < code > bot_id</ code > </ strong > </ dt >
@@ -152,6 +174,8 @@ <h2 id="args">Args</h2>
152174< dd > The scopes associated with the bot token</ dd >
153175< dt > < strong > < code > user_id</ code > </ strong > </ dt >
154176< dd > The request user ID</ dd >
177+ < dt > < strong > < code > user</ code > </ strong > </ dt >
178+ < dd > The request user's name</ dd >
155179< dt > < strong > < code > user_token</ code > </ strong > </ dt >
156180< dd > User access token starting with < code > xoxp-</ code > </ dd >
157181< dt > < strong > < code > user_scopes</ code > </ strong > </ dt >
@@ -166,11 +190,16 @@ <h2 id="args">Args</h2>
166190
167191 enterprise_id: Optional[str]
168192 team_id: Optional[str]
193+ team: Optional[str] # since v1.18
194+ url: Optional[str] # since v1.18
195+
169196 bot_id: Optional[str]
170197 bot_user_id: Optional[str]
171198 bot_token: Optional[str]
172199 bot_scopes: Optional[List[str]] # since v1.17
200+
173201 user_id: Optional[str]
202+ user: Optional[str] # since v1.18
174203 user_token: Optional[str]
175204 user_scopes: Optional[List[str]] # since v1.17
176205
@@ -179,30 +208,38 @@ <h2 id="args">Args</h2>
179208 *,
180209 enterprise_id: Optional[str],
181210 team_id: Optional[str],
211+ team: Optional[str] = None,
212+ url: Optional[str] = None,
182213 # bot
183214 bot_user_id: Optional[str] = None,
184215 bot_id: Optional[str] = None,
185216 bot_token: Optional[str] = None,
186217 bot_scopes: Optional[Union[List[str], str]] = None,
187218 # user
188219 user_id: Optional[str] = None,
220+ user: Optional[str] = None,
189221 user_token: Optional[str] = None,
190222 user_scopes: Optional[Union[List[str], str]] = None,
191223 ):
192224 """
193225 Args:
194226 enterprise_id: Organization ID (Enterprise Grid) starting with `E`
195227 team_id: Workspace ID starting with `T`
228+ team: Workspace name
229+ url: Workspace slack.com URL
196230 bot_user_id: Bot user's User ID starting with either `U` or `W`
197231 bot_id: Bot ID starting with `B`
198232 bot_token: Bot user access token starting with `xoxb-`
199233 bot_scopes: The scopes associated with the bot token
200234 user_id: The request user ID
235+ user: The request user's name
201236 user_token: User access token starting with `xoxp-`
202237 user_scopes: The scopes associated wth the user token
203238 """
204239 self["enterprise_id"] = self.enterprise_id = enterprise_id
205240 self["team_id"] = self.team_id = team_id
241+ self["team"] = self.team = team
242+ self["url"] = self.url = url
206243 # bot
207244 self["bot_user_id"] = self.bot_user_id = bot_user_id
208245 self["bot_id"] = self.bot_id = bot_id
@@ -212,6 +249,7 @@ <h2 id="args">Args</h2>
212249 self["bot_scopes"] = self.bot_scopes = bot_scopes # type: ignore
213250 # user
214251 self["user_id"] = self.user_id = user_id
252+ self["user"] = self.user = user
215253 self["user_token"] = self.user_token = user_token
216254 if user_scopes is not None and isinstance(user_scopes, str):
217255 user_scopes = [scope.strip() for scope in user_scopes.split(",")]
@@ -234,17 +272,21 @@ <h2 id="args">Args</h2>
234272 user_id: Optional[str] = ( # type:ignore
235273 auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None
236274 )
237- # Since v1.28, user_id can be set when user_token w/ its auth.test response exists
275+ user_name = auth_test_response.get("user")
238276 if user_id is None and user_auth_test_response is not None:
239277 user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore
278+ user_name: Optional[str] = user_auth_test_response.get("user") # type:ignore
240279
241280 return AuthorizeResult(
242281 enterprise_id=auth_test_response.get("enterprise_id"),
243282 team_id=auth_test_response.get("team_id"),
283+ team=auth_test_response.get("team"),
284+ url=auth_test_response.get("url"),
244285 bot_id=auth_test_response.get("bot_id"),
245286 bot_user_id=bot_user_id,
246287 bot_scopes=bot_scopes,
247288 user_id=user_id,
289+ user=user_name,
248290 bot_token=bot_token,
249291 user_token=user_token,
250292 user_scopes=user_scopes,
@@ -276,10 +318,22 @@ <h3>Class variables</h3>
276318< dd >
277319< div class ="desc "> </ div >
278320</ dd >
321+ < dt id ="slack_bolt.authorization.authorize_result.AuthorizeResult.team "> < code class ="name "> var < span class ="ident "> team</ span > : Optional[str]</ code > </ dt >
322+ < dd >
323+ < div class ="desc "> </ div >
324+ </ dd >
279325< dt id ="slack_bolt.authorization.authorize_result.AuthorizeResult.team_id "> < code class ="name "> var < span class ="ident "> team_id</ span > : Optional[str]</ code > </ dt >
280326< dd >
281327< div class ="desc "> </ div >
282328</ dd >
329+ < dt id ="slack_bolt.authorization.authorize_result.AuthorizeResult.url "> < code class ="name "> var < span class ="ident "> url</ span > : Optional[str]</ code > </ dt >
330+ < dd >
331+ < div class ="desc "> </ div >
332+ </ dd >
333+ < dt id ="slack_bolt.authorization.authorize_result.AuthorizeResult.user "> < code class ="name "> var < span class ="ident "> user</ span > : Optional[str]</ code > </ dt >
334+ < dd >
335+ < div class ="desc "> </ div >
336+ </ dd >
283337< dt id ="slack_bolt.authorization.authorize_result.AuthorizeResult.user_id "> < code class ="name "> var < span class ="ident "> user_id</ span > : Optional[str]</ code > </ dt >
284338< dd >
285339< div class ="desc "> </ div >
@@ -321,17 +375,21 @@ <h3>Static methods</h3>
321375 user_id: Optional[str] = ( # type:ignore
322376 auth_test_response.get("user_id") if auth_test_response.get("bot_id") is None else None
323377 )
324- # Since v1.28, user_id can be set when user_token w/ its auth.test response exists
378+ user_name = auth_test_response.get("user")
325379 if user_id is None and user_auth_test_response is not None:
326380 user_id: Optional[str] = user_auth_test_response.get("user_id") # type:ignore
381+ user_name: Optional[str] = user_auth_test_response.get("user") # type:ignore
327382
328383 return AuthorizeResult(
329384 enterprise_id=auth_test_response.get("enterprise_id"),
330385 team_id=auth_test_response.get("team_id"),
386+ team=auth_test_response.get("team"),
387+ url=auth_test_response.get("url"),
331388 bot_id=auth_test_response.get("bot_id"),
332389 bot_user_id=bot_user_id,
333390 bot_scopes=bot_scopes,
334391 user_id=user_id,
392+ user=user_name,
335393 bot_token=bot_token,
336394 user_token=user_token,
337395 user_scopes=user_scopes,
@@ -365,7 +423,10 @@ <h4><code><a title="slack_bolt.authorization.authorize_result.AuthorizeResult" h
365423< 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 >
366424< 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 >
367425< 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 >
426+ < li > < code > < a title ="slack_bolt.authorization.authorize_result.AuthorizeResult.team " href ="#slack_bolt.authorization.authorize_result.AuthorizeResult.team "> team</ a > </ code > </ li >
368427< 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 >
428+ < li > < code > < a title ="slack_bolt.authorization.authorize_result.AuthorizeResult.url " href ="#slack_bolt.authorization.authorize_result.AuthorizeResult.url "> url</ a > </ code > </ li >
429+ < li > < code > < a title ="slack_bolt.authorization.authorize_result.AuthorizeResult.user " href ="#slack_bolt.authorization.authorize_result.AuthorizeResult.user "> user</ a > </ code > </ li >
369430< 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 >
370431< 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 >
371432< 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 >
0 commit comments