MCPcopy Index your code
hub / github.com/slackapi/python-slack-sdk / AsyncSlackResponse

Class AsyncSlackResponse

slack/web/async_slack_response.py:9–187  ·  view source on GitHub ↗

An iterable container of response data. Attributes: data (dict): The json-encoded content of the response. Along with the headers and status code information. Methods: validate: Check if the response from Slack was successful. get: Retrieves any key from

Source from the content-addressed store, hash-verified

7
8
9class AsyncSlackResponse:
10 """An iterable container of response data.
11
12 Attributes:
13 data (dict): The json-encoded content of the response. Along
14 with the headers and status code information.
15
16 Methods:
17 validate: Check if the response from Slack was successful.
18 get: Retrieves any key from the response data.
19 next: Retrieves the next portion of results,
20 if 'next_cursor' is present.
21
22 Example:
23 ```python
24 import os
25 import slack
26
27 client = slack.AsyncWebClient(token=os.environ['SLACK_API_TOKEN'])
28
29 response1 = await client.auth_revoke(test='true')
30 assert not response1['revoked']
31
32 response2 = await client.auth_test()
33 assert response2.get('ok', False)
34
35 users = []
36 async for page in await client.users_list(limit=2):
37 users = users + page['members']
38 ```
39
40 Note:
41 Some responses return collections of information
42 like channel and user lists. If they do it's likely
43 that you'll only receive a portion of results. This
44 object allows you to iterate over the response which
45 makes subsequent API requests until your code hits
46 'break' or there are no more results to be found.
47
48 Any attributes or methods prefixed with _underscores are
49 intended to be "private" internal use only. They may be changed or
50 removed at anytime.
51 """
52
53 def __init__(
54 self,
55 *,
56 client, # AsyncWebClient
57 http_verb: str,
58 api_url: str,
59 req_args: dict,
60 data: dict,
61 headers: dict,
62 status_code: int,
63 ):
64 self.http_verb = http_verb
65 self.api_url = api_url
66 self.req_args = req_args

Callers 3

test_issue_1100Method · 0.90
test_issue_1102Method · 0.90
_sendMethod · 0.90

Calls

no outgoing calls

Tested by 2

test_issue_1100Method · 0.72
test_issue_1102Method · 0.72