Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def __call__(
self,
need_all: bool = None,
code: str = None,
offset: int = None,
count: int = None,
) -> responses.database.GetCountries:
""" database.getCountries
From Vk Docs: Returns a list of countries.
Access from user token(s)
:param need_all: '1' — to return a full list of all countries, '0' — to return a list of countries near the current user's country (default).
:param code: Country codes in [vk.com/dev/country_codes|ISO 3166-1 alpha-2] standard.
:param offset: Offset needed to return a specific subset of countries.
:param count: Number of countries 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(
"database.getCountries",
Access from user, service token(s)
:param q: Search query.
:param city_id: City ID.
:param offset: Offset needed to return a specific subset of schools.
:param count: Number of schools 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(
"database.getSchools",
params,
response_model=responses.database.GetSchoolsModel,
)
async def __call__(
self,
country_id: int,
region_id: int = None,
q: str = None,
need_all: bool = None,
offset: int = None,
count: int = None,
) -> responses.database.GetCities:
""" database.getCities
From Vk Docs: Returns a list of cities.
Access from user token(s)
:param country_id: Country ID.
:param region_id: Region ID.
:param q: Search query.
:param need_all: '1' — to return all cities in the country, '0' — to return major cities in the country (default),
:param offset: Offset needed to return a specific subset of cities.
:param count: Number of cities 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
}
) -> responses.database.GetCitiesById:
""" database.getCitiesById
From Vk Docs: Returns information about cities by their IDs.
Access from user, service token(s)
:param city_ids: City IDs.
"""
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(
"database.getCitiesById",
params,
response_model=responses.database.GetCitiesByIdModel,
)
async def __call__(
self, city_ids: typing.List = None
) -> responses.database.GetCitiesById:
""" database.getCitiesById
From Vk Docs: Returns information about cities by their IDs.
Access from user, service token(s)
:param city_ids: City IDs.
"""
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(
"database.getCitiesById",
params,
response_model=responses.database.GetCitiesByIdModel,
)
async def __call__(
self, university_id: int, offset: int = None, count: int = None
) -> responses.database.GetFaculties:
""" database.getFaculties
From Vk Docs: Returns a list of faculties (i.e., university departments).
Access from user, service token(s)
:param university_id: University ID.
:param offset: Offset needed to return a specific subset of faculties.
:param count: Number of faculties 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(
"database.getFaculties",
params,
) -> responses.database.GetMetroStationsById:
""" database.getMetroStationsById
From Vk Docs: Get metro station by his id
Access from user, service token(s)
:param station_ids:
"""
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(
"database.getMetroStationsById",
params,
response_model=responses.database.GetMetroStationsByIdModel,
)
From Vk Docs: Returns list of chairs on a specified faculty.
Access from user, service token(s)
:param faculty_id: id of the faculty to get chairs from
:param offset: offset required to get a certain subset of chairs
:param count: amount of chairs to get
"""
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(
"database.getChairs",
params,
response_model=responses.database.GetChairsModel,
)
async def __call__(
self, faculty_id: int, offset: int = None, count: int = None
) -> responses.database.GetChairs:
""" database.getChairs
From Vk Docs: Returns list of chairs on a specified faculty.
Access from user, service token(s)
:param faculty_id: id of the faculty to get chairs from
:param offset: offset required to get a certain subset of chairs
:param count: amount of chairs to get
"""
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(
"database.getChairs",
params,
Access from user token(s)
:param need_all: '1' — to return a full list of all countries, '0' — to return a list of countries near the current user's country (default).
:param code: Country codes in [vk.com/dev/country_codes|ISO 3166-1 alpha-2] standard.
:param offset: Offset needed to return a specific subset of countries.
:param count: Number of countries 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(
"database.getCountries",
params,
response_model=responses.database.GetCountriesModel,
)