Исходный код vk_maria.responses
from .vk_types import *
[документация]class ResponseItem:
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __repr__(self):
return f'<Item({", ".join(f"{k}={v}" for k, v in self.__dict__.items())})>'
[документация]class Response:
# TODO: Добавить итерацию или не надо ?
def __init__(self, response):
if isinstance(response, dict):
self.__response = ResponseItem(**response)
self.__dict__.update(self.__response.__dict__)
else:
self.__response = [ResponseItem(**el) for el in response]
def __getitem__(self, i: int):
return self.__response[i]
def __repr__(self):
if not isinstance(self.__response, list):
return self.__response.__repr__()
return "[{}]".format(',\n '.join(str(el) for el in self.__response))
[документация]class GroupsGetById(Response, Group):
def __init__(self, *args):
super().__init__(args[0])
[документация]class GroupsIsMember(Response):
member: int
request: int
invitation: int
can_invite: int
can_recall: int
user_id: int
[документация]class MessagesGetConversationMembers(Response):
count: int
items: List[Dict]
profiles: List[Profile]
groups: List[Group]
[документация]class MessagesGetConversations(Response):
count: int
items: List[Dict]
unread_count: int
profiles: List[Profile]
groups: List[Group]
[документация]class MessagesPin(Response):
id: int
date: int
from_id: int
text: str
attachments: List[Dict]
geo: Dict
fwd_messages: List[Dict]
[документация]class MessagesGetLongpollHistory(Response):
history: List
messages: List
groups: List[Group]
profiles: List[Profile]
[документация]class PhotosGetMessagesUploadServer(Response):
upload_url: str
album_id: int
group_id: int
[документация]class PhotosSaveMessagesPhoto(Response):
id: int
pid: int
aid: int
owner_id: int
src: str
src_big: str
src_small: str
created: str
src_xbig: str
src_xxbig: str
[документация]class StoriesGet(Response):
count: int
items: List[Dict]
profiles: List[Dict]
groups: List[Dict]
[документация]class StoriesGetById(Response):
count: int
items: List[Dict]
profiles: List[Dict]
groups: List[Dict]
[документация]class StoriesGetReplies(Response):
count: int
items: List[Dict]
profiles: List[Dict]
groups: List[Dict]
[документация]class StoriesGetStats(Response):
views: Dict
replies: Dict
answer: Dict
shares: Dict
subscribers: Dict
bans: Dict
open_link: Dict