Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:param count: Number of comments to return.
:param sort: Sort order: 'asc' — old first, 'desc' — new first
:param access_key:
:param extended:
:param fields:
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"photos.getComments",
params,
response_model=responses.photos.GetCommentsModel,
)
:param from_group: '1' — to post a comment from the community
:param reply_to_comment:
:param sticker_id:
:param access_key:
:param guid:
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"photos.createComment",
params,
response_model=responses.photos.CreateCommentModel,
)
async def __call__(
self,
title: str,
group_id: int = None,
description: str = None,
privacy_view: typing.List = None,
privacy_comment: typing.List = None,
upload_by_admins_only: bool = None,
comments_disabled: bool = None,
) -> responses.photos.CreateAlbum:
""" photos.createAlbum
From Vk Docs: Creates an empty photo album.
Access from user token(s)
:param title: Album title.
:param group_id: ID of the community in which the album will be created.
:param description: Album description.
:param privacy_view:
:param privacy_comment:
:param upload_by_admins_only:
:param comments_disabled:
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
:param owner_id: ID of the user or community that owns the photo.
:param photo_id: Photo ID.
:param user_id: ID of the user to be tagged.
:param x: Upper left-corner coordinate of the tagged area (as a percentage of the photo's width).
:param y: Upper left-corner coordinate of the tagged area (as a percentage of the photo's height).
:param x2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's width).
:param y2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's height).
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"photos.putTag", params, response_model=responses.photos.PutTagModel
)
async def __call__(
self,
photo: str,
user_id: int = None,
group_id: int = None,
server: int = None,
hash: str = None,
latitude: typing.Any = None,
longitude: typing.Any = None,
caption: str = None,
) -> responses.photos.SaveWallPhoto:
""" photos.saveWallPhoto
From Vk Docs: Saves a photo to a user's or community's wall after being uploaded.
Access from user token(s)
:param user_id: ID of the user on whose wall the photo will be saved.
:param group_id: ID of community on whose wall the photo will be saved.
:param photo: Parameter returned when the the photo is [vk.com/dev/upload_files|uploaded to the server].
:param server:
:param hash:
:param latitude: Geographical latitude, in degrees (from '-90' to '90').
:param longitude: Geographical longitude, in degrees (from '-180' to '180').
:param caption: Text describing the photo. 2048 digits max.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
) -> responses.photos.GetTags:
""" photos.getTags
From Vk Docs: Returns a list of tags on a photo.
Access from user token(s)
:param owner_id: ID of the user or community that owns the photo.
:param photo_id: Photo ID.
:param access_key:
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"photos.getTags", params, response_model=responses.photos.GetTagsModel
)
async def __call__(
self, offset: int = None, count: int = None
) -> responses.photos.GetNewTags:
""" photos.getNewTags
From Vk Docs: Returns a list of photos with tags that have not been viewed.
Access from user token(s)
:param offset: Offset needed to return a specific subset of photos.
:param count: Number of photos to return.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"photos.getNewTags", params, response_model=responses.photos.GetNewTagsModel
)
:param extended: '1' — to return detailed information about photos
:param offset: Offset needed to return a specific subset of photos. By default, '0'.
:param count: Number of photos to return.
:param photo_sizes: '1' – to return image sizes in [vk.com/dev/photo_sizes|special format].
:param no_service_albums: '1' – to return photos only from standard albums, '0' – to return all photos including those in service albums, e.g., 'My wall photos' (default)
:param need_hidden: '1' – to show information about photos being hidden from the block above the wall.
:param skip_hidden: '1' – not to return photos being hidden from the block above the wall. Works only with owner_id>0, no_service_albums is ignored.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"photos.getAll", params, response_model=responses.photos.GetAllModel
)
self, offset: int = None, count: int = None
) -> responses.photos.GetNewTags:
""" photos.getNewTags
From Vk Docs: Returns a list of photos with tags that have not been viewed.
Access from user token(s)
:param offset: Offset needed to return a specific subset of photos.
:param count: Number of photos to return.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"photos.getNewTags", params, response_model=responses.photos.GetNewTagsModel
)
async def __call__(
self, photo: str, server: int = None, hash: str = None
) -> responses.photos.SaveMessagesPhoto:
""" photos.saveMessagesPhoto
From Vk Docs: Saves a photo after being successfully uploaded. URL obtained with [vk.com/dev/photos.getMessagesUploadServer|photos.getMessagesUploadServer] method.
Access from user, group token(s)
:param photo: Parameter returned when the photo is [vk.com/dev/upload_files|uploaded to the server].
:param server:
:param hash:
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"photos.saveMessagesPhoto",
params,