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

Function _parse_web_class_objects

slack/web/internal_utils.py:9–25  ·  view source on GitHub ↗
(kwargs)

Source from the content-addressed store, hash-verified

7
8
9def _parse_web_class_objects(kwargs) -> None:
10 def to_dict(obj: Union[Dict, Block, Attachment]):
11 if isinstance(obj, Block):
12 return obj.to_dict()
13 if isinstance(obj, Attachment):
14 return obj.to_dict()
15 return obj
16
17 blocks = kwargs.get("blocks", None)
18 if blocks is not None and isinstance(blocks, list):
19 dict_blocks = [to_dict(b) for b in blocks]
20 kwargs.update({"blocks": dict_blocks})
21
22 attachments = kwargs.get("attachments", None)
23 if attachments is not None and isinstance(attachments, list):
24 dict_attachments = [to_dict(a) for a in attachments]
25 kwargs.update({"attachments": dict_attachments})
26
27
28def _update_call_participants(kwargs, users: Union[str, List[Dict[str, str]]]) -> None:

Calls 2

to_dictFunction · 0.70
getMethod · 0.45