gitcode_api.utils
Utility helper functions.
Functions
|
Convert one |
- as_dict(data: APIObject, deep_copy: bool = False) Dict[str, Any]
- as_dict(data: List[APIObject], deep_copy: bool = False) List[Dict[str, Any]]
Convert one
APIObjectto a plaindict, or several to a list of dicts.Similar to
dataclasses.asdict(). Input is converted withto_dict(). Whendeep_copyis true, each mapping is copied withcopy.deepcopy().- Parameters:
data – A single response model or a list of them.
deep_copy – When true, return deep-copied dicts.
- Returns:
A dict for a single input, or a list of dicts for a list input.