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

Method get

slack/web/async_slack_response.py:157–172  ·  view source on GitHub ↗

Retrieves any key from the response data. Note: This is implemented so users can reference the SlackResponse object like a dictionary. e.g. response.get("ok", False) Returns: The value from data or the specified default.

(self, key, default=None)

Source from the content-addressed store, hash-verified

155 raise StopAsyncIteration
156
157 def get(self, key, default=None):
158 """Retrieves any key from the response data.
159
160 Note:
161 This is implemented so users can reference the
162 SlackResponse object like a dictionary.
163 e.g. response.get("ok", False)
164
165 Returns:
166 The value from data or the specified default.
167 """
168 if isinstance(self.data, bytes):
169 raise ValueError("As the response.data is binary data, this operation is unsupported")
170 if self.data is None:
171 return None
172 return self.data.get(key, default)
173
174 def validate(self):
175 """Check if the response from Slack was successful.

Callers 12

test_issue_1100Method · 0.95
__contains__Method · 0.95
__getitem__Method · 0.45
__anext__Method · 0.45
validateMethod · 0.45
_sync_sendMethod · 0.45
_urllib_api_callMethod · 0.45
show_2020_01_deprecationFunction · 0.45
_parse_web_class_objectsFunction · 0.45
__init__Method · 0.45
require_anyMethod · 0.45
is_valid_requestMethod · 0.45

Calls

no outgoing calls

Tested by 1

test_issue_1100Method · 0.76