(
self,
endpoint: str,
data: JSONDict | None = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
connect_timeout: ODVInput[float] = DEFAULT_NONE,
pool_timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict | None = None,
)
| 684 | data[key] = DefaultValue.get_value(val) |
| 685 | |
| 686 | async def _post( |
| 687 | self, |
| 688 | endpoint: str, |
| 689 | data: JSONDict | None = None, |
| 690 | *, |
| 691 | read_timeout: ODVInput[float] = DEFAULT_NONE, |
| 692 | write_timeout: ODVInput[float] = DEFAULT_NONE, |
| 693 | connect_timeout: ODVInput[float] = DEFAULT_NONE, |
| 694 | pool_timeout: ODVInput[float] = DEFAULT_NONE, |
| 695 | api_kwargs: JSONDict | None = None, |
| 696 | ) -> Any: |
| 697 | # We know that the return type is Union[bool, JSONDict, list[JSONDict]], but it's hard |
| 698 | # to tell mypy which methods expects which of these return values and `Any` saves us a |
| 699 | # lot of `type: ignore` comments |
| 700 | if data is None: |
| 701 | data = {} |
| 702 | |
| 703 | if api_kwargs: |
| 704 | data.update(api_kwargs) |
| 705 | |
| 706 | # Insert is in-place, so no return value for data |
| 707 | self._insert_defaults(data) |
| 708 | |
| 709 | # Drop any None values because Telegram doesn't handle them well |
| 710 | data = {key: value for key, value in data.items() if value is not None} |
| 711 | |
| 712 | return await self._do_post( |
| 713 | endpoint=endpoint, |
| 714 | data=data, |
| 715 | read_timeout=read_timeout, |
| 716 | write_timeout=write_timeout, |
| 717 | connect_timeout=connect_timeout, |
| 718 | pool_timeout=pool_timeout, |
| 719 | ) |
| 720 | |
| 721 | async def _do_post( |
| 722 | self, |
no test coverage detected