From f565ef875611c73a04337db35274cf0df8a8d4a0 Mon Sep 17 00:00:00 2001 From: iPopstop Date: Sun, 12 Jul 2020 18:17:35 +0300 Subject: [PATCH 1/7] Execute, Groups, Messages etc. --- src/VK/Actions/AppWidgets.php | 120 ++++++++++++++++++- src/VK/Actions/Apps.php | 18 +-- src/VK/Actions/Execute.php | 45 +++++++ src/VK/Actions/Groups.php | 219 ++++++++++++++++++++++++++++++++++ src/VK/Actions/Messages.php | 48 ++++++++ src/VK/Client/VKApiClient.php | 51 +++++--- 6 files changed, 476 insertions(+), 25 deletions(-) create mode 100644 src/VK/Actions/Execute.php diff --git a/src/VK/Actions/AppWidgets.php b/src/VK/Actions/AppWidgets.php index fb2d9aa..d279811 100644 --- a/src/VK/Actions/AppWidgets.php +++ b/src/VK/Actions/AppWidgets.php @@ -30,11 +30,129 @@ public function __construct(VKApiRequest $request) { $this->request = $request; } + /** + * Returns URL to upload an app widget photo. + * + * @param string $access_token + * @param array $params + * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function getAppImageUploadServer($access_token, $params = []) { + return $this->request->post('appWidgets.getAppImageUploadServer', $access_token, $params); + } + + /** + * Returns a collection of application images. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of images. + * - @var integer count: Number of objects to return. + * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function getAppImages($access_token, $params = []) { + return $this->request->post('appWidgets.getAppImages', $access_token, $params); + } + + /** + * Returns the server address for community photo upload. + * + * @param string $access_token + * @param array $params + * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function getGroupImageUploadServer($access_token, $params = []) { + return $this->request->post('appWidgets.getGroupImageUploadServer', $access_token, $params); + } + + /** + * Returns a collection of application images. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of images. + * - @var integer count: Number of objects to return. + * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function getGroupImages($access_token, $params = []) { + return $this->request->post('appWidgets.getAppImages', $access_token, $params); + } + + /** + * Returns a collection of application images by id. + * + * @param string $access_token + * @param array $params + * - @var array[string] images: List of images ID + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function getGroupImagesById($access_token, $params = []) { + return $this->request->post('appWidgets.getGroupImagesById', $access_token, $params); + } + + /** + * Saves app photos after successful uploading. + * + * @param string $access_token + * @param array $params + * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string image: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function saveAppImage($access_token, $params = []) { + return $this->request->post('appWidgets.saveAppImage', $access_token, $params); + } + + /** + * Saves app photos into community after successful uploading. + * + * @param string $access_token + * @param array $params + * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string image: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function saveGroupImage($access_token, $params = []) { + return $this->request->post('appWidgets.saveGroupImage', $access_token, $params); + } + /** * Allows to update community app widget * * @param string $access_token - * @param array $params + * @param array $params * - @var string code * - @var AppWidgetsType type * @throws VKClientException diff --git a/src/VK/Actions/Apps.php b/src/VK/Actions/Apps.php index c00b12d..ef00d2a 100644 --- a/src/VK/Actions/Apps.php +++ b/src/VK/Actions/Apps.php @@ -45,7 +45,7 @@ public function deleteAppRequests($access_token) { * Returns applications data. * * @param string $access_token - * @param array $params + * @param array $params * - @var integer app_id: Application ID * - @var array[string] app_ids: List of application ID * - @var AppsPlatform platform: platform. Possible values: *'ios' — iOS,, *'android' — Android,, *'winphone' — Windows Phone,, *'web' — приложения на vk.com. By default: 'web'. @@ -65,7 +65,7 @@ public function get($access_token, array $params = []) { * Returns a list of applications (apps) available to users in the App Catalog. * * @param string $access_token - * @param array $params + * @param array $params * - @var AppsSort sort: Sort order: 'popular_today' — popular for one day (default), 'visitors' — by visitors number , 'create_date' — by creation date, 'growth_rate' — by growth rate, 'popular_week' — popular for one week * - @var integer offset: Offset required to return a specific subset of apps. * - @var integer count: Number of apps to return. @@ -89,7 +89,7 @@ public function getCatalog($access_token, array $params = []) { * Creates friends list for requests and invites in current app. * * @param string $access_token - * @param array $params + * @param array $params * - @var boolean extended * - @var integer count: List size. * - @var integer offset @@ -107,7 +107,7 @@ public function getFriendsList($access_token, array $params = []) { * Returns players rating in the game. * * @param string $access_token - * @param array $params + * @param array $params * - @var AppsType type: Leaderboard type. Possible values: *'level' — by level,, *'points' — by mission points,, *'score' — by score (). * - @var boolean global: Rating type. Possible values: *'1' — global rating among all players,, *'0' — rating among user friends. * - @var boolean extended: 1 — to return additional info about users @@ -123,7 +123,7 @@ public function getLeaderboard($access_token, array $params = []) { * Returns scopes for auth * * @param string $access_token - * @param array $params + * @param array $params * - @var AppsType type * @throws VKClientException * @throws VKApiException @@ -137,7 +137,7 @@ public function getScopes($access_token, array $params = []) { * Returns user score in app * * @param string $access_token - * @param array $params + * @param array $params * - @var integer user_id * @throws VKClientException * @throws VKApiException @@ -147,11 +147,15 @@ public function getScore($access_token, array $params = []) { return $this->request->post('apps.getScore', $access_token, $params); } + /* promoHasActiveGiftПроверить есть ли у пользователя подарок в игре. +promoUseGift + */ + /** * Sends a request to another user in an app that uses VK authorization. * * @param string $access_token - * @param array $params + * @param array $params * - @var integer user_id: id of the user to send a request * - @var string text: request text * - @var AppsType type: request type. Values: 'invite' – if the request is sent to a user who does not have the app installed,, 'request' – if a user has already installed the app diff --git a/src/VK/Actions/Execute.php b/src/VK/Actions/Execute.php new file mode 100644 index 0000000..e9f6c1b --- /dev/null +++ b/src/VK/Actions/Execute.php @@ -0,0 +1,45 @@ +request = $request; + } + + /** + * Returns a collection of application images by id. + * + * @param string $access_token + * @param array $params + * - @var string code: VKScript code + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function __invoke($access_token, $params = []) + { + return $this->request->post('execute', $access_token, $params); + } + +} diff --git a/src/VK/Actions/Groups.php b/src/VK/Actions/Groups.php index 77f9bc4..117f326 100644 --- a/src/VK/Actions/Groups.php +++ b/src/VK/Actions/Groups.php @@ -166,6 +166,25 @@ public function create($access_token, array $params = []) { return $this->request->post('groups.create', $access_token, $params); } + /** + * Creates a new community. + * + * @param string $access_token + * @param array $params + * - @var string title: Community title. + * - @var string description: Community description (ignored for 'type' = 'public'). + * - @var GroupsType type: Community type. Possible values: *'group' – group,, *'event' – event,, *'public' – public page + * - @var integer public_category: Category ID (for 'type' = 'public' only). + * - @var GroupsSubtype subtype: Public page subtype. Possible values: *'1' – place or small business,, *'2' – company, organization or website,, *'3' – famous person or group of people,, *'4' – product or work of art. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @return mixed + */ + public function deleteAddress($access_token, array $params = []) { + return $this->request->post('groups.deleteAddress', $access_token, $params); + } + /** * @param string $access_token * @param array $params @@ -597,6 +616,26 @@ public function getMembers($access_token, array $params = []) { return $this->request->post('groups.getMembers', $access_token, $params); } + /** + * Returns a list of community members. + * + * @param string $access_token + * @param array $params + * - @var string group_id: ID or screen name of the community. + * - @var GroupsSort sort: Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', 'time_desc'. 'time_asc' and 'time_desc' are availavle only if the method is called by the group's 'moderator'. + * - @var integer offset: Offset needed to return a specific subset of community members. + * - @var integer count: Number of community members to return. + * - @var array[GroupsFields] fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. + * - @var GroupsFilter filter: *'friends' – only friends in this community will be returned,, *'unsure' – only those who pressed 'I may attend' will be returned (if it's an event). + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamGroupIdException Invalid group id + * @return mixed + */ + public function getOnlineStatus($access_token, array $params = []) { + return $this->request->post('groups.getOnlineStatus', $access_token, $params); + } + /** * Returns a list of requests to the community. * @@ -628,6 +667,20 @@ public function getSettings($access_token, array $params = []) { return $this->request->post('groups.getSettings', $access_token, $params); } + /** + * Returns community settings. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getTagList($access_token, array $params = []) { + return $this->request->post('groups.getTagList', $access_token, $params); + } + /** * @param string $access_token * @throws VKClientException @@ -866,6 +919,172 @@ public function setLongPollSettings($access_token, array $params = []) { return $this->request->post('groups.setLongPollSettings', $access_token, $params); } + /** + * Sets Long Poll notification settings + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var boolean enabled: Sets whether Long Poll is enabled ('0' — disabled, '1' — enabled). + * - @var string api_version + * - @var boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). + * - @var boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). + * - @var boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). + * - @var boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). + * - @var boolean message_edit: A message has been edited ('0' — disabled, '1' — enabled). + * - @var boolean message_typing_state + * - @var boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). + * - @var boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). + * - @var boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). + * - @var boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). + * - @var boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). + * - @var boolean group_change_settings + * - @var boolean group_change_photo + * - @var boolean group_officers_edit + * - @var boolean user_block: User added to community blacklist + * - @var boolean user_unblock: User removed from community blacklist + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setSettings($access_token, array $params = []) { + return $this->request->post('groups.setSettings', $access_token, $params); + } + + /** + * Sets Long Poll notification settings + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var boolean enabled: Sets whether Long Poll is enabled ('0' — disabled, '1' — enabled). + * - @var string api_version + * - @var boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). + * - @var boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). + * - @var boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). + * - @var boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). + * - @var boolean message_edit: A message has been edited ('0' — disabled, '1' — enabled). + * - @var boolean message_typing_state + * - @var boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). + * - @var boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). + * - @var boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). + * - @var boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). + * - @var boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). + * - @var boolean group_change_settings + * - @var boolean group_change_photo + * - @var boolean group_officers_edit + * - @var boolean user_block: User added to community blacklist + * - @var boolean user_unblock: User removed from community blacklist + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setUserNote($access_token, array $params = []) { + return $this->request->post('groups.setUserNote', $access_token, $params); + } + + /** + * Sets Long Poll notification settings + * + * @param string $access_token + * @param array $params + * - @var boolean user_unblock: User removed from community blacklist + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function tagAdd($access_token, array $params = []) { + return $this->request->post('groups.tagAdd', $access_token, $params); + } + + /** + * Sets Long Poll notification settings + * + * @param string $access_token + * @param array $params + * - @var boolean user_unblock: User removed from community blacklist + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function tagBind($access_token, array $params = []) { + return $this->request->post('groups.tagBind', $access_token, $params); + } + + /** + * Sets Long Poll notification settings + * + * @param string $access_token + * @param array $params + * - @var boolean user_unblock: User removed from community blacklist + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function tagDelete($access_token, array $params = []) { + return $this->request->post('groups.tagDelete', $access_token, $params); + } + + /** + * Sets Long Poll notification settings + * + * @param string $access_token + * @param array $params + * - @var boolean user_unblock: User removed from community blacklist + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function tagUpdate($access_token, array $params = []) { + return $this->request->post('groups.tagUpdate', $access_token, $params); + } + /** * @param string $access_token * @param array $params diff --git a/src/VK/Actions/Messages.php b/src/VK/Actions/Messages.php index 636d2cb..ff3f59e 100644 --- a/src/VK/Actions/Messages.php +++ b/src/VK/Actions/Messages.php @@ -371,6 +371,26 @@ public function getHistoryAttachments($access_token, array $params = []) { return $this->request->post('messages.getHistoryAttachments', $access_token, $params); } + /** + * Returns important messages from the dialog or group chat. + * + * @param string $access_token + * @param array $params + * - @var integer count: Number of objects to return. + * - @var integer offset: Offset needed to return a specific subset of messages. + * - @var string start_message_id: Message ID to start return results from. + * - @var integer preview_length + * - @var array[MessagesFields] fields: Additional profile [vk.com/dev/fields|fields] to return. + * - @var boolean extended: '1' — return extra information about users and communities + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getImportantMessages($access_token, array $params = []) { + return $this->request->post('messages.getImportantMessages', $access_token, $params); + } + /** * @param string $access_token * @param array $params @@ -671,6 +691,34 @@ public function send($access_token, array $params = []) { return $this->request->post('messages.send', $access_token, $params); } + /** + * Sends a message event answer. + * + * @param string $access_token + * @param array $params + * - @var integer event_id: Event ID. + * - @var integer user_id: User ID (by default — current user). + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var string event_data + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist + * @throws VKApiMessagesDenySendException Can't send messages for users without permission + * @throws VKApiMessagesPrivacyException Can't send messages to this user due to their privacy settings + * @throws VKApiMessagesTooLongMessageException Message is too long + * @throws VKApiMessagesTooLongForwardsException Too many forwarded messages + * @throws VKApiMessagesCantFwdException Can't forward these messages + * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat + * @throws VKApiMessagesKeyboardInvalidException Keyboard format is invalid + * @throws VKApiMessagesChatBotFeatureException This is a chat bot feature, change this status in settings + * @throws VKApiMessagesContactNotFoundException Contact not found + * @throws VKApiMessagesTooManyPostsException Too many posts in messages + * @return mixed + */ + public function sendMessageEventAnswer($access_token, array $params = []) { + return $this->request->post('messages.sendMessageEventAnswer', $access_token, $params); + } + /** * Changes the status of a user as typing in a conversation. * diff --git a/src/VK/Client/VKApiClient.php b/src/VK/Client/VKApiClient.php index 03f5b34..7266332 100755 --- a/src/VK/Client/VKApiClient.php +++ b/src/VK/Client/VKApiClient.php @@ -6,10 +6,12 @@ use VK\Actions\Account; use VK\Actions\Ads; use VK\Actions\Apps; +use VK\Actions\AppWidgets; use VK\Actions\Auth; use VK\Actions\Board; use VK\Actions\Database; use VK\Actions\Docs; +use VK\Actions\Execute; use VK\Actions\Fave; use VK\Actions\Friends; use VK\Actions\Gifts; @@ -24,7 +26,6 @@ use VK\Actions\Orders; use VK\Actions\Pages; use VK\Actions\Photos; -use VK\Actions\Places; use VK\Actions\Polls; use VK\Actions\Search; use VK\Actions\Secure; @@ -63,6 +64,11 @@ class VKApiClient { */ private $apps; + /** + * @var AppWidgets + */ + private $appWidgets; + /** * @var Auth */ @@ -83,6 +89,11 @@ class VKApiClient { */ private $docs; + /** + * @var Execute + */ + private $execute; + /** * @var Fave */ @@ -153,11 +164,6 @@ class VKApiClient { */ private $photos; - /** - * @var Places - */ - private $places; - /** * @var Polls */ @@ -272,6 +278,17 @@ public function apps(): Apps { return $this->apps; } + /** + * @return AppWidgets + */ + public function appWidgets(): AppWidgets { + if (!$this->appWidgets) { + $this->appWidgets = new AppWidgets($this->request); + } + + return $this->appWidgets; + } + /** * @return Auth */ @@ -316,6 +333,17 @@ public function docs(): Docs { return $this->docs; } + /** + * @return Execute + */ + public function execute(): Execute { + if (!$this->execute) { + $this->execute = new Execute($this->request); + } + + return $this->execute; + } + /** * @return Fave */ @@ -470,17 +498,6 @@ public function photos(): Photos { return $this->photos; } - /** - * @return Places - */ - public function places(): Places { - if (!$this->places) { - $this->places = new Places($this->request); - } - - return $this->places; - } - /** * @return Polls */ From ce962c2d3495b9f9f2acbb2e0a1d6abba2f95974 Mon Sep 17 00:00:00 2001 From: iPopstop Date: Sun, 12 Jul 2020 19:34:49 +0300 Subject: [PATCH 2/7] Groups: onlineStatus, getTagList, setSettings, setUserNote, tagAdd, tagBind, tagDelete, tagUpdate AppWidgets: getAppImageUploadServer, getAppImages, getGroupImages, getGroupImagesById, saveAppImage, saveGroupImage --- src/VK/Actions/AppWidgets.php | 2 +- src/VK/Actions/Apps.php | 4 - src/VK/Actions/Execute.php | 45 ------------ src/VK/Actions/Groups.php | 133 ++++++++-------------------------- src/VK/Client/VKApiClient.php | 13 ++-- 5 files changed, 39 insertions(+), 158 deletions(-) delete mode 100644 src/VK/Actions/Execute.php diff --git a/src/VK/Actions/AppWidgets.php b/src/VK/Actions/AppWidgets.php index d279811..14896d6 100644 --- a/src/VK/Actions/AppWidgets.php +++ b/src/VK/Actions/AppWidgets.php @@ -95,7 +95,7 @@ public function getGroupImageUploadServer($access_token, $params = []) { * @return mixed */ public function getGroupImages($access_token, $params = []) { - return $this->request->post('appWidgets.getAppImages', $access_token, $params); + return $this->request->post('appWidgets.getGroupImages', $access_token, $params); } /** diff --git a/src/VK/Actions/Apps.php b/src/VK/Actions/Apps.php index ef00d2a..fd9a03c 100644 --- a/src/VK/Actions/Apps.php +++ b/src/VK/Actions/Apps.php @@ -147,10 +147,6 @@ public function getScore($access_token, array $params = []) { return $this->request->post('apps.getScore', $access_token, $params); } - /* promoHasActiveGiftПроверить есть ли у пользователя подарок в игре. -promoUseGift - */ - /** * Sends a request to another user in an app that uses VK authorization. * diff --git a/src/VK/Actions/Execute.php b/src/VK/Actions/Execute.php deleted file mode 100644 index e9f6c1b..0000000 --- a/src/VK/Actions/Execute.php +++ /dev/null @@ -1,45 +0,0 @@ -request = $request; - } - - /** - * Returns a collection of application images by id. - * - * @param string $access_token - * @param array $params - * - @var string code: VKScript code - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCompileException Unable to compile code - * @throws VKApiRuntimeException Runtime error occurred during code invocation - * @return mixed - */ - public function __invoke($access_token, $params = []) - { - return $this->request->post('execute', $access_token, $params); - } - -} diff --git a/src/VK/Actions/Groups.php b/src/VK/Actions/Groups.php index 117f326..d34bf07 100644 --- a/src/VK/Actions/Groups.php +++ b/src/VK/Actions/Groups.php @@ -617,16 +617,11 @@ public function getMembers($access_token, array $params = []) { } /** - * Returns a list of community members. - * + * Returns online status of community. + * * @param string $access_token * @param array $params - * - @var string group_id: ID or screen name of the community. - * - @var GroupsSort sort: Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', 'time_desc'. 'time_asc' and 'time_desc' are availavle only if the method is called by the group's 'moderator'. - * - @var integer offset: Offset needed to return a specific subset of community members. - * - @var integer count: Number of community members to return. - * - @var array[GroupsFields] fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. - * - @var GroupsFilter filter: *'friends' – only friends in this community will be returned,, *'unsure' – only those who pressed 'I may attend' will be returned (if it's an event). + * - @var integer group_id: ID of the community. * @throws VKClientException * @throws VKApiException * @throws VKApiParamGroupIdException Invalid group id @@ -668,7 +663,7 @@ public function getSettings($access_token, array $params = []) { } /** - * Returns community settings. + * Returns list of community tags. * * @param string $access_token * @param array $params @@ -920,52 +915,15 @@ public function setLongPollSettings($access_token, array $params = []) { } /** - * Sets Long Poll notification settings + * Sets community settings * * @param string $access_token * @param array $params * - @var integer group_id: Community ID. - * - @var boolean enabled: Sets whether Long Poll is enabled ('0' — disabled, '1' — enabled). - * - @var string api_version - * - @var boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). - * - @var boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). - * - @var boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). - * - @var boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). - * - @var boolean message_edit: A message has been edited ('0' — disabled, '1' — enabled). - * - @var boolean message_typing_state - * - @var boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). - * - @var boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). - * - @var boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). - * - @var boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). - * - @var boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). - * - @var boolean group_change_settings - * - @var boolean group_change_photo - * - @var boolean group_officers_edit - * - @var boolean user_block: User added to community blacklist - * - @var boolean user_unblock: User removed from community blacklist + * - @var boolean messages: Sets whether messages is enabled ('0' — disabled, '1' — enabled). + * - @var boolean bots_capabilities: Sets whether bots capabilities is enabled ('0' — disabled, '1' — enabled). + * - @var boolean bots_start_button: Start button ('0' — disabled, '1' — enabled). + * - @var boolean bots_add_to_chat: Users can add bots to conversations ('0' — disabled, '1' — enabled). * @throws VKClientException * @throws VKApiException * @return mixed @@ -975,52 +933,13 @@ public function setSettings($access_token, array $params = []) { } /** - * Sets Long Poll notification settings + * Set or update user note * * @param string $access_token * @param array $params * - @var integer group_id: Community ID. - * - @var boolean enabled: Sets whether Long Poll is enabled ('0' — disabled, '1' — enabled). - * - @var string api_version - * - @var boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). - * - @var boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). - * - @var boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). - * - @var boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). - * - @var boolean message_edit: A message has been edited ('0' — disabled, '1' — enabled). - * - @var boolean message_typing_state - * - @var boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). - * - @var boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). - * - @var boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). - * - @var boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). - * - @var boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). - * - @var boolean group_change_settings - * - @var boolean group_change_photo - * - @var boolean group_officers_edit - * - @var boolean user_block: User added to community blacklist - * - @var boolean user_unblock: User removed from community blacklist + * - @var integer user_id: User ID. + * - @var string note: Note text. * @throws VKClientException * @throws VKApiException * @return mixed @@ -1030,12 +949,14 @@ public function setUserNote($access_token, array $params = []) { } /** - * Sets Long Poll notification settings + * Add new tag to community * * @param string $access_token * @param array $params - * - @var boolean user_unblock: User removed from community blacklist - * @throws VKClientException + * - @var integer group_id: Community ID. + * - @var string tag_name: Name of tag. + * - @var string tag_color: Color of tag. + * @throws VKClientException * @throws VKApiException * @return mixed */ @@ -1044,11 +965,14 @@ public function tagAdd($access_token, array $params = []) { } /** - * Sets Long Poll notification settings + * Bind and unbind community's tags to conversations. * * @param string $access_token * @param array $params - * - @var boolean user_unblock: User removed from community blacklist + * - @var integer group_id: Community ID. + * - @var integer tag_id: Tag ID. + * - @var integer user_id: User ID. + * - @var string act: Tag Action. Values: *'bind',, *'unbind' * @throws VKClientException * @throws VKApiException * @return mixed @@ -1058,11 +982,12 @@ public function tagBind($access_token, array $params = []) { } /** - * Sets Long Poll notification settings + * Delete tag of community * * @param string $access_token * @param array $params - * - @var boolean user_unblock: User removed from community blacklist + * - @var integer group_id: Community ID. + * - @var integer tag_id: Tag ID. * @throws VKClientException * @throws VKApiException * @return mixed @@ -1072,11 +997,13 @@ public function tagDelete($access_token, array $params = []) { } /** - * Sets Long Poll notification settings - * + * Update tag of community + * * @param string $access_token * @param array $params - * - @var boolean user_unblock: User removed from community blacklist + * - @var integer group_id: Community ID. + * - @var integer tag_id: Tag ID. + * - @var string tag_name: Tag Name. * @throws VKClientException * @throws VKApiException * @return mixed diff --git a/src/VK/Client/VKApiClient.php b/src/VK/Client/VKApiClient.php index 7266332..2d20407 100755 --- a/src/VK/Client/VKApiClient.php +++ b/src/VK/Client/VKApiClient.php @@ -11,7 +11,6 @@ use VK\Actions\Board; use VK\Actions\Database; use VK\Actions\Docs; -use VK\Actions\Execute; use VK\Actions\Fave; use VK\Actions\Friends; use VK\Actions\Gifts; @@ -90,7 +89,7 @@ class VKApiClient { private $docs; /** - * @var Execute + * @var */ private $execute; @@ -334,11 +333,15 @@ public function docs(): Docs { } /** - * @return Execute + * @param string $access_token + * @param array $params + * - @var string code: VKScript code + * + * @return array */ - public function execute(): Execute { + public function execute($access_token, $params = []): array { if (!$this->execute) { - $this->execute = new Execute($this->request); + $this->execute = $this->request->post('execute', $access_token, $params); } return $this->execute; From e5329ad4d44ae612792b90f070e0cde320bcab54 Mon Sep 17 00:00:00 2001 From: iPopstop Date: Sun, 12 Jul 2020 19:49:10 +0300 Subject: [PATCH 3/7] VERSION 5.101 => 5.120 --- README.md | 8 ++++---- src/VK/Client/VKApiClient.php | 3 +-- src/VK/OAuth/VKOAuth.php | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a34c4a2..562139c 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ PHP library for VK API interaction, includes OAuth 2.0 authorization and API methods. Full VK API features documentation can be found [here](http://vk.com/dev). -This library has been created using the VK API JSON Schema. It can be found [here](https://github.com/VKCOM/vk-api-schema). It uses VK API [version](https://vk.com/dev/versions) 5.101 +This library has been created using the VK API JSON Schema. It can be found [here](https://github.com/VKCOM/vk-api-schema). It uses VK API [version](https://vk.com/dev/versions) 5.120 [![Packagist](https://img.shields.io/packagist/v/vkcom/vk-php-sdk.svg)](https://packagist.org/packages/vkcom/vk-php-sdk) @@ -29,11 +29,11 @@ $vk = new VK\Client\VKApiClient(); Also you can initialize `VKApiClient` with different API version and different language like this: ```php -$vk = new VKApiClient('5.101'); +$vk = new VKApiClient('5.120'); ``` ```php -$vk = new VKApiClient('5.101', VK\Client\Enums\VKLanguage::ENGLISH); +$vk = new VKApiClient('5.120', VK\Client\Enums\VKLanguage::ENGLISH); ``` ## 4. Authorization @@ -88,7 +88,7 @@ Then use this method to get the access token: ```php $oauth = new VK\OAuth\VKOAuth(); $client_id = 1234567; -$client_secret = 'SDAScasd' +$client_secret = 'SDAScasd'; $redirect_uri = 'https://example.com/vk'; $code = 'CODE'; diff --git a/src/VK/Client/VKApiClient.php b/src/VK/Client/VKApiClient.php index 2d20407..2e9c887 100755 --- a/src/VK/Client/VKApiClient.php +++ b/src/VK/Client/VKApiClient.php @@ -2,7 +2,6 @@ namespace VK\Client; -use VK\Client\Enums\VKLanguage; use VK\Actions\Account; use VK\Actions\Ads; use VK\Actions\Apps; @@ -40,7 +39,7 @@ use VK\Actions\Widgets; class VKApiClient { - protected const API_VERSION = '5.101'; + protected const API_VERSION = '5.120'; protected const API_HOST = 'https://api.vk.com/method'; /** diff --git a/src/VK/OAuth/VKOAuth.php b/src/VK/OAuth/VKOAuth.php index 7aefd76..337d85d 100755 --- a/src/VK/OAuth/VKOAuth.php +++ b/src/VK/OAuth/VKOAuth.php @@ -9,7 +9,7 @@ use VK\TransportClient\TransportRequestException; class VKOAuth { - protected const VERSION = '5.101'; + protected const VERSION = '5.120'; private const PARAM_VERSION = 'v'; private const PARAM_CLIENT_ID = 'client_id'; From 54359327ea3c30f469a4a29216bd0b883b364076 Mon Sep 17 00:00:00 2001 From: iPopstop Date: Sun, 12 Jul 2020 19:54:40 +0300 Subject: [PATCH 4/7] ... --- src/VK/Actions/Groups.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/VK/Actions/Groups.php b/src/VK/Actions/Groups.php index d34bf07..a8614da 100644 --- a/src/VK/Actions/Groups.php +++ b/src/VK/Actions/Groups.php @@ -167,18 +167,16 @@ public function create($access_token, array $params = []) { } /** - * Creates a new community. + * Delete community address. * * @param string $access_token * @param array $params - * - @var string title: Community title. - * - @var string description: Community description (ignored for 'type' = 'public'). - * - @var GroupsType type: Community type. Possible values: *'group' – group,, *'event' – event,, *'public' – public page - * - @var integer public_category: Category ID (for 'type' = 'public' only). - * - @var GroupsSubtype subtype: Public page subtype. Possible values: *'1' – place or small business,, *'2' – company, organization or website,, *'3' – famous person or group of people,, *'4' – product or work of art. - * @throws VKClientException + * - @var integer group_id: Group ID + * - @var integer address_id: Address ID + * @throws VKClientException * @throws VKApiException - * @throws VKApiLimitsException Out of limits + * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings + * @throws VKApiNotFoundException Not found * @return mixed */ public function deleteAddress($access_token, array $params = []) { From 1a6b869bbcc1d3f2bcb81e26550f1b5761bf9e57 Mon Sep 17 00:00:00 2001 From: iPopstop Date: Sun, 12 Jul 2020 19:54:40 +0300 Subject: [PATCH 5/7] ... --- src/VK/Actions/Groups.php | 14 ++++++-------- src/VK/Actions/Messages.php | 11 ----------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/VK/Actions/Groups.php b/src/VK/Actions/Groups.php index d34bf07..a8614da 100644 --- a/src/VK/Actions/Groups.php +++ b/src/VK/Actions/Groups.php @@ -167,18 +167,16 @@ public function create($access_token, array $params = []) { } /** - * Creates a new community. + * Delete community address. * * @param string $access_token * @param array $params - * - @var string title: Community title. - * - @var string description: Community description (ignored for 'type' = 'public'). - * - @var GroupsType type: Community type. Possible values: *'group' – group,, *'event' – event,, *'public' – public page - * - @var integer public_category: Category ID (for 'type' = 'public' only). - * - @var GroupsSubtype subtype: Public page subtype. Possible values: *'1' – place or small business,, *'2' – company, organization or website,, *'3' – famous person or group of people,, *'4' – product or work of art. - * @throws VKClientException + * - @var integer group_id: Group ID + * - @var integer address_id: Address ID + * @throws VKClientException * @throws VKApiException - * @throws VKApiLimitsException Out of limits + * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings + * @throws VKApiNotFoundException Not found * @return mixed */ public function deleteAddress($access_token, array $params = []) { diff --git a/src/VK/Actions/Messages.php b/src/VK/Actions/Messages.php index ff3f59e..4c6279d 100644 --- a/src/VK/Actions/Messages.php +++ b/src/VK/Actions/Messages.php @@ -702,17 +702,6 @@ public function send($access_token, array $params = []) { * - @var string event_data * @throws VKClientException * @throws VKApiException - * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist - * @throws VKApiMessagesDenySendException Can't send messages for users without permission - * @throws VKApiMessagesPrivacyException Can't send messages to this user due to their privacy settings - * @throws VKApiMessagesTooLongMessageException Message is too long - * @throws VKApiMessagesTooLongForwardsException Too many forwarded messages - * @throws VKApiMessagesCantFwdException Can't forward these messages - * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat - * @throws VKApiMessagesKeyboardInvalidException Keyboard format is invalid - * @throws VKApiMessagesChatBotFeatureException This is a chat bot feature, change this status in settings - * @throws VKApiMessagesContactNotFoundException Contact not found - * @throws VKApiMessagesTooManyPostsException Too many posts in messages * @return mixed */ public function sendMessageEventAnswer($access_token, array $params = []) { From 8c7426751a59d432f22a1629253d28402eacde2a Mon Sep 17 00:00:00 2001 From: iPopstop <26607111+iPopstop@users.noreply.github.com> Date: Fri, 7 May 2021 22:41:54 +0300 Subject: [PATCH 6/7] 5.120 => 5.130 --- src/VK/Actions/Account.php | 646 ++--- src/VK/Actions/Ads.php | 1500 +++++++----- src/VK/Actions/Adsweb.php | 138 ++ src/VK/Actions/AppWidgets.php | 266 +- src/VK/Actions/Apps.php | 412 ++-- src/VK/Actions/Auth.php | 86 +- src/VK/Actions/Board.php | 529 ++-- src/VK/Actions/Database.php | 443 ++-- src/VK/Actions/Docs.php | 427 ++-- src/VK/Actions/Donut.php | 94 + src/VK/Actions/DownloadedGames.php | 42 + .../AccountSaveProfileInfoBdateVisibility.php | 9 + .../Enum/AccountSaveProfileInfoRelation.php | 14 + .../Enum/AccountSaveProfileInfoSex.php | 9 + src/VK/Actions/Enum/AdsCheckLinkLinkType.php | 11 + .../Enum/AdsGetDemographicsIdsType.php | 8 + .../Actions/Enum/AdsGetDemographicsPeriod.php | 9 + .../Actions/Enum/AdsGetPostsReachIdsType.php | 8 + .../Actions/Enum/AdsGetStatisticsIdsType.php | 10 + .../Actions/Enum/AdsGetStatisticsPeriod.php | 9 + src/VK/Actions/Enum/AdsGetSuggestionsLang.php | 9 + .../Actions/Enum/AdsGetSuggestionsSection.php | 18 + .../Enum/AdsGetTargetingStatsAdFormat.php | 14 + .../Actions/Enum/AdsGetUploadURLAdFormat.php | 11 + ...idgetsGetAppImageUploadServerImageType.php | 11 + .../Enum/AppWidgetsGetAppImagesImageType.php | 11 + ...getsGetGroupImageUploadServerImageType.php | 11 + .../AppWidgetsGetGroupImagesImageType.php | 11 + src/VK/Actions/Enum/AppWidgetsUpdateType.php | 15 + src/VK/Actions/Enum/AppsGetCatalogFilter.php | 10 + src/VK/Actions/Enum/AppsGetCatalogSort.php | 11 + .../Actions/Enum/AppsGetFriendsListType.php | 8 + .../Actions/Enum/AppsGetLeaderboardType.php | 9 + src/VK/Actions/Enum/AppsGetNameCase.php | 12 + src/VK/Actions/Enum/AppsGetPlatform.php | 10 + src/VK/Actions/Enum/AppsGetScopesType.php | 8 + src/VK/Actions/Enum/AppsSendRequestType.php | 8 + src/VK/Actions/Enum/BoardGetCommentsSort.php | 8 + src/VK/Actions/Enum/BoardGetTopicsOrder.php | 11 + src/VK/Actions/Enum/BoardGetTopicsPreview.php | 9 + .../Enum/DocsGetMessagesUploadServerType.php | 9 + src/VK/Actions/Enum/DocsGetType.php | 15 + src/VK/Actions/Enum/FaveAddTagPosition.php | 8 + src/VK/Actions/Enum/FaveGetItemType.php | 16 + src/VK/Actions/Enum/FaveGetPagesType.php | 9 + src/VK/Actions/Enum/FaveSetTagsItemType.php | 16 + src/VK/Actions/Enum/FriendsGetNameCase.php | 12 + src/VK/Actions/Enum/FriendsGetOrder.php | 11 + .../Actions/Enum/FriendsGetRequestsSort.php | 9 + .../Enum/FriendsGetSuggestionsNameCase.php | 12 + src/VK/Actions/Enum/FriendsSearchNameCase.php | 12 + .../Enum/GroupsAddAddressWorkInfoStatus.php | 11 + src/VK/Actions/Enum/GroupsCreateSubtype.php | 10 + src/VK/Actions/Enum/GroupsCreateType.php | 9 + .../Enum/GroupsEditAddressWorkInfoStatus.php | 11 + src/VK/Actions/Enum/GroupsEditAgeLimits.php | 9 + .../Enum/GroupsGetInvitedUsersNameCase.php | 12 + .../Actions/Enum/GroupsGetMembersFilter.php | 10 + src/VK/Actions/Enum/GroupsGetMembersSort.php | 10 + src/VK/Actions/Enum/GroupsSearchSort.php | 12 + src/VK/Actions/Enum/GroupsSearchType.php | 9 + src/VK/Actions/Enum/GroupsTagAddTagColor.php | 26 + src/VK/Actions/Enum/GroupsTagBindAct.php | 8 + .../Actions/Enum/GroupsToggleMarketState.php | 9 + src/VK/Actions/Enum/LikesGetListFilter.php | 8 + .../Actions/Enum/LikesGetListFriendsOnly.php | 10 + .../Enum/MarketEditOrderPaymentStatus.php | 9 + src/VK/Actions/Enum/MarketGetCommentsSort.php | 8 + .../Enum/MarketReportCommentReason.php | 13 + src/VK/Actions/Enum/MarketReportReason.php | 13 + src/VK/Actions/Enum/MarketSearchRev.php | 8 + src/VK/Actions/Enum/MarketSearchSort.php | 10 + src/VK/Actions/Enum/MarketSearchStatus.php | 8 + .../Enum/MessagesGetConversationsFilter.php | 10 + ...MessagesGetHistoryAttachmentsMediaType.php | 16 + src/VK/Actions/Enum/MessagesGetHistoryRev.php | 8 + .../Enum/MessagesGetIntentUsersIntent.php | 9 + src/VK/Actions/Enum/MessagesSendIntent.php | 17 + .../Actions/Enum/MessagesSetActivityType.php | 11 + .../Enum/NewsfeedGetBannedNameCase.php | 12 + .../Actions/Enum/NewsfeedUnsubscribeType.php | 11 + src/VK/Actions/Enum/NotesGetCommentsSort.php | 8 + src/VK/Actions/Enum/NotesGetSort.php | 8 + .../NotificationsSendMessageSendingMode.php | 9 + .../Actions/Enum/OrdersChangeStateAction.php | 9 + src/VK/Actions/Enum/PagesSaveAccessEdit.php | 9 + src/VK/Actions/Enum/PagesSaveAccessView.php | 9 + src/VK/Actions/Enum/PhotosGetCommentsSort.php | 8 + .../Enum/PhotosReportCommentReason.php | 13 + src/VK/Actions/Enum/PhotosReportReason.php | 13 + .../Actions/Enum/PollsCreateBackgroundId.php | 13 + src/VK/Actions/Enum/PollsEditBackgroundId.php | 14 + src/VK/Actions/Enum/PollsGetByIdNameCase.php | 12 + .../Actions/Enum/PollsGetVotersNameCase.php | 12 + src/VK/Actions/Enum/StatsGetInterval.php | 11 + .../Enum/StreamingSetSettingsMonthlyTier.php | 13 + .../Enum/UsersGetFollowersNameCase.php | 12 + src/VK/Actions/Enum/UsersGetNameCase.php | 12 + src/VK/Actions/Enum/UsersReportType.php | 10 + src/VK/Actions/Enum/UsersSearchSex.php | 9 + src/VK/Actions/Enum/UsersSearchSort.php | 8 + src/VK/Actions/Enum/UsersSearchStatus.php | 14 + .../Enum/UtilsGetLinkStatsInterval.php | 11 + .../Actions/Enum/UtilsGetLinkStatsSource.php | 8 + src/VK/Actions/Enum/VideoGetCommentsSort.php | 8 + .../Actions/Enum/VideoReportCommentReason.php | 13 + src/VK/Actions/Enum/VideoReportReason.php | 13 + src/VK/Actions/Enum/VideoSearchSort.php | 9 + src/VK/Actions/Enum/WallGetCommentsSort.php | 8 + .../Actions/Enum/WallReportCommentReason.php | 13 + src/VK/Actions/Enum/WallReportPostReason.php | 13 + .../Actions/Enums/AccountBdateVisibility.php | 19 - src/VK/Actions/Enums/AccountFields.php | 31 - src/VK/Actions/Enums/AccountFilter.php | 47 - src/VK/Actions/Enums/AccountRelation.php | 39 - src/VK/Actions/Enums/AccountSex.php | 19 - src/VK/Actions/Enums/AdsAdFormat.php | 27 - src/VK/Actions/Enums/AdsIdsType.php | 23 - src/VK/Actions/Enums/AdsLang.php | 19 - src/VK/Actions/Enums/AdsLinkType.php | 27 - src/VK/Actions/Enums/AdsPeriod.php | 19 - src/VK/Actions/Enums/AdsSection.php | 55 - src/VK/Actions/Enums/AppWidgetsType.php | 43 - src/VK/Actions/Enums/AppsFields.php | 275 --- src/VK/Actions/Enums/AppsFilter.php | 23 - src/VK/Actions/Enums/AppsNameCase.php | 31 - src/VK/Actions/Enums/AppsPlatform.php | 23 - src/VK/Actions/Enums/AppsSort.php | 27 - src/VK/Actions/Enums/AppsType.php | 15 - src/VK/Actions/Enums/BoardOrder.php | 27 - src/VK/Actions/Enums/BoardPreview.php | 19 - src/VK/Actions/Enums/BoardSort.php | 15 - src/VK/Actions/Enums/DocsType.php | 19 - src/VK/Actions/Enums/FaveFields.php | 407 ---- src/VK/Actions/Enums/FaveItemType.php | 39 - src/VK/Actions/Enums/FaveType.php | 19 - src/VK/Actions/Enums/FriendsFields.php | 275 --- src/VK/Actions/Enums/FriendsFilter.php | 19 - src/VK/Actions/Enums/FriendsNameCase.php | 31 - src/VK/Actions/Enums/FriendsOrder.php | 15 - src/VK/Actions/Enums/FriendsSort.php | 15 - .../Enums/Groups/AddressWorkInfoStatus.php | 27 - src/VK/Actions/Enums/Groups/GroupAccess.php | 19 - .../Actions/Enums/Groups/GroupAgeLimits.php | 19 - src/VK/Actions/Enums/Groups/GroupAudio.php | 19 - src/VK/Actions/Enums/Groups/GroupDocs.php | 19 - .../Enums/Groups/GroupMarketCurrency.php | 27 - src/VK/Actions/Enums/Groups/GroupPhotos.php | 19 - src/VK/Actions/Enums/Groups/GroupRole.php | 19 - src/VK/Actions/Enums/Groups/GroupSubject.php | 175 -- src/VK/Actions/Enums/Groups/GroupTopics.php | 19 - src/VK/Actions/Enums/Groups/GroupVideo.php | 19 - src/VK/Actions/Enums/Groups/GroupWall.php | 23 - src/VK/Actions/Enums/Groups/GroupWiki.php | 19 - src/VK/Actions/Enums/GroupsAccess.php | 19 - src/VK/Actions/Enums/GroupsAgeLimits.php | 19 - src/VK/Actions/Enums/GroupsAudio.php | 19 - src/VK/Actions/Enums/GroupsDocs.php | 19 - src/VK/Actions/Enums/GroupsFields.php | 275 --- src/VK/Actions/Enums/GroupsFilter.php | 15 - src/VK/Actions/Enums/GroupsMarketCurrency.php | 27 - src/VK/Actions/Enums/GroupsNameCase.php | 31 - src/VK/Actions/Enums/GroupsPhotos.php | 19 - src/VK/Actions/Enums/GroupsRole.php | 19 - src/VK/Actions/Enums/GroupsSort.php | 31 - src/VK/Actions/Enums/GroupsSubject.php | 175 -- src/VK/Actions/Enums/GroupsSubtype.php | 23 - src/VK/Actions/Enums/GroupsTopics.php | 19 - src/VK/Actions/Enums/GroupsType.php | 19 - src/VK/Actions/Enums/GroupsVideo.php | 19 - src/VK/Actions/Enums/GroupsWall.php | 23 - src/VK/Actions/Enums/GroupsWiki.php | 19 - src/VK/Actions/Enums/GroupsWorkInfoStatus.php | 27 - src/VK/Actions/Enums/LeadsStatus.php | 27 - src/VK/Actions/Enums/LikesFilter.php | 15 - src/VK/Actions/Enums/LikesFriendsOnly.php | 23 - src/VK/Actions/Enums/LikesType.php | 55 - src/VK/Actions/Enums/MarketFields.php | 275 --- src/VK/Actions/Enums/MarketReason.php | 35 - src/VK/Actions/Enums/MarketRev.php | 15 - src/VK/Actions/Enums/MarketSort.php | 23 - src/VK/Actions/Enums/MarketStatus.php | 15 - src/VK/Actions/Enums/MessagesFields.php | 275 --- src/VK/Actions/Enums/MessagesFilter.php | 31 - src/VK/Actions/Enums/MessagesMediaType.php | 47 - src/VK/Actions/Enums/MessagesRev.php | 15 - .../Actions/Enums/Newsfeed/IgnoreItemType.php | 31 - src/VK/Actions/Enums/NewsfeedFields.php | 407 ---- src/VK/Actions/Enums/NewsfeedFilters.php | 27 - src/VK/Actions/Enums/NewsfeedNameCase.php | 31 - src/VK/Actions/Enums/NewsfeedType.php | 27 - src/VK/Actions/Enums/NotesSort.php | 15 - src/VK/Actions/Enums/NotificationsFilters.php | 35 - src/VK/Actions/Enums/OrdersAction.php | 19 - src/VK/Actions/Enums/PagesEdit.php | 19 - src/VK/Actions/Enums/PagesView.php | 19 - src/VK/Actions/Enums/PhotosFields.php | 275 --- src/VK/Actions/Enums/PhotosReason.php | 35 - src/VK/Actions/Enums/PhotosSort.php | 15 - src/VK/Actions/Enums/PollsBackgroundId.php | 39 - src/VK/Actions/Enums/PollsFields.php | 275 --- src/VK/Actions/Enums/PollsNameCase.php | 31 - .../Actions/Enums/Stories/UploadLinkText.php | 87 - src/VK/Actions/Enums/StoriesFields.php | 407 ---- src/VK/Actions/Enums/StoriesLinkText.php | 87 - src/VK/Actions/Enums/StreamingMonthlyTier.php | 35 - src/VK/Actions/Enums/UsersFields.php | 275 --- src/VK/Actions/Enums/UsersNameCase.php | 31 - src/VK/Actions/Enums/UsersSex.php | 19 - src/VK/Actions/Enums/UsersSort.php | 15 - src/VK/Actions/Enums/UsersStatus.php | 39 - src/VK/Actions/Enums/UsersType.php | 23 - src/VK/Actions/Enums/UtilsInterval.php | 27 - src/VK/Actions/Enums/UtilsSource.php | 15 - src/VK/Actions/Enums/VideoFilters.php | 23 - src/VK/Actions/Enums/VideoPrivacy.php | 23 - src/VK/Actions/Enums/VideoReason.php | 35 - src/VK/Actions/Enums/VideoSort.php | 19 - src/VK/Actions/Enums/WallFields.php | 407 ---- src/VK/Actions/Enums/WallFilter.php | 27 - src/VK/Actions/Enums/WallReason.php | 35 - src/VK/Actions/Enums/WallSort.php | 15 - src/VK/Actions/Enums/WidgetsFields.php | 275 --- src/VK/Actions/Fave.php | 701 +++--- src/VK/Actions/Friends.php | 688 +++--- src/VK/Actions/Gifts.php | 60 +- src/VK/Actions/Groups.php | 2132 +++++++++-------- src/VK/Actions/Leads.php | 137 -- src/VK/Actions/Likes.php | 207 +- src/VK/Actions/Market.php | 1148 +++++---- src/VK/Actions/Messages.php | 1651 +++++++------ src/VK/Actions/Newsfeed.php | 592 +++-- src/VK/Actions/Notes.php | 393 +-- src/VK/Actions/Notifications.php | 138 +- src/VK/Actions/Orders.php | 295 +-- src/VK/Actions/Pages.php | 322 +-- src/VK/Actions/Photos.php | 1815 +++++++------- src/VK/Actions/Podcasts.php | 41 + src/VK/Actions/Polls.php | 368 +-- src/VK/Actions/PrettyCards.php | 227 +- src/VK/Actions/Search.php | 66 +- src/VK/Actions/Secure.php | 361 +-- src/VK/Actions/Stats.php | 134 +- src/VK/Actions/Status.php | 93 +- src/VK/Actions/Storage.php | 132 +- src/VK/Actions/Store.php | 115 + src/VK/Actions/Stories.php | 563 +++-- src/VK/Actions/Streaming.php | 82 +- src/VK/Actions/Users.php | 300 +-- src/VK/Actions/Utils.php | 247 +- src/VK/Actions/Video.php | 973 ++++---- src/VK/Actions/Wall.php | 1023 ++++---- src/VK/Actions/Widgets.php | 105 +- src/VK/Client/{Enums => Enum}/VKLanguage.php | 2 +- src/VK/Client/VKApiClient.php | 140 +- src/VK/Exceptions/Api/ExceptionMapper.php | 383 ++- .../Api/VKApiAccessAlbumException.php | 19 - .../Api/VKApiAccessAudioException.php | 19 - .../Api/VKApiAccessCommentException.php | 19 - .../Api/VKApiAccessDeniedException.php | 16 + ...piAccessDeniedPleaseVoteFirstException.php | 16 + .../Exceptions/Api/VKApiAccessException.php | 19 - .../Api/VKApiAccessGroupException.php | 19 - .../Api/VKApiAccessGroupsException.php | 19 - .../Api/VKApiAccessMarketException.php | 19 - .../Api/VKApiAccessMenuException.php | 19 - .../Api/VKApiAccessNoteCommentException.php | 19 - .../Api/VKApiAccessNoteException.php | 19 - .../Api/VKApiAccessPageException.php | 19 - ...VKApiAccessToAddingPostDeniedException.php | 16 + .../VKApiAccessToCommentDeniedException.php | 16 + ...essToDocumentDeletingIsDeniedException.php | 16 + ...VKApiAccessToDocumentIsDeniedException.php | 16 + .../Api/VKApiAccessToNoteDeniedException.php | 16 + .../Api/VKApiAccessToPageDeniedException.php | 16 + .../Api/VKApiAccessToPollDeniedException.php | 16 + ...ApiAccessToPostCommentsDeniedException.php | 16 + ...piAccessToStatusRepliesDeniedException.php | 16 + ...dDueToTheUsersPrivacySettingsException.php | 16 + ...ccessToTheMenuOfTheUserDeniedException.php | 16 + ...ApiAccessToWallsCommentDeniedException.php | 16 + .../VKApiAccessToWallsPostDeniedException.php | 16 + .../Api/VKApiAccessVideoException.php | 19 - .../Api/VKApiActionFailedException.php | 19 - .../Api/VKApiAdsObjectDeletedException.php | 19 - .../Api/VKApiAdsPartialSuccessException.php | 19 - .../Api/VKApiAdsPermissionException.php | 19 - .../Api/VKApiAdsSpecificException.php | 19 - ...rtisementPostWasRecentlyAddedException.php | 16 + .../Api/VKApiAlbumFullException.php | 19 - .../Api/VKApiAlbumNotFoundException.php | 16 + .../Api/VKApiAlbumsLimitException.php | 19 - ...ApiAlbumsNumberLimitIsReachedException.php | 16 + .../Exceptions/Api/VKApiAppAuthException.php | 19 - ...plicationHasInsufficientFundsException.php | 16 + ...tionIsNotInstalledInCommunityException.php | 16 + .../Api/VKApiAppsAlreadyUnlockedException.php | 19 - ...AppsSubscriptionInvalidStatusException.php | 19 - ...VKApiAppsSubscriptionNotFoundException.php | 19 - .../Api/VKApiAuthDelayException.php | 19 - src/VK/Exceptions/Api/VKApiAuthException.php | 19 - .../Api/VKApiAuthFloodException.php | 19 - .../Api/VKApiAuthHttpsException.php | 19 - .../Api/VKApiAuthValidationException.php | 19 - .../Exceptions/Api/VKApiBlockedException.php | 19 - .../VKApiCallbackApiServersLimitException.php | 19 - ...heyHavePutYouOnTheirBlacklistException.php | 16 + ...isUserToFriendsAsUserNotFoundException.php | 16 + ...FriendsAsYouPutHimOnBlacklistException.php | 16 + ...iCannotAddUserHimselfAsFriendException.php | 16 + .../VKApiCannotEditCreatorRoleException.php | 16 + .../VKApiCannotPinOne-timeStoryException.php | 16 + .../Api/VKApiCannotUseThisIntentException.php | 16 + ...BecauseUserHasNoAccessToGroupException.php | 16 + ...DeleteThisMessageForEverybodyException.php | 16 + ...VKApiCantEditPinnedMessageYetException.php | 16 + ...KApiCantEditThisKindOfMessageException.php | 16 + ...itThisMessageBecauseItsTooOldException.php | 16 + ...VKApiCantForwardTheseMessagesException.php | 16 + ...iCantSendMessageReplyTimedOutException.php | 16 + ...MessagesForUsersFromBlacklistException.php | 16 + ...agesForUsersWithoutPermissionException.php | 16 + ...UserDueToTheirPrivacySettingsException.php | 16 + ...ntThisMessageBecauseItsTooBigException.php | 16 + ...iexpressTagToThisTypeOfObjectException.php | 16 + .../Exceptions/Api/VKApiCaptchaException.php | 19 - .../VKApiCardIsConnectedToPostException.php | 16 + .../Api/VKApiCardNotFoundException.php | 16 + .../Api/VKApiCartIsEmptyException.php | 16 + ...iesAreNotAvailableForThisUserException.php | 16 + ...alogIsNotAvailableForThisUserException.php | 16 + .../Api/VKApiChatDoesNotExistException.php | 16 + .../Api/VKApiChatNotSupportedException.php | 16 + .../Api/VKApiChatWasDisabledException.php | 16 + .../Api/VKApiClientUpdateNeededException.php | 16 + ...ommentsForThisMarketAreClosedException.php | 16 + ...CommentsForThisVideoAreClosedException.php | 16 + ...ApiCommunitiesCatalogDisabledException.php | 19 - ...CommunitiesCategoriesDisabledException.php | 19 - .../Exceptions/Api/VKApiCompileException.php | 19 - .../Api/VKApiContactNotFoundException.php | 16 + .../Api/VKApiContentBlockedException.php | 16 + .../Api/VKApiCouldntSaveFileException.php | 16 + ...ightCornerIsOutsideOfTheImageException.php | 16 + ...iCropSizeIsLessThanTheMinimumException.php | 16 + .../Exceptions/Api/VKApiDisabledException.php | 19 - .../Api/VKApiDonutIsDisabledException.php | 16 + .../Api/VKApiEnabledInTestException.php | 19 - ...VKApiExtendedMarketNotEnabledException.php | 16 + src/VK/Exceptions/Api/VKApiFloodException.php | 19 - .../Api/VKApiFriendsAddEnemyException.php | 19 - .../Api/VKApiFriendsAddInEnemyException.php | 19 - .../Api/VKApiFriendsAddNotFoundException.php | 19 - .../Api/VKApiFriendsAddYourselfException.php | 19 - .../Api/VKApiFriendsListIdException.php | 19 - .../Api/VKApiFriendsListLimitException.php | 19 - ...pAppIsNotInstalledInCommunityException.php | 19 - .../Api/VKApiGroupAuthException.php | 19 - .../Api/VKApiGroupChangeCreatorException.php | 19 - .../Api/VKApiGroupHostNeed2faException.php | 19 - .../Api/VKApiGroupNeed2faException.php | 19 - .../Api/VKApiGroupNotInClubException.php | 19 - .../VKApiGroupTooManyAddressesException.php | 19 - .../VKApiGroupTooManyOfficersException.php | 19 - ...GroupingAlreadyHasSuchVariantException.php | 16 + ...roupingMustHaveTwoOrMoreItemsException.php | 16 + .../VKApiHyperlinksAreForbiddenException.php | 16 + .../VKApiIncorrectReplyPrivacyException.php | 16 + .../Api/VKApiInsufficientFundsException.php | 19 - .../Api/VKApiInvalidAddressException.php | 19 - .../Api/VKApiInvalidAlbumIdException.php | 16 + .../Api/VKApiInvalidAnswerIdException.php | 16 + .../Api/VKApiInvalidDocumentIdException.php | 16 + .../VKApiInvalidDocumentTitleException.php | 16 + .../Api/VKApiInvalidGroupIdException.php | 16 + .../Api/VKApiInvalidHashException.php | 16 + .../VKApiInvalidImageCropFormatException.php | 16 + .../Api/VKApiInvalidListIdException.php | 16 + .../Api/VKApiInvalidPhotoException.php | 16 + .../Api/VKApiInvalidPhotosException.php | 16 + .../Api/VKApiInvalidPollIdException.php | 16 + .../Api/VKApiInvalidScreenNameException.php | 16 + .../Api/VKApiInvalidServerException.php | 16 + .../Api/VKApiInvalidTitleException.php | 16 + ...lid-ExpiredDeletedOrNotExistsException.php | 16 + .../VKApiItemAlreadyAddedToAlbumException.php | 16 + ...iItemHasBadLinksInDescriptionException.php | 16 + ...temMustHaveDistinctPropertiesException.php | 16 + .../Api/VKApiItemNotFoundException.php | 16 + .../VKApiKeyboardFormatIsInvalidException.php | 16 + .../Exceptions/Api/VKApiLimitsException.php | 19 - ...piLimitsOverflowForThisIntentException.php | 16 + .../Api/VKApiMarketAlbumNotFoundException.php | 19 - .../VKApiMarketCommentsClosedException.php | 19 - ...emsMustHaveDistinctPropertiesException.php | 19 - ...ingMustContainMoreThanOneItemException.php | 19 - .../VKApiMarketItemAlreadyAddedException.php | 19 - .../VKApiMarketItemHasBadLinksException.php | 19 - .../Api/VKApiMarketItemNotFoundException.php | 19 - .../Api/VKApiMarketNotEnabledException.php | 16 + .../VKApiMarketPropertyNotFoundException.php | 19 - .../VKApiMarketRestoreTooLateException.php | 19 - .../Api/VKApiMarketTooManyAlbumsException.php | 19 - .../Api/VKApiMarketTooManyItemsException.php | 19 - ...KApiMarketTooManyItemsInAlbumException.php | 19 - .../VKApiMarketVariantNotFoundException.php | 19 - ...WasAlreadyDisabledInThisGroupException.php | 16 + ...tWasAlreadyEnabledInThisGroupException.php | 16 + .../Api/VKApiMessageIsTooLongException.php | 16 + ...KApiMessageRequestAlreadySentException.php | 16 + ...iMessagesCantChangeInviteLinkException.php | 19 - ...VKApiMessagesCantDeleteForAllException.php | 19 - .../Api/VKApiMessagesCantFwdException.php | 19 - ...piMessagesCantPinOneTimeStoryException.php | 19 - ...KApiMessagesCantSeeInviteLinkException.php | 19 - .../VKApiMessagesChatBotFeatureException.php | 19 - .../VKApiMessagesChatNotAdminException.php | 19 - .../VKApiMessagesChatNotExistException.php | 19 - ...VKApiMessagesChatUserNoAccessException.php | 19 - ...KApiMessagesChatUserNotInChatException.php | 19 - .../VKApiMessagesContactNotFoundException.php | 19 - .../Api/VKApiMessagesDenySendException.php | 19 - .../Api/VKApiMessagesEditExpiredException.php | 19 - ...ApiMessagesEditKindDisallowedException.php | 19 - .../VKApiMessagesGroupPeerAccessException.php | 19 - .../VKApiMessagesKeyboardInvalidException.php | 19 - ...agesMessageRequestAlreadySendException.php | 19 - ...agesMessageRequestAlreadySentException.php | 19 - .../Api/VKApiMessagesPrivacyException.php | 19 - .../Api/VKApiMessagesTooBigException.php | 19 - .../VKApiMessagesTooLongForwardsException.php | 19 - .../VKApiMessagesTooLongMessageException.php | 19 - .../VKApiMessagesTooManyPostsException.php | 19 - .../Api/VKApiMessagesTooNewPtsException.php | 19 - .../Api/VKApiMessagesTooOldPtsException.php | 19 - .../Api/VKApiMessagesUserBlockedException.php | 19 - .../Api/VKApiMethodAdsException.php | 19 - .../Api/VKApiMethodDisabledException.php | 19 - .../Exceptions/Api/VKApiMethodException.php | 19 - ...ionWasInterruptedDueToTimeoutException.php | 16 + .../Api/VKApiMethodPermissionException.php | 19 - .../Api/VKApiMobileNotActivatedException.php | 19 - .../Api/VKApiNeedConfirmationException.php | 19 - .../VKApiNeedTokenConfirmationException.php | 19 - .../Exceptions/Api/VKApiNotFoundException.php | 19 +- .../Api/VKApiNoteNotFoundException.php | 16 + .../Api/VKApiObjectDeletedException.php | 16 + .../VKApiOriginalPhotoWasChangedException.php | 16 + .../Api/VKApiOutOfLimitsException.php | 16 + .../Api/VKApiPageNotFoundException.php | 16 + .../Api/VKApiParamAlbumIdException.php | 19 - .../Api/VKApiParamApiIdException.php | 19 - .../Api/VKApiParamDocAccessException.php | 19 - .../VKApiParamDocDeleteAccessException.php | 19 - .../Api/VKApiParamDocIdException.php | 19 - .../Api/VKApiParamDocTitleException.php | 19 - src/VK/Exceptions/Api/VKApiParamException.php | 19 - .../Api/VKApiParamGroupIdException.php | 19 - .../Api/VKApiParamHashException.php | 19 - .../Api/VKApiParamNoteIdException.php | 19 - .../Api/VKApiParamPageIdException.php | 19 - .../Api/VKApiParamPhoneException.php | 19 - .../Api/VKApiParamPhotoException.php | 19 - .../Api/VKApiParamPhotosException.php | 19 - .../Api/VKApiParamServerException.php | 19 - .../Api/VKApiParamTimestampException.php | 19 - .../Api/VKApiParamTitleException.php | 19 - .../Api/VKApiParamUserIdException.php | 19 - ...oManyActionsThisDay.TryLater.Exception.php | 16 + .../Api/VKApiPermissionException.php | 19 - .../Api/VKApiPhoneAlreadyUsedException.php | 19 - .../Api/VKApiPhotoChangedException.php | 19 - .../Api/VKApiPollsAccessException.php | 19 - .../VKApiPollsAccessWithoutVoteException.php | 19 - .../Api/VKApiPollsAnswerIdException.php | 19 - .../Api/VKApiPollsPollIdException.php | 19 - ...ttyCardsCardIsConnectedToPostException.php | 19 - .../VKApiPrettyCardsCardNotFoundException.php | 19 - .../VKApiPrettyCardsTooManyCardsException.php | 19 - .../Api/VKApiPrivateProfileException.php | 19 - .../Api/VKApiPropertyNotFoundException.php | 16 + .../Api/VKApiRateLimitException.php | 19 - ...eachedTheMaximumNumberOfListsException.php | 16 + ...ionCanNotBeAppliedToTheObjectException.php | 16 + .../Exceptions/Api/VKApiRequestException.php | 19 - .../Exceptions/Api/VKApiRuntimeException.php | 19 - ...eOccurredDuringCodeInvocationException.php | 16 + .../Exceptions/Api/VKApiSaveFileException.php | 19 - .../Exceptions/Api/VKApiServerException.php | 19 - ...piServersNumberLimitIsReachedException.php | 16 + .../Api/VKApiSignatureException.php | 19 - ...TheRequestHasNotBeenCompletedException.php | 16 + ...nkIsIncorrect(cantFindSource)Exception.php | 16 + ...gthHeightAndWeightAllTogetherException.php | 16 + .../Api/VKApiStatusNoAudioException.php | 19 - .../VKApiStickersAreNotFavoriteException.php | 16 + .../VKApiStickersAreNotPurchasedException.php | 16 + .../Api/VKApiStoryExpiredException.php | 19 - .../VKApiStoryHasAlreadyExpiredException.php | 16 + ...ApiStoryIncorrectReplyPrivacyException.php | 19 - ...SubscriptionIsInInvalidStatusException.php | 16 + .../VKApiSubscriptionNotFoundException.php | 16 + ...obileNumberOfTheUserIsUnknownException.php | 16 + ...sAchievementIsAlreadyUnlockedException.php | 16 + ...ureChangeThisStatusInSettingsException.php | 16 + .../VKApiThisVideoIsAlreadyAddedException.php | 16 + .../Api/VKApiTooLateForRestoreException.php | 16 + .../VKApiTooManyAddressesInClubException.php | 16 + .../Api/VKApiTooManyAdsPostsException.php | 16 + .../Api/VKApiTooManyAlbumsException.php | 16 + ...ManyAuthAttemptsTryAgainLaterException.php | 16 + .../Api/VKApiTooManyCardsException.php | 16 + .../Exceptions/Api/VKApiTooManyException.php | 19 - .../VKApiTooManyFavoriteStickersException.php | 16 + .../Api/VKApiTooManyFeedListsException.php | 16 + ...VKApiTooManyForwardedMessagesException.php | 16 + .../Api/VKApiTooManyItemsException.php | 16 + .../Api/VKApiTooManyItemsInAlbumException.php | 16 + .../Api/VKApiTooManyListsException.php | 19 - .../VKApiTooManyOfficersInClubException.php | 16 + .../VKApiTooManyPostsInMessagesException.php | 16 + .../Api/VKApiTooManyRecipientsException.php | 16 + .../Api/VKApiTooManyRepliesException.php | 16 + .../Api/VKApiUnableToCompileCodeException.php | 16 + .../VKApiUnableToProcessActionException.php | 16 + .../Exceptions/Api/VKApiUnknownException.php | 19 - .../Exceptions/Api/VKApiUploadException.php | 19 +- .../Api/VKApiUserDeletedException.php | 19 - ...serDisabledTrackNameBroadcastException.php | 16 + ...NeedsToEnable2faForThisActionException.php | 16 + .../Api/VKApiUserNotFoundInChatException.php | 16 + .../Api/VKApiUserShouldBeInClubException.php | 16 + .../VKApiValueOfTsOrPtsIsTooNewException.php | 16 + .../VKApiValueOfTsOrPtsIsTooOldException.php | 16 + .../Api/VKApiVariantNotFoundException.php | 16 + .../Api/VKApiVideoAlreadyAddedException.php | 19 - .../Api/VKApiVideoCommentsClosedException.php | 19 - ...ApiVkPayStatusCanNotBeChangedException.php | 16 + src/VK/Exceptions/Api/VKApiVotesException.php | 19 - .../Api/VKApiVotesPermissionException.php | 19 - .../Api/VKApiWallAccessAddReplyException.php | 19 - .../Api/VKApiWallAccessCommentException.php | 19 - .../Api/VKApiWallAccessPostException.php | 19 - .../Api/VKApiWallAccessRepliesException.php | 19 - .../Api/VKApiWallAddPostException.php | 19 - .../VKApiWallAdsPostLimitReachedException.php | 19 - .../Api/VKApiWallAdsPublishedException.php | 19 - .../Api/VKApiWallLinksForbiddenException.php | 19 - .../Api/VKApiWallReplyOwnerFloodException.php | 19 - .../VKApiWallTooManyRecipientsException.php | 19 - .../Api/VKApiWeightedFloodException.php | 19 - ...VKApiYouAreNotAdminOfThisChatException.php | 16 + ...ntChangeInviteLinkForThisChatException.php | 16 + .../VKApiYouCantCommentThisNoteException.php | 16 + ...uCantSeeInviteLinkForThisChatException.php | 16 + ...piYouDontHaveAccessToThisChatException.php | 16 + ...uNeedToEnable2faForThisActionException.php | 16 + ...unityCantInteractWithThisPeerException.php | 16 + 558 files changed, 14781 insertions(+), 18797 deletions(-) create mode 100644 src/VK/Actions/Adsweb.php create mode 100644 src/VK/Actions/Donut.php create mode 100644 src/VK/Actions/DownloadedGames.php create mode 100644 src/VK/Actions/Enum/AccountSaveProfileInfoBdateVisibility.php create mode 100644 src/VK/Actions/Enum/AccountSaveProfileInfoRelation.php create mode 100644 src/VK/Actions/Enum/AccountSaveProfileInfoSex.php create mode 100644 src/VK/Actions/Enum/AdsCheckLinkLinkType.php create mode 100644 src/VK/Actions/Enum/AdsGetDemographicsIdsType.php create mode 100644 src/VK/Actions/Enum/AdsGetDemographicsPeriod.php create mode 100644 src/VK/Actions/Enum/AdsGetPostsReachIdsType.php create mode 100644 src/VK/Actions/Enum/AdsGetStatisticsIdsType.php create mode 100644 src/VK/Actions/Enum/AdsGetStatisticsPeriod.php create mode 100644 src/VK/Actions/Enum/AdsGetSuggestionsLang.php create mode 100644 src/VK/Actions/Enum/AdsGetSuggestionsSection.php create mode 100644 src/VK/Actions/Enum/AdsGetTargetingStatsAdFormat.php create mode 100644 src/VK/Actions/Enum/AdsGetUploadURLAdFormat.php create mode 100644 src/VK/Actions/Enum/AppWidgetsGetAppImageUploadServerImageType.php create mode 100644 src/VK/Actions/Enum/AppWidgetsGetAppImagesImageType.php create mode 100644 src/VK/Actions/Enum/AppWidgetsGetGroupImageUploadServerImageType.php create mode 100644 src/VK/Actions/Enum/AppWidgetsGetGroupImagesImageType.php create mode 100644 src/VK/Actions/Enum/AppWidgetsUpdateType.php create mode 100644 src/VK/Actions/Enum/AppsGetCatalogFilter.php create mode 100644 src/VK/Actions/Enum/AppsGetCatalogSort.php create mode 100644 src/VK/Actions/Enum/AppsGetFriendsListType.php create mode 100644 src/VK/Actions/Enum/AppsGetLeaderboardType.php create mode 100644 src/VK/Actions/Enum/AppsGetNameCase.php create mode 100644 src/VK/Actions/Enum/AppsGetPlatform.php create mode 100644 src/VK/Actions/Enum/AppsGetScopesType.php create mode 100644 src/VK/Actions/Enum/AppsSendRequestType.php create mode 100644 src/VK/Actions/Enum/BoardGetCommentsSort.php create mode 100644 src/VK/Actions/Enum/BoardGetTopicsOrder.php create mode 100644 src/VK/Actions/Enum/BoardGetTopicsPreview.php create mode 100644 src/VK/Actions/Enum/DocsGetMessagesUploadServerType.php create mode 100644 src/VK/Actions/Enum/DocsGetType.php create mode 100644 src/VK/Actions/Enum/FaveAddTagPosition.php create mode 100644 src/VK/Actions/Enum/FaveGetItemType.php create mode 100644 src/VK/Actions/Enum/FaveGetPagesType.php create mode 100644 src/VK/Actions/Enum/FaveSetTagsItemType.php create mode 100644 src/VK/Actions/Enum/FriendsGetNameCase.php create mode 100644 src/VK/Actions/Enum/FriendsGetOrder.php create mode 100644 src/VK/Actions/Enum/FriendsGetRequestsSort.php create mode 100644 src/VK/Actions/Enum/FriendsGetSuggestionsNameCase.php create mode 100644 src/VK/Actions/Enum/FriendsSearchNameCase.php create mode 100644 src/VK/Actions/Enum/GroupsAddAddressWorkInfoStatus.php create mode 100644 src/VK/Actions/Enum/GroupsCreateSubtype.php create mode 100644 src/VK/Actions/Enum/GroupsCreateType.php create mode 100644 src/VK/Actions/Enum/GroupsEditAddressWorkInfoStatus.php create mode 100644 src/VK/Actions/Enum/GroupsEditAgeLimits.php create mode 100644 src/VK/Actions/Enum/GroupsGetInvitedUsersNameCase.php create mode 100644 src/VK/Actions/Enum/GroupsGetMembersFilter.php create mode 100644 src/VK/Actions/Enum/GroupsGetMembersSort.php create mode 100644 src/VK/Actions/Enum/GroupsSearchSort.php create mode 100644 src/VK/Actions/Enum/GroupsSearchType.php create mode 100644 src/VK/Actions/Enum/GroupsTagAddTagColor.php create mode 100644 src/VK/Actions/Enum/GroupsTagBindAct.php create mode 100644 src/VK/Actions/Enum/GroupsToggleMarketState.php create mode 100644 src/VK/Actions/Enum/LikesGetListFilter.php create mode 100644 src/VK/Actions/Enum/LikesGetListFriendsOnly.php create mode 100644 src/VK/Actions/Enum/MarketEditOrderPaymentStatus.php create mode 100644 src/VK/Actions/Enum/MarketGetCommentsSort.php create mode 100644 src/VK/Actions/Enum/MarketReportCommentReason.php create mode 100644 src/VK/Actions/Enum/MarketReportReason.php create mode 100644 src/VK/Actions/Enum/MarketSearchRev.php create mode 100644 src/VK/Actions/Enum/MarketSearchSort.php create mode 100644 src/VK/Actions/Enum/MarketSearchStatus.php create mode 100644 src/VK/Actions/Enum/MessagesGetConversationsFilter.php create mode 100644 src/VK/Actions/Enum/MessagesGetHistoryAttachmentsMediaType.php create mode 100644 src/VK/Actions/Enum/MessagesGetHistoryRev.php create mode 100644 src/VK/Actions/Enum/MessagesGetIntentUsersIntent.php create mode 100644 src/VK/Actions/Enum/MessagesSendIntent.php create mode 100644 src/VK/Actions/Enum/MessagesSetActivityType.php create mode 100644 src/VK/Actions/Enum/NewsfeedGetBannedNameCase.php create mode 100644 src/VK/Actions/Enum/NewsfeedUnsubscribeType.php create mode 100644 src/VK/Actions/Enum/NotesGetCommentsSort.php create mode 100644 src/VK/Actions/Enum/NotesGetSort.php create mode 100644 src/VK/Actions/Enum/NotificationsSendMessageSendingMode.php create mode 100644 src/VK/Actions/Enum/OrdersChangeStateAction.php create mode 100644 src/VK/Actions/Enum/PagesSaveAccessEdit.php create mode 100644 src/VK/Actions/Enum/PagesSaveAccessView.php create mode 100644 src/VK/Actions/Enum/PhotosGetCommentsSort.php create mode 100644 src/VK/Actions/Enum/PhotosReportCommentReason.php create mode 100644 src/VK/Actions/Enum/PhotosReportReason.php create mode 100644 src/VK/Actions/Enum/PollsCreateBackgroundId.php create mode 100644 src/VK/Actions/Enum/PollsEditBackgroundId.php create mode 100644 src/VK/Actions/Enum/PollsGetByIdNameCase.php create mode 100644 src/VK/Actions/Enum/PollsGetVotersNameCase.php create mode 100644 src/VK/Actions/Enum/StatsGetInterval.php create mode 100644 src/VK/Actions/Enum/StreamingSetSettingsMonthlyTier.php create mode 100644 src/VK/Actions/Enum/UsersGetFollowersNameCase.php create mode 100644 src/VK/Actions/Enum/UsersGetNameCase.php create mode 100644 src/VK/Actions/Enum/UsersReportType.php create mode 100644 src/VK/Actions/Enum/UsersSearchSex.php create mode 100644 src/VK/Actions/Enum/UsersSearchSort.php create mode 100644 src/VK/Actions/Enum/UsersSearchStatus.php create mode 100644 src/VK/Actions/Enum/UtilsGetLinkStatsInterval.php create mode 100644 src/VK/Actions/Enum/UtilsGetLinkStatsSource.php create mode 100644 src/VK/Actions/Enum/VideoGetCommentsSort.php create mode 100644 src/VK/Actions/Enum/VideoReportCommentReason.php create mode 100644 src/VK/Actions/Enum/VideoReportReason.php create mode 100644 src/VK/Actions/Enum/VideoSearchSort.php create mode 100644 src/VK/Actions/Enum/WallGetCommentsSort.php create mode 100644 src/VK/Actions/Enum/WallReportCommentReason.php create mode 100644 src/VK/Actions/Enum/WallReportPostReason.php delete mode 100644 src/VK/Actions/Enums/AccountBdateVisibility.php delete mode 100644 src/VK/Actions/Enums/AccountFields.php delete mode 100644 src/VK/Actions/Enums/AccountFilter.php delete mode 100644 src/VK/Actions/Enums/AccountRelation.php delete mode 100644 src/VK/Actions/Enums/AccountSex.php delete mode 100644 src/VK/Actions/Enums/AdsAdFormat.php delete mode 100644 src/VK/Actions/Enums/AdsIdsType.php delete mode 100644 src/VK/Actions/Enums/AdsLang.php delete mode 100644 src/VK/Actions/Enums/AdsLinkType.php delete mode 100644 src/VK/Actions/Enums/AdsPeriod.php delete mode 100644 src/VK/Actions/Enums/AdsSection.php delete mode 100644 src/VK/Actions/Enums/AppWidgetsType.php delete mode 100644 src/VK/Actions/Enums/AppsFields.php delete mode 100644 src/VK/Actions/Enums/AppsFilter.php delete mode 100644 src/VK/Actions/Enums/AppsNameCase.php delete mode 100644 src/VK/Actions/Enums/AppsPlatform.php delete mode 100644 src/VK/Actions/Enums/AppsSort.php delete mode 100644 src/VK/Actions/Enums/AppsType.php delete mode 100644 src/VK/Actions/Enums/BoardOrder.php delete mode 100644 src/VK/Actions/Enums/BoardPreview.php delete mode 100644 src/VK/Actions/Enums/BoardSort.php delete mode 100644 src/VK/Actions/Enums/DocsType.php delete mode 100644 src/VK/Actions/Enums/FaveFields.php delete mode 100644 src/VK/Actions/Enums/FaveItemType.php delete mode 100644 src/VK/Actions/Enums/FaveType.php delete mode 100644 src/VK/Actions/Enums/FriendsFields.php delete mode 100644 src/VK/Actions/Enums/FriendsFilter.php delete mode 100644 src/VK/Actions/Enums/FriendsNameCase.php delete mode 100644 src/VK/Actions/Enums/FriendsOrder.php delete mode 100644 src/VK/Actions/Enums/FriendsSort.php delete mode 100644 src/VK/Actions/Enums/Groups/AddressWorkInfoStatus.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupAccess.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupAgeLimits.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupAudio.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupDocs.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupMarketCurrency.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupPhotos.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupRole.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupSubject.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupTopics.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupVideo.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupWall.php delete mode 100644 src/VK/Actions/Enums/Groups/GroupWiki.php delete mode 100644 src/VK/Actions/Enums/GroupsAccess.php delete mode 100644 src/VK/Actions/Enums/GroupsAgeLimits.php delete mode 100644 src/VK/Actions/Enums/GroupsAudio.php delete mode 100644 src/VK/Actions/Enums/GroupsDocs.php delete mode 100644 src/VK/Actions/Enums/GroupsFields.php delete mode 100644 src/VK/Actions/Enums/GroupsFilter.php delete mode 100644 src/VK/Actions/Enums/GroupsMarketCurrency.php delete mode 100644 src/VK/Actions/Enums/GroupsNameCase.php delete mode 100644 src/VK/Actions/Enums/GroupsPhotos.php delete mode 100644 src/VK/Actions/Enums/GroupsRole.php delete mode 100644 src/VK/Actions/Enums/GroupsSort.php delete mode 100644 src/VK/Actions/Enums/GroupsSubject.php delete mode 100644 src/VK/Actions/Enums/GroupsSubtype.php delete mode 100644 src/VK/Actions/Enums/GroupsTopics.php delete mode 100644 src/VK/Actions/Enums/GroupsType.php delete mode 100644 src/VK/Actions/Enums/GroupsVideo.php delete mode 100644 src/VK/Actions/Enums/GroupsWall.php delete mode 100644 src/VK/Actions/Enums/GroupsWiki.php delete mode 100644 src/VK/Actions/Enums/GroupsWorkInfoStatus.php delete mode 100644 src/VK/Actions/Enums/LeadsStatus.php delete mode 100644 src/VK/Actions/Enums/LikesFilter.php delete mode 100644 src/VK/Actions/Enums/LikesFriendsOnly.php delete mode 100644 src/VK/Actions/Enums/LikesType.php delete mode 100644 src/VK/Actions/Enums/MarketFields.php delete mode 100644 src/VK/Actions/Enums/MarketReason.php delete mode 100644 src/VK/Actions/Enums/MarketRev.php delete mode 100644 src/VK/Actions/Enums/MarketSort.php delete mode 100644 src/VK/Actions/Enums/MarketStatus.php delete mode 100644 src/VK/Actions/Enums/MessagesFields.php delete mode 100644 src/VK/Actions/Enums/MessagesFilter.php delete mode 100644 src/VK/Actions/Enums/MessagesMediaType.php delete mode 100644 src/VK/Actions/Enums/MessagesRev.php delete mode 100644 src/VK/Actions/Enums/Newsfeed/IgnoreItemType.php delete mode 100644 src/VK/Actions/Enums/NewsfeedFields.php delete mode 100644 src/VK/Actions/Enums/NewsfeedFilters.php delete mode 100644 src/VK/Actions/Enums/NewsfeedNameCase.php delete mode 100644 src/VK/Actions/Enums/NewsfeedType.php delete mode 100644 src/VK/Actions/Enums/NotesSort.php delete mode 100644 src/VK/Actions/Enums/NotificationsFilters.php delete mode 100644 src/VK/Actions/Enums/OrdersAction.php delete mode 100644 src/VK/Actions/Enums/PagesEdit.php delete mode 100644 src/VK/Actions/Enums/PagesView.php delete mode 100644 src/VK/Actions/Enums/PhotosFields.php delete mode 100644 src/VK/Actions/Enums/PhotosReason.php delete mode 100644 src/VK/Actions/Enums/PhotosSort.php delete mode 100644 src/VK/Actions/Enums/PollsBackgroundId.php delete mode 100644 src/VK/Actions/Enums/PollsFields.php delete mode 100644 src/VK/Actions/Enums/PollsNameCase.php delete mode 100644 src/VK/Actions/Enums/Stories/UploadLinkText.php delete mode 100644 src/VK/Actions/Enums/StoriesFields.php delete mode 100644 src/VK/Actions/Enums/StoriesLinkText.php delete mode 100644 src/VK/Actions/Enums/StreamingMonthlyTier.php delete mode 100644 src/VK/Actions/Enums/UsersFields.php delete mode 100644 src/VK/Actions/Enums/UsersNameCase.php delete mode 100644 src/VK/Actions/Enums/UsersSex.php delete mode 100644 src/VK/Actions/Enums/UsersSort.php delete mode 100644 src/VK/Actions/Enums/UsersStatus.php delete mode 100644 src/VK/Actions/Enums/UsersType.php delete mode 100644 src/VK/Actions/Enums/UtilsInterval.php delete mode 100644 src/VK/Actions/Enums/UtilsSource.php delete mode 100644 src/VK/Actions/Enums/VideoFilters.php delete mode 100644 src/VK/Actions/Enums/VideoPrivacy.php delete mode 100644 src/VK/Actions/Enums/VideoReason.php delete mode 100644 src/VK/Actions/Enums/VideoSort.php delete mode 100644 src/VK/Actions/Enums/WallFields.php delete mode 100644 src/VK/Actions/Enums/WallFilter.php delete mode 100644 src/VK/Actions/Enums/WallReason.php delete mode 100644 src/VK/Actions/Enums/WallSort.php delete mode 100644 src/VK/Actions/Enums/WidgetsFields.php delete mode 100644 src/VK/Actions/Leads.php create mode 100644 src/VK/Actions/Podcasts.php create mode 100644 src/VK/Actions/Store.php rename src/VK/Client/{Enums => Enum}/VKLanguage.php (89%) mode change 100755 => 100644 delete mode 100644 src/VK/Exceptions/Api/VKApiAccessAlbumException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessAudioException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessCommentException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessDeniedPleaseVoteFirstException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessGroupException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessGroupsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessMarketException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessMenuException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessNoteCommentException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessNoteException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessPageException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToAddingPostDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToCommentDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToDocumentDeletingIsDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToDocumentIsDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToNoteDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToPageDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToPollDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToPostCommentsDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToStatusRepliesDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToTheGroupsListIsDeniedDueToTheUsersPrivacySettingsException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToTheMenuOfTheUserDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToWallsCommentDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessToWallsPostDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessVideoException.php delete mode 100644 src/VK/Exceptions/Api/VKApiActionFailedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAdsObjectDeletedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAdsPartialSuccessException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAdsPermissionException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAdsSpecificException.php create mode 100644 src/VK/Exceptions/Api/VKApiAdvertisementPostWasRecentlyAddedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAlbumFullException.php create mode 100644 src/VK/Exceptions/Api/VKApiAlbumNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAlbumsLimitException.php create mode 100644 src/VK/Exceptions/Api/VKApiAlbumsNumberLimitIsReachedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAppAuthException.php create mode 100644 src/VK/Exceptions/Api/VKApiApplicationHasInsufficientFundsException.php create mode 100644 src/VK/Exceptions/Api/VKApiApplicationIsNotInstalledInCommunityException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAppsAlreadyUnlockedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAppsSubscriptionInvalidStatusException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAppsSubscriptionNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAuthDelayException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAuthException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAuthFloodException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAuthHttpsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAuthValidationException.php delete mode 100644 src/VK/Exceptions/Api/VKApiBlockedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCallbackApiServersLimitException.php create mode 100644 src/VK/Exceptions/Api/VKApiCannotAddThisUserToFriendsAsTheyHavePutYouOnTheirBlacklistException.php create mode 100644 src/VK/Exceptions/Api/VKApiCannotAddThisUserToFriendsAsUserNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiCannotAddThisUserToFriendsAsYouPutHimOnBlacklistException.php create mode 100644 src/VK/Exceptions/Api/VKApiCannotAddUserHimselfAsFriendException.php create mode 100644 src/VK/Exceptions/Api/VKApiCannotEditCreatorRoleException.php create mode 100644 src/VK/Exceptions/Api/VKApiCannotPinOne-timeStoryException.php create mode 100644 src/VK/Exceptions/Api/VKApiCannotUseThisIntentException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantAddUserToChatBecauseUserHasNoAccessToGroupException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantDeleteThisMessageForEverybodyException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantEditPinnedMessageYetException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantEditThisKindOfMessageException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantEditThisMessageBecauseItsTooOldException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantForwardTheseMessagesException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantSendMessageReplyTimedOutException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantSendMessagesForUsersFromBlacklistException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantSendMessagesForUsersWithoutPermissionException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantSendMessagesToThisUserDueToTheirPrivacySettingsException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantSentThisMessageBecauseItsTooBigException.php create mode 100644 src/VK/Exceptions/Api/VKApiCantSetAliexpressTagToThisTypeOfObjectException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCaptchaException.php create mode 100644 src/VK/Exceptions/Api/VKApiCardIsConnectedToPostException.php create mode 100644 src/VK/Exceptions/Api/VKApiCardNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiCartIsEmptyException.php create mode 100644 src/VK/Exceptions/Api/VKApiCatalogCategoriesAreNotAvailableForThisUserException.php create mode 100644 src/VK/Exceptions/Api/VKApiCatalogIsNotAvailableForThisUserException.php create mode 100644 src/VK/Exceptions/Api/VKApiChatDoesNotExistException.php create mode 100644 src/VK/Exceptions/Api/VKApiChatNotSupportedException.php create mode 100644 src/VK/Exceptions/Api/VKApiChatWasDisabledException.php create mode 100644 src/VK/Exceptions/Api/VKApiClientUpdateNeededException.php create mode 100644 src/VK/Exceptions/Api/VKApiCommentsForThisMarketAreClosedException.php create mode 100644 src/VK/Exceptions/Api/VKApiCommentsForThisVideoAreClosedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCommunitiesCatalogDisabledException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCommunitiesCategoriesDisabledException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCompileException.php create mode 100644 src/VK/Exceptions/Api/VKApiContactNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiContentBlockedException.php create mode 100644 src/VK/Exceptions/Api/VKApiCouldntSaveFileException.php create mode 100644 src/VK/Exceptions/Api/VKApiCropBottomRightCornerIsOutsideOfTheImageException.php create mode 100644 src/VK/Exceptions/Api/VKApiCropSizeIsLessThanTheMinimumException.php delete mode 100644 src/VK/Exceptions/Api/VKApiDisabledException.php create mode 100644 src/VK/Exceptions/Api/VKApiDonutIsDisabledException.php delete mode 100644 src/VK/Exceptions/Api/VKApiEnabledInTestException.php create mode 100644 src/VK/Exceptions/Api/VKApiExtendedMarketNotEnabledException.php delete mode 100644 src/VK/Exceptions/Api/VKApiFloodException.php delete mode 100644 src/VK/Exceptions/Api/VKApiFriendsAddEnemyException.php delete mode 100644 src/VK/Exceptions/Api/VKApiFriendsAddInEnemyException.php delete mode 100644 src/VK/Exceptions/Api/VKApiFriendsAddNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiFriendsAddYourselfException.php delete mode 100644 src/VK/Exceptions/Api/VKApiFriendsListIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiFriendsListLimitException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupAppIsNotInstalledInCommunityException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupAuthException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupChangeCreatorException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupHostNeed2faException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupNeed2faException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupNotInClubException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupTooManyAddressesException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupTooManyOfficersException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupingAlreadyHasSuchVariantException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupingMustHaveTwoOrMoreItemsException.php create mode 100644 src/VK/Exceptions/Api/VKApiHyperlinksAreForbiddenException.php create mode 100644 src/VK/Exceptions/Api/VKApiIncorrectReplyPrivacyException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInsufficientFundsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidAddressException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidAlbumIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidAnswerIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidDocumentIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidDocumentTitleException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidGroupIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidHashException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidImageCropFormatException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidListIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidPhotoException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidPhotosException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidPollIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidScreenNameException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidServerException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidTitleException.php create mode 100644 src/VK/Exceptions/Api/VKApiInviteLinkIsInvalid-ExpiredDeletedOrNotExistsException.php create mode 100644 src/VK/Exceptions/Api/VKApiItemAlreadyAddedToAlbumException.php create mode 100644 src/VK/Exceptions/Api/VKApiItemHasBadLinksInDescriptionException.php create mode 100644 src/VK/Exceptions/Api/VKApiItemMustHaveDistinctPropertiesException.php create mode 100644 src/VK/Exceptions/Api/VKApiItemNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiKeyboardFormatIsInvalidException.php delete mode 100644 src/VK/Exceptions/Api/VKApiLimitsException.php create mode 100644 src/VK/Exceptions/Api/VKApiLimitsOverflowForThisIntentException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketAlbumNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketCommentsClosedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketGroupingItemsMustHaveDistinctPropertiesException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketGroupingMustContainMoreThanOneItemException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketItemAlreadyAddedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketItemHasBadLinksException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketItemNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketNotEnabledException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketPropertyNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketRestoreTooLateException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketTooManyAlbumsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketTooManyItemsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketTooManyItemsInAlbumException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketVariantNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketWasAlreadyDisabledInThisGroupException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketWasAlreadyEnabledInThisGroupException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessageIsTooLongException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessageRequestAlreadySentException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantChangeInviteLinkException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantDeleteForAllException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantFwdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantPinOneTimeStoryException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantSeeInviteLinkException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatBotFeatureException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatNotAdminException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatNotExistException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatUserNoAccessException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatUserNotInChatException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesContactNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesDenySendException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesEditExpiredException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesEditKindDisallowedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesGroupPeerAccessException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesKeyboardInvalidException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesMessageRequestAlreadySendException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesMessageRequestAlreadySentException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesPrivacyException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooBigException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooLongForwardsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooLongMessageException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooManyPostsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooNewPtsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooOldPtsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessagesUserBlockedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMethodAdsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMethodDisabledException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMethodException.php create mode 100644 src/VK/Exceptions/Api/VKApiMethodExecutionWasInterruptedDueToTimeoutException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMethodPermissionException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMobileNotActivatedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiNeedConfirmationException.php delete mode 100644 src/VK/Exceptions/Api/VKApiNeedTokenConfirmationException.php create mode 100644 src/VK/Exceptions/Api/VKApiNoteNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiObjectDeletedException.php create mode 100644 src/VK/Exceptions/Api/VKApiOriginalPhotoWasChangedException.php create mode 100644 src/VK/Exceptions/Api/VKApiOutOfLimitsException.php create mode 100644 src/VK/Exceptions/Api/VKApiPageNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamAlbumIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamApiIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamDocAccessException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamDocDeleteAccessException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamDocIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamDocTitleException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamGroupIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamHashException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamNoteIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamPageIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamPhoneException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamPhotoException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamPhotosException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamServerException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamTimestampException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamTitleException.php delete mode 100644 src/VK/Exceptions/Api/VKApiParamUserIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiPermissionDenied.YouHaveRequestedTooManyActionsThisDay.TryLater.Exception.php delete mode 100644 src/VK/Exceptions/Api/VKApiPermissionException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPhoneAlreadyUsedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPhotoChangedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPollsAccessException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPollsAccessWithoutVoteException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPollsAnswerIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPollsPollIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPrettyCardsCardIsConnectedToPostException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPrettyCardsCardNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPrettyCardsTooManyCardsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPrivateProfileException.php create mode 100644 src/VK/Exceptions/Api/VKApiPropertyNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiRateLimitException.php create mode 100644 src/VK/Exceptions/Api/VKApiReachedTheMaximumNumberOfListsException.php create mode 100644 src/VK/Exceptions/Api/VKApiReactionCanNotBeAppliedToTheObjectException.php delete mode 100644 src/VK/Exceptions/Api/VKApiRequestException.php delete mode 100644 src/VK/Exceptions/Api/VKApiRuntimeException.php create mode 100644 src/VK/Exceptions/Api/VKApiRuntimeOccurredDuringCodeInvocationException.php delete mode 100644 src/VK/Exceptions/Api/VKApiSaveFileException.php delete mode 100644 src/VK/Exceptions/Api/VKApiServerException.php create mode 100644 src/VK/Exceptions/Api/VKApiServersNumberLimitIsReachedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiSignatureException.php create mode 100644 src/VK/Exceptions/Api/VKApiSomePartOfTheRequestHasNotBeenCompletedException.php create mode 100644 src/VK/Exceptions/Api/VKApiSpecifiedLinkIsIncorrect(cantFindSource)Exception.php create mode 100644 src/VK/Exceptions/Api/VKApiSpecifyWidthLengthHeightAndWeightAllTogetherException.php delete mode 100644 src/VK/Exceptions/Api/VKApiStatusNoAudioException.php create mode 100644 src/VK/Exceptions/Api/VKApiStickersAreNotFavoriteException.php create mode 100644 src/VK/Exceptions/Api/VKApiStickersAreNotPurchasedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiStoryExpiredException.php create mode 100644 src/VK/Exceptions/Api/VKApiStoryHasAlreadyExpiredException.php delete mode 100644 src/VK/Exceptions/Api/VKApiStoryIncorrectReplyPrivacyException.php create mode 100644 src/VK/Exceptions/Api/VKApiSubscriptionIsInInvalidStatusException.php create mode 100644 src/VK/Exceptions/Api/VKApiSubscriptionNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiTheMobileNumberOfTheUserIsUnknownException.php create mode 100644 src/VK/Exceptions/Api/VKApiThisAchievementIsAlreadyUnlockedException.php create mode 100644 src/VK/Exceptions/Api/VKApiThisIsAChatBotFeatureChangeThisStatusInSettingsException.php create mode 100644 src/VK/Exceptions/Api/VKApiThisVideoIsAlreadyAddedException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooLateForRestoreException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyAddressesInClubException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyAdsPostsException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyAlbumsException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyAuthAttemptsTryAgainLaterException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyCardsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyFavoriteStickersException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyFeedListsException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyForwardedMessagesException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyItemsException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyItemsInAlbumException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyListsException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyOfficersInClubException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyPostsInMessagesException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyRecipientsException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyRepliesException.php create mode 100644 src/VK/Exceptions/Api/VKApiUnableToCompileCodeException.php create mode 100644 src/VK/Exceptions/Api/VKApiUnableToProcessActionException.php delete mode 100644 src/VK/Exceptions/Api/VKApiUnknownException.php delete mode 100644 src/VK/Exceptions/Api/VKApiUserDeletedException.php create mode 100644 src/VK/Exceptions/Api/VKApiUserDisabledTrackNameBroadcastException.php create mode 100644 src/VK/Exceptions/Api/VKApiUserNeedsToEnable2faForThisActionException.php create mode 100644 src/VK/Exceptions/Api/VKApiUserNotFoundInChatException.php create mode 100644 src/VK/Exceptions/Api/VKApiUserShouldBeInClubException.php create mode 100644 src/VK/Exceptions/Api/VKApiValueOfTsOrPtsIsTooNewException.php create mode 100644 src/VK/Exceptions/Api/VKApiValueOfTsOrPtsIsTooOldException.php create mode 100644 src/VK/Exceptions/Api/VKApiVariantNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiVideoAlreadyAddedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiVideoCommentsClosedException.php create mode 100644 src/VK/Exceptions/Api/VKApiVkPayStatusCanNotBeChangedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiVotesException.php delete mode 100644 src/VK/Exceptions/Api/VKApiVotesPermissionException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallAccessAddReplyException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallAccessCommentException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallAccessPostException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallAccessRepliesException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallAddPostException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallAdsPostLimitReachedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallAdsPublishedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallLinksForbiddenException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallReplyOwnerFloodException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWallTooManyRecipientsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiWeightedFloodException.php create mode 100644 src/VK/Exceptions/Api/VKApiYouAreNotAdminOfThisChatException.php create mode 100644 src/VK/Exceptions/Api/VKApiYouCantChangeInviteLinkForThisChatException.php create mode 100644 src/VK/Exceptions/Api/VKApiYouCantCommentThisNoteException.php create mode 100644 src/VK/Exceptions/Api/VKApiYouCantSeeInviteLinkForThisChatException.php create mode 100644 src/VK/Exceptions/Api/VKApiYouDontHaveAccessToThisChatException.php create mode 100644 src/VK/Exceptions/Api/VKApiYouNeedToEnable2faForThisActionException.php create mode 100644 src/VK/Exceptions/Api/VKApiYourCommunityCantInteractWithThisPeerException.php diff --git a/src/VK/Actions/Account.php b/src/VK/Actions/Account.php index 7859e66..6554236 100644 --- a/src/VK/Actions/Account.php +++ b/src/VK/Actions/Account.php @@ -1,323 +1,381 @@ request = $request; - } + /** + * Account constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function ban($access_token, array $params = []) { - return $this->request->post('account.ban', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function ban(string $access_token, array $params = array()) { + return $this->request->post('account.ban', $access_token, $params); + } - /** - * Changes a user password after access is successfully restored with the [vk.com/dev/auth.restore|auth.restore] method. - * - * @param string $access_token - * @param array $params - * - @var string restore_sid: Session id received after the [vk.com/dev/auth.restore|auth.restore] method is executed. (If the password is changed right after the access was restored) - * - @var string change_password_hash: Hash received after a successful OAuth authorization with a code got by SMS. (If the password is changed right after the access was restored) - * - @var string old_password: Current user password. - * - @var string new_password: New password that will be set as a current - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function changePassword($access_token, array $params = []) { - return $this->request->post('account.changePassword', $access_token, $params); - } + /** + * Changes a user password after access is successfully restored with the [vk.com/dev/auth.restore|auth.restore] + * method. + * + * @param $access_token string + * @param $params array + * - string restore_sid: Session id received after the [vk.com/dev/auth.restore|auth.restore] method is + * executed. (If the password is changed right after the access was restored) + * - string change_password_hash: Hash received after a successful OAuth authorization with a code got by + * SMS. (If the password is changed right after the access was restored) + * - string old_password: Current user password. + * - string new_password: New password that will be set as a current + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function changePassword(string $access_token, array $params = array()) { + return $this->request->post('account.changePassword', $access_token, $params); + } - /** - * Returns a list of active ads (offers) which executed by the user will bring him/her respective number of votes to his balance in the application. - * - * @param string $access_token - * @param array $params - * - @var integer offset - * - @var integer count: Number of results to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getActiveOffers($access_token, array $params = []) { - return $this->request->post('account.getActiveOffers', $access_token, $params); - } + /** + * Returns a list of active ads (offers) which executed by the user will bring him/her respective number of votes + * to his balance in the application. + * + * @param $access_token string + * @param $params array + * - integer offset: + * - integer count: Number of results to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getActiveOffers(string $access_token, array $params = array()) { + return $this->request->post('account.getActiveOffers', $access_token, $params); + } - /** - * Gets settings of the user in this application. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID whose settings information shall be got. By default: current user. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getAppPermissions($access_token, array $params = []) { - return $this->request->post('account.getAppPermissions', $access_token, $params); - } + /** + * Gets settings of the user in this application. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID whose settings information shall be got. By default: current user. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAppPermissions(string $access_token, array $params = array()) { + return $this->request->post('account.getAppPermissions', $access_token, $params); + } - /** - * Returns a user's blacklist. - * - * @param string $access_token - * @param array $params - * - @var integer offset: Offset needed to return a specific subset of results. - * - @var integer count: Number of results to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getBanned($access_token, array $params = []) { - return $this->request->post('account.getBanned', $access_token, $params); - } + /** + * Returns a user's blacklist. + * + * @param $access_token string + * @param $params array + * - integer offset: Offset needed to return a specific subset of results. + * - integer count: Number of results to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getBanned(string $access_token, array $params = array()) { + return $this->request->post('account.getBanned', $access_token, $params); + } - /** - * Returns non-null values of user counters. - * - * @param string $access_token - * @param array $params - * - @var array[AccountFilter] filter: Counters to be returned. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCounters($access_token, array $params = []) { - return $this->request->post('account.getCounters', $access_token, $params); - } + /** + * Returns non-null values of user counters. + * + * @param $access_token string + * @param $params array + * - array filter: Counters to be returned. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCounters(string $access_token, array $params = array()) { + return $this->request->post('account.getCounters', $access_token, $params); + } - /** - * Returns current account info. - * - * @param string $access_token - * @param array $params - * - @var array[AccountFields] fields: Fields to return. Possible values: *'country' — user country,, *'https_required' — is "HTTPS only" option enabled,, *'own_posts_default' — is "Show my posts only" option is enabled,, *'no_wall_replies' — are wall replies disabled or not,, *'intro' — is intro passed by user or not,, *'lang' — user language. By default: all. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getInfo($access_token, array $params = []) { - return $this->request->post('account.getInfo', $access_token, $params); - } + /** + * Returns current account info. + * + * @param $access_token string + * @param $params array + * - array fields: Fields to return. Possible values: *'country' — user country,, *'https_required' — + * is "HTTPS only" option enabled,, *'own_posts_default' — is "Show my posts only" option is enabled,, + * *'no_wall_replies' — are wall replies disabled or not,, *'intro' — is intro passed by user or not,, + * *'lang' — user language. By default: all. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getInfo(string $access_token, array $params = array()) { + return $this->request->post('account.getInfo', $access_token, $params); + } - /** - * Returns the current account info. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getProfileInfo($access_token) { - return $this->request->post('account.getProfileInfo', $access_token); - } + /** + * Returns the current account info. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getProfileInfo(string $access_token, array $params = array()) { + return $this->request->post('account.getProfileInfo', $access_token, $params); + } - /** - * Gets settings of push notifications. - * - * @param string $access_token - * @param array $params - * - @var string device_id: Unique device ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getPushSettings($access_token, array $params = []) { - return $this->request->post('account.getPushSettings', $access_token, $params); - } + /** + * Gets settings of push notifications. + * + * @param $access_token string + * @param $params array + * - string device_id: Unique device ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getPushSettings(string $access_token, array $params = array()) { + return $this->request->post('account.getPushSettings', $access_token, $params); + } - /** - * Subscribes an iOS/Android/Windows Phone-based device to receive push notifications - * - * @param string $access_token - * @param array $params - * - @var string token: Device token used to send notifications. (for mpns, the token shall be URL for sending of notifications) - * - @var string device_model: String name of device model. - * - @var integer device_year: Device year. - * - @var string device_id: Unique device ID. - * - @var string system_version: String version of device operating system. - * - @var string settings: Push settings in a [vk.com/dev/push_settings|special format]. - * - @var boolean sandbox - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function registerDevice($access_token, array $params = []) { - return $this->request->post('account.registerDevice', $access_token, $params); - } + /** + * Subscribes an iOS/Android/Windows Phone-based device to receive push notifications + * + * @param $access_token string + * @param $params array + * - string token: Device token used to send notifications. (for mpns, the token shall be URL for sending + * of notifications) + * - string device_model: String name of device model. + * - integer device_year: Device year. + * - string device_id: Unique device ID. + * - string system_version: String version of device operating system. + * - string settings: Push settings in a [vk.com/dev/push_settings|special format]. + * - boolean sandbox: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function registerDevice(string $access_token, array $params = array()) { + return $this->request->post('account.registerDevice', $access_token, $params); + } - /** - * Edits current profile info. - * - * @param string $access_token - * @param array $params - * - @var string first_name: User first name. - * - @var string last_name: User last name. - * - @var string maiden_name: User maiden name (female only) - * - @var string screen_name: User screen name. - * - @var integer cancel_request_id: ID of the name change request to be canceled. If this parameter is sent, all the others are ignored. - * - @var AccountSex sex: User sex. Possible values: , * '1' – female,, * '2' – male. - * - @var AccountRelation relation: User relationship status. Possible values: , * '1' – single,, * '2' – in a relationship,, * '3' – engaged,, * '4' – married,, * '5' – it's complicated,, * '6' – actively searching,, * '7' – in love,, * '0' – not specified. - * - @var integer relation_partner_id: ID of the relationship partner. - * - @var string bdate: User birth date, format: DD.MM.YYYY. - * - @var AccountBdateVisibility bdate_visibility: Birth date visibility. Returned values: , * '1' – show birth date,, * '2' – show only month and day,, * '0' – hide birth date. - * - @var string home_town: User home town. - * - @var integer country_id: User country. - * - @var integer city_id: User city. - * - @var string status: Status text. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiInvalidAddressException Invalid screen name - * @return mixed - */ - public function saveProfileInfo($access_token, array $params = []) { - return $this->request->post('account.saveProfileInfo', $access_token, $params); - } + /** + * Edits current profile info. + * + * @param $access_token string + * @param $params array + * - string first_name: User first name. + * - string last_name: User last name. + * - string maiden_name: User maiden name (female only) + * - string screen_name: User screen name. + * - integer cancel_request_id: ID of the name change request to be canceled. If this parameter is sent, + * all the others are ignored. + * - AccountSaveProfileInfoSex sex: User sex. Possible values: , * '1' - female,, * '2' - male. + * @see AccountSaveProfileInfoSex + * - AccountSaveProfileInfoRelation relation: User relationship status. Possible values: , * '1' - + * single,, * '2' - in a relationship,, * '3' - engaged,, * '4' - married,, * '5' - it's complicated,, * '6' - + * actively searching,, * '7' - in love,, * '0' - not specified. + * @see AccountSaveProfileInfoRelation + * - integer relation_partner_id: ID of the relationship partner. + * - string bdate: User birth date, format: DD.MM.YYYY. + * - AccountSaveProfileInfoBdateVisibility bdate_visibility: Birth date visibility. Returned values: , * + * '1' - show birth date,, * '2' - show only month and day,, * '0' - hide birth date. + * @see AccountSaveProfileInfoBdateVisibility + * - string home_town: User home town. + * - integer country_id: User country. + * - integer city_id: User city. + * - string status: Status text. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function saveProfileInfo(string $access_token, array $params = array()) { + return $this->request->post('account.saveProfileInfo', $access_token, $params); + } - /** - * Allows to edit the current account info. - * - * @param string $access_token - * @param array $params - * - @var string name: Setting name. - * - @var string value: Setting value. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function setInfo($access_token, array $params = []) { - return $this->request->post('account.setInfo', $access_token, $params); - } + /** + * Allows to edit the current account info. + * + * @param $access_token string + * @param $params array + * - string name: Setting name. + * - string value: Setting value. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function setInfo(string $access_token, array $params = array()) { + return $this->request->post('account.setInfo', $access_token, $params); + } - /** - * Sets an application screen name (up to 17 characters), that is shown to the user in the left menu. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var string name: Application screen name. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessMenuException Access to the menu of the user denied - * @return mixed - */ - public function setNameInMenu($access_token, array $params = []) { - return $this->request->post('account.setNameInMenu', $access_token, $params); - } + /** + * Sets an application screen name (up to 17 characters), that is shown to the user in the left menu. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - string name: Application screen name. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function setNameInMenu(string $access_token, array $params = array()) { + return $this->request->post('account.setNameInMenu', $access_token, $params); + } - /** - * Marks a current user as offline. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function setOffline($access_token) { - return $this->request->post('account.setOffline', $access_token); - } + /** + * Marks a current user as offline. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function setOffline(string $access_token, array $params = array()) { + return $this->request->post('account.setOffline', $access_token, $params); + } - /** - * Marks the current user as online for 15 minutes. - * - * @param string $access_token - * @param array $params - * - @var boolean voip: '1' if videocalls are available for current device. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function setOnline($access_token, array $params = []) { - return $this->request->post('account.setOnline', $access_token, $params); - } + /** + * Marks the current user as online for 15 minutes. + * + * @param $access_token string + * @param $params array + * - boolean voip: '1' if videocalls are available for current device. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function setOnline(string $access_token, array $params = array()) { + return $this->request->post('account.setOnline', $access_token, $params); + } - /** - * Change push settings. - * - * @param string $access_token - * @param array $params - * - @var string device_id: Unique device ID. - * - @var string settings: Push settings in a [vk.com/dev/push_settings|special format]. - * - @var string key: Notification key. - * - @var array[string] value: New value for the key in a [vk.com/dev/push_settings|special format]. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function setPushSettings($access_token, array $params = []) { - return $this->request->post('account.setPushSettings', $access_token, $params); - } + /** + * Change push settings. + * + * @param $access_token string + * @param $params array + * - string device_id: Unique device ID. + * - string settings: Push settings in a [vk.com/dev/push_settings|special format]. + * - string key: Notification key. + * - array value: New value for the key in a [vk.com/dev/push_settings|special format]. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function setPushSettings(string $access_token, array $params = array()) { + return $this->request->post('account.setPushSettings', $access_token, $params); + } - /** - * Mutes push notifications for the set period of time. - * - * @param string $access_token - * @param array $params - * - @var string device_id: Unique device ID. - * - @var integer time: Time in seconds for what notifications should be disabled. '-1' to disable forever. - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " - * - @var integer sound: '1' — to enable sound in this dialog, '0' — to disable sound. Only if 'peer_id' contains user or community ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function setSilenceMode($access_token, array $params = []) { - return $this->request->post('account.setSilenceMode', $access_token, $params); - } + /** + * Mutes push notifications for the set period of time. + * + * @param $access_token string + * @param $params array + * - string device_id: Unique device ID. + * - integer time: Time in seconds for what notifications should be disabled. '-1' to disable forever. + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat + * ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * - integer sound: '1' — to enable sound in this dialog, '0' — to disable sound. Only if 'peer_id' + * contains user or community ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function setSilenceMode(string $access_token, array $params = array()) { + return $this->request->post('account.setSilenceMode', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function unban($access_token, array $params = []) { - return $this->request->post('account.unban', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function unban(string $access_token, array $params = array()) { + return $this->request->post('account.unban', $access_token, $params); + } - /** - * Unsubscribes a device from push notifications. - * - * @param string $access_token - * @param array $params - * - @var string device_id: Unique device ID. - * - @var boolean sandbox - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function unregisterDevice($access_token, array $params = []) { - return $this->request->post('account.unregisterDevice', $access_token, $params); - } + /** + * Unsubscribes a device from push notifications. + * + * @param $access_token string + * @param $params array + * - string device_id: Unique device ID. + * - boolean sandbox: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function unregisterDevice(string $access_token, array $params = array()) { + return $this->request->post('account.unregisterDevice', $access_token, $params); + } } diff --git a/src/VK/Actions/Ads.php b/src/VK/Actions/Ads.php index 97e033f..b7e47f4 100644 --- a/src/VK/Actions/Ads.php +++ b/src/VK/Actions/Ads.php @@ -1,640 +1,878 @@ request = $request; - } - - /** - * Adds managers and/or supervisors to advertising account. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string data: Serialized JSON array of objects that describe added managers. Description of 'user_specification' objects see below. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function addOfficeUsers($access_token, array $params = []) { - return $this->request->post('ads.addOfficeUsers', $access_token, $params); - } - - /** - * Allows to check the ad link. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var AdsLinkType link_type: Object type: *'community' — community,, *'post' — community post,, *'application' — VK application,, *'video' — video,, *'site' — external site. - * - @var string link_url: Object URL. - * - @var integer campaign_id: Campaign ID - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function checkLink($access_token, array $params = []) { - return $this->request->post('ads.checkLink', $access_token, $params); - } - - /** - * Creates ads. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string data: Serialized JSON array of objects that describe created ads. Description of 'ad_specification' objects see below. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function createAds($access_token, array $params = []) { - return $this->request->post('ads.createAds', $access_token, $params); - } - - /** - * Creates advertising campaigns. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string data: Serialized JSON array of objects that describe created campaigns. Description of 'campaign_specification' objects see below. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function createCampaigns($access_token, array $params = []) { - return $this->request->post('ads.createCampaigns', $access_token, $params); - } - - /** - * Creates clients of an advertising agency. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string data: Serialized JSON array of objects that describe created campaigns. Description of 'client_specification' objects see below. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function createClients($access_token, array $params = []) { - return $this->request->post('ads.createClients', $access_token, $params); - } - - /** - * Creates a group to re-target ads for users who visited advertiser's site (viewed information about the product, registered, etc.). - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account where the group will be created. - * - @var string name: Name of the target group — a string up to 64 characters long. - * - @var integer lifetime: 'For groups with auditory created with pixel code only.', , Number of days after that users will be automatically removed from the group. - * - @var integer target_pixel_id - * - @var string target_pixel_rules - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function createTargetGroup($access_token, array $params = []) { - return $this->request->post('ads.createTargetGroup', $access_token, $params); - } - - /** - * Archives ads. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string ids: Serialized JSON array with ad IDs. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAdsObjectDeletedException Object deleted - * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function deleteAds($access_token, array $params = []) { - return $this->request->post('ads.deleteAds', $access_token, $params); - } - - /** - * Archives advertising campaigns. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string ids: Serialized JSON array with IDs of deleted campaigns. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAdsObjectDeletedException Object deleted - * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function deleteCampaigns($access_token, array $params = []) { - return $this->request->post('ads.deleteCampaigns', $access_token, $params); - } - - /** - * Archives clients of an advertising agency. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string ids: Serialized JSON array with IDs of deleted clients. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAdsObjectDeletedException Object deleted - * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function deleteClients($access_token, array $params = []) { - return $this->request->post('ads.deleteClients', $access_token, $params); - } - - /** - * Deletes a retarget group. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created. - * - @var integer target_group_id: Group ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function deleteTargetGroup($access_token, array $params = []) { - return $this->request->post('ads.deleteTargetGroup', $access_token, $params); - } - - /** - * Returns a list of advertising accounts. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getAccounts($access_token) { - return $this->request->post('ads.getAccounts', $access_token); - } - - /** - * Returns number of ads. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads will be shown. - * - @var string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the parameter is null, ads of all campaigns will be shown. - * - @var integer client_id: 'Available and required for advertising agencies.' ID of the client ads are retrieved from. - * - @var boolean include_deleted: Flag that specifies whether archived ads shall be shown: *0 — show only active ads,, *1 — show all ads. - * - @var integer limit: Limit of number of returned ads. Used only if ad_ids parameter is null, and 'campaign_ids' parameter contains ID of only one campaign. - * - @var integer offset: Offset. Used in the same cases as 'limit' parameter. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getAds($access_token, array $params = []) { - return $this->request->post('ads.getAds', $access_token, $params); - } - - /** - * Returns descriptions of ad layouts. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads will be shown. - * - @var string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the parameter is null, ads of all campaigns will be shown. - * - @var integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. - * - @var boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 — show only active ads,, *1 — show all ads. - * - @var integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and 'campaign_ids' parameter contains ID of only one campaign. - * - @var integer offset: Offset. Used in the same cases as 'limit' parameter. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getAdsLayout($access_token, array $params = []) { - return $this->request->post('ads.getAdsLayout', $access_token, $params); - } - - /** - * Returns ad targeting parameters. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads will be shown. - * - @var string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the parameter is null, ads of all campaigns will be shown. - * - @var integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. - * - @var boolean include_deleted: flag that specifies whether archived ads shall be shown: *0 — show only active ads,, *1 — show all ads. - * - @var integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and 'campaign_ids' parameter contains ID of only one campaign. - * - @var integer offset: Offset needed to return a specific subset of results. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getAdsTargeting($access_token, array $params = []) { - return $this->request->post('ads.getAdsTargeting', $access_token, $params); - } - - /** - * Returns current budget of the advertising account. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getBudget($access_token, array $params = []) { - return $this->request->post('ads.getBudget', $access_token, $params); - } - - /** - * Returns a list of campaigns in an advertising account. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var integer client_id: 'For advertising agencies'. ID of the client advertising campaigns are retrieved from. - * - @var boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 — show only active campaigns,, *1 — show all campaigns. - * - @var string campaign_ids: Filter of advertising campaigns to show. Serialized JSON array with campaign IDs. Only campaigns that exist in 'campaign_ids' and belong to the specified advertising account will be shown. If the parameter is null, all campaigns will be shown. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getCampaigns($access_token, array $params = []) { - return $this->request->post('ads.getCampaigns', $access_token, $params); - } - - /** - * Returns a list of possible ad categories. - * - * @param string $access_token - * @param array $params - * - @var string lang: Language. The full list of supported languages is [vk.com/dev/api_requests|here]. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCategories($access_token, array $params = []) { - return $this->request->post('ads.getCategories', $access_token, $params); - } - - /** - * Returns a list of advertising agency's clients. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getClients($access_token, array $params = []) { - return $this->request->post('ads.getClients', $access_token, $params); - } - - /** - * Returns demographics for ads or campaigns. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var AdsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns. - * - @var string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in 'ids_type'. Maximum 2000 objects. - * - @var AdsPeriod period: Data grouping by dates: *day — statistics by days,, *month — statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary limits. - * - @var string date_from: Date to show statistics from. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0. - * - @var string date_to: Date to show statistics to. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — current month,, *overall: 0. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getDemographics($access_token, array $params = []) { - return $this->request->post('ads.getDemographics', $access_token, $params); - } - - /** - * Returns information about current state of a counter — number of remaining runs of methods and time to the next counter nulling in seconds. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getFloodStats($access_token, array $params = []) { - return $this->request->post('ads.getFloodStats', $access_token, $params); - } - - /** - * Returns a list of managers and supervisors of advertising account. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getOfficeUsers($access_token, array $params = []) { - return $this->request->post('ads.getOfficeUsers', $access_token, $params); - } - - /** - * Returns detailed statistics of promoted posts reach from campaigns and ads. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var AdsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns. - * - @var string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in 'ids_type'. Maximum 100 objects. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getPostsReach($access_token, array $params = []) { - return $this->request->post('ads.getPostsReach', $access_token, $params); - } - - /** - * Returns a reason of ad rejection for pre-moderation. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var integer ad_id: Ad ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getRejectionReason($access_token, array $params = []) { - return $this->request->post('ads.getRejectionReason', $access_token, $params); - } - - /** - * Returns statistics of performance indicators for ads, campaigns, clients or the whole account. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var AdsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns,, *client — clients,, *office — account. - * - @var string ids: IDs requested ads, campaigns, clients or account, separated with a comma, depending on the value set in 'ids_type'. Maximum 2000 objects. - * - @var AdsPeriod period: Data grouping by dates: *day — statistics by days,, *month — statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary limits. - * - @var string date_from: Date to show statistics from. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0. - * - @var string date_to: Date to show statistics to. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — current month,, *overall: 0. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getStatistics($access_token, array $params = []) { - return $this->request->post('ads.getStatistics', $access_token, $params); - } - - /** - * Returns a set of auto-suggestions for various targeting parameters. - * - * @param string $access_token - * @param array $params - * - @var AdsSection section: Section, suggestions are retrieved in. Available values: *countries — request of a list of countries. If q is not set or blank, a short list of countries is shown. Otherwise, a full list of countries is shown. *regions — requested list of regions. 'country' parameter is required. *cities — requested list of cities. 'country' parameter is required. *districts — requested list of districts. 'cities' parameter is required. *stations — requested list of subway stations. 'cities' parameter is required. *streets — requested list of streets. 'cities' parameter is required. *schools — requested list of educational organizations. 'cities' parameter is required. *interests — requested list of interests. *positions — requested list of positions (professions). *group_types — requested list of group types. *religions — requested list of religious commitments. *browsers — requested list of browsers and mobile devices. - * - @var string ids: Objects IDs separated by commas. If the parameter is passed, 'q, country, cities' should not be passed. - * - @var string q: Filter-line of the request (for countries, regions, cities, streets, schools, interests, positions). - * - @var integer country: ID of the country objects are searched in. - * - @var string cities: IDs of cities where objects are searched in, separated with a comma. - * - @var AdsLang lang: Language of the returned string values. Supported languages: *ru — Russian,, *ua — Ukrainian,, *en — English. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getSuggestions($access_token, array $params = []) { - return $this->request->post('ads.getSuggestions', $access_token, $params); - } - - /** - * Returns a list of target groups. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account where the group will be created. - * - @var boolean extended: '1' — to return pixel code. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getTargetGroups($access_token, array $params = []) { - return $this->request->post('ads.getTargetGroups', $access_token, $params); - } - - /** - * Returns the size of targeting audience, and also recommended values for CPC and CPM. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var integer client_id - * - @var string criteria: Serialized JSON object that describes targeting parameters. Description of 'criteria' object see below. - * - @var integer ad_id: ID of an ad which targeting parameters shall be analyzed. - * - @var AdsAdFormat ad_format: Ad format. Possible values: *'1' — image and text,, *'2' — big image,, *'3' — exclusive format,, *'4' — community, square image,, *'7' — special app format,, *'8' — special community format,, *'9' — post in community,, *'10' — app board. - * - @var string ad_platform: Platforms to use for ad showing. Possible values: (for 'ad_format' = '1'), *'0' — VK and partner sites,, *'1' — VK only. (for 'ad_format' = '9'), *'all' — all platforms,, *'desktop' — desktop version,, *'mobile' — mobile version and apps. - * - @var string ad_platform_no_wall - * - @var string ad_platform_no_ad_network - * - @var string link_url: URL for the advertised object. - * - @var string link_domain: Domain of the advertised object. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function getTargetingStats($access_token, array $params = []) { - return $this->request->post('ads.getTargetingStats', $access_token, $params); - } - - /** - * Returns URL to upload an ad photo to. - * - * @param string $access_token - * @param array $params - * - @var AdsAdFormat ad_format: Ad format: *1 — image and text,, *2 — big image,, *3 — exclusive format,, *4 — community, square image,, *7 — special app format. - * - @var integer icon - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getUploadURL($access_token, array $params = []) { - return $this->request->post('ads.getUploadURL', $access_token, $params); - } - - /** - * Returns URL to upload an ad video to. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getVideoUploadURL($access_token) { - return $this->request->post('ads.getVideoUploadURL', $access_token); - } - - /** - * Imports a list of advertiser's contacts to count VK registered users against the target group. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created. - * - @var integer target_group_id: Target group ID. - * - @var string contacts: List of phone numbers, emails or user IDs separated with a comma. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function importTargetContacts($access_token, array $params = []) { - return $this->request->post('ads.importTargetContacts', $access_token, $params); - } - - /** - * Removes managers and/or supervisors from advertising account. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string ids: Serialized JSON array with IDs of deleted managers. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function removeOfficeUsers($access_token, array $params = []) { - return $this->request->post('ads.removeOfficeUsers', $access_token, $params); - } - - /** - * Edits ads. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string data: Serialized JSON array of objects that describe changes in ads. Description of 'ad_edit_specification' objects see below. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function updateAds($access_token, array $params = []) { - return $this->request->post('ads.updateAds', $access_token, $params); - } - - /** - * Edits advertising campaigns. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string data: Serialized JSON array of objects that describe changes in campaigns. Description of 'campaign_mod' objects see below. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function updateCampaigns($access_token, array $params = []) { - return $this->request->post('ads.updateCampaigns', $access_token, $params); - } - - /** - * Edits clients of an advertising agency. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var string data: Serialized JSON array of objects that describe changes in clients. Description of 'client_mod' objects see below. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function updateClients($access_token, array $params = []) { - return $this->request->post('ads.updateClients', $access_token, $params); - } - - /** - * Edits a retarget group. - * - * @param string $access_token - * @param array $params - * - @var integer account_id: Advertising account ID. - * - @var integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created. - * - @var integer target_group_id: Group ID. - * - @var string name: New name of the target group — a string up to 64 characters long. - * - @var string domain: Domain of the site where user accounting code will be placed. - * - @var integer lifetime: 'Only for the groups that get audience from sites with user accounting code.', Time in days when users added to a retarget group will be automatically excluded from it. '0' – automatic exclusion is off. - * - @var integer target_pixel_id - * - @var string target_pixel_rules - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. - * @return mixed - */ - public function updateTargetGroup($access_token, array $params = []) { - return $this->request->post('ads.updateTargetGroup', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Ads constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Adds managers and/or supervisors to advertising account. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - array data: Serialized JSON array of objects that describe added managers. Description of + * 'user_specification' objects see below. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function addOfficeUsers(string $access_token, array $params = array()) { + return $this->request->post('ads.addOfficeUsers', $access_token, $params); + } + + /** + * Allows to check the ad link. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - AdsCheckLinkLinkType link_type: Object type: *'community' — community,, *'post' — community + * post,, *'application' — VK application,, *'video' — video,, *'site' — external site. + * @see AdsCheckLinkLinkType + * - string link_url: Object URL. + * - integer campaign_id: Campaign ID + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function checkLink(string $access_token, array $params = array()) { + return $this->request->post('ads.checkLink', $access_token, $params); + } + + /** + * Creates ads. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string data: Serialized JSON array of objects that describe created ads. Description of + * 'ad_specification' objects see below. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function createAds(string $access_token, array $params = array()) { + return $this->request->post('ads.createAds', $access_token, $params); + } + + /** + * Creates advertising campaigns. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string data: Serialized JSON array of objects that describe created campaigns. Description of + * 'campaign_specification' objects see below. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function createCampaigns(string $access_token, array $params = array()) { + return $this->request->post('ads.createCampaigns', $access_token, $params); + } + + /** + * Creates clients of an advertising agency. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string data: Serialized JSON array of objects that describe created campaigns. Description of + * 'client_specification' objects see below. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function createClients(string $access_token, array $params = array()) { + return $this->request->post('ads.createClients', $access_token, $params); + } + + /** + * Creates a group to re-target ads for users who visited advertiser's site (viewed information about the product, + * registered, etc.). + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account + * where the group will be created. + * - string name: Name of the target group — a string up to 64 characters long. + * - integer lifetime: 'For groups with auditory created with pixel code only.', , Number of days after + * that users will be automatically removed from the group. + * - integer target_pixel_id: + * - string target_pixel_rules: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function createTargetGroup(string $access_token, array $params = array()) { + return $this->request->post('ads.createTargetGroup', $access_token, $params); + } + + /** + * Archives ads. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string ids: Serialized JSON array with ad IDs. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function deleteAds(string $access_token, array $params = array()) { + return $this->request->post('ads.deleteAds', $access_token, $params); + } + + /** + * Archives advertising campaigns. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string ids: Serialized JSON array with IDs of deleted campaigns. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function deleteCampaigns(string $access_token, array $params = array()) { + return $this->request->post('ads.deleteCampaigns', $access_token, $params); + } + + /** + * Archives clients of an advertising agency. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string ids: Serialized JSON array with IDs of deleted clients. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function deleteClients(string $access_token, array $params = array()) { + return $this->request->post('ads.deleteClients', $access_token, $params); + } + + /** + * Deletes a retarget group. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account + * where the group will be created. + * - integer target_group_id: Group ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function deleteTargetGroup(string $access_token, array $params = array()) { + return $this->request->post('ads.deleteTargetGroup', $access_token, $params); + } + + /** + * Returns a list of advertising accounts. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAccounts(string $access_token, array $params = array()) { + return $this->request->post('ads.getAccounts', $access_token, $params); + } + + /** + * Returns number of ads. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads + * will be shown. + * - string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the + * parameter is null, ads of all campaigns will be shown. + * - integer client_id: 'Available and required for advertising agencies.' ID of the client ads are + * retrieved from. + * - boolean include_deleted: Flag that specifies whether archived ads shall be shown: *0 — show only + * active ads,, *1 — show all ads. + * - boolean only_deleted: Flag that specifies whether to show only archived ads: *0 — show all ads,, *1 + * — show only archived ads. Available when include_deleted flag is *1 + * - integer limit: Limit of number of returned ads. Used only if ad_ids parameter is null, and + * 'campaign_ids' parameter contains ID of only one campaign. + * - integer offset: Offset. Used in the same cases as 'limit' parameter. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getAds(string $access_token, array $params = array()) { + return $this->request->post('ads.getAds', $access_token, $params); + } + + /** + * Returns descriptions of ad layouts. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads + * will be shown. + * - string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the + * parameter is null, ads of all campaigns will be shown. + * - integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. + * - boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 — show only + * active ads,, *1 — show all ads. + * - integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and + * 'campaign_ids' parameter contains ID of only one campaign. + * - integer offset: Offset. Used in the same cases as 'limit' parameter. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getAdsLayout(string $access_token, array $params = array()) { + return $this->request->post('ads.getAdsLayout', $access_token, $params); + } + + /** + * Returns ad targeting parameters. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads + * will be shown. + * - string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the + * parameter is null, ads of all campaigns will be shown. + * - integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. + * - boolean include_deleted: flag that specifies whether archived ads shall be shown: *0 — show only + * active ads,, *1 — show all ads. + * - integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and + * 'campaign_ids' parameter contains ID of only one campaign. + * - integer offset: Offset needed to return a specific subset of results. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getAdsTargeting(string $access_token, array $params = array()) { + return $this->request->post('ads.getAdsTargeting', $access_token, $params); + } + + /** + * Returns current budget of the advertising account. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getBudget(string $access_token, array $params = array()) { + return $this->request->post('ads.getBudget', $access_token, $params); + } + + /** + * Returns a list of campaigns in an advertising account. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - integer client_id: 'For advertising agencies'. ID of the client advertising campaigns are retrieved + * from. + * - boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 — show only + * active campaigns,, *1 — show all campaigns. + * - string campaign_ids: Filter of advertising campaigns to show. Serialized JSON array with campaign + * IDs. Only campaigns that exist in 'campaign_ids' and belong to the specified advertising account will be + * shown. If the parameter is null, all campaigns will be shown. + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getCampaigns(string $access_token, array $params = array()) { + return $this->request->post('ads.getCampaigns', $access_token, $params); + } + + /** + * Returns a list of possible ad categories. + * + * @param $access_token string + * @param $params array + * - string lang: Language. The full list of supported languages is [vk.com/dev/api_requests|here]. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCategories(string $access_token, array $params = array()) { + return $this->request->post('ads.getCategories', $access_token, $params); + } + + /** + * Returns a list of advertising agency's clients. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getClients(string $access_token, array $params = array()) { + return $this->request->post('ads.getClients', $access_token, $params); + } + + /** + * Returns demographics for ads or campaigns. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - AdsGetDemographicsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — + * ads,, *campaign — campaigns. + * @see AdsGetDemographicsIdsType + * - string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in + * 'ids_type'. Maximum 2000 objects. + * - AdsGetDemographicsPeriod period: Data grouping by dates: *day — statistics by days,, *month — + * statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary + * limits. + * @see AdsGetDemographicsPeriod + * - string date_from: Date to show statistics from. For different value of 'period' different date format + * is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, + * *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0. + * - string date_to: Date to show statistics to. For different value of 'period' different date format is + * used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, + * example: 2011-09 — September 2011, **0 — current month,, *overall: 0. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getDemographics(string $access_token, array $params = array()) { + return $this->request->post('ads.getDemographics', $access_token, $params); + } + + /** + * Returns information about current state of a counter — number of remaining runs of methods and time to the + * next counter nulling in seconds. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getFloodStats(string $access_token, array $params = array()) { + return $this->request->post('ads.getFloodStats', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer account_id: + * - integer client_id: + * - string requests_ids: + * - integer offset: + * - integer limit: + * - string sort_by: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getLookalikeRequests(string $access_token, array $params = array()) { + return $this->request->post('ads.getLookalikeRequests', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - string artist_name: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function getMusicians(string $access_token, array $params = array()) { + return $this->request->post('ads.getMusicians', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - array ids: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getMusiciansByIds(string $access_token, array $params = array()) { + return $this->request->post('ads.getMusiciansByIds', $access_token, $params); + } + + /** + * Returns a list of managers and supervisors of advertising account. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getOfficeUsers(string $access_token, array $params = array()) { + return $this->request->post('ads.getOfficeUsers', $access_token, $params); + } + + /** + * Returns detailed statistics of promoted posts reach from campaigns and ads. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - AdsGetPostsReachIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, + * *campaign — campaigns. + * @see AdsGetPostsReachIdsType + * - string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in + * 'ids_type'. Maximum 100 objects. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getPostsReach(string $access_token, array $params = array()) { + return $this->request->post('ads.getPostsReach', $access_token, $params); + } + + /** + * Returns a reason of ad rejection for pre-moderation. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - integer ad_id: Ad ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getRejectionReason(string $access_token, array $params = array()) { + return $this->request->post('ads.getRejectionReason', $access_token, $params); + } + + /** + * Returns statistics of performance indicators for ads, campaigns, clients or the whole account. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - AdsGetStatisticsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, + * *campaign — campaigns,, *client — clients,, *office — account. + * @see AdsGetStatisticsIdsType + * - string ids: IDs requested ads, campaigns, clients or account, separated with a comma, depending on + * the value set in 'ids_type'. Maximum 2000 objects. + * - AdsGetStatisticsPeriod period: Data grouping by dates: *day — statistics by days,, *month — + * statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary + * limits. + * @see AdsGetStatisticsPeriod + * - string date_from: Date to show statistics from. For different value of 'period' different date format + * is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, + * *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0. + * - string date_to: Date to show statistics to. For different value of 'period' different date format is + * used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, + * example: 2011-09 — September 2011, **0 — current month,, *overall: 0. + * - array stats_fields: Additional fields to add to statistics + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getStatistics(string $access_token, array $params = array()) { + return $this->request->post('ads.getStatistics', $access_token, $params); + } + + /** + * Returns a set of auto-suggestions for various targeting parameters. + * + * @param $access_token string + * @param $params array + * - AdsGetSuggestionsSection section: Section, suggestions are retrieved in. Available values: *countries + * — request of a list of countries. If q is not set or blank, a short list of countries is shown. Otherwise, + * a full list of countries is shown. *regions — requested list of regions. 'country' parameter is required. + * *cities — requested list of cities. 'country' parameter is required. *districts — requested list of + * districts. 'cities' parameter is required. *stations — requested list of subway stations. 'cities' + * parameter is required. *streets — requested list of streets. 'cities' parameter is required. *schools — + * requested list of educational organizations. 'cities' parameter is required. *interests — requested list + * of interests. *positions — requested list of positions (professions). *group_types — requested list of + * group types. *religions — requested list of religious commitments. *browsers — requested list of + * browsers and mobile devices. + * @see AdsGetSuggestionsSection + * - string ids: Objects IDs separated by commas. If the parameter is passed, 'q, country, cities' should + * not be passed. + * - string q: Filter-line of the request (for countries, regions, cities, streets, schools, interests, + * positions). + * - integer country: ID of the country objects are searched in. + * - string cities: IDs of cities where objects are searched in, separated with a comma. + * - AdsGetSuggestionsLang lang: Language of the returned string values. Supported languages: *ru — + * Russian,, *ua — Ukrainian,, *en — English. + * @see AdsGetSuggestionsLang + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSuggestions(string $access_token, array $params = array()) { + return $this->request->post('ads.getSuggestions', $access_token, $params); + } + + /** + * Returns a list of target groups. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account + * where the group will be created. + * - boolean extended: '1' — to return pixel code. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getTargetGroups(string $access_token, array $params = array()) { + return $this->request->post('ads.getTargetGroups', $access_token, $params); + } + + /** + * Returns the size of targeting audience, and also recommended values for CPC and CPM. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - integer client_id: + * - string criteria: Serialized JSON object that describes targeting parameters. Description of + * 'criteria' object see below. + * - integer ad_id: ID of an ad which targeting parameters shall be analyzed. + * - AdsGetTargetingStatsAdFormat ad_format: Ad format. Possible values: *'1' — image and text,, *'2' + * — big image,, *'3' — exclusive format,, *'4' — community, square image,, *'7' — special app format,, + * *'8' — special community format,, *'9' — post in community,, *'10' — app board. + * @see AdsGetTargetingStatsAdFormat + * - string ad_platform: Platforms to use for ad showing. Possible values: (for 'ad_format' = '1'), *'0' + * — VK and partner sites,, *'1' — VK only. (for 'ad_format' = '9'), *'all' — all platforms,, *'desktop' + * — desktop version,, *'mobile' — mobile version and apps. + * - string ad_platform_no_wall: + * - string ad_platform_no_ad_network: + * - string publisher_platforms: + * - string link_url: URL for the advertised object. + * - string link_domain: Domain of the advertised object. + * - boolean need_precise: Additionally return recommended cpc and cpm to reach 5,10..95 percents of + * audience. + * - integer impressions_limit_period: Impressions limit period in seconds, must be a multiple of + * 86400(day) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getTargetingStats(string $access_token, array $params = array()) { + return $this->request->post('ads.getTargetingStats', $access_token, $params); + } + + /** + * Returns URL to upload an ad photo to. + * + * @param $access_token string + * @param $params array + * - AdsGetUploadURLAdFormat ad_format: Ad format: *1 — image and text,, *2 — big image,, *3 — + * exclusive format,, *4 — community, square image,, *7 — special app format. + * @see AdsGetUploadURLAdFormat + * - integer icon: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getUploadURL(string $access_token, array $params = array()) { + return $this->request->post('ads.getUploadURL', $access_token, $params); + } + + /** + * Returns URL to upload an ad video to. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getVideoUploadURL(string $access_token, array $params = array()) { + return $this->request->post('ads.getVideoUploadURL', $access_token, $params); + } + + /** + * Imports a list of advertiser's contacts to count VK registered users against the target group. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account + * where the group will be created. + * - integer target_group_id: Target group ID. + * - string contacts: List of phone numbers, emails or user IDs separated with a comma. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function importTargetContacts(string $access_token, array $params = array()) { + return $this->request->post('ads.importTargetContacts', $access_token, $params); + } + + /** + * Removes managers and/or supervisors from advertising account. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string ids: Serialized JSON array with IDs of deleted managers. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function removeOfficeUsers(string $access_token, array $params = array()) { + return $this->request->post('ads.removeOfficeUsers', $access_token, $params); + } + + /** + * Edits ads. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string data: Serialized JSON array of objects that describe changes in ads. Description of + * 'ad_edit_specification' objects see below. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function updateAds(string $access_token, array $params = array()) { + return $this->request->post('ads.updateAds', $access_token, $params); + } + + /** + * Edits advertising campaigns. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string data: Serialized JSON array of objects that describe changes in campaigns. Description of + * 'campaign_mod' objects see below. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function updateCampaigns(string $access_token, array $params = array()) { + return $this->request->post('ads.updateCampaigns', $access_token, $params); + } + + /** + * Edits clients of an advertising agency. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - string data: Serialized JSON array of objects that describe changes in clients. Description of + * 'client_mod' objects see below. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function updateClients(string $access_token, array $params = array()) { + return $this->request->post('ads.updateClients', $access_token, $params); + } + + /** + * Adds managers and/or supervisors to advertising account. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - array data: Serialized JSON array of objects that describe added managers. Description of + * 'user_specification' objects see below. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function updateOfficeUsers(string $access_token, array $params = array()) { + return $this->request->post('ads.updateOfficeUsers', $access_token, $params); + } + + /** + * Edits a retarget group. + * + * @param $access_token string + * @param $params array + * - integer account_id: Advertising account ID. + * - integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account + * where the group will be created. + * - integer target_group_id: Group ID. + * - string name: New name of the target group — a string up to 64 characters long. + * - string domain: Domain of the site where user accounting code will be placed. + * - integer lifetime: 'Only for the groups that get audience from sites with user accounting code.', Time + * in days when users added to a retarget group will be automatically excluded from it. '0' - automatic + * exclusion is off. + * - integer target_pixel_id: + * - string target_pixel_rules: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function updateTargetGroup(string $access_token, array $params = array()) { + return $this->request->post('ads.updateTargetGroup', $access_token, $params); + } } diff --git a/src/VK/Actions/Adsweb.php b/src/VK/Actions/Adsweb.php new file mode 100644 index 0000000..1e2d812 --- /dev/null +++ b/src/VK/Actions/Adsweb.php @@ -0,0 +1,138 @@ +request = $request; + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer office_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAdCategories(string $access_token, array $params = array()) { + return $this->request->post('adsweb.getAdCategories', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAdUnitCode(string $access_token, array $params = array()) { + return $this->request->post('adsweb.getAdUnitCode', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer office_id: + * - string sites_ids: + * - string ad_units_ids: + * - string fields: + * - integer limit: + * - integer offset: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAdUnits(string $access_token, array $params = array()) { + return $this->request->post('adsweb.getAdUnits', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer office_id: + * - string sites_ids: + * - integer limit: + * - integer offset: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getFraudHistory(string $access_token, array $params = array()) { + return $this->request->post('adsweb.getFraudHistory', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer office_id: + * - string sites_ids: + * - string fields: + * - integer limit: + * - integer offset: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSites(string $access_token, array $params = array()) { + return $this->request->post('adsweb.getSites', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer office_id: + * - string ids_type: + * - string ids: + * - string period: + * - string date_from: + * - string date_to: + * - string fields: + * - integer limit: + * - string page_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getStatistics(string $access_token, array $params = array()) { + return $this->request->post('adsweb.getStatistics', $access_token, $params); + } +} diff --git a/src/VK/Actions/AppWidgets.php b/src/VK/Actions/AppWidgets.php index 14896d6..61b3237 100644 --- a/src/VK/Actions/AppWidgets.php +++ b/src/VK/Actions/AppWidgets.php @@ -1,171 +1,177 @@ request = $request; - } + /** + * AppWidgets constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns URL to upload an app widget photo. - * - * @param string $access_token - * @param array $params - * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCompileException Unable to compile code - * @throws VKApiRuntimeException Runtime error occurred during code invocation - * @return mixed - */ - public function getAppImageUploadServer($access_token, $params = []) { - return $this->request->post('appWidgets.getAppImageUploadServer', $access_token, $params); - } + /** + * Returns a URL for uploading a photo to the community collection for community app widgets + * + * @param $access_token string + * @param $params array + * - AppWidgetsGetAppImageUploadServerImageType image_type: + * @see AppWidgetsGetAppImageUploadServerImageType + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAppImageUploadServer(string $access_token, array $params = array()) { + return $this->request->post('appWidgets.getAppImageUploadServer', $access_token, $params); + } - /** - * Returns a collection of application images. - * - * @param string $access_token - * @param array $params - * - @var integer offset: Offset needed to return a specific subset of images. - * - @var integer count: Number of objects to return. - * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCompileException Unable to compile code - * @throws VKApiRuntimeException Runtime error occurred during code invocation - * @return mixed - */ - public function getAppImages($access_token, $params = []) { + /** + * Returns an app collection of images for community app widgets + * + * @param $access_token string + * @param $params array + * - integer offset: Offset needed to return a specific subset of images. + * - integer count: Maximum count of results. + * - AppWidgetsGetAppImagesImageType image_type: + * @see AppWidgetsGetAppImagesImageType + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAppImages(string $access_token, array $params = array()) { return $this->request->post('appWidgets.getAppImages', $access_token, $params); } - /** - * Returns the server address for community photo upload. - * - * @param string $access_token - * @param array $params - * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCompileException Unable to compile code - * @throws VKApiRuntimeException Runtime error occurred during code invocation - * @return mixed - */ - public function getGroupImageUploadServer($access_token, $params = []) { + /** + * Returns a URL for uploading a photo to the community collection for community app widgets + * + * @param $access_token string + * @param $params array + * - AppWidgetsGetGroupImageUploadServerImageType image_type: + * @see AppWidgetsGetGroupImageUploadServerImageType + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getGroupImageUploadServer(string $access_token, array $params = array()) { return $this->request->post('appWidgets.getGroupImageUploadServer', $access_token, $params); } /** - * Returns a collection of application images. - * - * @param string $access_token - * @param array $params - * - @var integer offset: Offset needed to return a specific subset of images. - * - @var integer count: Number of objects to return. - * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCompileException Unable to compile code - * @throws VKApiRuntimeException Runtime error occurred during code invocation + * Returns a community collection of images for community app widgets + * + * @param $access_token string + * @param $params array + * - integer offset: Offset needed to return a specific subset of images. + * - integer count: Maximum count of results. + * - AppWidgetsGetGroupImagesImageType image_type: + * @see AppWidgetsGetGroupImagesImageType + * * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * */ - public function getGroupImages($access_token, $params = []) { + public function getGroupImages(string $access_token, array $params = array()) { return $this->request->post('appWidgets.getGroupImages', $access_token, $params); } /** - * Returns a collection of application images by id. - * - * @param string $access_token - * @param array $params - * - @var array[string] images: List of images ID - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCompileException Unable to compile code - * @throws VKApiRuntimeException Runtime error occurred during code invocation + * Returns an image for community app widgets by its ID + * + * @param $access_token string + * @param $params array + * - array images: List of images IDs + * * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * */ - public function getGroupImagesById($access_token, $params = []) { - return $this->request->post('appWidgets.getGroupImagesById', $access_token, $params); + public function getImagesById(string $access_token, array $params = array()) { + return $this->request->post('appWidgets.getImagesById', $access_token, $params); } /** - * Saves app photos after successful uploading. - * - * @param string $access_token - * @param array $params - * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var string image: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCompileException Unable to compile code - * @throws VKApiRuntimeException Runtime error occurred during code invocation + * Allows to save image into app collection for community app widgets + * + * @param $access_token string + * @param $params array + * - string hash: Parameter returned when photo is uploaded to server + * - string image: Parameter returned when photo is uploaded to server + * * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * */ - public function saveAppImage($access_token, $params = []) { + public function saveAppImage(string $access_token, array $params = array()) { return $this->request->post('appWidgets.saveAppImage', $access_token, $params); } /** - * Saves app photos into community after successful uploading. - * - * @param string $access_token - * @param array $params - * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var string image: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCompileException Unable to compile code - * @throws VKApiRuntimeException Runtime error occurred during code invocation + * Allows to save image into community collection for community app widgets + * + * @param $access_token string + * @param $params array + * - string hash: Parameter returned when photo is uploaded to server + * - string image: Parameter returned when photo is uploaded to server + * * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * */ - public function saveGroupImage($access_token, $params = []) { + public function saveGroupImage(string $access_token, array $params = array()) { return $this->request->post('appWidgets.saveGroupImage', $access_token, $params); } - /** - * Allows to update community app widget - * - * @param string $access_token - * @param array $params - * - @var string code - * - @var AppWidgetsType type - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCompileException Unable to compile code - * @throws VKApiRuntimeException Runtime error occurred during code invocation - * @throws VKApiBlockedException Content blocked - * @throws VKApiWallAccessPostException Access to wall's post denied - * @throws VKApiWallAccessRepliesException Access to post comments denied - * @throws VKApiParamGroupIdException Invalid group id - * @return mixed - */ - public function update($access_token, array $params = []) { - return $this->request->post('appWidgets.update', $access_token, $params); - } + /** + * Allows to update community app widget + * + * @param $access_token string + * @param $params array + * - string code: + * - AppWidgetsUpdateType type: + * @see AppWidgetsUpdateType + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function update(string $access_token, array $params = array()) { + return $this->request->post('appWidgets.update', $access_token, $params); + } } diff --git a/src/VK/Actions/Apps.php b/src/VK/Actions/Apps.php index fd9a03c..d06b25d 100644 --- a/src/VK/Actions/Apps.php +++ b/src/VK/Actions/Apps.php @@ -1,169 +1,261 @@ request = $request; - } - - /** - * Deletes all request notifications from the current app. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteAppRequests($access_token) { - return $this->request->post('apps.deleteAppRequests', $access_token); - } - - /** - * Returns applications data. - * - * @param string $access_token - * @param array $params - * - @var integer app_id: Application ID - * - @var array[string] app_ids: List of application ID - * - @var AppsPlatform platform: platform. Possible values: *'ios' — iOS,, *'android' — Android,, *'winphone' — Windows Phone,, *'web' — приложения на vk.com. By default: 'web'. - * - @var boolean extended - * - @var boolean return_friends - * - @var array[AppsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities', (only if return_friends - 1) - * - @var AppsNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default),, 'gen' — genitive,, 'dat' — dative,, 'acc' — accusative,, 'ins' — instrumental,, 'abl' — prepositional. (only if 'return_friends' = '1') - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('apps.get', $access_token, $params); - } - - /** - * Returns a list of applications (apps) available to users in the App Catalog. - * - * @param string $access_token - * @param array $params - * - @var AppsSort sort: Sort order: 'popular_today' — popular for one day (default), 'visitors' — by visitors number , 'create_date' — by creation date, 'growth_rate' — by growth rate, 'popular_week' — popular for one week - * - @var integer offset: Offset required to return a specific subset of apps. - * - @var integer count: Number of apps to return. - * - @var string platform - * - @var boolean extended: '1' — to return additional fields 'screenshots', 'MAU', 'catalog_position', and 'international'. If set, 'count' must be less than or equal to '100'. '0' — not to return additional fields (default). - * - @var boolean return_friends - * - @var array[AppsFields] fields - * - @var string name_case - * - @var string q: Search query string. - * - @var integer genre_id - * - @var AppsFilter filter: 'installed' — to return list of installed apps (only for mobile platform). - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCatalog($access_token, array $params = []) { - return $this->request->post('apps.getCatalog', $access_token, $params); - } - - /** - * Creates friends list for requests and invites in current app. - * - * @param string $access_token - * @param array $params - * - @var boolean extended - * - @var integer count: List size. - * - @var integer offset - * - @var AppsType type: List type. Possible values: * 'invite' — available for invites (don't play the game),, * 'request' — available for request (play the game). By default: 'invite'. - * - @var array[AppsFields] fields: Additional profile fields, see [vk.com/dev/fields|description]. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getFriendsList($access_token, array $params = []) { - return $this->request->post('apps.getFriendsList', $access_token, $params); - } - - /** - * Returns players rating in the game. - * - * @param string $access_token - * @param array $params - * - @var AppsType type: Leaderboard type. Possible values: *'level' — by level,, *'points' — by mission points,, *'score' — by score (). - * - @var boolean global: Rating type. Possible values: *'1' — global rating among all players,, *'0' — rating among user friends. - * - @var boolean extended: 1 — to return additional info about users - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getLeaderboard($access_token, array $params = []) { - return $this->request->post('apps.getLeaderboard', $access_token, $params); - } - - /** - * Returns scopes for auth - * - * @param string $access_token - * @param array $params - * - @var AppsType type - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getScopes($access_token, array $params = []) { - return $this->request->post('apps.getScopes', $access_token, $params); - } - - /** - * Returns user score in app - * - * @param string $access_token - * @param array $params - * - @var integer user_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getScore($access_token, array $params = []) { - return $this->request->post('apps.getScore', $access_token, $params); - } - - /** - * Sends a request to another user in an app that uses VK authorization. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: id of the user to send a request - * - @var string text: request text - * - @var AppsType type: request type. Values: 'invite' – if the request is sent to a user who does not have the app installed,, 'request' – if a user has already installed the app - * - @var string name - * - @var string key: special string key to be sent with the request - * - @var boolean separate - * @throws VKClientException - * @throws VKApiException - * @throws VKApiFloodException Flood control - * @return mixed - */ - public function sendRequest($access_token, array $params = []) { - return $this->request->post('apps.sendRequest', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Apps constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Deletes all request notifications from the current app. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteAppRequests(string $access_token, array $params = array()) { + return $this->request->post('apps.deleteAppRequests', $access_token, $params); + } + + /** + * Returns applications data. + * + * @param $access_token string + * @param $params array + * - integer app_id: Application ID + * - array app_ids: List of application ID + * - AppsGetPlatform platform: platform. Possible values: *'ios' — iOS,, *'android' — Android,, + * *'winphone' — Windows Phone,, *'web' — приложения на vk.com. By default: 'web'. + * @see AppsGetPlatform + * - boolean extended: + * - boolean return_friends: + * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' + * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', + * 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', + * 'can_see_all_posts', 'can_post', 'universities', (only if return_friends - 1) + * - AppsGetNameCase name_case: Case for declension of user name and surname: 'nom' — nominative + * (default),, 'gen' — genitive,, 'dat' — dative,, 'acc' — accusative,, 'ins' — instrumental,, 'abl' + * — prepositional. (only if 'return_friends' = '1') + * @see AppsGetNameCase + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('apps.get', $access_token, $params); + } + + /** + * Returns a list of applications (apps) available to users in the App Catalog. + * + * @param $access_token string + * @param $params array + * - AppsGetCatalogSort sort: Sort order: 'popular_today' — popular for one day (default), 'visitors' + * — by visitors number , 'create_date' — by creation date, 'growth_rate' — by growth rate, + * 'popular_week' — popular for one week + * @see AppsGetCatalogSort + * - integer offset: Offset required to return a specific subset of apps. + * - integer count: Number of apps to return. + * - string platform: + * - boolean extended: '1' — to return additional fields 'screenshots', 'MAU', 'catalog_position', and + * 'international'. If set, 'count' must be less than or equal to '100'. '0' — not to return additional + * fields (default). + * - boolean return_friends: + * - array fields: + * - string name_case: + * - string q: Search query string. + * - integer genre_id: + * - AppsGetCatalogFilter filter: 'installed' — to return list of installed apps (only for mobile + * platform). + * @see AppsGetCatalogFilter + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCatalog(string $access_token, array $params = array()) { + return $this->request->post('apps.getCatalog', $access_token, $params); + } + + /** + * Creates friends list for requests and invites in current app. + * + * @param $access_token string + * @param $params array + * - boolean extended: + * - integer count: List size. + * - integer offset: + * - AppsGetFriendsListType type: List type. Possible values: * 'invite' — available for invites (don't + * play the game),, * 'request' — available for request (play the game). By default: 'invite'. + * @see AppsGetFriendsListType + * - array fields: Additional profile fields, see [vk.com/dev/fields|description]. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getFriendsList(string $access_token, array $params = array()) { + return $this->request->post('apps.getFriendsList', $access_token, $params); + } + + /** + * Returns players rating in the game. + * + * @param $access_token string + * @param $params array + * - AppsGetLeaderboardType type: Leaderboard type. Possible values: *'level' — by level,, *'points' — + * by mission points,, *'score' — by score (). + * @see AppsGetLeaderboardType + * - boolean global: Rating type. Possible values: *'1' — global rating among all players,, *'0' — + * rating among user friends. + * - boolean extended: 1 — to return additional info about users + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getLeaderboard(string $access_token, array $params = array()) { + return $this->request->post('apps.getLeaderboard', $access_token, $params); + } + + /** + * Returns policies and terms given to a mini app. + * + * @param $access_token string + * @param $params array + * - integer app_id: Mini App ID + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getMiniAppPolicies(string $access_token, array $params = array()) { + return $this->request->post('apps.getMiniAppPolicies', $access_token, $params); + } + + /** + * Returns scopes for auth + * + * @param $access_token string + * @param $params array + * - AppsGetScopesType type: + * @see AppsGetScopesType + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getScopes(string $access_token, array $params = array()) { + return $this->request->post('apps.getScopes', $access_token, $params); + } + + /** + * Returns user score in app + * + * @param $access_token string + * @param $params array + * - integer user_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getScore(string $access_token, array $params = array()) { + return $this->request->post('apps.getScore', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer promo_id: Id of game promo action + * - integer user_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function promoHasActiveGift(string $access_token, array $params = array()) { + return $this->request->post('apps.promoHasActiveGift', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer promo_id: Id of game promo action + * - integer user_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function promoUseGift(string $access_token, array $params = array()) { + return $this->request->post('apps.promoUseGift', $access_token, $params); + } + + /** + * Sends a request to another user in an app that uses VK authorization. + * + * @param $access_token string + * @param $params array + * - integer user_id: id of the user to send a request + * - string text: request text + * - AppsSendRequestType type: request type. Values: 'invite' - if the request is sent to a user who does + * not have the app installed,, 'request' - if a user has already installed the app + * @see AppsSendRequestType + * - string name: + * - string key: special string key to be sent with the request + * - boolean separate: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function sendRequest(string $access_token, array $params = array()) { + return $this->request->post('apps.sendRequest', $access_token, $params); + } } diff --git a/src/VK/Actions/Auth.php b/src/VK/Actions/Auth.php index 51a69b0..544230e 100644 --- a/src/VK/Actions/Auth.php +++ b/src/VK/Actions/Auth.php @@ -1,65 +1,43 @@ request = $request; - } + /** + * @var VKApiRequest + */ + private $request; - /** - * Checks a user's phone number for correctness. - * - * @param string $access_token - * @param array $params - * - @var string phone: Phone number. - * - @var integer client_id: User ID. - * - @var string client_secret - * - @var boolean auth_by_phone - * @throws VKClientException - * @throws VKApiException - * @throws VKApiPhoneAlreadyUsedException This phone number is used by another user - * @throws VKApiAuthDelayException Processing.. Try later - * @throws VKApiParamPhoneException Invalid phone number - * @return mixed - */ - public function checkPhone($access_token, array $params = []) { - return $this->request->post('auth.checkPhone', $access_token, $params); - } + /** + * Auth constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Allows to restore account access using a code received via SMS. " This method is only available for apps with [vk.com/dev/auth_direct|Direct authorization] access. " - * - * @param string $access_token - * @param array $params - * - @var string phone: User phone number. - * - @var string last_name: User last name. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAuthFloodException Too many auth attempts, try again later - * @return mixed - */ - public function restore($access_token, array $params = []) { - return $this->request->post('auth.restore', $access_token, $params); - } + /** + * Allows to restore account access using a code received via SMS. " This method is only available for apps with + * [vk.com/dev/auth_direct|Direct authorization] access. " + * + * @param $access_token string + * @param $params array + * - string phone: User phone number. + * - string last_name: User last name. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function restore(string $access_token, array $params = array()) { + return $this->request->post('auth.restore', $access_token, $params); + } } diff --git a/src/VK/Actions/Board.php b/src/VK/Actions/Board.php index a3ca234..dc44614 100644 --- a/src/VK/Actions/Board.php +++ b/src/VK/Actions/Board.php @@ -1,249 +1,298 @@ request = $request; - } - - /** - * Creates a new topic on a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var string title: Topic title. - * - @var string text: Text of the topic. - * - @var boolean from_group: For a community: '1' — to post the topic as by the community, '0' — to post the topic as by the user (default) - * - @var array[string] attachments: List of media objects attached to the topic, in the following format: "_,_", '' — Type of media object: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media ID. Example: "photo100172_166443618,photo66748_265827614", , "NOTE: If you try to attach more than one reference, an error will be thrown.", - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function addTopic($access_token, array $params = []) { - return $this->request->post('board.addTopic', $access_token, $params); - } - - /** - * Closes a topic on a community's discussion board so that comments cannot be posted. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function closeTopic($access_token, array $params = []) { - return $this->request->post('board.closeTopic', $access_token, $params); - } - - /** - * Adds a comment on a topic on a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: ID of the topic to be commented on. - * - @var string message: (Required if 'attachments' is not set.) Text of the comment. - * - @var array[string] attachments: (Required if 'text' is not set.) List of media objects attached to the comment, in the following format: "_,_", '' — Type of media object: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media ID. - * - @var boolean from_group: '1' — to post the comment as by the community, '0' — to post the comment as by the user (default) - * - @var integer sticker_id: Sticker ID. - * - @var string guid: Unique identifier to avoid repeated comments. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function createComment($access_token, array $params = []) { - return $this->request->post('board.createComment', $access_token, $params); - } - - /** - * Deletes a comment on a topic on a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * - @var integer comment_id: Comment ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteComment($access_token, array $params = []) { - return $this->request->post('board.deleteComment', $access_token, $params); - } - - /** - * Deletes a topic from a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteTopic($access_token, array $params = []) { - return $this->request->post('board.deleteTopic', $access_token, $params); - } - - /** - * Edits a comment on a topic on a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * - @var integer comment_id: ID of the comment on the topic. - * - @var string message: (Required if 'attachments' is not set). New comment text. - * - @var array[string] attachments: (Required if 'message' is not set.) List of media objects attached to the comment, in the following format: "_,_", '' — Type of media object: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media ID. Example: "photo100172_166443618,photo66748_265827614" - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function editComment($access_token, array $params = []) { - return $this->request->post('board.editComment', $access_token, $params); - } - - /** - * Edits the title of a topic on a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * - @var string title: New title of the topic. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function editTopic($access_token, array $params = []) { - return $this->request->post('board.editTopic', $access_token, $params); - } - - /** - * Pins a topic (fixes its place) to the top of a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function fixTopic($access_token, array $params = []) { - return $this->request->post('board.fixTopic', $access_token, $params); - } - - /** - * Returns a list of comments on a topic on a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * - @var boolean need_likes: '1' — to return the 'likes' field, '0' — not to return the 'likes' field (default) - * - @var integer start_comment_id - * - @var integer offset: Offset needed to return a specific subset of comments. - * - @var integer count: Number of comments to return. - * - @var boolean extended: '1' — to return information about users who posted comments, '0' — to return no additional fields (default) - * - @var BoardSort sort: Sort order: 'asc' — by creation date in chronological order, 'desc' — by creation date in reverse chronological order, - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getComments($access_token, array $params = []) { - return $this->request->post('board.getComments', $access_token, $params); - } - - /** - * Returns a list of topics on a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var array[integer] topic_ids: IDs of topics to be returned (100 maximum). By default, all topics are returned. If this parameter is set, the 'order', 'offset', and 'count' parameters are ignored. - * - @var BoardOrder order: Sort order: '1' — by date updated in reverse chronological order. '2' — by date created in reverse chronological order. '-1' — by date updated in chronological order. '-2' — by date created in chronological order. If no sort order is specified, topics are returned in the order specified by the group administrator. Pinned topics are returned first, regardless of the sorting. - * - @var integer offset: Offset needed to return a specific subset of topics. - * - @var integer count: Number of topics to return. - * - @var boolean extended: '1' — to return information about users who created topics or who posted there last, '0' — to return no additional fields (default) - * - @var BoardPreview preview: '1' — to return the first comment in each topic,, '2' — to return the last comment in each topic,, '0' — to return no comments. By default: '0'. - * - @var integer preview_length: Number of characters after which to truncate the previewed comment. To preview the full comment, specify '0'. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getTopics($access_token, array $params = []) { - return $this->request->post('board.getTopics', $access_token, $params); - } - - /** - * Re-opens a previously closed topic on a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function openTopic($access_token, array $params = []) { - return $this->request->post('board.openTopic', $access_token, $params); - } - - /** - * Restores a comment deleted from a topic on a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * - @var integer comment_id: Comment ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function restoreComment($access_token, array $params = []) { - return $this->request->post('board.restoreComment', $access_token, $params); - } - - /** - * Unpins a pinned topic from the top of a community's discussion board. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the discussion board. - * - @var integer topic_id: Topic ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function unfixTopic($access_token, array $params = []) { - return $this->request->post('board.unfixTopic', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Board constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Creates a new topic on a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - string title: Topic title. + * - string text: Text of the topic. + * - boolean from_group: For a community: '1' — to post the topic as by the community, '0' — to post + * the topic as by the user (default) + * - array attachments: List of media objects attached to the topic, in the following format: + * "_,_", '' — Type of media object: 'photo' — photo, 'video' — + * video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media + * ID. Example: "photo100172_166443618,photo66748_265827614", , "NOTE: If you try to attach more than one + * reference, an error will be thrown.", + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function addTopic(string $access_token, array $params = array()) { + return $this->request->post('board.addTopic', $access_token, $params); + } + + /** + * Closes a topic on a community's discussion board so that comments cannot be posted. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function closeTopic(string $access_token, array $params = array()) { + return $this->request->post('board.closeTopic', $access_token, $params); + } + + /** + * Adds a comment on a topic on a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: ID of the topic to be commented on. + * - string message: (Required if 'attachments' is not set.) Text of the comment. + * - array attachments: (Required if 'text' is not set.) List of media objects attached to the comment, in + * the following format: "_,_", '' — Type of media object: 'photo' + * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. + * '' — Media ID. + * - boolean from_group: '1' — to post the comment as by the community, '0' — to post the comment as + * by the user (default) + * - integer sticker_id: Sticker ID. + * - string guid: Unique identifier to avoid repeated comments. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function createComment(string $access_token, array $params = array()) { + return $this->request->post('board.createComment', $access_token, $params); + } + + /** + * Deletes a comment on a topic on a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * - integer comment_id: Comment ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteComment(string $access_token, array $params = array()) { + return $this->request->post('board.deleteComment', $access_token, $params); + } + + /** + * Deletes a topic from a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteTopic(string $access_token, array $params = array()) { + return $this->request->post('board.deleteTopic', $access_token, $params); + } + + /** + * Edits a comment on a topic on a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * - integer comment_id: ID of the comment on the topic. + * - string message: (Required if 'attachments' is not set). New comment text. + * - array attachments: (Required if 'message' is not set.) List of media objects attached to the comment, + * in the following format: "_,_", '' — Type of media object: 'photo' + * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. + * '' — Media ID. Example: "photo100172_166443618,photo66748_265827614" + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function editComment(string $access_token, array $params = array()) { + return $this->request->post('board.editComment', $access_token, $params); + } + + /** + * Edits the title of a topic on a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * - string title: New title of the topic. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function editTopic(string $access_token, array $params = array()) { + return $this->request->post('board.editTopic', $access_token, $params); + } + + /** + * Pins a topic (fixes its place) to the top of a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function fixTopic(string $access_token, array $params = array()) { + return $this->request->post('board.fixTopic', $access_token, $params); + } + + /** + * Returns a list of comments on a topic on a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * - boolean need_likes: '1' — to return the 'likes' field, '0' — not to return the 'likes' field + * (default) + * - integer start_comment_id: + * - integer offset: Offset needed to return a specific subset of comments. + * - integer count: Number of comments to return. + * - boolean extended: '1' — to return information about users who posted comments, '0' — to return no + * additional fields (default) + * - BoardGetCommentsSort sort: Sort order: 'asc' — by creation date in chronological order, 'desc' — + * by creation date in reverse chronological order, + * @see BoardGetCommentsSort + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getComments(string $access_token, array $params = array()) { + return $this->request->post('board.getComments', $access_token, $params); + } + + /** + * Returns a list of topics on a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - array topic_ids: IDs of topics to be returned (100 maximum). By default, all topics are returned. If + * this parameter is set, the 'order', 'offset', and 'count' parameters are ignored. + * - BoardGetTopicsOrder order: Sort order: '1' — by date updated in reverse chronological order. '2' + * — by date created in reverse chronological order. '-1' — by date updated in chronological order. '-2' + * — by date created in chronological order. If no sort order is specified, topics are returned in the order + * specified by the group administrator. Pinned topics are returned first, regardless of the sorting. + * @see BoardGetTopicsOrder + * - integer offset: Offset needed to return a specific subset of topics. + * - integer count: Number of topics to return. + * - boolean extended: '1' — to return information about users who created topics or who posted there + * last, '0' — to return no additional fields (default) + * - BoardGetTopicsPreview preview: '1' — to return the first comment in each topic,, '2' — to return + * the last comment in each topic,, '0' — to return no comments. By default: '0'. + * @see BoardGetTopicsPreview + * - integer preview_length: Number of characters after which to truncate the previewed comment. To + * preview the full comment, specify '0'. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getTopics(string $access_token, array $params = array()) { + return $this->request->post('board.getTopics', $access_token, $params); + } + + /** + * Re-opens a previously closed topic on a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function openTopic(string $access_token, array $params = array()) { + return $this->request->post('board.openTopic', $access_token, $params); + } + + /** + * Restores a comment deleted from a topic on a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * - integer comment_id: Comment ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function restoreComment(string $access_token, array $params = array()) { + return $this->request->post('board.restoreComment', $access_token, $params); + } + + /** + * Unpins a pinned topic from the top of a community's discussion board. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the discussion board. + * - integer topic_id: Topic ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function unfixTopic(string $access_token, array $params = array()) { + return $this->request->post('board.unfixTopic', $access_token, $params); + } } diff --git a/src/VK/Actions/Database.php b/src/VK/Actions/Database.php index f4b523e..d19e033 100644 --- a/src/VK/Actions/Database.php +++ b/src/VK/Actions/Database.php @@ -1,218 +1,243 @@ request = $request; - } - - /** - * Returns list of chairs on a specified faculty. - * - * @param string $access_token - * @param array $params - * - @var integer faculty_id: id of the faculty to get chairs from - * - @var integer offset: offset required to get a certain subset of chairs - * - @var integer count: amount of chairs to get - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getChairs($access_token, array $params = []) { - return $this->request->post('database.getChairs', $access_token, $params); - } - - /** - * Returns a list of cities. - * - * @param string $access_token - * @param array $params - * - @var integer country_id: Country ID. - * - @var integer region_id: Region ID. - * - @var string q: Search query. - * - @var boolean need_all: '1' — to return all cities in the country, '0' — to return major cities in the country (default), - * - @var integer offset: Offset needed to return a specific subset of cities. - * - @var integer count: Number of cities to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCities($access_token, array $params = []) { - return $this->request->post('database.getCities', $access_token, $params); - } - - /** - * Returns information about cities by their IDs. - * - * @param string $access_token - * @param array $params - * - @var array[integer] city_ids: City IDs. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCitiesById($access_token, array $params = []) { - return $this->request->post('database.getCitiesById', $access_token, $params); - } - - /** - * Returns a list of countries. - * - * @param string $access_token - * @param array $params - * - @var boolean 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). - * - @var string code: Country codes in [vk.com/dev/country_codes|ISO 3166-1 alpha-2] standard. - * - @var integer offset: Offset needed to return a specific subset of countries. - * - @var integer count: Number of countries to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCountries($access_token, array $params = []) { - return $this->request->post('database.getCountries', $access_token, $params); - } - - /** - * Returns information about countries by their IDs. - * - * @param string $access_token - * @param array $params - * - @var array[integer] country_ids: Country IDs. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCountriesById($access_token, array $params = []) { - return $this->request->post('database.getCountriesById', $access_token, $params); - } - - /** - * Returns a list of faculties (i.e., university departments). - * - * @param string $access_token - * @param array $params - * - @var integer university_id: University ID. - * - @var integer offset: Offset needed to return a specific subset of faculties. - * - @var integer count: Number of faculties to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getFaculties($access_token, array $params = []) { - return $this->request->post('database.getFaculties', $access_token, $params); - } - - /** - * Get metro stations by city - * - * @param string $access_token - * @param array $params - * - @var integer city_id - * - @var integer offset - * - @var integer count - * - @var boolean extended - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getMetroStations($access_token, array $params = []) { - return $this->request->post('database.getMetroStations', $access_token, $params); - } - - /** - * Get metro station by his id - * - * @param string $access_token - * @param array $params - * - @var array[integer] station_ids - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getMetroStationsById($access_token, array $params = []) { - return $this->request->post('database.getMetroStationsById', $access_token, $params); - } - - /** - * Returns a list of regions. - * - * @param string $access_token - * @param array $params - * - @var integer country_id: Country ID, received in [vk.com/dev/database.getCountries|database.getCountries] method. - * - @var string q: Search query. - * - @var integer offset: Offset needed to return specific subset of regions. - * - @var integer count: Number of regions to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getRegions($access_token, array $params = []) { - return $this->request->post('database.getRegions', $access_token, $params); - } - - /** - * Returns a list of school classes specified for the country. - * - * @param string $access_token - * @param array $params - * - @var integer country_id: Country ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getSchoolClasses($access_token, array $params = []) { - return $this->request->post('database.getSchoolClasses', $access_token, $params); - } - - /** - * Returns a list of schools. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query. - * - @var integer city_id: City ID. - * - @var integer offset: Offset needed to return a specific subset of schools. - * - @var integer count: Number of schools to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getSchools($access_token, array $params = []) { - return $this->request->post('database.getSchools', $access_token, $params); - } - - /** - * Returns a list of higher education institutions. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query. - * - @var integer country_id: Country ID. - * - @var integer city_id: City ID. - * - @var integer offset: Offset needed to return a specific subset of universities. - * - @var integer count: Number of universities to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getUniversities($access_token, array $params = []) { - return $this->request->post('database.getUniversities', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Database constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Returns list of chairs on a specified faculty. + * + * @param $access_token string + * @param $params array + * - integer faculty_id: id of the faculty to get chairs from + * - integer offset: offset required to get a certain subset of chairs + * - integer count: amount of chairs to get + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getChairs(string $access_token, array $params = array()) { + return $this->request->post('database.getChairs', $access_token, $params); + } + + /** + * Returns a list of cities. + * + * @param $access_token string + * @param $params array + * - integer country_id: Country ID. + * - integer region_id: Region ID. + * - string q: Search query. + * - boolean need_all: '1' — to return all cities in the country, '0' — to return major cities in the + * country (default), + * - integer offset: Offset needed to return a specific subset of cities. + * - integer count: Number of cities to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCities(string $access_token, array $params = array()) { + return $this->request->post('database.getCities', $access_token, $params); + } + + /** + * Returns information about cities by their IDs. + * + * @param $access_token string + * @param $params array + * - array city_ids: City IDs. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCitiesById(string $access_token, array $params = array()) { + return $this->request->post('database.getCitiesById', $access_token, $params); + } + + /** + * Returns a list of countries. + * + * @param $access_token string + * @param $params array + * - boolean 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). + * - string code: Country codes in [vk.com/dev/country_codes|ISO 3166-1 alpha-2] standard. + * - integer offset: Offset needed to return a specific subset of countries. + * - integer count: Number of countries to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCountries(string $access_token, array $params = array()) { + return $this->request->post('database.getCountries', $access_token, $params); + } + + /** + * Returns information about countries by their IDs. + * + * @param $access_token string + * @param $params array + * - array country_ids: Country IDs. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCountriesById(string $access_token, array $params = array()) { + return $this->request->post('database.getCountriesById', $access_token, $params); + } + + /** + * Returns a list of faculties (i.e., university departments). + * + * @param $access_token string + * @param $params array + * - integer university_id: University ID. + * - integer offset: Offset needed to return a specific subset of faculties. + * - integer count: Number of faculties to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getFaculties(string $access_token, array $params = array()) { + return $this->request->post('database.getFaculties', $access_token, $params); + } + + /** + * Get metro stations by city + * + * @param $access_token string + * @param $params array + * - integer city_id: + * - integer offset: + * - integer count: + * - boolean extended: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getMetroStations(string $access_token, array $params = array()) { + return $this->request->post('database.getMetroStations', $access_token, $params); + } + + /** + * Get metro station by his id + * + * @param $access_token string + * @param $params array + * - array station_ids: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getMetroStationsById(string $access_token, array $params = array()) { + return $this->request->post('database.getMetroStationsById', $access_token, $params); + } + + /** + * Returns a list of regions. + * + * @param $access_token string + * @param $params array + * - integer country_id: Country ID, received in [vk.com/dev/database.getCountries|database.getCountries] + * method. + * - string q: Search query. + * - integer offset: Offset needed to return specific subset of regions. + * - integer count: Number of regions to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getRegions(string $access_token, array $params = array()) { + return $this->request->post('database.getRegions', $access_token, $params); + } + + /** + * Returns a list of school classes specified for the country. + * + * @param $access_token string + * @param $params array + * - integer country_id: Country ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSchoolClasses(string $access_token, array $params = array()) { + return $this->request->post('database.getSchoolClasses', $access_token, $params); + } + + /** + * Returns a list of schools. + * + * @param $access_token string + * @param $params array + * - string q: Search query. + * - integer city_id: City ID. + * - integer offset: Offset needed to return a specific subset of schools. + * - integer count: Number of schools to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSchools(string $access_token, array $params = array()) { + return $this->request->post('database.getSchools', $access_token, $params); + } + + /** + * Returns a list of higher education institutions. + * + * @param $access_token string + * @param $params array + * - string q: Search query. + * - integer country_id: Country ID. + * - integer city_id: City ID. + * - integer offset: Offset needed to return a specific subset of universities. + * - integer count: Number of universities to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getUniversities(string $access_token, array $params = array()) { + return $this->request->post('database.getUniversities', $access_token, $params); + } } diff --git a/src/VK/Actions/Docs.php b/src/VK/Actions/Docs.php index 299b103..9f6cb9c 100644 --- a/src/VK/Actions/Docs.php +++ b/src/VK/Actions/Docs.php @@ -1,208 +1,237 @@ request = $request; - } - - /** - * Copies a document to a user's or community's document list. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the document. Use a negative value to designate a community ID. - * - @var integer doc_id: Document ID. - * - @var string access_key: Access key. This parameter is required if 'access_key' was returned with the document's data. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function add($access_token, array $params = []) { - return $this->request->post('docs.add', $access_token, $params); - } - - /** - * Deletes a user or community document. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the document. Use a negative value to designate a community ID. - * - @var integer doc_id: Document ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamDocDeleteAccessException Access to document deleting is denied - * @throws VKApiParamDocIdException Invalid document id - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('docs.delete', $access_token, $params); - } - - /** - * Edits a document. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer doc_id: Document ID. - * - @var string title: Document title. - * - @var array[string] tags: Document tags. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamDocAccessException Access to document is denied - * @throws VKApiParamDocIdException Invalid document id - * @throws VKApiParamDocTitleException Invalid document title - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('docs.edit', $access_token, $params); - } - - /** - * Returns detailed information about user or community documents. - * - * @param string $access_token - * @param array $params - * - @var integer count: Number of documents to return. By default, all documents. - * - @var integer offset: Offset needed to return a specific subset of documents. - * - @var DocsType type - * - @var integer owner_id: ID of the user or community that owns the documents. Use a negative value to designate a community ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('docs.get', $access_token, $params); - } - - /** - * Returns information about documents by their IDs. - * - * @param string $access_token - * @param array $params - * - @var array[string] docs: Document IDs. Example: , "66748_91488,66748_91455", - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('docs.getById', $access_token, $params); - } - - /** - * Returns the server address for document upload. - * - * @param string $access_token - * @param array $params - * - @var DocsType type: Document type. - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesDenySendException Can't send messages for users without permission - * @return mixed - */ - public function getMessagesUploadServer($access_token, array $params = []) { - return $this->request->post('docs.getMessagesUploadServer', $access_token, $params); - } - - /** - * Returns documents types available for current user. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the documents. Use a negative value to designate a community ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getTypes($access_token, array $params = []) { - return $this->request->post('docs.getTypes', $access_token, $params); - } - - /** - * Returns the server address for document upload. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID (if the document will be uploaded to the community). - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getUploadServer($access_token, array $params = []) { - return $this->request->post('docs.getUploadServer', $access_token, $params); - } - - /** - * Returns the server address for document upload onto a user's or community's wall. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID (if the document will be uploaded to the community). - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getWallUploadServer($access_token, array $params = []) { - return $this->request->post('docs.getWallUploadServer', $access_token, $params); - } - - /** - * Saves a document after [vk.com/dev/upload_files_2|uploading it to a server]. - * - * @param string $access_token - * @param array $params - * - @var string file: This parameter is returned when the file is [vk.com/dev/upload_files_2|uploaded to the server]. - * - @var string title: Document title. - * - @var string tags: Document tags. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiSaveFileException Couldn't save file - * @return mixed - */ - public function save($access_token, array $params = []) { - return $this->request->post('docs.save', $access_token, $params); - } - - /** - * Returns a list of documents matching the search criteria. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query string. - * - @var boolean search_own - * - @var integer count: Number of results to return. - * - @var integer offset: Offset needed to return a specific subset of results. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('docs.search', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Docs constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Copies a document to a user's or community's document list. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the document. Use a negative value to + * designate a community ID. + * - integer doc_id: Document ID. + * - string access_key: Access key. This parameter is required if 'access_key' was returned with the + * document's data. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function add(string $access_token, array $params = array()) { + return $this->request->post('docs.add', $access_token, $params); + } + + /** + * Deletes a user or community document. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the document. Use a negative value to + * designate a community ID. + * - integer doc_id: Document ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('docs.delete', $access_token, $params); + } + + /** + * Edits a document. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer doc_id: Document ID. + * - string title: Document title. + * - array tags: Document tags. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('docs.edit', $access_token, $params); + } + + /** + * Returns detailed information about user or community documents. + * + * @param $access_token string + * @param $params array + * - integer count: Number of documents to return. By default, all documents. + * - integer offset: Offset needed to return a specific subset of documents. + * - DocsGetType type: + * @see DocsGetType + * - integer owner_id: ID of the user or community that owns the documents. Use a negative value to + * designate a community ID. + * - boolean return_tags: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('docs.get', $access_token, $params); + } + + /** + * Returns information about documents by their IDs. + * + * @param $access_token string + * @param $params array + * - array docs: Document IDs. Example: , "66748_91488,66748_91455", + * - boolean return_tags: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('docs.getById', $access_token, $params); + } + + /** + * Returns the server address for document upload. + * + * @param $access_token string + * @param $params array + * - DocsGetMessagesUploadServerType type: Document type. + * @see DocsGetMessagesUploadServerType + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat + * ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getMessagesUploadServer(string $access_token, array $params = array()) { + return $this->request->post('docs.getMessagesUploadServer', $access_token, $params); + } + + /** + * Returns documents types available for current user. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the documents. Use a negative value to + * designate a community ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getTypes(string $access_token, array $params = array()) { + return $this->request->post('docs.getTypes', $access_token, $params); + } + + /** + * Returns the server address for document upload. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID (if the document will be uploaded to the community). + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getUploadServer(string $access_token, array $params = array()) { + return $this->request->post('docs.getUploadServer', $access_token, $params); + } + + /** + * Returns the server address for document upload onto a user's or community's wall. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID (if the document will be uploaded to the community). + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getWallUploadServer(string $access_token, array $params = array()) { + return $this->request->post('docs.getWallUploadServer', $access_token, $params); + } + + /** + * Saves a document after [vk.com/dev/upload_files_2|uploading it to a server]. + * + * @param $access_token string + * @param $params array + * - string file: This parameter is returned when the file is [vk.com/dev/upload_files_2|uploaded to the + * server]. + * - string title: Document title. + * - string tags: Document tags. + * - boolean return_tags: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function save(string $access_token, array $params = array()) { + return $this->request->post('docs.save', $access_token, $params); + } + + /** + * Returns a list of documents matching the search criteria. + * + * @param $access_token string + * @param $params array + * - string q: Search query string. + * - boolean search_own: + * - integer count: Number of results to return. + * - integer offset: Offset needed to return a specific subset of results. + * - boolean return_tags: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('docs.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Donut.php b/src/VK/Actions/Donut.php new file mode 100644 index 0000000..42c6ac2 --- /dev/null +++ b/src/VK/Actions/Donut.php @@ -0,0 +1,94 @@ +request = $request; + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer offset: + * - integer count: + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getFriends(string $access_token, array $params = array()) { + return $this->request->post('donut.getFriends', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getSubscription(string $access_token, array $params = array()) { + return $this->request->post('donut.getSubscription', $access_token, $params); + } + + /** + * Returns a list of user's VK Donut subscriptions. + * + * @param $access_token string + * @param $params array + * - array fields: + * - integer offset: + * - integer count: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSubscriptions(string $access_token, array $params = array()) { + return $this->request->post('donut.getSubscriptions', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function isDon(string $access_token, array $params = array()) { + return $this->request->post('donut.isDon', $access_token, $params); + } +} diff --git a/src/VK/Actions/DownloadedGames.php b/src/VK/Actions/DownloadedGames.php new file mode 100644 index 0000000..a4f84b4 --- /dev/null +++ b/src/VK/Actions/DownloadedGames.php @@ -0,0 +1,42 @@ +request = $request; + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function getPaidStatus(string $access_token, array $params = array()) { + return $this->request->post('downloadedGames.getPaidStatus', $access_token, $params); + } +} diff --git a/src/VK/Actions/Enum/AccountSaveProfileInfoBdateVisibility.php b/src/VK/Actions/Enum/AccountSaveProfileInfoBdateVisibility.php new file mode 100644 index 0000000..fffe35d --- /dev/null +++ b/src/VK/Actions/Enum/AccountSaveProfileInfoBdateVisibility.php @@ -0,0 +1,9 @@ +request = $request; + } - /** - * Fave constructor. - * - * @param VKApiRequest $request - */ - public function __construct(VKApiRequest $request) { - $this->request = $request; - } + /** + * + * + * @param $access_token string + * @param $params array + * - string url: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function addArticle(string $access_token, array $params = array()) { + return $this->request->post('fave.addArticle', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var string url - * @throws VKClientException - * @throws VKApiException - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function addArticle($access_token, array $params = []) { - return $this->request->post('fave.addArticle', $access_token, $params); - } + /** + * Adds a link to user faves. + * + * @param $access_token string + * @param $params array + * - string link: Link URL. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function addLink(string $access_token, array $params = array()) { + return $this->request->post('fave.addLink', $access_token, $params); + } - /** - * Adds a link to user faves. - * - * @param string $access_token - * @param array $params - * - @var string link: Link URL. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function addLink($access_token, array $params = []) { - return $this->request->post('fave.addLink', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function addPage(string $access_token, array $params = array()) { + return $this->request->post('fave.addPage', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer user_id - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function addPage($access_token, array $params = []) { - return $this->request->post('fave.addPage', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer id: + * - string access_key: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function addPost(string $access_token, array $params = array()) { + return $this->request->post('fave.addPost', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer id - * - @var string access_key - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function addPost($access_token, array $params = []) { - return $this->request->post('fave.addPost', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer id: + * - string access_key: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function addProduct(string $access_token, array $params = array()) { + return $this->request->post('fave.addProduct', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer id - * - @var string access_key - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function addProduct($access_token, array $params = []) { - return $this->request->post('fave.addProduct', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - string name: + * - FaveAddTagPosition position: + * @see FaveAddTagPosition + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function addTag(string $access_token, array $params = array()) { + return $this->request->post('fave.addTag', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var string name - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @return mixed - */ - public function addTag($access_token, array $params = []) { - return $this->request->post('fave.addTag', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer id: + * - string access_key: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function addVideo(string $access_token, array $params = array()) { + return $this->request->post('fave.addVideo', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer id - * - @var string access_key - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function addVideo($access_token, array $params = []) { - return $this->request->post('fave.addVideo', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer id: + * - string name: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function editTag(string $access_token, array $params = array()) { + return $this->request->post('fave.editTag', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer id - * - @var string name - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function editTag($access_token, array $params = []) { - return $this->request->post('fave.editTag', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - boolean extended: '1' — to return additional 'wall', 'profiles', and 'groups' fields. By default: + * '0'. + * - FaveGetItemType item_type: + * @see FaveGetItemType + * - integer tag_id: Tag ID. + * - integer offset: Offset needed to return a specific subset of users. + * - integer count: Number of users to return. + * - string fields: + * - boolean is_from_snackbar: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('fave.get', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var boolean extended: '1' — to return additional 'wall', 'profiles', and 'groups' fields. By default: '0'. - * - @var FaveItemType item_type - * - @var integer tag_id: Tag ID. - * - @var integer offset: Offset needed to return a specific subset of users. - * - @var integer count: Number of users to return. - * - @var string fields - * - @var boolean is_from_snackbar - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('fave.get', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer offset: + * - integer count: + * - FaveGetPagesType type: + * @see FaveGetPagesType + * - array fields: + * - integer tag_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getPages(string $access_token, array $params = array()) { + return $this->request->post('fave.getPages', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer offset - * - @var integer count - * - @var FaveType type - * - @var array[FaveFields] fields - * - @var integer tag_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getPages($access_token, array $params = []) { - return $this->request->post('fave.getPages', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getTags(string $access_token, array $params = array()) { + return $this->request->post('fave.getTags', $access_token, $params); + } - /** - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getTags($access_token) { - return $this->request->post('fave.getTags', $access_token); - } + /** + * + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function markSeen(string $access_token, array $params = array()) { + return $this->request->post('fave.markSeen', $access_token, $params); + } - /** - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function markSeen($access_token) { - return $this->request->post('fave.markSeen', $access_token); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer article_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function removeArticle(string $access_token, array $params = array()) { + return $this->request->post('fave.removeArticle', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer article_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function removeArticle($access_token, array $params = []) { - return $this->request->post('fave.removeArticle', $access_token, $params); - } + /** + * Removes link from the user's faves. + * + * @param $access_token string + * @param $params array + * - string link_id: Link ID (can be obtained by [vk.com/dev/faves.getLinks|faves.getLinks] method). + * - string link: Link URL + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function removeLink(string $access_token, array $params = array()) { + return $this->request->post('fave.removeLink', $access_token, $params); + } - /** - * Removes link from the user's faves. - * - * @param string $access_token - * @param array $params - * - @var string link_id: Link ID (can be obtained by [vk.com/dev/faves.getLinks|faves.getLinks] method). - * - @var string link: Link URL - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function removeLink($access_token, array $params = []) { - return $this->request->post('fave.removeLink', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function removePage(string $access_token, array $params = array()) { + return $this->request->post('fave.removePage', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer user_id - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function removePage($access_token, array $params = []) { - return $this->request->post('fave.removePage', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function removePost(string $access_token, array $params = array()) { + return $this->request->post('fave.removePost', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function removePost($access_token, array $params = []) { - return $this->request->post('fave.removePost', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function removeProduct(string $access_token, array $params = array()) { + return $this->request->post('fave.removeProduct', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function removeProduct($access_token, array $params = []) { - return $this->request->post('fave.removeProduct', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function removeTag(string $access_token, array $params = array()) { + return $this->request->post('fave.removeTag', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function removeTag($access_token, array $params = []) { - return $this->request->post('fave.removeTag', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function removeVideo(string $access_token, array $params = array()) { + return $this->request->post('fave.removeVideo', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var array[integer] ids - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function reorderTags($access_token, array $params = []) { - return $this->request->post('fave.reorderTags', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - array ids: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function reorderTags(string $access_token, array $params = array()) { + return $this->request->post('fave.reorderTags', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer user_id - * - @var integer group_id - * - @var array[integer] tag_ids - * @throws VKClientException - * @throws VKApiException - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function setPageTags($access_token, array $params = []) { - return $this->request->post('fave.setPageTags', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer group_id: + * - array tag_ids: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function setPageTags(string $access_token, array $params = array()) { + return $this->request->post('fave.setPageTags', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var FaveItemType item_type - * - @var integer item_owner_id - * - @var integer item_id - * - @var array[integer] tag_ids - * - @var string link_id - * - @var string link_url - * @throws VKClientException - * @throws VKApiException - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function setTags($access_token, array $params = []) { - return $this->request->post('fave.setTags', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - FaveSetTagsItemType item_type: + * @see FaveSetTagsItemType + * - integer item_owner_id: + * - integer item_id: + * - array tag_ids: + * - string link_id: + * - string link_url: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function setTags(string $access_token, array $params = array()) { + return $this->request->post('fave.setTags', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer user_id - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function trackPageInteraction($access_token, array $params = []) { - return $this->request->post('fave.trackPageInteraction', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function trackPageInteraction(string $access_token, array $params = array()) { + return $this->request->post('fave.trackPageInteraction', $access_token, $params); + } } diff --git a/src/VK/Actions/Friends.php b/src/VK/Actions/Friends.php index 320faab..642ac79 100644 --- a/src/VK/Actions/Friends.php +++ b/src/VK/Actions/Friends.php @@ -1,335 +1,409 @@ request = $request; - } + /** + * Friends constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Approves or creates a friend request. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: ID of the user whose friend request will be approved or to whom a friend request will be sent. - * - @var string text: Text of the message (up to 500 characters) for the friend request, if any. - * - @var boolean follow: '1' to pass an incoming request to followers list. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiFriendsAddInEnemyException Cannot add this user to friends as they have put you on their blacklist - * @throws VKApiFriendsAddEnemyException Cannot add this user to friends as you put him on blacklist - * @throws VKApiFriendsAddYourselfException Cannot add user himself as friend - * @throws VKApiFriendsAddNotFoundException Cannot add this user to friends as user not found - * @return mixed - */ - public function add($access_token, array $params = []) { - return $this->request->post('friends.add', $access_token, $params); - } + /** + * Approves or creates a friend request. + * + * @param $access_token string + * @param $params array + * - integer user_id: ID of the user whose friend request will be approved or to whom a friend request + * will be sent. + * - string text: Text of the message (up to 500 characters) for the friend request, if any. + * - boolean follow: '1' to pass an incoming request to followers list. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function add(string $access_token, array $params = array()) { + return $this->request->post('friends.add', $access_token, $params); + } - /** - * Creates a new friend list for the current user. - * - * @param string $access_token - * @param array $params - * - @var string name: Name of the friend list. - * - @var array[integer] user_ids: IDs of users to be added to the friend list. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiFriendsListLimitException Reached the maximum number of lists - * @return mixed - */ - public function addList($access_token, array $params = []) { - return $this->request->post('friends.addList', $access_token, $params); - } + /** + * Creates a new friend list for the current user. + * + * @param $access_token string + * @param $params array + * - string name: Name of the friend list. + * - array user_ids: IDs of users to be added to the friend list. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function addList(string $access_token, array $params = array()) { + return $this->request->post('friends.addList', $access_token, $params); + } - /** - * Checks the current user's friendship status with other specified users. - * - * @param string $access_token - * @param array $params - * - @var array[integer] user_ids: IDs of the users whose friendship status to check. - * - @var boolean need_sign: '1' — to return 'sign' field. 'sign' is md5("{id}_{user_id}_{friends_status}_{application_secret}"), where id is current user ID. This field allows to check that data has not been modified by the client. By default: '0'. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function areFriends($access_token, array $params = []) { - return $this->request->post('friends.areFriends', $access_token, $params); - } + /** + * Checks the current user's friendship status with other specified users. + * + * @param $access_token string + * @param $params array + * - array user_ids: IDs of the users whose friendship status to check. + * - boolean need_sign: '1' — to return 'sign' field. 'sign' is + * md5("{id}_{user_id}_{friends_status}_{application_secret}"), where id is current user ID. This field allows + * to check that data has not been modified by the client. By default: '0'. + * - boolean extended: Return friend request read_state field + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function areFriends(string $access_token, array $params = array()) { + return $this->request->post('friends.areFriends', $access_token, $params); + } - /** - * Declines a friend request or deletes a user from the current user's friend list. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: ID of the user whose friend request is to be declined or who is to be deleted from the current user's friend list. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('friends.delete', $access_token, $params); - } + /** + * Declines a friend request or deletes a user from the current user's friend list. + * + * @param $access_token string + * @param $params array + * - integer user_id: ID of the user whose friend request is to be declined or who is to be deleted from + * the current user's friend list. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('friends.delete', $access_token, $params); + } - /** - * Marks all incoming friend requests as viewed. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteAllRequests($access_token) { - return $this->request->post('friends.deleteAllRequests', $access_token); - } + /** + * Marks all incoming friend requests as viewed. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteAllRequests(string $access_token, array $params = array()) { + return $this->request->post('friends.deleteAllRequests', $access_token, $params); + } - /** - * Deletes a friend list of the current user. - * - * @param string $access_token - * @param array $params - * - @var integer list_id: ID of the friend list to delete. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiFriendsListIdException Invalid list id - * @return mixed - */ - public function deleteList($access_token, array $params = []) { - return $this->request->post('friends.deleteList', $access_token, $params); - } + /** + * Deletes a friend list of the current user. + * + * @param $access_token string + * @param $params array + * - integer list_id: ID of the friend list to delete. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function deleteList(string $access_token, array $params = array()) { + return $this->request->post('friends.deleteList', $access_token, $params); + } - /** - * Edits the friend lists of the selected user. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: ID of the user whose friend list is to be edited. - * - @var array[integer] list_ids: IDs of the friend lists to which to add the user. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('friends.edit', $access_token, $params); - } + /** + * Edits the friend lists of the selected user. + * + * @param $access_token string + * @param $params array + * - integer user_id: ID of the user whose friend list is to be edited. + * - array list_ids: IDs of the friend lists to which to add the user. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('friends.edit', $access_token, $params); + } - /** - * Edits a friend list of the current user. - * - * @param string $access_token - * @param array $params - * - @var string name: Name of the friend list. - * - @var integer list_id: Friend list ID. - * - @var array[integer] user_ids: IDs of users in the friend list. - * - @var array[integer] add_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to add to the friend list. - * - @var array[integer] delete_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to delete from the friend list. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiFriendsListIdException Invalid list id - * @return mixed - */ - public function editList($access_token, array $params = []) { - return $this->request->post('friends.editList', $access_token, $params); - } + /** + * Edits a friend list of the current user. + * + * @param $access_token string + * @param $params array + * - string name: Name of the friend list. + * - integer list_id: Friend list ID. + * - array user_ids: IDs of users in the friend list. + * - array add_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to add to the friend + * list. + * - array delete_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to delete from the + * friend list. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function editList(string $access_token, array $params = array()) { + return $this->request->post('friends.editList', $access_token, $params); + } - /** - * Returns a list of user IDs or detailed information about a user's friends. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. By default, the current user ID. - * - @var FriendsOrder order: Sort order: , 'name' — by name (enabled only if the 'fields' parameter is used), 'hints' — by rating, similar to how friends are sorted in My friends section, , This parameter is available only for [vk.com/dev/standalone|desktop applications]. - * - @var integer list_id: ID of the friend list returned by the [vk.com/dev/friends.getLists|friends.getLists] method to be used as the source. This parameter is taken into account only when the uid parameter is set to the current user ID. This parameter is available only for [vk.com/dev/standalone|desktop applications]. - * - @var integer count: Number of friends to return. - * - @var integer offset: Offset needed to return a specific subset of friends. - * - @var array[FriendsFields] fields: Profile fields to return. Sample values: 'uid', 'first_name', 'last_name', 'nickname', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'domain', 'has_mobile', 'rate', 'contacts', 'education'. - * - @var FriendsNameCase name_case: Case for declension of user name and surname: , 'nom' — nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional - * - @var string ref - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('friends.get', $access_token, $params); - } + /** + * Returns a list of user IDs or detailed information about a user's friends. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. By default, the current user ID. + * - FriendsGetOrder order: Sort order: , 'name' — by name (enabled only if the 'fields' parameter is + * used), 'hints' — by rating, similar to how friends are sorted in My friends section, , This parameter is + * available only for [vk.com/dev/standalone|desktop applications]. + * @see FriendsGetOrder + * - integer list_id: ID of the friend list returned by the [vk.com/dev/friends.getLists|friends.getLists] + * method to be used as the source. This parameter is taken into account only when the uid parameter is set to + * the current user ID. This parameter is available only for [vk.com/dev/standalone|desktop applications]. + * - integer count: Number of friends to return. + * - integer offset: Offset needed to return a specific subset of friends. + * - array fields: Profile fields to return. Sample values: 'uid', 'first_name', 'last_name', 'nickname', + * 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'domain', + * 'has_mobile', 'rate', 'contacts', 'education'. + * - FriendsGetNameCase name_case: Case for declension of user name and surname: , 'nom' — nominative + * (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' + * — prepositional + * @see FriendsGetNameCase + * - string ref: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('friends.get', $access_token, $params); + } - /** - * Returns a list of IDs of the current user's friends who installed the application. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getAppUsers($access_token) { - return $this->request->post('friends.getAppUsers', $access_token); - } + /** + * Returns a list of IDs of the current user's friends who installed the application. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAppUsers(string $access_token, array $params = array()) { + return $this->request->post('friends.getAppUsers', $access_token, $params); + } - /** - * Returns a list of the current user's friends whose phone numbers, validated or specified in a profile, are in a given list. - * - * @param string $access_token - * @param array $params - * - @var array[string] phones: List of phone numbers in MSISDN format (maximum 1000). Example: "+79219876543,+79111234567" - * - @var array[FriendsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online, counters'. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getByPhones($access_token, array $params = []) { - return $this->request->post('friends.getByPhones', $access_token, $params); - } + /** + * Returns a list of the current user's friends whose phone numbers, validated or specified in a profile, are in a + * given list. + * + * @param $access_token string + * @param $params array + * - array phones: List of phone numbers in MSISDN format (maximum 1000). Example: + * "+79219876543,+79111234567" + * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' + * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', + * 'contacts', 'education', 'online, counters'. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getByPhones(string $access_token, array $params = array()) { + return $this->request->post('friends.getByPhones', $access_token, $params); + } - /** - * Returns a list of the user's friend lists. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var boolean return_system: '1' — to return system friend lists. By default: '0'. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getLists($access_token, array $params = []) { - return $this->request->post('friends.getLists', $access_token, $params); - } + /** + * Returns a list of the user's friend lists. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - boolean return_system: '1' — to return system friend lists. By default: '0'. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getLists(string $access_token, array $params = array()) { + return $this->request->post('friends.getLists', $access_token, $params); + } - /** - * Returns a list of user IDs of the mutual friends of two users. - * - * @param string $access_token - * @param array $params - * - @var integer source_uid: ID of the user whose friends will be checked against the friends of the user specified in 'target_uid'. - * - @var integer target_uid: ID of the user whose friends will be checked against the friends of the user specified in 'source_uid'. - * - @var array[integer] target_uids: IDs of the users whose friends will be checked against the friends of the user specified in 'source_uid'. - * - @var string order: Sort order: 'random' — random order - * - @var integer count: Number of mutual friends to return. - * - @var integer offset: Offset needed to return a specific subset of mutual friends. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getMutual($access_token, array $params = []) { - return $this->request->post('friends.getMutual', $access_token, $params); - } + /** + * Returns a list of user IDs of the mutual friends of two users. + * + * @param $access_token string + * @param $params array + * - integer source_uid: ID of the user whose friends will be checked against the friends of the user + * specified in 'target_uid'. + * - integer target_uid: ID of the user whose friends will be checked against the friends of the user + * specified in 'source_uid'. + * - array target_uids: IDs of the users whose friends will be checked against the friends of the user + * specified in 'source_uid'. + * - string order: Sort order: 'random' — random order + * - integer count: Number of mutual friends to return. + * - integer offset: Offset needed to return a specific subset of mutual friends. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getMutual(string $access_token, array $params = array()) { + return $this->request->post('friends.getMutual', $access_token, $params); + } - /** - * Returns a list of user IDs of a user's friends who are online. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var integer list_id: Friend list ID. If this parameter is not set, information about all online friends is returned. - * - @var boolean online_mobile: '1' — to return an additional 'online_mobile' field, '0' — (default), - * - @var string order: Sort order: 'random' — random order - * - @var integer count: Number of friends to return. - * - @var integer offset: Offset needed to return a specific subset of friends. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getOnline($access_token, array $params = []) { - return $this->request->post('friends.getOnline', $access_token, $params); - } + /** + * Returns a list of user IDs of a user's friends who are online. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - integer list_id: Friend list ID. If this parameter is not set, information about all online friends + * is returned. + * - boolean online_mobile: '1' — to return an additional 'online_mobile' field, '0' — (default), + * - string order: Sort order: 'random' — random order + * - integer count: Number of friends to return. + * - integer offset: Offset needed to return a specific subset of friends. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getOnline(string $access_token, array $params = array()) { + return $this->request->post('friends.getOnline', $access_token, $params); + } - /** - * Returns a list of user IDs of the current user's recently added friends. - * - * @param string $access_token - * @param array $params - * - @var integer count: Number of recently added friends to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getRecent($access_token, array $params = []) { - return $this->request->post('friends.getRecent', $access_token, $params); - } + /** + * Returns a list of user IDs of the current user's recently added friends. + * + * @param $access_token string + * @param $params array + * - integer count: Number of recently added friends to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getRecent(string $access_token, array $params = array()) { + return $this->request->post('friends.getRecent', $access_token, $params); + } - /** - * Returns information about the current user's incoming and outgoing friend requests. - * - * @param string $access_token - * @param array $params - * - @var integer offset: Offset needed to return a specific subset of friend requests. - * - @var integer count: Number of friend requests to return (default 100, maximum 1000). - * - @var boolean extended: '1' — to return response messages from users who have sent a friend request or, if 'suggested' is set to '1', to return a list of suggested friends - * - @var boolean need_mutual: '1' — to return a list of mutual friends (up to 20), if any - * - @var boolean out: '1' — to return outgoing requests, '0' — to return incoming requests (default) - * - @var FriendsSort sort: Sort order: '1' — by number of mutual friends, '0' — by date - * - @var boolean need_viewed - * - @var boolean suggested: '1' — to return a list of suggested friends, '0' — to return friend requests (default) - * - @var string ref - * - @var array[FriendsFields] fields - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getRequests($access_token, array $params = []) { - return $this->request->post('friends.getRequests', $access_token, $params); - } + /** + * Returns information about the current user's incoming and outgoing friend requests. + * + * @param $access_token string + * @param $params array + * - integer offset: Offset needed to return a specific subset of friend requests. + * - integer count: Number of friend requests to return (default 100, maximum 1000). + * - boolean extended: '1' — to return response messages from users who have sent a friend request or, + * if 'suggested' is set to '1', to return a list of suggested friends + * - boolean need_mutual: '1' — to return a list of mutual friends (up to 20), if any + * - boolean out: '1' — to return outgoing requests, '0' — to return incoming requests (default) + * - FriendsGetRequestsSort sort: Sort order: '1' — by number of mutual friends, '0' — by date + * @see FriendsGetRequestsSort + * - boolean need_viewed: + * - boolean suggested: '1' — to return a list of suggested friends, '0' — to return friend requests + * (default) + * - string ref: + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getRequests(string $access_token, array $params = array()) { + return $this->request->post('friends.getRequests', $access_token, $params); + } - /** - * Returns a list of profiles of users whom the current user may know. - * - * @param string $access_token - * @param array $params - * - @var array[FriendsFilter] filter: Types of potential friends to return: 'mutual' — users with many mutual friends , 'contacts' — users found with the [vk.com/dev/account.importContacts|account.importContacts] method , 'mutual_contacts' — users who imported the same contacts as the current user with the [vk.com/dev/account.importContacts|account.importContacts] method - * - @var integer count: Number of suggestions to return. - * - @var integer offset: Offset needed to return a specific subset of suggestions. - * - @var array[FriendsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'. - * - @var FriendsNameCase name_case: Case for declension of user name and surname: , 'nom' — nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getSuggestions($access_token, array $params = []) { - return $this->request->post('friends.getSuggestions', $access_token, $params); - } + /** + * Returns a list of profiles of users whom the current user may know. + * + * @param $access_token string + * @param $params array + * - array filter: Types of potential friends to return: 'mutual' — users with many mutual friends , + * 'contacts' — users found with the [vk.com/dev/account.importContacts|account.importContacts] method , + * 'mutual_contacts' — users who imported the same contacts as the current user with the + * [vk.com/dev/account.importContacts|account.importContacts] method + * - integer count: Number of suggestions to return. + * - integer offset: Offset needed to return a specific subset of suggestions. + * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' + * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', + * 'contacts', 'education', 'online', 'counters'. + * - FriendsGetSuggestionsNameCase name_case: Case for declension of user name and surname: , 'nom' — + * nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental + * , 'abl' — prepositional + * @see FriendsGetSuggestionsNameCase + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSuggestions(string $access_token, array $params = array()) { + return $this->request->post('friends.getSuggestions', $access_token, $params); + } - /** - * Returns a list of friends matching the search criteria. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var string q: Search query string (e.g., 'Vasya Babich'). - * - @var array[FriendsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', - * - @var FriendsNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional - * - @var integer offset: Offset needed to return a specific subset of friends. - * - @var integer count: Number of friends to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('friends.search', $access_token, $params); - } + /** + * Returns a list of friends matching the search criteria. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - string q: Search query string (e.g., 'Vasya Babich'). + * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' + * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', + * 'contacts', 'education', 'online', + * - FriendsSearchNameCase name_case: Case for declension of user name and surname: 'nom' — nominative + * (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — + * prepositional + * @see FriendsSearchNameCase + * - integer offset: Offset needed to return a specific subset of friends. + * - integer count: Number of friends to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('friends.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Gifts.php b/src/VK/Actions/Gifts.php index e7a6367..2bffd59 100644 --- a/src/VK/Actions/Gifts.php +++ b/src/VK/Actions/Gifts.php @@ -1,41 +1,41 @@ request = $request; - } + /** + * Gifts constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns a list of user gifts. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var integer count: Number of gifts to return. - * - @var integer offset: Offset needed to return a specific subset of results. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('gifts.get', $access_token, $params); - } + /** + * Returns a list of user gifts. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - integer count: Number of gifts to return. + * - integer offset: Offset needed to return a specific subset of results. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('gifts.get', $access_token, $params); + } } diff --git a/src/VK/Actions/Groups.php b/src/VK/Actions/Groups.php index a8614da..8197e89 100644 --- a/src/VK/Actions/Groups.php +++ b/src/VK/Actions/Groups.php @@ -1,1025 +1,1229 @@ request = $request; - } + /** + * Groups constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * - @var string title - * - @var string address - * - @var string additional_address - * - @var integer country_id - * - @var integer city_id - * - @var integer metro_id - * - @var number latitude - * - @var number longitude - * - @var string phone - * - @var AddressWorkInfoStatus work_info_status: Status of information about timetable - * - @var string timetable - * - @var boolean is_main_address - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings - * @throws VKApiNotFoundException Not found - * @throws VKApiGroupTooManyAddressesException Too many addresses in club - * @return mixed - */ - public function addAddress($access_token, array $params = []) { - return $this->request->post('groups.addAddress', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - string title: + * - string address: + * - string additional_address: + * - integer country_id: + * - integer city_id: + * - integer metro_id: + * - number latitude: + * - number longitude: + * - string phone: + * - GroupsAddAddressWorkInfoStatus work_info_status: + * @see GroupsAddAddressWorkInfoStatus + * - string timetable: + * - boolean is_main_address: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function addAddress(string $access_token, array $params = array()) { + return $this->request->post('groups.addAddress', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * - @var string url - * - @var string title - * - @var string secret_key - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCallbackApiServersLimitException Servers number limit is reached - * @return mixed - */ - public function addCallbackServer($access_token, array $params = []) { - return $this->request->post('groups.addCallbackServer', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - string url: + * - string title: + * - string secret_key: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function addCallbackServer(string $access_token, array $params = array()) { + return $this->request->post('groups.addCallbackServer', $access_token, $params); + } - /** - * Allows to add a link to the community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var string link: Link URL. - * - @var string text: Description text for the link. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function addLink($access_token, array $params = []) { - return $this->request->post('groups.addLink', $access_token, $params); - } + /** + * Allows to add a link to the community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - string link: Link URL. + * - string text: Description text for the link. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function addLink(string $access_token, array $params = array()) { + return $this->request->post('groups.addLink', $access_token, $params); + } - /** - * Allows to approve join request to the community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer user_id: User ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @return mixed - */ - public function approveRequest($access_token, array $params = []) { - return $this->request->post('groups.approveRequest', $access_token, $params); - } + /** + * Allows to approve join request to the community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer user_id: User ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function approveRequest(string $access_token, array $params = array()) { + return $this->request->post('groups.approveRequest', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * - @var integer owner_id - * - @var integer end_date - * - @var integer reason - * - @var string comment - * - @var boolean comment_visible - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function ban($access_token, array $params = []) { - return $this->request->post('groups.ban', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer owner_id: + * - integer end_date: + * - integer reason: + * - string comment: + * - boolean comment_visible: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function ban(string $access_token, array $params = array()) { + return $this->request->post('groups.ban', $access_token, $params); + } - /** - * Creates a new community. - * - * @param string $access_token - * @param array $params - * - @var string title: Community title. - * - @var string description: Community description (ignored for 'type' = 'public'). - * - @var GroupsType type: Community type. Possible values: *'group' – group,, *'event' – event,, *'public' – public page - * - @var integer public_category: Category ID (for 'type' = 'public' only). - * - @var GroupsSubtype subtype: Public page subtype. Possible values: *'1' – place or small business,, *'2' – company, organization or website,, *'3' – famous person or group of people,, *'4' – product or work of art. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @return mixed - */ - public function create($access_token, array $params = []) { - return $this->request->post('groups.create', $access_token, $params); - } + /** + * Creates a new community. + * + * @param $access_token string + * @param $params array + * - string title: Community title. + * - string description: Community description (ignored for 'type' = 'public'). + * - GroupsCreateType type: Community type. Possible values: *'group' - group,, *'event' - event,, + * *'public' - public page + * @see GroupsCreateType + * - integer public_category: Category ID (for 'type' = 'public' only). + * - GroupsCreateSubtype subtype: Public page subtype. Possible values: *'1' - place or small business,, + * *'2' - company, organization or website,, *'3' - famous person or group of people,, *'4' - product or work + * of art. + * @see GroupsCreateSubtype + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function create(string $access_token, array $params = array()) { + return $this->request->post('groups.create', $access_token, $params); + } - /** - * Delete community address. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Group ID - * - @var integer address_id: Address ID - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function deleteAddress($access_token, array $params = []) { - return $this->request->post('groups.deleteAddress', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer address_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function deleteAddress(string $access_token, array $params = array()) { + return $this->request->post('groups.deleteAddress', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * - @var integer server_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function deleteCallbackServer($access_token, array $params = []) { - return $this->request->post('groups.deleteCallbackServer', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer server_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function deleteCallbackServer(string $access_token, array $params = array()) { + return $this->request->post('groups.deleteCallbackServer', $access_token, $params); + } - /** - * Allows to delete a link from the community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer link_id: Link ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteLink($access_token, array $params = []) { - return $this->request->post('groups.deleteLink', $access_token, $params); - } + /** + * Allows to delete a link from the community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer link_id: Link ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteLink(string $access_token, array $params = array()) { + return $this->request->post('groups.deleteLink', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function disableOnline($access_token, array $params = []) { - return $this->request->post('groups.disableOnline', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function disableOnline(string $access_token, array $params = array()) { + return $this->request->post('groups.disableOnline', $access_token, $params); + } - /** - * Edits a community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var string title: Community title. - * - @var string description: Community description. - * - @var string screen_name: Community screen name. - * - @var GroupAccess access: Community type. Possible values: *'0' – open,, *'1' – closed,, *'2' – private. - * - @var string website: Website that will be displayed in the community information field. - * - @var GroupSubject subject: Community subject. Possible values: , *'1' – auto/moto,, *'2' – activity holidays,, *'3' – business,, *'4' – pets,, *'5' – health,, *'6' – dating and communication, , *'7' – games,, *'8' – IT (computers and software),, *'9' – cinema,, *'10' – beauty and fashion,, *'11' – cooking,, *'12' – art and culture,, *'13' – literature,, *'14' – mobile services and internet,, *'15' – music,, *'16' – science and technology,, *'17' – real estate,, *'18' – news and media,, *'19' – security,, *'20' – education,, *'21' – home and renovations,, *'22' – politics,, *'23' – food,, *'24' – industry,, *'25' – travel,, *'26' – work,, *'27' – entertainment,, *'28' – religion,, *'29' – family,, *'30' – sports,, *'31' – insurance,, *'32' – television,, *'33' – goods and services,, *'34' – hobbies,, *'35' – finance,, *'36' – photo,, *'37' – esoterics,, *'38' – electronics and appliances,, *'39' – erotic,, *'40' – humor,, *'41' – society, humanities,, *'42' – design and graphics. - * - @var string email: Organizer email (for events). - * - @var string phone: Organizer phone number (for events). - * - @var string rss: RSS feed address for import (available only to communities with special permission. Contact vk.com/support to get it. - * - @var integer event_start_date: Event start date in Unixtime format. - * - @var integer event_finish_date: Event finish date in Unixtime format. - * - @var integer event_group_id: Organizer community ID (for events only). - * - @var integer public_category: Public page category ID. - * - @var integer public_subcategory: Public page subcategory ID. - * - @var string public_date: Founding date of a company or organization owning the community in "dd.mm.YYYY" format. - * - @var GroupWall wall: Wall settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (groups and events only),, *'3' – closed (groups and events only). - * - @var GroupTopics topics: Board topics settings. Possbile values: , *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). - * - @var GroupPhotos photos: Photos settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). - * - @var GroupVideo video: Video settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). - * - @var GroupAudio audio: Audio settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). - * - @var boolean links: Links settings (for public pages only). Possible values: *'0' – disabled,, *'1' – enabled. - * - @var boolean events: Events settings (for public pages only). Possible values: *'0' – disabled,, *'1' – enabled. - * - @var boolean places: Places settings (for public pages only). Possible values: *'0' – disabled,, *'1' – enabled. - * - @var boolean contacts: Contacts settings (for public pages only). Possible values: *'0' – disabled,, *'1' – enabled. - * - @var GroupDocs docs: Documents settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). - * - @var GroupWiki wiki: Wiki pages settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). - * - @var boolean messages: Community messages. Possible values: *'0' — disabled,, *'1' — enabled. - * - @var boolean articles - * - @var boolean addresses - * - @var GroupAgeLimits age_limits: Community age limits. Possible values: *'1' — no limits,, *'2' — 16+,, *'3' — 18+. - * - @var boolean market: Market settings. Possible values: *'0' – disabled,, *'1' – enabled. - * - @var boolean market_comments: market comments settings. Possible values: *'0' – disabled,, *'1' – enabled. - * - @var array[integer] market_country: Market delivery countries. - * - @var array[integer] market_city: Market delivery cities (if only one country is specified). - * - @var GroupMarketCurrency market_currency: Market currency settings. Possbile values: , *'643' – Russian rubles,, *'980' – Ukrainian hryvnia,, *'398' – Kazakh tenge,, *'978' – Euro,, *'840' – US dollars - * - @var integer market_contact: Seller contact for market. Set '0' for community messages. - * - @var integer market_wiki: ID of a wiki page with market description. - * - @var boolean obscene_filter: Obscene expressions filter in comments. Possible values: , *'0' – disabled,, *'1' – enabled. - * - @var boolean obscene_stopwords: Stopwords filter in comments. Possible values: , *'0' – disabled,, *'1' – enabled. - * - @var array[string] obscene_words: Keywords for stopwords filter. - * - @var integer main_section - * - @var integer secondary_section - * - @var integer country: Country of the community. - * - @var integer city: City of the community. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiInvalidAddressException Invalid screen name - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('groups.edit', $access_token, $params); - } + /** + * Edits a community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - string title: Community title. + * - string description: Community description. + * - string screen_name: Community screen name. + * - integer access: Community type. Possible values: *'0' - open,, *'1' - closed,, *'2' - private. + * - string website: Website that will be displayed in the community information field. + * - string subject: Community subject. Possible values: , *'1' - auto/moto,, *'2' - activity holidays,, + * *'3' - business,, *'4' - pets,, *'5' - health,, *'6' - dating and communication, , *'7' - games,, *'8' - IT + * (computers and software),, *'9' - cinema,, *'10' - beauty and fashion,, *'11' - cooking,, *'12' - art and + * culture,, *'13' - literature,, *'14' - mobile services and internet,, *'15' - music,, *'16' - science and + * technology,, *'17' - real estate,, *'18' - news and media,, *'19' - security,, *'20' - education,, *'21' - + * home and renovations,, *'22' - politics,, *'23' - food,, *'24' - industry,, *'25' - travel,, *'26' - work,, + * *'27' - entertainment,, *'28' - religion,, *'29' - family,, *'30' - sports,, *'31' - insurance,, *'32' - + * television,, *'33' - goods and services,, *'34' - hobbies,, *'35' - finance,, *'36' - photo,, *'37' - + * esoterics,, *'38' - electronics and appliances,, *'39' - erotic,, *'40' - humor,, *'41' - society, + * humanities,, *'42' - design and graphics. + * - string email: Organizer email (for events). + * - string phone: Organizer phone number (for events). + * - string rss: RSS feed address for import (available only to communities with special permission. + * Contact vk.com/support to get it. + * - integer event_start_date: Event start date in Unixtime format. + * - integer event_finish_date: Event finish date in Unixtime format. + * - integer event_group_id: Organizer community ID (for events only). + * - integer public_category: Public page category ID. + * - integer public_subcategory: Public page subcategory ID. + * - string public_date: Founding date of a company or organization owning the community in "dd.mm.YYYY" + * format. + * - integer wall: Wall settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (groups + * and events only),, *'3' - closed (groups and events only). + * - integer topics: Board topics settings. Possbile values: , *'0' - disabled,, *'1' - open,, *'2' - + * limited (for groups and events only). + * - integer photos: Photos settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for + * groups and events only). + * - integer video: Video settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for + * groups and events only). + * - integer audio: Audio settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for + * groups and events only). + * - boolean links: Links settings (for public pages only). Possible values: *'0' - disabled,, *'1' - + * enabled. + * - boolean events: Events settings (for public pages only). Possible values: *'0' - disabled,, *'1' - + * enabled. + * - boolean places: Places settings (for public pages only). Possible values: *'0' - disabled,, *'1' - + * enabled. + * - boolean contacts: Contacts settings (for public pages only). Possible values: *'0' - disabled,, *'1' + * - enabled. + * - integer docs: Documents settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited + * (for groups and events only). + * - integer wiki: Wiki pages settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited + * (for groups and events only). + * - boolean messages: Community messages. Possible values: *'0' — disabled,, *'1' — enabled. + * - boolean articles: + * - boolean addresses: + * - GroupsEditAgeLimits age_limits: Community age limits. Possible values: *'1' — no limits,, *'2' — + * 16+,, *'3' — 18+. + * @see GroupsEditAgeLimits + * - boolean market: Market settings. Possible values: *'0' - disabled,, *'1' - enabled. + * - boolean market_comments: market comments settings. Possible values: *'0' - disabled,, *'1' - enabled. + * - array market_country: Market delivery countries. + * - array market_city: Market delivery cities (if only one country is specified). + * - integer market_currency: Market currency settings. Possbile values: , *'643' - Russian rubles,, + * *'980' - Ukrainian hryvnia,, *'398' - Kazakh tenge,, *'978' - Euro,, *'840' - US dollars + * - integer market_contact: Seller contact for market. Set '0' for community messages. + * - integer market_wiki: ID of a wiki page with market description. + * - boolean obscene_filter: Obscene expressions filter in comments. Possible values: , *'0' - disabled,, + * *'1' - enabled. + * - boolean obscene_stopwords: Stopwords filter in comments. Possible values: , *'0' - disabled,, *'1' - + * enabled. + * - array obscene_words: Keywords for stopwords filter. + * - integer main_section: + * - integer secondary_section: + * - integer country: Country of the community. + * - integer city: City of the community. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('groups.edit', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * - @var integer address_id - * - @var string title - * - @var string address - * - @var string additional_address - * - @var integer country_id - * - @var integer city_id - * - @var integer metro_id - * - @var number latitude - * - @var number longitude - * - @var string phone - * - @var AddressWorkInfoStatus work_info_status: Status of information about timetable - * - @var string timetable - * - @var boolean is_main_address - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings - * @throws VKApiNotFoundException Not found - * @throws VKApiGroupTooManyAddressesException Too many addresses in club - * @return mixed - */ - public function editAddress($access_token, array $params = []) { - return $this->request->post('groups.editAddress', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer address_id: + * - string title: + * - string address: + * - string additional_address: + * - integer country_id: + * - integer city_id: + * - integer metro_id: + * - number latitude: + * - number longitude: + * - string phone: + * - GroupsEditAddressWorkInfoStatus work_info_status: + * @see GroupsEditAddressWorkInfoStatus + * - string timetable: + * - boolean is_main_address: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function editAddress(string $access_token, array $params = array()) { + return $this->request->post('groups.editAddress', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * - @var integer server_id - * - @var string url - * - @var string title - * - @var string secret_key - * @throws VKClientException - * @throws VKApiException - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function editCallbackServer($access_token, array $params = []) { - return $this->request->post('groups.editCallbackServer', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer server_id: + * - string url: + * - string title: + * - string secret_key: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function editCallbackServer(string $access_token, array $params = array()) { + return $this->request->post('groups.editCallbackServer', $access_token, $params); + } - /** - * Allows to edit a link in the community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer link_id: Link ID. - * - @var string text: New description text for the link. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function editLink($access_token, array $params = []) { - return $this->request->post('groups.editLink', $access_token, $params); - } + /** + * Allows to edit a link in the community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer link_id: Link ID. + * - string text: New description text for the link. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function editLink(string $access_token, array $params = array()) { + return $this->request->post('groups.editLink', $access_token, $params); + } - /** - * Allows to add, remove or edit the community manager. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer user_id: User ID. - * - @var GroupRole role: Manager role. Possible values: *'moderator',, *'editor',, *'administrator'. - * - @var boolean is_contact: '1' — to show the manager in Contacts block of the community. - * - @var string contact_position: Position to show in Contacts block. - * - @var string contact_phone: Contact phone. - * - @var string contact_email: Contact e-mail. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiGroupChangeCreatorException Cannot edit creator role - * @throws VKApiGroupNotInClubException User should be in club - * @throws VKApiGroupTooManyOfficersException Too many officers in club - * @throws VKApiGroupNeed2faException You need to enable 2FA for this action - * @throws VKApiGroupHostNeed2faException User needs to enable 2FA for this action - * @return mixed - */ - public function editManager($access_token, array $params = []) { - return $this->request->post('groups.editManager', $access_token, $params); - } + /** + * Allows to add, remove or edit the community manager. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer user_id: User ID. + * - string role: Manager role. Possible values: *'moderator',, *'editor',, *'administrator',, + * *'advertiser'. + * - boolean is_contact: '1' — to show the manager in Contacts block of the community. + * - string contact_position: Position to show in Contacts block. + * - string contact_phone: Contact phone. + * - string contact_email: Contact e-mail. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function editManager(string $access_token, array $params = array()) { + return $this->request->post('groups.editManager', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function enableOnline($access_token, array $params = []) { - return $this->request->post('groups.enableOnline', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function enableOnline(string $access_token, array $params = array()) { + return $this->request->post('groups.enableOnline', $access_token, $params); + } - /** - * Returns a list of the communities to which a user belongs. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var boolean extended: '1' — to return complete information about a user's communities, '0' — to return a list of community IDs without any additional fields (default), - * - @var array[GroupsFilter] filter: Types of communities to return: 'admin' — to return communities administered by the user , 'editor' — to return communities where the user is an administrator or editor, 'moder' — to return communities where the user is an administrator, editor, or moderator, 'groups' — to return only groups, 'publics' — to return only public pages, 'events' — to return only events - * - @var array[GroupsFields] fields: Profile fields to return. - * - @var integer offset: Offset needed to return a specific subset of communities. - * - @var integer count: Number of communities to return. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('groups.get', $access_token, $params); - } + /** + * Returns a list of the communities to which a user belongs. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - boolean extended: '1' — to return complete information about a user's communities, '0' — to + * return a list of community IDs without any additional fields (default), + * - array filter: Types of communities to return: 'admin' — to return communities administered by the + * user , 'editor' — to return communities where the user is an administrator or editor, 'moder' — to + * return communities where the user is an administrator, editor, or moderator, 'groups' — to return only + * groups, 'publics' — to return only public pages, 'events' — to return only events + * - array fields: Profile fields to return. + * - integer offset: Offset needed to return a specific subset of communities. + * - integer count: Number of communities to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('groups.get', $access_token, $params); + } - /** - * Returns a list of community addresses. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID or screen name of the community. - * - @var array[integer] address_ids - * - @var number latitude: Latitude of the user geo position. - * - @var number longitude: Longitude of the user geo position. - * - @var integer offset: Offset needed to return a specific subset of community addresses. - * - @var integer count: Number of community addresses to return. - * - @var array[GroupsFields] fields: Address fields - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamGroupIdException Invalid group id - * @return mixed - */ - public function getAddresses($access_token, array $params = []) { - return $this->request->post('groups.getAddresses', $access_token, $params); - } + /** + * Returns a list of community addresses. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID or screen name of the community. + * - array address_ids: + * - number latitude: Latitude of the user geo position. + * - number longitude: Longitude of the user geo position. + * - integer offset: Offset needed to return a specific subset of community addresses. + * - integer count: Number of community addresses to return. + * - array fields: Address fields + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function getAddresses(string $access_token, array $params = array()) { + return $this->request->post('groups.getAddresses', $access_token, $params); + } - /** - * Returns a list of users on a community blacklist. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer offset: Offset needed to return a specific subset of users. - * - @var integer count: Number of users to return. - * - @var array[GroupsFields] fields - * - @var integer owner_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function getBanned($access_token, array $params = []) { - return $this->request->post('groups.getBanned', $access_token, $params); - } + /** + * Returns a list of users on a community blacklist. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer offset: Offset needed to return a specific subset of users. + * - integer count: Number of users to return. + * - array fields: + * - integer owner_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getBanned(string $access_token, array $params = array()) { + return $this->request->post('groups.getBanned', $access_token, $params); + } - /** - * Returns information about communities by their IDs. - * - * @param string $access_token - * @param array $params - * - @var array[string] group_ids: IDs or screen names of communities. - * - @var string group_id: ID or screen name of the community. - * - @var array[GroupsFields] fields: Group fields to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('groups.getById', $access_token, $params); - } + /** + * Returns information about communities by their IDs. + * + * @param $access_token string + * @param $params array + * - array group_ids: IDs or screen names of communities. + * - string group_id: ID or screen name of the community. + * - array fields: Group fields to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('groups.getById', $access_token, $params); + } - /** - * Returns Callback API confirmation code for the community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCallbackConfirmationCode($access_token, array $params = []) { - return $this->request->post('groups.getCallbackConfirmationCode', $access_token, $params); - } + /** + * Returns Callback API confirmation code for the community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCallbackConfirmationCode(string $access_token, array $params = array()) { + return $this->request->post('groups.getCallbackConfirmationCode', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * - @var array[integer] server_ids - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCallbackServers($access_token, array $params = []) { - return $this->request->post('groups.getCallbackServers', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - array server_ids: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCallbackServers(string $access_token, array $params = array()) { + return $this->request->post('groups.getCallbackServers', $access_token, $params); + } - /** - * Returns [vk.com/dev/callback_api|Callback API] notifications settings. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer server_id: Server ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function getCallbackSettings($access_token, array $params = []) { - return $this->request->post('groups.getCallbackSettings', $access_token, $params); - } + /** + * Returns [vk.com/dev/callback_api|Callback API] notifications settings. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer server_id: Server ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getCallbackSettings(string $access_token, array $params = array()) { + return $this->request->post('groups.getCallbackSettings', $access_token, $params); + } - /** - * Returns communities list for a catalog category. - * - * @param string $access_token - * @param array $params - * - @var integer category_id: Category id received from [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. - * - @var integer subcategory_id: Subcategory id received from [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiCommunitiesCatalogDisabledException Catalog is not available for this user - * @throws VKApiCommunitiesCategoriesDisabledException Catalog categories are not available for this user - * @return mixed - */ - public function getCatalog($access_token, array $params = []) { - return $this->request->post('groups.getCatalog', $access_token, $params); - } + /** + * Returns communities list for a catalog category. + * + * @param $access_token string + * @param $params array + * - integer category_id: Category id received from + * [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. + * - integer subcategory_id: Subcategory id received from + * [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function getCatalog(string $access_token, array $params = array()) { + return $this->request->post('groups.getCatalog', $access_token, $params); + } - /** - * Returns categories list for communities catalog - * - * @param string $access_token - * @param array $params - * - @var boolean extended: 1 – to return communities count and three communities for preview. By default: 0. - * - @var boolean subcategories: 1 – to return subcategories info. By default: 0. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCatalogInfo($access_token, array $params = []) { - return $this->request->post('groups.getCatalogInfo', $access_token, $params); - } + /** + * Returns categories list for communities catalog + * + * @param $access_token string + * @param $params array + * - boolean extended: 1 - to return communities count and three communities for preview. By default: 0. + * - boolean subcategories: 1 - to return subcategories info. By default: 0. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCatalogInfo(string $access_token, array $params = array()) { + return $this->request->post('groups.getCatalogInfo', $access_token, $params); + } - /** - * Returns invited users list of a community - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Group ID to return invited users for. - * - @var integer offset: Offset needed to return a specific subset of results. - * - @var integer count: Number of results to return. - * - @var array[GroupsFields] fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. - * - @var GroupsNameCase name_case: Case for declension of user name and surname. Possible values: *'nom' — nominative (default),, *'gen' — genitive,, *'dat' — dative,, *'acc' — accusative, , *'ins' — instrumental,, *'abl' — prepositional. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getInvitedUsers($access_token, array $params = []) { - return $this->request->post('groups.getInvitedUsers', $access_token, $params); - } + /** + * Returns invited users list of a community + * + * @param $access_token string + * @param $params array + * - integer group_id: Group ID to return invited users for. + * - integer offset: Offset needed to return a specific subset of results. + * - integer count: Number of results to return. + * - array fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, + * photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, + * online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, + * can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, + * relation, relatives, counters'. + * - GroupsGetInvitedUsersNameCase name_case: Case for declension of user name and surname. Possible + * values: *'nom' — nominative (default),, *'gen' — genitive,, *'dat' — dative,, *'acc' — accusative, , + * *'ins' — instrumental,, *'abl' — prepositional. + * @see GroupsGetInvitedUsersNameCase + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getInvitedUsers(string $access_token, array $params = array()) { + return $this->request->post('groups.getInvitedUsers', $access_token, $params); + } - /** - * Returns a list of invitations to join communities and events. - * - * @param string $access_token - * @param array $params - * - @var integer offset: Offset needed to return a specific subset of invitations. - * - @var integer count: Number of invitations to return. - * - @var boolean extended: '1' — to return additional [vk.com/dev/fields_groups|fields] for communities.. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getInvites($access_token, array $params = []) { - return $this->request->post('groups.getInvites', $access_token, $params); - } + /** + * Returns a list of invitations to join communities and events. + * + * @param $access_token string + * @param $params array + * - integer offset: Offset needed to return a specific subset of invitations. + * - integer count: Number of invitations to return. + * - boolean extended: '1' — to return additional [vk.com/dev/fields_groups|fields] for communities.. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getInvites(string $access_token, array $params = array()) { + return $this->request->post('groups.getInvites', $access_token, $params); + } - /** - * Returns the data needed to query a Long Poll server for events - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getLongPollServer($access_token, array $params = []) { - return $this->request->post('groups.getLongPollServer', $access_token, $params); - } + /** + * Returns the data needed to query a Long Poll server for events + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getLongPollServer(string $access_token, array $params = array()) { + return $this->request->post('groups.getLongPollServer', $access_token, $params); + } - /** - * Returns Long Poll notification settings - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getLongPollSettings($access_token, array $params = []) { - return $this->request->post('groups.getLongPollSettings', $access_token, $params); - } + /** + * Returns Long Poll notification settings + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getLongPollSettings(string $access_token, array $params = array()) { + return $this->request->post('groups.getLongPollSettings', $access_token, $params); + } - /** - * Returns a list of community members. - * - * @param string $access_token - * @param array $params - * - @var string group_id: ID or screen name of the community. - * - @var GroupsSort sort: Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', 'time_desc'. 'time_asc' and 'time_desc' are availavle only if the method is called by the group's 'moderator'. - * - @var integer offset: Offset needed to return a specific subset of community members. - * - @var integer count: Number of community members to return. - * - @var array[GroupsFields] fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. - * - @var GroupsFilter filter: *'friends' – only friends in this community will be returned,, *'unsure' – only those who pressed 'I may attend' will be returned (if it's an event). - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamGroupIdException Invalid group id - * @return mixed - */ - public function getMembers($access_token, array $params = []) { - return $this->request->post('groups.getMembers', $access_token, $params); - } + /** + * Returns a list of community members. + * + * @param $access_token string + * @param $params array + * - string group_id: ID or screen name of the community. + * - GroupsGetMembersSort sort: Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', + * 'time_desc'. 'time_asc' and 'time_desc' are availavle only if the method is called by the group's + * 'moderator'. + * @see GroupsGetMembersSort + * - integer offset: Offset needed to return a specific subset of community members. + * - integer count: Number of community members to return. + * - array fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, + * photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, + * online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, + * can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, + * relation, relatives, counters'. + * - GroupsGetMembersFilter filter: *'friends' - only friends in this community will be returned,, + * *'unsure' - only those who pressed 'I may attend' will be returned (if it's an event). + * @see GroupsGetMembersFilter + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getMembers(string $access_token, array $params = array()) { + return $this->request->post('groups.getMembers', $access_token, $params); + } - /** - * Returns online status of community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamGroupIdException Invalid group id - * @return mixed - */ - public function getOnlineStatus($access_token, array $params = []) { - return $this->request->post('groups.getOnlineStatus', $access_token, $params); - } + /** + * Returns a list of requests to the community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer offset: Offset needed to return a specific subset of results. + * - integer count: Number of results to return. + * - array fields: Profile fields to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getRequests(string $access_token, array $params = array()) { + return $this->request->post('groups.getRequests', $access_token, $params); + } - /** - * Returns a list of requests to the community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer offset: Offset needed to return a specific subset of results. - * - @var integer count: Number of results to return. - * - @var array[GroupsFields] fields: Profile fields to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getRequests($access_token, array $params = []) { - return $this->request->post('groups.getRequests', $access_token, $params); - } + /** + * Returns community settings. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSettings(string $access_token, array $params = array()) { + return $this->request->post('groups.getSettings', $access_token, $params); + } - /** - * Returns community settings. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getSettings($access_token, array $params = []) { - return $this->request->post('groups.getSettings', $access_token, $params); - } + /** + * List of group's tags + * + * @param $access_token string + * @param $params array + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getTagList(string $access_token, array $params = array()) { + return $this->request->post('groups.getTagList', $access_token, $params); + } - /** - * Returns list of community tags. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getTagList($access_token, array $params = []) { - return $this->request->post('groups.getTagList', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getTokenPermissions(string $access_token, array $params = array()) { + return $this->request->post('groups.getTokenPermissions', $access_token, $params); + } - /** - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getTokenPermissions($access_token) { - return $this->request->post('groups.getTokenPermissions', $access_token); - } + /** + * Allows to invite friends to the community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer user_id: User ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function invite(string $access_token, array $params = array()) { + return $this->request->post('groups.invite', $access_token, $params); + } - /** - * Allows to invite friends to the community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer user_id: User ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @return mixed - */ - public function invite($access_token, array $params = []) { - return $this->request->post('groups.invite', $access_token, $params); - } + /** + * Returns information specifying whether a user is a member of a community. + * + * @param $access_token string + * @param $params array + * - string group_id: ID or screen name of the community. + * - integer user_id: User ID. + * - array user_ids: User IDs. + * - boolean extended: '1' — to return an extended response with additional fields. By default: '0'. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function isMember(string $access_token, array $params = array()) { + return $this->request->post('groups.isMember', $access_token, $params); + } - /** - * Returns information specifying whether a user is a member of a community. - * - * @param string $access_token - * @param array $params - * - @var string group_id: ID or screen name of the community. - * - @var integer user_id: User ID. - * - @var array[integer] user_ids: User IDs. - * - @var boolean extended: '1' — to return an extended response with additional fields. By default: '0'. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function isMember($access_token, array $params = []) { - return $this->request->post('groups.isMember', $access_token, $params); - } + /** + * With this method you can join the group or public page, and also confirm your participation in an event. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID or screen name of the community. + * - string not_sure: Optional parameter which is taken into account when 'gid' belongs to the event: '1' + * — Perhaps I will attend, '0' — I will be there for sure (default), , + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function join(string $access_token, array $params = array()) { + return $this->request->post('groups.join', $access_token, $params); + } - /** - * With this method you can join the group or public page, and also confirm your participation in an event. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID or screen name of the community. - * - @var string not_sure: Optional parameter which is taken into account when 'gid' belongs to the event: '1' — Perhaps I will attend, '0' — I will be there for sure (default), , - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @return mixed - */ - public function join($access_token, array $params = []) { - return $this->request->post('groups.join', $access_token, $params); - } + /** + * With this method you can leave a group, public page, or event. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID or screen name of the community. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function leave(string $access_token, array $params = array()) { + return $this->request->post('groups.leave', $access_token, $params); + } - /** - * With this method you can leave a group, public page, or event. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID or screen name of the community. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function leave($access_token, array $params = []) { - return $this->request->post('groups.leave', $access_token, $params); - } + /** + * Removes a user from the community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer user_id: User ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function removeUser(string $access_token, array $params = array()) { + return $this->request->post('groups.removeUser', $access_token, $params); + } - /** - * Removes a user from the community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer user_id: User ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function removeUser($access_token, array $params = []) { - return $this->request->post('groups.removeUser', $access_token, $params); - } + /** + * Allows to reorder links in the community. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer link_id: Link ID. + * - integer after: ID of the link after which to place the link with 'link_id'. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function reorderLink(string $access_token, array $params = array()) { + return $this->request->post('groups.reorderLink', $access_token, $params); + } - /** - * Allows to reorder links in the community. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer link_id: Link ID. - * - @var integer after: ID of the link after which to place the link with 'link_id'. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function reorderLink($access_token, array $params = []) { - return $this->request->post('groups.reorderLink', $access_token, $params); - } + /** + * Returns a list of communities matching the search criteria. + * + * @param $access_token string + * @param $params array + * - string q: Search query string. + * - GroupsSearchType type: Community type. Possible values: 'group, page, event.' + * @see GroupsSearchType + * - integer country_id: Country ID. + * - integer city_id: City ID. If this parameter is transmitted, country_id is ignored. + * - boolean future: '1' — to return only upcoming events. Works with the 'type' = 'event' only. + * - boolean market: '1' — to return communities with enabled market only. + * - GroupsSearchSort sort: Sort order. Possible values: *'0' — default sorting (similar the full + * version of the site),, *'1' — by growth speed,, *'2'— by the "day attendance/members number" ratio,, + * *'3' — by the "Likes number/members number" ratio,, *'4' — by the "comments number/members number" + * ratio,, *'5' — by the "boards entries number/members number" ratio. + * @see GroupsSearchSort + * - integer offset: Offset needed to return a specific subset of results. + * - integer count: Number of communities to return. "Note that you can not receive more than first + * thousand of results, regardless of 'count' and 'offset' values." + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('groups.search', $access_token, $params); + } - /** - * Returns a list of communities matching the search criteria. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query string. - * - @var GroupsType type: Community type. Possible values: 'group, page, event.' - * - @var integer country_id: Country ID. - * - @var integer city_id: City ID. If this parameter is transmitted, country_id is ignored. - * - @var boolean future: '1' — to return only upcoming events. Works with the 'type' = 'event' only. - * - @var boolean market: '1' — to return communities with enabled market only. - * - @var GroupsSort sort: Sort order. Possible values: *'0' — default sorting (similar the full version of the site),, *'1' — by growth speed,, *'2'— by the "day attendance/members number" ratio,, *'3' — by the "Likes number/members number" ratio,, *'4' — by the "comments number/members number" ratio,, *'5' — by the "boards entries number/members number" ratio. - * - @var integer offset: Offset needed to return a specific subset of results. - * - @var integer count: Number of communities to return. "Note that you can not receive more than first thousand of results, regardless of 'count' and 'offset' values." - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('groups.search', $access_token, $params); - } + /** + * Allow to set notifications settings for group. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer server_id: Server ID. + * - string api_version: + * - boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). + * - boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). + * - boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). + * - boolean message_edit: + * - boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). + * - boolean message_typing_state: + * - boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). + * - boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). + * - boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). + * - boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). + * - boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). + * - boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). + * - boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). + * - boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). + * - boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). + * - boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). + * - boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). + * - boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). + * - boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). + * - boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). + * - boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). + * - boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). + * - boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). + * - boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). + * - boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). + * - boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). + * - boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). + * - boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — + * enabled). + * - boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). + * - boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). + * - boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — + * enabled). + * - boolean market_order_new: + * - boolean market_order_edit: + * - boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). + * - boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). + * - boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). + * - boolean group_change_settings: + * - boolean group_change_photo: + * - boolean group_officers_edit: + * - boolean user_block: User added to community blacklist + * - boolean user_unblock: User removed from community blacklist + * - boolean lead_forms_new: New form in lead forms + * - boolean like_add: + * - boolean like_remove: + * - boolean message_event: + * - boolean donut_subscription_create: + * - boolean donut_subscription_prolonged: + * - boolean donut_subscription_cancelled: + * - boolean donut_subscription_price_changed: + * - boolean donut_subscription_expired: + * - boolean donut_money_withdraw: + * - boolean donut_money_withdraw_error: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function setCallbackSettings(string $access_token, array $params = array()) { + return $this->request->post('groups.setCallbackSettings', $access_token, $params); + } - /** - * Allow to set notifications settings for group. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer server_id: Server ID. - * - @var string api_version - * - @var boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). - * - @var boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). - * - @var boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). - * - @var boolean message_edit - * - @var boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). - * - @var boolean message_typing_state - * - @var boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). - * - @var boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). - * - @var boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). - * - @var boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). - * - @var boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). - * - @var boolean group_change_settings - * - @var boolean group_change_photo - * - @var boolean group_officers_edit - * - @var boolean user_block: User added to community blacklist - * - @var boolean user_unblock: User removed from community blacklist - * - @var boolean lead_forms_new: New form in lead forms - * @throws VKClientException - * @throws VKApiException - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function setCallbackSettings($access_token, array $params = []) { - return $this->request->post('groups.setCallbackSettings', $access_token, $params); - } + /** + * Sets Long Poll notification settings + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - boolean enabled: Sets whether Long Poll is enabled ('0' — disabled, '1' — enabled). + * - string api_version: + * - boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). + * - boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). + * - boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). + * - boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). + * - boolean message_edit: A message has been edited ('0' — disabled, '1' — enabled). + * - boolean message_typing_state: + * - boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). + * - boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). + * - boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). + * - boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). + * - boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). + * - boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). + * - boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). + * - boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). + * - boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). + * - boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). + * - boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). + * - boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). + * - boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). + * - boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). + * - boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). + * - boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). + * - boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). + * - boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). + * - boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). + * - boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). + * - boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). + * - boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — + * enabled). + * - boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). + * - boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). + * - boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — + * enabled). + * - boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). + * - boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). + * - boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). + * - boolean group_change_settings: + * - boolean group_change_photo: + * - boolean group_officers_edit: + * - boolean user_block: User added to community blacklist + * - boolean user_unblock: User removed from community blacklist + * - boolean like_add: + * - boolean like_remove: + * - boolean message_event: + * - boolean donut_subscription_create: + * - boolean donut_subscription_prolonged: + * - boolean donut_subscription_cancelled: + * - boolean donut_subscription_price_changed: + * - boolean donut_subscription_expired: + * - boolean donut_money_withdraw: + * - boolean donut_money_withdraw_error: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function setLongPollSettings(string $access_token, array $params = array()) { + return $this->request->post('groups.setLongPollSettings', $access_token, $params); + } - /** - * Sets Long Poll notification settings - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var boolean enabled: Sets whether Long Poll is enabled ('0' — disabled, '1' — enabled). - * - @var string api_version - * - @var boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). - * - @var boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). - * - @var boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). - * - @var boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). - * - @var boolean message_edit: A message has been edited ('0' — disabled, '1' — enabled). - * - @var boolean message_typing_state - * - @var boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). - * - @var boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). - * - @var boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). - * - @var boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). - * - @var boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — enabled). - * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). - * - @var boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). - * - @var boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). - * - @var boolean group_change_settings - * - @var boolean group_change_photo - * - @var boolean group_officers_edit - * - @var boolean user_block: User added to community blacklist - * - @var boolean user_unblock: User removed from community blacklist - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function setLongPollSettings($access_token, array $params = []) { - return $this->request->post('groups.setLongPollSettings', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - boolean messages: + * - boolean bots_capabilities: + * - boolean bots_start_button: + * - boolean bots_add_to_chat: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function setSettings(string $access_token, array $params = array()) { + return $this->request->post('groups.setSettings', $access_token, $params); + } - /** - * Sets community settings - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var boolean messages: Sets whether messages is enabled ('0' — disabled, '1' — enabled). - * - @var boolean bots_capabilities: Sets whether bots capabilities is enabled ('0' — disabled, '1' — enabled). - * - @var boolean bots_start_button: Start button ('0' — disabled, '1' — enabled). - * - @var boolean bots_add_to_chat: Users can add bots to conversations ('0' — disabled, '1' — enabled). - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function setSettings($access_token, array $params = []) { - return $this->request->post('groups.setSettings', $access_token, $params); - } + /** + * In order to save note about group participant + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer user_id: + * - string note: Note body + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function setUserNote(string $access_token, array $params = array()) { + return $this->request->post('groups.setUserNote', $access_token, $params); + } - /** - * Set or update user note - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer user_id: User ID. - * - @var string note: Note text. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function setUserNote($access_token, array $params = []) { - return $this->request->post('groups.setUserNote', $access_token, $params); - } + /** + * Add new group's tag + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - string tag_name: + * - GroupsTagAddTagColor tag_color: + * @see GroupsTagAddTagColor + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function tagAdd(string $access_token, array $params = array()) { + return $this->request->post('groups.tagAdd', $access_token, $params); + } - /** - * Add new tag to community - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var string tag_name: Name of tag. - * - @var string tag_color: Color of tag. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function tagAdd($access_token, array $params = []) { - return $this->request->post('groups.tagAdd', $access_token, $params); - } + /** + * Bind or unbind group's tag to user + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer tag_id: + * - integer user_id: + * - GroupsTagBindAct act: Describe the action + * @see GroupsTagBindAct + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function tagBind(string $access_token, array $params = array()) { + return $this->request->post('groups.tagBind', $access_token, $params); + } - /** - * Bind and unbind community's tags to conversations. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer tag_id: Tag ID. - * - @var integer user_id: User ID. - * - @var string act: Tag Action. Values: *'bind',, *'unbind' - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function tagBind($access_token, array $params = []) { - return $this->request->post('groups.tagBind', $access_token, $params); - } + /** + * Delete group's tag + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer tag_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function tagDelete(string $access_token, array $params = array()) { + return $this->request->post('groups.tagDelete', $access_token, $params); + } - /** - * Delete tag of community - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer tag_id: Tag ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function tagDelete($access_token, array $params = []) { - return $this->request->post('groups.tagDelete', $access_token, $params); - } + /** + * Update group's tag + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer tag_id: + * - string tag_name: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function tagUpdate(string $access_token, array $params = array()) { + return $this->request->post('groups.tagUpdate', $access_token, $params); + } - /** - * Update tag of community - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer tag_id: Tag ID. - * - @var string tag_name: Tag Name. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function tagUpdate($access_token, array $params = []) { - return $this->request->post('groups.tagUpdate', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - GroupsToggleMarketState state: + * @see GroupsToggleMarketState + * - string ref: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function toggleMarket(string $access_token, array $params = array()) { + return $this->request->post('groups.toggleMarket', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer group_id - * - @var integer owner_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function unban($access_token, array $params = []) { - return $this->request->post('groups.unban', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer owner_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function unban(string $access_token, array $params = array()) { + return $this->request->post('groups.unban', $access_token, $params); + } } diff --git a/src/VK/Actions/Leads.php b/src/VK/Actions/Leads.php deleted file mode 100644 index 6d9ab2e..0000000 --- a/src/VK/Actions/Leads.php +++ /dev/null @@ -1,137 +0,0 @@ -request = $request; - } - - /** - * Checks if the user can start the lead. - * - * @param string $access_token - * @param array $params - * - @var integer lead_id: Lead ID. - * - @var integer test_result: Value to be return in 'result' field when test mode is used. - * - @var boolean test_mode - * - @var boolean auto_start - * - @var integer age: User age. - * - @var string country: User country code. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiActionFailedException Unable to process action - * @return mixed - */ - public function checkUser($access_token, array $params = []) { - return $this->request->post('leads.checkUser', $access_token, $params); - } - - /** - * Completes the lead started by user. - * - * @param string $access_token - * @param array $params - * - @var string vk_sid: Session obtained as GET parameter when session started. - * - @var string secret: Secret key from the lead testing interface. - * - @var string comment: Comment text. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @throws VKApiVotesException Not enough votes - * @return mixed - */ - public function complete($access_token, array $params = []) { - return $this->request->post('leads.complete', $access_token, $params); - } - - /** - * Returns lead stats data. - * - * @param string $access_token - * @param array $params - * - @var integer lead_id: Lead ID. - * - @var string secret: Secret key obtained from the lead testing interface. - * - @var string date_start: Day to start stats from (YYYY_MM_DD, e.g.2011-09-17). - * - @var string date_end: Day to finish stats (YYYY_MM_DD, e.g.2011-09-17). - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getStats($access_token, array $params = []) { - return $this->request->post('leads.getStats', $access_token, $params); - } - - /** - * Returns a list of last user actions for the offer. - * - * @param string $access_token - * @param array $params - * - @var integer offer_id: Offer ID. - * - @var string secret: Secret key obtained in the lead testing interface. - * - @var integer offset: Offset needed to return a specific subset of results. - * - @var integer count: Number of results to return. - * - @var LeadsStatus status: Action type. Possible values: *'0' — start,, *'1' — finish,, *'2' — blocking users,, *'3' — start in a test mode,, *'4' — finish in a test mode. - * - @var boolean reverse: Sort order. Possible values: *'1' — chronological,, *'0' — reverse chronological. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getUsers($access_token, array $params = []) { - return $this->request->post('leads.getUsers', $access_token, $params); - } - - /** - * Counts the metric event. - * - * @param string $access_token - * @param array $params - * - @var string data: Metric data obtained in the lead interface. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function metricHit($access_token, array $params = []) { - return $this->request->post('leads.metricHit', $access_token, $params); - } - - /** - * Creates new session for the user passing the offer. - * - * @param string $access_token - * @param array $params - * - @var integer lead_id: Lead ID. - * - @var string secret: Secret key from the lead testing interface. - * - @var integer uid - * - @var integer aid - * - @var boolean test_mode - * - @var boolean force - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @return mixed - */ - public function start($access_token, array $params = []) { - return $this->request->post('leads.start', $access_token, $params); - } -} diff --git a/src/VK/Actions/Likes.php b/src/VK/Actions/Likes.php index 5f80230..edbd3b2 100644 --- a/src/VK/Actions/Likes.php +++ b/src/VK/Actions/Likes.php @@ -1,101 +1,134 @@ request = $request; - } + /** + * Likes constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Adds the specified object to the 'Likes' list of the current user. - * - * @param string $access_token - * @param array $params - * - @var LikesType type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed - * - @var integer owner_id: ID of the user or community that owns the object. - * - @var integer item_id: Object ID. - * - @var string access_key: Access key required for an object owned by a private entity. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function add($access_token, array $params = []) { - return $this->request->post('likes.add', $access_token, $params); - } + /** + * Adds the specified object to the 'Likes' list of the current user. + * + * @param $access_token string + * @param $params array + * - string type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall + * post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment + * on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, + * 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed + * - integer owner_id: ID of the user or community that owns the object. + * - integer item_id: Object ID. + * - string access_key: Access key required for an object owned by a private entity. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function add(string $access_token, array $params = array()) { + return $this->request->post('likes.add', $access_token, $params); + } - /** - * Deletes the specified object from the 'Likes' list of the current user. - * - * @param string $access_token - * @param array $params - * - @var LikesType type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed - * - @var integer owner_id: ID of the user or community that owns the object. - * - @var integer item_id: Object ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('likes.delete', $access_token, $params); - } + /** + * Deletes the specified object from the 'Likes' list of the current user. + * + * @param $access_token string + * @param $params array + * - string type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall + * post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment + * on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, + * 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed + * - integer owner_id: ID of the user or community that owns the object. + * - integer item_id: Object ID. + * - string access_key: Access key required for an object owned by a private entity. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('likes.delete', $access_token, $params); + } - /** - * Returns a list of IDs of users who added the specified object to their 'Likes' list. - * - * @param string $access_token - * @param array $params - * - @var LikesType type: , Object type: 'post' — post on user or community wall, 'comment' — comment on a wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed - * - @var integer owner_id: ID of the user, community, or application that owns the object. If the 'type' parameter is set as 'sitepage', the application ID is passed as 'owner_id'. Use negative value for a community id. If the 'type' parameter is not set, the 'owner_id' is assumed to be either the current user or the same application ID as if the 'type' parameter was set to 'sitepage'. - * - @var integer item_id: Object ID. If 'type' is set as 'sitepage', 'item_id' can include the 'page_id' parameter value used during initialization of the [vk.com/dev/Like|Like widget]. - * - @var string page_url: URL of the page where the [vk.com/dev/Like|Like widget] is installed. Used instead of the 'item_id' parameter. - * - @var LikesFilter filter: Filters to apply: 'likes' — returns information about all users who liked the object (default), 'copies' — returns information only about users who told their friends about the object - * - @var LikesFriendsOnly friends_only: Specifies which users are returned: '1' — to return only the current user's friends, '0' — to return all users (default) - * - @var boolean extended: Specifies whether extended information will be returned. '1' — to return extended information about users and communities from the 'Likes' list, '0' — to return no additional information (default) - * - @var integer offset: Offset needed to select a specific subset of users. - * - @var integer count: Number of user IDs to return (maximum '1000'). Default is '100' if 'friends_only' is set to '0', otherwise, the default is '10' if 'friends_only' is set to '1'. - * - @var boolean skip_own - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getList($access_token, array $params = []) { - return $this->request->post('likes.getList', $access_token, $params); - } + /** + * Returns a list of IDs of users who added the specified object to their 'Likes' list. + * + * @param $access_token string + * @param $params array + * - string type: , Object type: 'post' — post on user or community wall, 'comment' — comment on a + * wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — + * comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the + * discussion, 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed + * - integer owner_id: ID of the user, community, or application that owns the object. If the 'type' + * parameter is set as 'sitepage', the application ID is passed as 'owner_id'. Use negative value for a + * community id. If the 'type' parameter is not set, the 'owner_id' is assumed to be either the current user or + * the same application ID as if the 'type' parameter was set to 'sitepage'. + * - integer item_id: Object ID. If 'type' is set as 'sitepage', 'item_id' can include the 'page_id' + * parameter value used during initialization of the [vk.com/dev/Like|Like widget]. + * - string page_url: URL of the page where the [vk.com/dev/Like|Like widget] is installed. Used instead + * of the 'item_id' parameter. + * - LikesGetListFilter filter: Filters to apply: 'likes' — returns information about all users who + * liked the object (default), 'copies' — returns information only about users who told their friends about + * the object + * @see LikesGetListFilter + * - LikesGetListFriendsOnly friends_only: Specifies which users are returned: '1' — to return only the + * current user's friends, '0' — to return all users (default) + * @see LikesGetListFriendsOnly + * - boolean extended: Specifies whether extended information will be returned. '1' — to return extended + * information about users and communities from the 'Likes' list, '0' — to return no additional information + * (default) + * - integer offset: Offset needed to select a specific subset of users. + * - integer count: Number of user IDs to return (maximum '1000'). Default is '100' if 'friends_only' is + * set to '0', otherwise, the default is '10' if 'friends_only' is set to '1'. + * - boolean skip_own: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getList(string $access_token, array $params = array()) { + return $this->request->post('likes.getList', $access_token, $params); + } - /** - * Checks for the object in the 'Likes' list of the specified user. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var LikesType type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion - * - @var integer owner_id: ID of the user or community that owns the object. - * - @var integer item_id: Object ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function isLiked($access_token, array $params = []) { - return $this->request->post('likes.isLiked', $access_token, $params); - } + /** + * Checks for the object in the 'Likes' list of the specified user. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - string type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall + * post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment + * on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion + * - integer owner_id: ID of the user or community that owns the object. + * - integer item_id: Object ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function isLiked(string $access_token, array $params = array()) { + return $this->request->post('likes.isLiked', $access_token, $params); + } } diff --git a/src/VK/Actions/Market.php b/src/VK/Actions/Market.php index b3f403c..9191699 100644 --- a/src/VK/Actions/Market.php +++ b/src/VK/Actions/Market.php @@ -1,482 +1,684 @@ request = $request; - } - - /** - * Ads a new item to the market. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var string name: Item name. - * - @var string description: Item description. - * - @var integer category_id: Item category ID. - * - @var number price: Item price. - * - @var number old_price - * - @var boolean deleted: Item status ('1' — deleted, '0' — not deleted). - * - @var integer main_photo_id: Cover photo ID. - * - @var array[integer] photo_ids: IDs of additional photos. - * - @var string url: Url for button in market item. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessMarketException Access denied - * @throws VKApiMarketTooManyItemsException Too many items - * @throws VKApiMarketItemHasBadLinksException Item has bad links in description - * @return mixed - */ - public function add($access_token, array $params = []) { - return $this->request->post('market.add', $access_token, $params); - } - - /** - * Creates new collection of items - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var string title: Collection title. - * - @var integer photo_id: Cover photo ID. - * - @var boolean main_album: Set as main ('1' – set, '0' – no). - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMarketTooManyAlbumsException Too many albums - * @return mixed - */ - public function addAlbum($access_token, array $params = []) { - return $this->request->post('market.addAlbum', $access_token, $params); - } - - /** - * Adds an item to one or multiple collections. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer item_id: Item ID. - * - @var array[integer] album_ids: Collections IDs to add item to. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMarketAlbumNotFoundException Album not found - * @throws VKApiMarketItemNotFoundException Item not found - * @throws VKApiMarketTooManyItemsInAlbumException Too many items in album - * @throws VKApiMarketItemAlreadyAddedException Item already added to album - * @return mixed - */ - public function addToAlbum($access_token, array $params = []) { - return $this->request->post('market.addToAlbum', $access_token, $params); - } - - /** - * Creates a new comment for an item. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer item_id: Item ID. - * - @var string message: Comment text (required if 'attachments' parameter is not specified) - * - @var array[string] attachments: Comma-separated list of objects attached to a comment. The field is submitted the following way: , "'_,_'", , '' - media attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - media attachment id, , For example: "photo100172_166443618,photo66748_265827614", - * - @var boolean from_group: '1' - comment will be published on behalf of a community, '0' - on behalf of a user (by default). - * - @var integer reply_to_comment: ID of a comment to reply with current comment to. - * - @var integer sticker_id: Sticker ID. - * - @var string guid: Random value to avoid resending one comment. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function createComment($access_token, array $params = []) { - return $this->request->post('market.createComment', $access_token, $params); - } - - /** - * Deletes an item. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer item_id: Item ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessMarketException Access denied - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('market.delete', $access_token, $params); - } - - /** - * Deletes a collection of items. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an collection owner community. - * - @var integer album_id: Collection ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMarketAlbumNotFoundException Album not found - * @return mixed - */ - public function deleteAlbum($access_token, array $params = []) { - return $this->request->post('market.deleteAlbum', $access_token, $params); - } - - /** - * Deletes an item's comment - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " - * - @var integer comment_id: comment id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteComment($access_token, array $params = []) { - return $this->request->post('market.deleteComment', $access_token, $params); - } - - /** - * Edits an item. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer item_id: Item ID. - * - @var string name: Item name. - * - @var string description: Item description. - * - @var integer category_id: Item category ID. - * - @var number price: Item price. - * - @var boolean deleted: Item status ('1' — deleted, '0' — not deleted). - * - @var integer main_photo_id: Cover photo ID. - * - @var array[integer] photo_ids: IDs of additional photos. - * - @var string url: Url for button in market item. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessMarketException Access denied - * @throws VKApiMarketItemNotFoundException Item not found - * @throws VKApiMarketItemHasBadLinksException Item has bad links in description - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('market.edit', $access_token, $params); - } - - /** - * Edits a collection of items - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an collection owner community. - * - @var integer album_id: Collection ID. - * - @var string title: Collection title. - * - @var integer photo_id: Cover photo id - * - @var boolean main_album: Set as main ('1' – set, '0' – no). - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMarketAlbumNotFoundException Album not found - * @return mixed - */ - public function editAlbum($access_token, array $params = []) { - return $this->request->post('market.editAlbum', $access_token, $params); - } - - /** - * Chages item comment's text - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer comment_id: Comment ID. - * - @var string message: New comment text (required if 'attachments' are not specified), , 2048 symbols maximum. - * - @var array[string] attachments: Comma-separated list of objects attached to a comment. The field is submitted the following way: , "'_,_'", , '' - media attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - media attachment id, , For example: "photo100172_166443618,photo66748_265827614", - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function editComment($access_token, array $params = []) { - return $this->request->post('market.editComment', $access_token, $params); - } - - /** - * Returns items list for a community. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " - * - @var integer album_id - * - @var integer count: Number of items to return. - * - @var integer offset: Offset needed to return a specific subset of results. - * - @var boolean extended: '1' – method will return additional fields: 'likes, can_comment, car_repost, photos'. These parameters are not returned by default. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('market.get', $access_token, $params); - } - - /** - * Returns items album's data - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: identifier of an album owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " - * - @var array[integer] album_ids: collections identifiers to obtain data from - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getAlbumById($access_token, array $params = []) { - return $this->request->post('market.getAlbumById', $access_token, $params); - } - - /** - * Returns community's collections list. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an items owner community. - * - @var integer offset: Offset needed to return a specific subset of results. - * - @var integer count: Number of items to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getAlbums($access_token, array $params = []) { - return $this->request->post('market.getAlbums', $access_token, $params); - } - - /** - * Returns information about market items by their ids. - * - * @param string $access_token - * @param array $params - * - @var array[string] item_ids: Comma-separated ids list: {user id}_{item id}. If an item belongs to a community -{community id} is used. " 'Videos' value example: , '-4363_136089719,13245770_137352259'" - * - @var boolean extended: '1' – to return additional fields: 'likes, can_comment, car_repost, photos'. By default: '0'. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('market.getById', $access_token, $params); - } - - /** - * Returns a list of market categories. - * - * @param string $access_token - * @param array $params - * - @var integer count: Number of results to return. - * - @var integer offset: Offset needed to return a specific subset of results. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getCategories($access_token, array $params = []) { - return $this->request->post('market.getCategories', $access_token, $params); - } - - /** - * Returns comments list for an item. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community - * - @var integer item_id: Item ID. - * - @var boolean need_likes: '1' — to return likes info. - * - @var integer start_comment_id: ID of a comment to start a list from (details below). - * - @var integer offset - * - @var integer count: Number of results to return. - * - @var MarketSort sort: Sort order ('asc' — from old to new, 'desc' — from new to old) - * - @var boolean extended: '1' — comments will be returned as numbered objects, in addition lists of 'profiles' and 'groups' objects will be returned. - * - @var array[MarketFields] fields: List of additional profile fields to return. See the [vk.com/dev/fields|details] - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMarketCommentsClosedException Comments for this market are closed - * @return mixed - */ - public function getComments($access_token, array $params = []) { - return $this->request->post('market.getComments', $access_token, $params); - } - - /** - * Removes an item from one or multiple collections. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer item_id: Item ID. - * - @var array[integer] album_ids: Collections IDs to remove item from. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMarketAlbumNotFoundException Album not found - * @throws VKApiMarketItemNotFoundException Item not found - * @return mixed - */ - public function removeFromAlbum($access_token, array $params = []) { - return $this->request->post('market.removeFromAlbum', $access_token, $params); - } - - /** - * Reorders the collections list. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer album_id: Collection ID. - * - @var integer before: ID of a collection to place current collection before it. - * - @var integer after: ID of a collection to place current collection after it. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessMarketException Access denied - * @throws VKApiMarketAlbumNotFoundException Album not found - * @return mixed - */ - public function reorderAlbums($access_token, array $params = []) { - return $this->request->post('market.reorderAlbums', $access_token, $params); - } - - /** - * Changes item place in a collection. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer album_id: ID of a collection to reorder items in. Set 0 to reorder full items list. - * - @var integer item_id: Item ID. - * - @var integer before: ID of an item to place current item before it. - * - @var integer after: ID of an item to place current item after it. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessMarketException Access denied - * @throws VKApiMarketAlbumNotFoundException Album not found - * @throws VKApiMarketItemNotFoundException Item not found - * @return mixed - */ - public function reorderItems($access_token, array $params = []) { - return $this->request->post('market.reorderItems', $access_token, $params); - } - - /** - * Sends a complaint to the item. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer item_id: Item ID. - * - @var MarketReason reason: Complaint reason. Possible values: *'0' — spam,, *'1' — child porn,, *'2' — extremism,, *'3' — violence,, *'4' — drugs propaganda,, *'5' — adult materials,, *'6' — insult. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function report($access_token, array $params = []) { - return $this->request->post('market.report', $access_token, $params); - } - - /** - * Sends a complaint to the item's comment. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer comment_id: Comment ID. - * - @var MarketReason reason: Complaint reason. Possible values: *'0' — spam,, *'1' — child porn,, *'2' — extremism,, *'3' — violence,, *'4' — drugs propaganda,, *'5' — adult materials,, *'6' — insult. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function reportComment($access_token, array $params = []) { - return $this->request->post('market.reportComment', $access_token, $params); - } - - /** - * Restores recently deleted item - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an item owner community. - * - @var integer item_id: Deleted item ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessMarketException Access denied - * @throws VKApiMarketRestoreTooLateException Too late for restore - * @return mixed - */ - public function restore($access_token, array $params = []) { - return $this->request->post('market.restore', $access_token, $params); - } - - /** - * Restores a recently deleted comment - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " - * - @var integer comment_id: deleted comment id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function restoreComment($access_token, array $params = []) { - return $this->request->post('market.restoreComment', $access_token, $params); - } - - /** - * Searches market items in a community's catalog - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of an items owner community. - * - @var integer album_id - * - @var string q: Search query, for example "pink slippers". - * - @var integer price_from: Minimum item price value. - * - @var integer price_to: Maximum item price value. - * - @var array[integer] tags: Comma-separated tag IDs list. - * - @var MarketSort sort - * - @var MarketRev rev: '0' — do not use reverse order, '1' — use reverse order - * - @var integer offset: Offset needed to return a specific subset of results. - * - @var integer count: Number of items to return. - * - @var boolean extended: '1' – to return additional fields: 'likes, can_comment, car_repost, photos'. By default: '0'. - * - @var MarketStatus status - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('market.search', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Market constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Ads a new item to the market. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - string name: Item name. + * - string description: Item description. + * - integer category_id: Item category ID. + * - number price: Item price. + * - number old_price: + * - boolean deleted: Item status ('1' — deleted, '0' — not deleted). + * - integer main_photo_id: Cover photo ID. + * - array photo_ids: IDs of additional photos. + * - string url: Url for button in market item. + * - integer dimension_width: + * - integer dimension_height: + * - integer dimension_length: + * - integer weight: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function add(string $access_token, array $params = array()) { + return $this->request->post('market.add', $access_token, $params); + } + + /** + * Creates new collection of items + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - string title: Collection title. + * - integer photo_id: Cover photo ID. + * - boolean main_album: Set as main ('1' - set, '0' - no). + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function addAlbum(string $access_token, array $params = array()) { + return $this->request->post('market.addAlbum', $access_token, $params); + } + + /** + * Adds an item to one or multiple collections. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer item_id: Item ID. + * - array album_ids: Collections IDs to add item to. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function addToAlbum(string $access_token, array $params = array()) { + return $this->request->post('market.addToAlbum', $access_token, $params); + } + + /** + * Creates a new comment for an item. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer item_id: Item ID. + * - string message: Comment text (required if 'attachments' parameter is not specified) + * - array attachments: Comma-separated list of objects attached to a comment. The field is submitted the + * following way: , "'_,_'", , '' - media attachment type: "'photo' - + * photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - + * media attachment id, , For example: "photo100172_166443618,photo66748_265827614", + * - boolean from_group: '1' - comment will be published on behalf of a community, '0' - on behalf of a + * user (by default). + * - integer reply_to_comment: ID of a comment to reply with current comment to. + * - integer sticker_id: Sticker ID. + * - string guid: Random value to avoid resending one comment. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function createComment(string $access_token, array $params = array()) { + return $this->request->post('market.createComment', $access_token, $params); + } + + /** + * Deletes an item. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer item_id: Item ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('market.delete', $access_token, $params); + } + + /** + * Deletes a collection of items. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an collection owner community. + * - integer album_id: Collection ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function deleteAlbum(string $access_token, array $params = array()) { + return $this->request->post('market.deleteAlbum', $access_token, $params); + } + + /** + * Deletes an item's comment + * + * @param $access_token string + * @param $params array + * - integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' + * parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community + * " + * - integer comment_id: comment id + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteComment(string $access_token, array $params = array()) { + return $this->request->post('market.deleteComment', $access_token, $params); + } + + /** + * Edits an item. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer item_id: Item ID. + * - string name: Item name. + * - string description: Item description. + * - integer category_id: Item category ID. + * - number price: Item price. + * - boolean deleted: Item status ('1' — deleted, '0' — not deleted). + * - integer main_photo_id: Cover photo ID. + * - array photo_ids: IDs of additional photos. + * - string url: Url for button in market item. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('market.edit', $access_token, $params); + } + + /** + * Edits a collection of items + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an collection owner community. + * - integer album_id: Collection ID. + * - string title: Collection title. + * - integer photo_id: Cover photo id + * - boolean main_album: Set as main ('1' - set, '0' - no). + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function editAlbum(string $access_token, array $params = array()) { + return $this->request->post('market.editAlbum', $access_token, $params); + } + + /** + * Chages item comment's text + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer comment_id: Comment ID. + * - string message: New comment text (required if 'attachments' are not specified), , 2048 symbols + * maximum. + * - array attachments: Comma-separated list of objects attached to a comment. The field is submitted the + * following way: , "'_,_'", , '' - media attachment type: "'photo' - + * photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - + * media attachment id, , For example: "photo100172_166443618,photo66748_265827614", + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function editComment(string $access_token, array $params = array()) { + return $this->request->post('market.editComment', $access_token, $params); + } + + /** + * Edit order + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer order_id: + * - string merchant_comment: + * - integer status: + * - string track_number: + * - MarketEditOrderPaymentStatus payment_status: + * @see MarketEditOrderPaymentStatus + * - integer delivery_price: + * - integer width: + * - integer length: + * - integer height: + * - integer weight: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function editOrder(string $access_token, array $params = array()) { + return $this->request->post('market.editOrder', $access_token, $params); + } + + /** + * Returns items list for a community. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community, "Note that community id in the 'owner_id' parameter + * should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " + * - integer album_id: + * - integer count: Number of items to return. + * - integer offset: Offset needed to return a specific subset of results. + * - boolean extended: '1' - method will return additional fields: 'likes, can_comment, car_repost, + * photos'. These parameters are not returned by default. + * - string date_from: Items update date from (format: yyyy-mm-dd) + * - string date_to: Items update date to (format: yyyy-mm-dd) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('market.get', $access_token, $params); + } + + /** + * Returns items album's data + * + * @param $access_token string + * @param $params array + * - integer owner_id: identifier of an album owner community, "Note that community id in the 'owner_id' + * parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community + * " + * - array album_ids: collections identifiers to obtain data from + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAlbumById(string $access_token, array $params = array()) { + return $this->request->post('market.getAlbumById', $access_token, $params); + } + + /** + * Returns community's market collections list. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an items owner community. + * - integer offset: Offset needed to return a specific subset of results. + * - integer count: Number of items to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAlbums(string $access_token, array $params = array()) { + return $this->request->post('market.getAlbums', $access_token, $params); + } + + /** + * Returns information about market items by their ids. + * + * @param $access_token string + * @param $params array + * - array item_ids: Comma-separated ids list: {user id}_{item id}. If an item belongs to a community + * -{community id} is used. " 'Videos' value example: , '-4363_136089719,13245770_137352259'" + * - boolean extended: '1' - to return additional fields: 'likes, can_comment, car_repost, photos'. By + * default: '0'. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('market.getById', $access_token, $params); + } + + /** + * Returns a list of market categories. + * + * @param $access_token string + * @param $params array + * - integer count: Number of results to return. + * - integer offset: Offset needed to return a specific subset of results. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getCategories(string $access_token, array $params = array()) { + return $this->request->post('market.getCategories', $access_token, $params); + } + + /** + * Returns comments list for an item. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community + * - integer item_id: Item ID. + * - boolean need_likes: '1' — to return likes info. + * - integer start_comment_id: ID of a comment to start a list from (details below). + * - integer offset: + * - integer count: Number of results to return. + * - MarketGetCommentsSort sort: Sort order ('asc' — from old to new, 'desc' — from new to old) + * @see MarketGetCommentsSort + * - boolean extended: '1' — comments will be returned as numbered objects, in addition lists of + * 'profiles' and 'groups' objects will be returned. + * - array fields: List of additional profile fields to return. See the [vk.com/dev/fields|details] + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getComments(string $access_token, array $params = array()) { + return $this->request->post('market.getComments', $access_token, $params); + } + + /** + * Get market orders + * + * @param $access_token string + * @param $params array + * - integer group_id: + * - integer offset: + * - integer count: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getGroupOrders(string $access_token, array $params = array()) { + return $this->request->post('market.getGroupOrders', $access_token, $params); + } + + /** + * Get order + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer order_id: + * - boolean extended: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getOrderById(string $access_token, array $params = array()) { + return $this->request->post('market.getOrderById', $access_token, $params); + } + + /** + * Get market items in the order + * + * @param $access_token string + * @param $params array + * - integer order_id: + * - integer offset: + * - integer count: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getOrderItems(string $access_token, array $params = array()) { + return $this->request->post('market.getOrderItems', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer offset: + * - integer count: + * - boolean extended: + * - string date_from: Orders status updated date from (format: yyyy-mm-dd) + * - string date_to: Orders status updated date to (format: yyyy-mm-dd) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getOrders(string $access_token, array $params = array()) { + return $this->request->post('market.getOrders', $access_token, $params); + } + + /** + * Removes an item from one or multiple collections. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer item_id: Item ID. + * - array album_ids: Collections IDs to remove item from. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function removeFromAlbum(string $access_token, array $params = array()) { + return $this->request->post('market.removeFromAlbum', $access_token, $params); + } + + /** + * Reorders the collections list. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer album_id: Collection ID. + * - integer before: ID of a collection to place current collection before it. + * - integer after: ID of a collection to place current collection after it. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function reorderAlbums(string $access_token, array $params = array()) { + return $this->request->post('market.reorderAlbums', $access_token, $params); + } + + /** + * Changes item place in a collection. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer album_id: ID of a collection to reorder items in. Set 0 to reorder full items list. + * - integer item_id: Item ID. + * - integer before: ID of an item to place current item before it. + * - integer after: ID of an item to place current item after it. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function reorderItems(string $access_token, array $params = array()) { + return $this->request->post('market.reorderItems', $access_token, $params); + } + + /** + * Sends a complaint to the item. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer item_id: Item ID. + * - MarketReportReason reason: Complaint reason. Possible values: *'0' — spam,, *'1' — child porn,, + * *'2' — extremism,, *'3' — violence,, *'4' — drugs propaganda,, *'5' — adult materials,, *'6' — + * insult. + * @see MarketReportReason + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function report(string $access_token, array $params = array()) { + return $this->request->post('market.report', $access_token, $params); + } + + /** + * Sends a complaint to the item's comment. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer comment_id: Comment ID. + * - MarketReportCommentReason reason: Complaint reason. Possible values: *'0' — spam,, *'1' — child + * porn,, *'2' — extremism,, *'3' — violence,, *'4' — drugs propaganda,, *'5' — adult materials,, *'6' + * — insult. + * @see MarketReportCommentReason + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function reportComment(string $access_token, array $params = array()) { + return $this->request->post('market.reportComment', $access_token, $params); + } + + /** + * Restores recently deleted item + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an item owner community. + * - integer item_id: Deleted item ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function restore(string $access_token, array $params = array()) { + return $this->request->post('market.restore', $access_token, $params); + } + + /** + * Restores a recently deleted comment + * + * @param $access_token string + * @param $params array + * - integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' + * parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community + * " + * - integer comment_id: deleted comment id + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function restoreComment(string $access_token, array $params = array()) { + return $this->request->post('market.restoreComment', $access_token, $params); + } + + /** + * Searches market items in a community's catalog + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of an items owner community. + * - integer album_id: + * - string q: Search query, for example "pink slippers". + * - integer price_from: Minimum item price value. + * - integer price_to: Maximum item price value. + * - MarketSearchSort sort: + * @see MarketSearchSort + * - MarketSearchRev rev: '0' — do not use reverse order, '1' — use reverse order + * @see MarketSearchRev + * - integer offset: Offset needed to return a specific subset of results. + * - integer count: Number of items to return. + * - boolean extended: '1' - to return additional fields: 'likes, can_comment, car_repost, photos'. By + * default: '0'. + * - MarketSearchStatus status: + * @see MarketSearchStatus + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('market.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Messages.php b/src/VK/Actions/Messages.php index 4c6279d..fad8f81 100644 --- a/src/VK/Actions/Messages.php +++ b/src/VK/Actions/Messages.php @@ -1,761 +1,920 @@ request = $request; - } - - /** - * Adds a new user to a chat. - * - * @param string $access_token - * @param array $params - * - @var integer chat_id: Chat ID. - * - @var integer user_id: ID of the user to be added to the chat. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @throws VKApiMessagesChatNotAdminException You are not admin of this chat - * @throws VKApiMessagesMessageRequestAlreadySentException Message request already sent - * @throws VKApiMessagesContactNotFoundException Contact not found - * @return mixed - */ - public function addChatUser($access_token, array $params = []) { - return $this->request->post('messages.addChatUser', $access_token, $params); - } - - /** - * Allows sending messages from community to the current user. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Group ID. - * - @var string key - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function allowMessagesFromGroup($access_token, array $params = []) { - return $this->request->post('messages.allowMessagesFromGroup', $access_token, $params); - } - - /** - * Creates a chat with several participants. - * - * @param string $access_token - * @param array $params - * - @var array[integer] user_ids: IDs of the users to be added to the chat. - * - @var string title: Chat title. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesContactNotFoundException Contact not found - * @return mixed - */ - public function createChat($access_token, array $params = []) { - return $this->request->post('messages.createChat', $access_token, $params); - } - - /** - * Deletes one or more messages. - * - * @param string $access_token - * @param array $params - * - @var array[integer] message_ids: Message IDs. - * - @var boolean spam: '1' — to mark message as spam. - * - @var integer group_id: Group ID (for group messages with user access token) - * - @var boolean delete_for_all: '1' — delete message for for all. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesCantDeleteForAllException Can't delete this message for everybody - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('messages.delete', $access_token, $params); - } - - /** - * Deletes a chat's cover picture. - * - * @param string $access_token - * @param array $params - * - @var integer chat_id: Chat ID. - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesChatNotAdminException You are not admin of this chat - * @return mixed - */ - public function deleteChatPhoto($access_token, array $params = []) { - return $this->request->post('messages.deleteChatPhoto', $access_token, $params); - } - - /** - * Deletes all private messages in a conversation. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. To clear a chat history use 'chat_id' - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - @var integer group_id: Group ID (for group messages with user access token) - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesContactNotFoundException Contact not found - * @return mixed - */ - public function deleteConversation($access_token, array $params = []) { - return $this->request->post('messages.deleteConversation', $access_token, $params); - } - - /** - * Denies sending message from community to the current user. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Group ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function denyMessagesFromGroup($access_token, array $params = []) { - return $this->request->post('messages.denyMessagesFromGroup', $access_token, $params); - } - - /** - * Edits the message. - * - * @param string $access_token - * @param array $params - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - @var string message: (Required if 'attachments' is not set.) Text of the message. - * - @var integer message_id - * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - @var string attachment: (Required if 'message' is not set.) List of objects attached to the message, separated by commas, in the following format: "_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'wall' — wall post, '' — ID of the media attachment owner. '' — media attachment ID. Example: "photo100172_166443618" - * - @var boolean keep_forward_messages: '1' — to keep forwarded, messages. - * - @var boolean keep_snippets: '1' — to keep attached snippets. - * - @var integer group_id: Group ID (for group messages with user access token) - * - @var boolean dont_parse_links - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesDenySendException Can't send messages for users without permission - * @throws VKApiMessagesEditExpiredException Can't edit this message, because it's too old - * @throws VKApiMessagesTooBigException Can't sent this message, because it's too big - * @throws VKApiMessagesEditKindDisallowedException Can't edit this kind of message - * @throws VKApiMessagesTooLongMessageException Message is too long - * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat - * @throws VKApiMessagesKeyboardInvalidException Keyboard format is invalid - * @throws VKApiMessagesTooManyPostsException Too many posts in messages - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('messages.edit', $access_token, $params); - } - - /** - * Edits the title of a chat. - * - * @param string $access_token - * @param array $params - * - @var integer chat_id: Chat ID. - * - @var string title: New title of the chat. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesChatNotAdminException You are not admin of this chat - * @return mixed - */ - public function editChat($access_token, array $params = []) { - return $this->request->post('messages.editChat', $access_token, $params); - } - - /** - * Returns messages by their IDs within the conversation. - * - * @param string $access_token - * @param array $params - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - @var array[integer] conversation_message_ids: Conversation message IDs. - * - @var boolean extended: Information whether the response should be extended - * - @var array[MessagesFields] fields: Profile fields to return. - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getByConversationMessageId($access_token, array $params = []) { - return $this->request->post('messages.getByConversationMessageId', $access_token, $params); - } - - /** - * Returns messages by their IDs. - * - * @param string $access_token - * @param array $params - * - @var array[integer] message_ids: Message IDs. - * - @var integer preview_length: Number of characters after which to truncate a previewed message. To preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by words." - * - @var boolean extended: Information whether the response should be extended - * - @var array[MessagesFields] fields: Profile fields to return. - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('messages.getById', $access_token, $params); - } - - /** - * @param string $access_token - * @param array $params - * - @var integer peer_id - * - @var string link: Invitation link. - * - @var array[MessagesFields] fields: Profile fields to return. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat - * @return mixed - */ - public function getChatPreview($access_token, array $params = []) { - return $this->request->post('messages.getChatPreview', $access_token, $params); - } - - /** - * Returns a list of IDs of users participating in a chat. - * - * @param string $access_token - * @param array $params - * - @var integer peer_id: Peer ID. - * - @var array[MessagesFields] fields: Profile fields to return. - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat - * @return mixed - */ - public function getConversationMembers($access_token, array $params = []) { - return $this->request->post('messages.getConversationMembers', $access_token, $params); - } - - /** - * Returns a list of the current user's conversations. - * - * @param string $access_token - * @param array $params - * - @var integer offset: Offset needed to return a specific subset of conversations. - * - @var integer count: Number of conversations to return. - * - @var MessagesFilter filter: Filter to apply: 'all' — all conversations, 'unread' — conversations with unread messages, 'important' — conversations, marked as important (only for community messages), 'unanswered' — conversations, marked as unanswered (only for community messages) - * - @var boolean extended: '1' — return extra information about users and communities - * - @var integer start_message_id: ID of the message from what to return dialogs. - * - @var array[MessagesFields] fields: Profile and communities fields to return. - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesContactNotFoundException Contact not found - * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat - * @return mixed - */ - public function getConversations($access_token, array $params = []) { - return $this->request->post('messages.getConversations', $access_token, $params); - } - - /** - * Returns conversations by their IDs - * - * @param string $access_token - * @param array $params - * - @var array[integer] peer_ids: Destination IDs. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - @var boolean extended: Return extended properties - * - @var array[MessagesFields] fields: Profile and communities fields to return. - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesChatNotExistException Chat does not exist - * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat - * @throws VKApiMessagesContactNotFoundException Contact not found - * @return mixed - */ - public function getConversationsById($access_token, array $params = []) { - return $this->request->post('messages.getConversationsById', $access_token, $params); - } - - /** - * Returns message history for the specified user or group chat. - * - * @param string $access_token - * @param array $params - * - @var integer offset: Offset needed to return a specific subset of messages. - * - @var integer count: Number of messages to return. - * - @var integer user_id: ID of the user whose message history you want to return. - * - @var integer peer_id - * - @var integer start_message_id: Starting message ID from which to return history. - * - @var MessagesRev rev: Sort order: '1' — return messages in chronological order. '0' — return messages in reverse chronological order. - * - @var boolean extended: Information whether the response should be extended - * - @var array[MessagesFields] fields: Profile fields to return. - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesContactNotFoundException Contact not found - * @return mixed - */ - public function getHistory($access_token, array $params = []) { - return $this->request->post('messages.getHistory', $access_token, $params); - } - - /** - * Returns media files from the dialog or group chat. - * - * @param string $access_token - * @param array $params - * - @var integer peer_id: Peer ID. ", For group chat: '2000000000 + chat ID' , , For community: '-community ID'" - * - @var MessagesMediaType media_type: Type of media files to return: *'photo',, *'video',, *'audio',, *'doc',, *'link'.,*'market'.,*'wall'.,*'share' - * - @var string start_from: Message ID to start return results from. - * - @var integer count: Number of objects to return. - * - @var boolean photo_sizes: '1' — to return photo sizes in a - * - @var array[MessagesFields] fields: Additional profile [vk.com/dev/fields|fields] to return. - * - @var integer group_id: Group ID (for group messages with group access token) - * - @var boolean preserve_order - * - @var integer max_forwards_level - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getHistoryAttachments($access_token, array $params = []) { - return $this->request->post('messages.getHistoryAttachments', $access_token, $params); - } - - /** - * Returns important messages from the dialog or group chat. - * - * @param string $access_token - * @param array $params - * - @var integer count: Number of objects to return. - * - @var integer offset: Offset needed to return a specific subset of messages. - * - @var string start_message_id: Message ID to start return results from. - * - @var integer preview_length - * - @var array[MessagesFields] fields: Additional profile [vk.com/dev/fields|fields] to return. - * - @var boolean extended: '1' — return extra information about users and communities - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getImportantMessages($access_token, array $params = []) { + /** + * @var VKApiRequest + */ + private $request; + + /** + * Messages constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Adds a new user to a chat. + * + * @param $access_token string + * @param $params array + * - integer chat_id: Chat ID. + * - integer user_id: ID of the user to be added to the chat. + * - integer visible_messages_count: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function addChatUser(string $access_token, array $params = array()) { + return $this->request->post('messages.addChatUser', $access_token, $params); + } + + /** + * Allows sending messages from community to the current user. + * + * @param $access_token string + * @param $params array + * - integer group_id: Group ID. + * - string key: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function allowMessagesFromGroup(string $access_token, array $params = array()) { + return $this->request->post('messages.allowMessagesFromGroup', $access_token, $params); + } + + /** + * Creates a chat with several participants. + * + * @param $access_token string + * @param $params array + * - array user_ids: IDs of the users to be added to the chat. + * - string title: Chat title. + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function createChat(string $access_token, array $params = array()) { + return $this->request->post('messages.createChat', $access_token, $params); + } + + /** + * Deletes one or more messages. + * + * @param $access_token string + * @param $params array + * - array message_ids: Message IDs. + * - boolean spam: '1' — to mark message as spam. + * - integer group_id: Group ID (for group messages with user access token) + * - boolean delete_for_all: '1' — delete message for for all. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('messages.delete', $access_token, $params); + } + + /** + * Deletes a chat's cover picture. + * + * @param $access_token string + * @param $params array + * - integer chat_id: Chat ID. + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function deleteChatPhoto(string $access_token, array $params = array()) { + return $this->request->post('messages.deleteChatPhoto', $access_token, $params); + } + + /** + * Deletes all private messages in a conversation. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. To clear a chat history use 'chat_id' + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - integer group_id: Group ID (for group messages with user access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function deleteConversation(string $access_token, array $params = array()) { + return $this->request->post('messages.deleteConversation', $access_token, $params); + } + + /** + * Denies sending message from community to the current user. + * + * @param $access_token string + * @param $params array + * - integer group_id: Group ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function denyMessagesFromGroup(string $access_token, array $params = array()) { + return $this->request->post('messages.denyMessagesFromGroup', $access_token, $params); + } + + /** + * Edits the message. + * + * @param $access_token string + * @param $params array + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - string message: (Required if 'attachments' is not set.) Text of the message. + * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - string attachment: (Required if 'message' is not set.) List of objects attached to the message, + * separated by commas, in the following format: "_", '' — Type of media attachment: + * 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'wall' — wall post, + * '' — ID of the media attachment owner. '' — media attachment ID. Example: + * "photo100172_166443618" + * - boolean keep_forward_messages: '1' — to keep forwarded, messages. + * - boolean keep_snippets: '1' — to keep attached snippets. + * - integer group_id: Group ID (for group messages with user access token) + * - boolean dont_parse_links: + * - integer message_id: + * - integer conversation_message_id: + * - string template: + * - string keyboard: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('messages.edit', $access_token, $params); + } + + /** + * Edits the title of a chat. + * + * @param $access_token string + * @param $params array + * - integer chat_id: Chat ID. + * - string title: New title of the chat. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function editChat(string $access_token, array $params = array()) { + return $this->request->post('messages.editChat', $access_token, $params); + } + + /** + * Returns messages by their IDs within the conversation. + * + * @param $access_token string + * @param $params array + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - array conversation_message_ids: Conversation message IDs. + * - boolean extended: Information whether the response should be extended + * - array fields: Profile fields to return. + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getByConversationMessageId(string $access_token, array $params = array()) { + return $this->request->post('messages.getByConversationMessageId', $access_token, $params); + } + + /** + * Returns messages by their IDs. + * + * @param $access_token string + * @param $params array + * - array message_ids: Message IDs. + * - integer preview_length: Number of characters after which to truncate a previewed message. To preview + * the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by + * words." + * - boolean extended: Information whether the response should be extended + * - array fields: Profile fields to return. + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('messages.getById', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer peer_id: + * - string link: Invitation link. + * - array fields: Profile fields to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getChatPreview(string $access_token, array $params = array()) { + return $this->request->post('messages.getChatPreview', $access_token, $params); + } + + /** + * Returns a list of IDs of users participating in a chat. + * + * @param $access_token string + * @param $params array + * - integer peer_id: Peer ID. + * - array fields: Profile fields to return. + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getConversationMembers(string $access_token, array $params = array()) { + return $this->request->post('messages.getConversationMembers', $access_token, $params); + } + + /** + * Returns a list of the current user's conversations. + * + * @param $access_token string + * @param $params array + * - integer offset: Offset needed to return a specific subset of conversations. + * - integer count: Number of conversations to return. + * - MessagesGetConversationsFilter filter: Filter to apply: 'all' — all conversations, 'unread' — + * conversations with unread messages, 'important' — conversations, marked as important (only for community + * messages), 'unanswered' — conversations, marked as unanswered (only for community messages) + * @see MessagesGetConversationsFilter + * - boolean extended: '1' — return extra information about users and communities + * - integer start_message_id: ID of the message from what to return dialogs. + * - array fields: Profile and communities fields to return. + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function getConversations(string $access_token, array $params = array()) { + return $this->request->post('messages.getConversations', $access_token, $params); + } + + /** + * Returns conversations by their IDs + * + * @param $access_token string + * @param $params array + * - array peer_ids: Destination IDs. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - boolean extended: Return extended properties + * - array fields: Profile and communities fields to return. + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function getConversationsById(string $access_token, array $params = array()) { + return $this->request->post('messages.getConversationsById', $access_token, $params); + } + + /** + * Returns message history for the specified user or group chat. + * + * @param $access_token string + * @param $params array + * - integer offset: Offset needed to return a specific subset of messages. + * - integer count: Number of messages to return. + * - integer user_id: ID of the user whose message history you want to return. + * - integer peer_id: + * - integer start_message_id: Starting message ID from which to return history. + * - MessagesGetHistoryRev rev: Sort order: '1' — return messages in chronological order. '0' — return + * messages in reverse chronological order. + * @see MessagesGetHistoryRev + * - boolean extended: Information whether the response should be extended + * - array fields: Profile fields to return. + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getHistory(string $access_token, array $params = array()) { + return $this->request->post('messages.getHistory', $access_token, $params); + } + + /** + * Returns media files from the dialog or group chat. + * + * @param $access_token string + * @param $params array + * - integer peer_id: Peer ID. ", For group chat: '2000000000 + chat ID' , , For community: '-community + * ID'" + * - MessagesGetHistoryAttachmentsMediaType media_type: Type of media files to return: *'photo',, + * *'video',, *'audio',, *'doc',, *'link'.,*'market'.,*'wall'.,*'share' + * @see MessagesGetHistoryAttachmentsMediaType + * - string start_from: Message ID to start return results from. + * - integer count: Number of objects to return. + * - boolean photo_sizes: '1' — to return photo sizes in a + * - array fields: Additional profile [vk.com/dev/fields|fields] to return. + * - integer group_id: Group ID (for group messages with group access token) + * - boolean preserve_order: + * - integer max_forwards_level: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getHistoryAttachments(string $access_token, array $params = array()) { + return $this->request->post('messages.getHistoryAttachments', $access_token, $params); + } + + /** + * Returns a list of user's important messages. + * + * @param $access_token string + * @param $params array + * - integer count: Amount of needed important messages. + * - integer offset: + * - integer start_message_id: + * - integer preview_length: Maximum length of messages body. + * - array fields: Actors fields to return. + * - boolean extended: Return extended properties + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getImportantMessages(string $access_token, array $params = array()) { return $this->request->post('messages.getImportantMessages', $access_token, $params); } - /** - * @param string $access_token - * @param array $params - * - @var integer peer_id: Destination ID. - * - @var boolean reset: 1 — to generate new link (revoke previous), 0 — to return previous link. - * - @var integer group_id: Group ID - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesCantSeeInviteLinkException You can't see invite link for this chat - * @throws VKApiMessagesCantChangeInviteLinkException You can't change invite link for this chat - * @return mixed - */ - public function getInviteLink($access_token, array $params = []) { - return $this->request->post('messages.getInviteLink', $access_token, $params); - } - - /** - * Returns a user's current status and date of last activity. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getLastActivity($access_token, array $params = []) { - return $this->request->post('messages.getLastActivity', $access_token, $params); - } - - /** - * Returns updates in user's private messages. - * - * @param string $access_token - * @param array $params - * - @var integer ts: Last value of the 'ts' parameter returned from the Long Poll server or by using [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. - * - @var integer pts: Lsat value of 'pts' parameter returned from the Long Poll server or by using [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. - * - @var integer preview_length: Number of characters after which to truncate a previewed message. To preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by words." - * - @var boolean onlines: '1' — to return history with online users only. - * - @var array[MessagesFields] fields: Additional profile [vk.com/dev/fields|fields] to return. - * - @var integer events_limit: Maximum number of events to return. - * - @var integer msgs_limit: Maximum number of messages to return. - * - @var integer max_msg_id: Maximum ID of the message among existing ones in the local copy. Both messages received with API methods (for example, , ), and data received from a Long Poll server (events with code 4) are taken into account. - * - @var integer group_id: Group ID (for group messages with user access token) - * - @var integer lp_version - * - @var integer last_n - * - @var boolean credentials - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesTooOldPtsException Value of ts or pts is too old - * @throws VKApiMessagesTooNewPtsException Value of ts or pts is too new - * @return mixed - */ - public function getLongPollHistory($access_token, array $params = []) { - return $this->request->post('messages.getLongPollHistory', $access_token, $params); - } - - /** - * Returns data required for connection to a Long Poll server. - * - * @param string $access_token - * @param array $params - * - @var boolean need_pts: '1' — to return the 'pts' field, needed for the [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. - * - @var integer group_id: Group ID (for group messages with user access token) - * - @var integer lp_version: Long poll version - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getLongPollServer($access_token, array $params = []) { - return $this->request->post('messages.getLongPollServer', $access_token, $params); - } - - /** - * Returns information whether sending messages from the community to current user is allowed. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Group ID. - * - @var integer user_id: User ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function isMessagesFromGroupAllowed($access_token, array $params = []) { - return $this->request->post('messages.isMessagesFromGroupAllowed', $access_token, $params); - } - - /** - * @param string $access_token - * @param array $params - * - @var string link: Invitation link. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat - * @throws VKApiLimitsException Out of limits - * @return mixed - */ - public function joinChatByInviteLink($access_token, array $params = []) { - return $this->request->post('messages.joinChatByInviteLink', $access_token, $params); - } - - /** - * Marks and unmarks conversations as unanswered. - * - * @param string $access_token - * @param array $params - * - @var integer peer_id: ID of conversation to mark as important. - * - @var boolean answered: '1' — to mark as answered, '0' — to remove the mark - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function markAsAnsweredConversation($access_token, array $params = []) { - return $this->request->post('messages.markAsAnsweredConversation', $access_token, $params); - } - - /** - * Marks and unmarks messages as important (starred). - * - * @param string $access_token - * @param array $params - * - @var array[integer] message_ids: IDs of messages to mark as important. - * - @var integer important: '1' — to add a star (mark as important), '0' — to remove the star - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function markAsImportant($access_token, array $params = []) { - return $this->request->post('messages.markAsImportant', $access_token, $params); - } - - /** - * Marks and unmarks conversations as important. - * - * @param string $access_token - * @param array $params - * - @var integer peer_id: ID of conversation to mark as important. - * - @var boolean important: '1' — to add a star (mark as important), '0' — to remove the star - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function markAsImportantConversation($access_token, array $params = []) { - return $this->request->post('messages.markAsImportantConversation', $access_token, $params); - } - - /** - * Marks messages as read. - * - * @param string $access_token - * @param array $params - * - @var array[integer] message_ids: IDs of messages to mark as read. - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - @var integer start_message_id: Message ID to start from. - * - @var integer group_id: Group ID (for group messages with user access token) - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function markAsRead($access_token, array $params = []) { - return $this->request->post('messages.markAsRead', $access_token, $params); - } - - /** - * Pin a message. - * - * @param string $access_token - * @param array $params - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " - * - @var integer message_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesChatNotAdminException You are not admin of this chat - * @throws VKApiMessagesCantPinOneTimeStoryException Cannot pin one-time story - * @return mixed - */ - public function pin($access_token, array $params = []) { - return $this->request->post('messages.pin', $access_token, $params); - } - - /** - * Allows the current user to leave a chat or, if the current user started the chat, allows the user to remove another user from the chat. - * - * @param string $access_token - * @param array $params - * - @var integer chat_id: Chat ID. - * - @var integer user_id: ID of the user to be removed from the chat. - * - @var integer member_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesChatNotAdminException You are not admin of this chat - * @throws VKApiMessagesChatUserNotInChatException User not found in chat - * @throws VKApiMessagesContactNotFoundException Contact not found - * @return mixed - */ - public function removeChatUser($access_token, array $params = []) { - return $this->request->post('messages.removeChatUser', $access_token, $params); - } - - /** - * Restores a deleted message. - * - * @param string $access_token - * @param array $params - * - @var integer message_id: ID of a previously-deleted message to restore. - * - @var integer group_id: Group ID (for group messages with user access token) - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function restore($access_token, array $params = []) { - return $this->request->post('messages.restore', $access_token, $params); - } - - /** - * Returns a list of the current user's private messages that match search criteria. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query string. - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - @var integer date: Date to search message before in Unixtime. - * - @var integer preview_length: Number of characters after which to truncate a previewed message. To preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by words." - * - @var integer offset: Offset needed to return a specific subset of messages. - * - @var integer count: Number of messages to return. - * - @var boolean extended - * - @var array[string] fields - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('messages.search', $access_token, $params); - } - - /** - * Returns a list of the current user's conversations that match search criteria. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query string. - * - @var integer count: Maximum number of results. - * - @var boolean extended: '1' — return extra information about users and communities - * - @var array[MessagesFields] fields: Profile fields to return. - * - @var integer group_id: Group ID (for group messages with user access token) - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function searchConversations($access_token, array $params = []) { - return $this->request->post('messages.searchConversations', $access_token, $params); - } - - /** - * Sends a message. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID (by default — current user). - * - @var integer random_id: Unique identifier to avoid resending the message. - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - @var string domain: User's short address (for example, 'illarionov'). - * - @var integer chat_id: ID of conversation the message will relate to. - * - @var array[integer] user_ids: IDs of message recipients (if new conversation shall be started). - * - @var string message: (Required if 'attachments' is not set.) Text of the message. - * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - @var string attachment: (Required if 'message' is not set.) List of objects attached to the message, separated by commas, in the following format: "_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'wall' — wall post, '' — ID of the media attachment owner. '' — media attachment ID. Example: "photo100172_166443618" - * - @var integer reply_to - * - @var array[integer] forward_messages: ID of forwarded messages, separated with a comma. Listed messages of the sender will be shown in the message body at the recipient's. Example: "123,431,544" - * - @var string forward - * - @var integer sticker_id: Sticker id. - * - @var integer group_id: Group ID (for group messages with group access token) - * - @var string keyboard - * - @var string payload - * - @var boolean dont_parse_links - * - @var boolean disable_mentions - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist - * @throws VKApiMessagesDenySendException Can't send messages for users without permission - * @throws VKApiMessagesPrivacyException Can't send messages to this user due to their privacy settings - * @throws VKApiMessagesTooLongMessageException Message is too long - * @throws VKApiMessagesTooLongForwardsException Too many forwarded messages - * @throws VKApiMessagesCantFwdException Can't forward these messages - * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat - * @throws VKApiMessagesKeyboardInvalidException Keyboard format is invalid - * @throws VKApiMessagesChatBotFeatureException This is a chat bot feature, change this status in settings - * @throws VKApiMessagesContactNotFoundException Contact not found - * @throws VKApiMessagesTooManyPostsException Too many posts in messages - * @return mixed - */ - public function send($access_token, array $params = []) { - return $this->request->post('messages.send', $access_token, $params); - } - - /** - * Sends a message event answer. - * - * @param string $access_token - * @param array $params - * - @var integer event_id: Event ID. - * - @var integer user_id: User ID (by default — current user). - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - @var string event_data - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function sendMessageEventAnswer($access_token, array $params = []) { + /** + * + * + * @param $access_token string + * @param $params array + * - MessagesGetIntentUsersIntent intent: + * @see MessagesGetIntentUsersIntent + * - integer subscribe_id: + * - integer offset: + * - integer count: + * - boolean extended: + * - array name_case: + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getIntentUsers(string $access_token, array $params = array()) { + return $this->request->post('messages.getIntentUsers', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer peer_id: Destination ID. + * - boolean reset: 1 — to generate new link (revoke previous), 0 — to return previous link. + * - integer group_id: Group ID + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function getInviteLink(string $access_token, array $params = array()) { + return $this->request->post('messages.getInviteLink', $access_token, $params); + } + + /** + * Returns a user's current status and date of last activity. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getLastActivity(string $access_token, array $params = array()) { + return $this->request->post('messages.getLastActivity', $access_token, $params); + } + + /** + * Returns updates in user's private messages. + * + * @param $access_token string + * @param $params array + * - integer ts: Last value of the 'ts' parameter returned from the Long Poll server or by using + * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. + * - integer pts: Lsat value of 'pts' parameter returned from the Long Poll server or by using + * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. + * - integer preview_length: Number of characters after which to truncate a previewed message. To preview + * the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by + * words." + * - boolean onlines: '1' — to return history with online users only. + * - array fields: Additional profile [vk.com/dev/fields|fields] to return. + * - integer events_limit: Maximum number of events to return. + * - integer msgs_limit: Maximum number of messages to return. + * - integer max_msg_id: Maximum ID of the message among existing ones in the local copy. Both messages + * received with API methods (for example, , ), and data received from a Long Poll server (events with code 4) + * are taken into account. + * - integer group_id: Group ID (for group messages with user access token) + * - integer lp_version: + * - integer last_n: + * - boolean credentials: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function getLongPollHistory(string $access_token, array $params = array()) { + return $this->request->post('messages.getLongPollHistory', $access_token, $params); + } + + /** + * Returns data required for connection to a Long Poll server. + * + * @param $access_token string + * @param $params array + * - boolean need_pts: '1' — to return the 'pts' field, needed for the + * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. + * - integer group_id: Group ID (for group messages with user access token) + * - integer lp_version: Long poll version + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getLongPollServer(string $access_token, array $params = array()) { + return $this->request->post('messages.getLongPollServer', $access_token, $params); + } + + /** + * Returns information whether sending messages from the community to current user is allowed. + * + * @param $access_token string + * @param $params array + * - integer group_id: Group ID. + * - integer user_id: User ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function isMessagesFromGroupAllowed(string $access_token, array $params = array()) { + return $this->request->post('messages.isMessagesFromGroupAllowed', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - string link: Invitation link. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function joinChatByInviteLink(string $access_token, array $params = array()) { + return $this->request->post('messages.joinChatByInviteLink', $access_token, $params); + } + + /** + * Marks and unmarks conversations as unanswered. + * + * @param $access_token string + * @param $params array + * - integer peer_id: ID of conversation to mark as important. + * - boolean answered: '1' — to mark as answered, '0' — to remove the mark + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function markAsAnsweredConversation(string $access_token, array $params = array()) { + return $this->request->post('messages.markAsAnsweredConversation', $access_token, $params); + } + + /** + * Marks and unmarks messages as important (starred). + * + * @param $access_token string + * @param $params array + * - array message_ids: IDs of messages to mark as important. + * - integer important: '1' — to add a star (mark as important), '0' — to remove the star + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function markAsImportant(string $access_token, array $params = array()) { + return $this->request->post('messages.markAsImportant', $access_token, $params); + } + + /** + * Marks and unmarks conversations as important. + * + * @param $access_token string + * @param $params array + * - integer peer_id: ID of conversation to mark as important. + * - boolean important: '1' — to add a star (mark as important), '0' — to remove the star + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function markAsImportantConversation(string $access_token, array $params = array()) { + return $this->request->post('messages.markAsImportantConversation', $access_token, $params); + } + + /** + * Marks messages as read. + * + * @param $access_token string + * @param $params array + * - array message_ids: IDs of messages to mark as read. + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - integer start_message_id: Message ID to start from. + * - integer group_id: Group ID (for group messages with user access token) + * - boolean mark_conversation_as_read: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function markAsRead(string $access_token, array $params = array()) { + return $this->request->post('messages.markAsRead', $access_token, $params); + } + + /** + * Pin a message. + * + * @param $access_token string + * @param $params array + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat + * ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * - integer message_id: Message ID + * - integer conversation_message_id: Conversation message ID + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function pin(string $access_token, array $params = array()) { + return $this->request->post('messages.pin', $access_token, $params); + } + + /** + * Allows the current user to leave a chat or, if the current user started the chat, allows the user to remove + * another user from the chat. + * + * @param $access_token string + * @param $params array + * - integer chat_id: Chat ID. + * - integer user_id: ID of the user to be removed from the chat. + * - integer member_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function removeChatUser(string $access_token, array $params = array()) { + return $this->request->post('messages.removeChatUser', $access_token, $params); + } + + /** + * Restores a deleted message. + * + * @param $access_token string + * @param $params array + * - integer message_id: ID of a previously-deleted message to restore. + * - integer group_id: Group ID (for group messages with user access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function restore(string $access_token, array $params = array()) { + return $this->request->post('messages.restore', $access_token, $params); + } + + /** + * Returns a list of the current user's private messages that match search criteria. + * + * @param $access_token string + * @param $params array + * - string q: Search query string. + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - integer date: Date to search message before in Unixtime. + * - integer preview_length: Number of characters after which to truncate a previewed message. To preview + * the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by + * words." + * - integer offset: Offset needed to return a specific subset of messages. + * - integer count: Number of messages to return. + * - boolean extended: + * - array fields: + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('messages.search', $access_token, $params); + } + + /** + * Returns a list of the current user's conversations that match search criteria. + * + * @param $access_token string + * @param $params array + * - string q: Search query string. + * - integer count: Maximum number of results. + * - boolean extended: '1' — return extra information about users and communities + * - array fields: Profile fields to return. + * - integer group_id: Group ID (for group messages with user access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function searchConversations(string $access_token, array $params = array()) { + return $this->request->post('messages.searchConversations', $access_token, $params); + } + + /** + * Sends a message. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID (by default — current user). + * - integer random_id: Unique identifier to avoid resending the message. + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - array peer_ids: IDs of message recipients. (See peer_id) + * - string domain: User's short address (for example, 'illarionov'). + * - integer chat_id: ID of conversation the message will relate to. + * - array user_ids: IDs of message recipients (if new conversation shall be started). + * - string message: (Required if 'attachments' is not set.) Text of the message. + * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - string attachment: (Required if 'message' is not set.) List of objects attached to the message, + * separated by commas, in the following format: "_", '' — Type of media attachment: + * 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'wall' — wall post, + * '' — ID of the media attachment owner. '' — media attachment ID. Example: + * "photo100172_166443618" + * - integer reply_to: + * - array forward_messages: ID of forwarded messages, separated with a comma. Listed messages of the + * sender will be shown in the message body at the recipient's. Example: "123,431,544" + * - string forward: JSON describing the forwarded message or reply + * - integer sticker_id: Sticker id. + * - integer group_id: Group ID (for group messages with group access token) + * - string keyboard: + * - string template: + * - string payload: + * - string content_source: JSON describing the content source in the message + * - boolean dont_parse_links: + * - boolean disable_mentions: + * - MessagesSendIntent intent: + * @see MessagesSendIntent + * - integer subscribe_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function send(string $access_token, array $params = array()) { + return $this->request->post('messages.send', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - string event_id: + * - integer user_id: + * - integer peer_id: + * - string event_data: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function sendMessageEventAnswer(string $access_token, array $params = array()) { return $this->request->post('messages.sendMessageEventAnswer', $access_token, $params); } - /** - * Changes the status of a user as typing in a conversation. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var string type: 'typing' — user has started to type. - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - @var integer group_id: Group ID (for group messages with group access token) - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesGroupPeerAccessException Your community can't interact with this peer - * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat - * @throws VKApiMessagesContactNotFoundException Contact not found - * @return mixed - */ - public function setActivity($access_token, array $params = []) { - return $this->request->post('messages.setActivity', $access_token, $params); - } - - /** - * Sets a previously-uploaded picture as the cover picture of a chat. - * - * @param string $access_token - * @param array $params - * - @var string file: Upload URL from the 'response' field returned by the [vk.com/dev/photos.getChatUploadServer|photos.getChatUploadServer] method upon successfully uploading an image. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiUploadException Upload error - * @throws VKApiPhotoChangedException Original photo was changed - * @throws VKApiMessagesChatNotAdminException You are not admin of this chat - * @return mixed - */ - public function setChatPhoto($access_token, array $params = []) { - return $this->request->post('messages.setChatPhoto', $access_token, $params); - } - - /** - * @param string $access_token - * @param array $params - * - @var integer peer_id - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesChatNotAdminException You are not admin of this chat - * @return mixed - */ - public function unpin($access_token, array $params = []) { - return $this->request->post('messages.unpin', $access_token, $params); - } + /** + * Changes the status of a user as typing in a conversation. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - MessagesSetActivityType type: 'typing' — user has started to type. + * @see MessagesSetActivityType + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - integer group_id: Group ID (for group messages with group access token) + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function setActivity(string $access_token, array $params = array()) { + return $this->request->post('messages.setActivity', $access_token, $params); + } + + /** + * Sets a previously-uploaded picture as the cover picture of a chat. + * + * @param $access_token string + * @param $params array + * - string file: Upload URL from the 'response' field returned by the + * [vk.com/dev/photos.getChatUploadServer|photos.getChatUploadServer] method upon successfully uploading an + * image. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function setChatPhoto(string $access_token, array $params = array()) { + return $this->request->post('messages.setChatPhoto', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - integer peer_id: + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function unpin(string $access_token, array $params = array()) { + return $this->request->post('messages.unpin', $access_token, $params); + } } diff --git a/src/VK/Actions/Newsfeed.php b/src/VK/Actions/Newsfeed.php index a5500ac..66c1ee6 100644 --- a/src/VK/Actions/Newsfeed.php +++ b/src/VK/Actions/Newsfeed.php @@ -1,288 +1,354 @@ request = $request; - } + /** + * Newsfeed constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Prevents news from specified users and communities from appearing in the current user's newsfeed. - * - * @param string $access_token - * @param array $params - * - @var array[integer] user_ids - * - @var array[integer] group_ids - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function addBan($access_token, array $params = []) { - return $this->request->post('newsfeed.addBan', $access_token, $params); - } + /** + * Prevents news from specified users and communities from appearing in the current user's newsfeed. + * + * @param $access_token string + * @param $params array + * - array user_ids: + * - array group_ids: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function addBan(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.addBan', $access_token, $params); + } - /** - * Allows news from previously banned users and communities to be shown in the current user's newsfeed. - * - * @param string $access_token - * @param array $params - * - @var array[integer] user_ids - * - @var array[integer] group_ids - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteBan($access_token, array $params = []) { - return $this->request->post('newsfeed.deleteBan', $access_token, $params); - } + /** + * Allows news from previously banned users and communities to be shown in the current user's newsfeed. + * + * @param $access_token string + * @param $params array + * - array user_ids: + * - array group_ids: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteBan(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.deleteBan', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer list_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteList($access_token, array $params = []) { - return $this->request->post('newsfeed.deleteList', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer list_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteList(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.deleteList', $access_token, $params); + } - /** - * Returns data required to show newsfeed for the current user. - * - * @param string $access_token - * @param array $params - * - @var array[NewsfeedFilters] filters: Filters to apply: 'post' — new wall posts, 'photo' — new photos, 'photo_tag' — new photo tags, 'wall_photo' — new wall photos, 'friend' — new friends, 'note' — new notes - * - @var boolean return_banned: '1' — to return news items from banned sources - * - @var integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago. - * - @var integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current time. - * - @var integer max_photos: Maximum number of photos to return. By default, '5'. - * - @var string source_ids: Sources to obtain news from, separated by commas. User IDs can be specified in formats '' or 'u' , where '' is the user's friend ID. Community IDs can be specified in formats '-' or 'g' , where '' is the community ID. If the parameter is not set, all of the user's friends and communities are returned, except for banned sources, which can be obtained with the [vk.com/dev/newsfeed.getBanned|newsfeed.getBanned] method. - * - @var string start_from: identifier required to get the next page of results. Value for this parameter is returned in 'next_from' field in a reply. - * - @var integer count: Number of news items to return (default 50, maximum 100). For auto feed, you can use the 'new_offset' parameter returned by this method. - * - @var array[NewsfeedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. - * - @var string section - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('newsfeed.get', $access_token, $params); - } + /** + * Returns data required to show newsfeed for the current user. + * + * @param $access_token string + * @param $params array + * - array filters: Filters to apply: 'post' — new wall posts, 'photo' — new photos, 'photo_tag' — + * new photo tags, 'wall_photo' — new wall photos, 'friend' — new friends + * - boolean return_banned: '1' — to return news items from banned sources + * - integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours + * ago. + * - integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current + * time. + * - integer max_photos: Maximum number of photos to return. By default, '5'. + * - string source_ids: Sources to obtain news from, separated by commas. User IDs can be specified in + * formats '' or 'u' , where '' is the user's friend ID. Community IDs can be specified in formats '-' or 'g' , + * where '' is the community ID. If the parameter is not set, all of the user's friends and communities are + * returned, except for banned sources, which can be obtained with the + * [vk.com/dev/newsfeed.getBanned|newsfeed.getBanned] method. + * - string start_from: identifier required to get the next page of results. Value for this parameter is + * returned in 'next_from' field in a reply. + * - integer count: Number of news items to return (default 50, maximum 100). For auto feed, you can use + * the 'new_offset' parameter returned by this method. + * - array fields: Additional fields of [vk.com/dev/fields|profiles] and + * [vk.com/dev/fields_groups|communities] to return. + * - string section: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.get', $access_token, $params); + } - /** - * Returns a list of users and communities banned from the current user's newsfeed. - * - * @param string $access_token - * @param array $params - * - @var boolean extended: '1' — return extra information about users and communities - * - @var array[NewsfeedFields] fields: Profile fields to return. - * - @var NewsfeedNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getBanned($access_token, array $params = []) { - return $this->request->post('newsfeed.getBanned', $access_token, $params); - } + /** + * Returns a list of users and communities banned from the current user's newsfeed. + * + * @param $access_token string + * @param $params array + * - boolean extended: '1' — return extra information about users and communities + * - array fields: Profile fields to return. + * - NewsfeedGetBannedNameCase name_case: Case for declension of user name and surname: 'nom' — + * nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , + * 'abl' — prepositional + * @see NewsfeedGetBannedNameCase + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getBanned(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.getBanned', $access_token, $params); + } - /** - * Returns a list of comments in the current user's newsfeed. - * - * @param string $access_token - * @param array $params - * - @var integer count: Number of comments to return. For auto feed, you can use the 'new_offset' parameter returned by this method. - * - @var array[NewsfeedFilters] filters: Filters to apply: 'post' — new comments on wall posts, 'photo' — new comments on photos, 'video' — new comments on videos, 'topic' — new comments on discussions, 'note' — new comments on notes, - * - @var string reposts: Object ID, comments on repost of which shall be returned, e.g. 'wall1_45486'. (If the parameter is set, the 'filters' parameter is optional.), - * - @var integer start_time: Earliest timestamp (in Unix time) of a comment to return. By default, 24 hours ago. - * - @var integer end_time: Latest timestamp (in Unix time) of a comment to return. By default, the current time. - * - @var integer last_comments_count - * - @var string start_from: Identificator needed to return the next page with results. Value for this parameter returns in 'next_from' field. - * - @var array[NewsfeedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getComments($access_token, array $params = []) { - return $this->request->post('newsfeed.getComments', $access_token, $params); - } + /** + * Returns a list of comments in the current user's newsfeed. + * + * @param $access_token string + * @param $params array + * - integer count: Number of comments to return. For auto feed, you can use the 'new_offset' parameter + * returned by this method. + * - array filters: Filters to apply: 'post' — new comments on wall posts, 'photo' — new comments on + * photos, 'video' — new comments on videos, 'topic' — new comments on discussions, 'note' — new comments + * on notes, + * - string reposts: Object ID, comments on repost of which shall be returned, e.g. 'wall1_45486'. (If the + * parameter is set, the 'filters' parameter is optional.), + * - integer start_time: Earliest timestamp (in Unix time) of a comment to return. By default, 24 hours + * ago. + * - integer end_time: Latest timestamp (in Unix time) of a comment to return. By default, the current + * time. + * - integer last_comments_count: + * - string start_from: Identificator needed to return the next page with results. Value for this + * parameter returns in 'next_from' field. + * - array fields: Additional fields of [vk.com/dev/fields|profiles] and + * [vk.com/dev/fields_groups|communities] to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getComments(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.getComments', $access_token, $params); + } - /** - * Returns a list of newsfeeds followed by the current user. - * - * @param string $access_token - * @param array $params - * - @var array[integer] list_ids: numeric list identifiers. - * - @var boolean extended: Return additional list info - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getLists($access_token, array $params = []) { - return $this->request->post('newsfeed.getLists', $access_token, $params); - } + /** + * Returns a list of newsfeeds followed by the current user. + * + * @param $access_token string + * @param $params array + * - array list_ids: numeric list identifiers. + * - boolean extended: Return additional list info + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getLists(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.getLists', $access_token, $params); + } - /** - * Returns a list of posts on user walls in which the current user is mentioned. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: Owner ID. - * - @var integer start_time: Earliest timestamp (in Unix time) of a post to return. By default, 24 hours ago. - * - @var integer end_time: Latest timestamp (in Unix time) of a post to return. By default, the current time. - * - @var integer offset: Offset needed to return a specific subset of posts. - * - @var integer count: Number of posts to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getMentions($access_token, array $params = []) { - return $this->request->post('newsfeed.getMentions', $access_token, $params); - } + /** + * Returns a list of posts on user walls in which the current user is mentioned. + * + * @param $access_token string + * @param $params array + * - integer owner_id: Owner ID. + * - integer start_time: Earliest timestamp (in Unix time) of a post to return. By default, 24 hours ago. + * - integer end_time: Latest timestamp (in Unix time) of a post to return. By default, the current time. + * - integer offset: Offset needed to return a specific subset of posts. + * - integer count: Number of posts to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getMentions(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.getMentions', $access_token, $params); + } - /** - * , Returns a list of newsfeeds recommended to the current user. - * - * @param string $access_token - * @param array $params - * - @var integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago. - * - @var integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current time. - * - @var integer max_photos: Maximum number of photos to return. By default, '5'. - * - @var string start_from: 'new_from' value obtained in previous call. - * - @var integer count: Number of news items to return. - * - @var array[NewsfeedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getRecommended($access_token, array $params = []) { - return $this->request->post('newsfeed.getRecommended', $access_token, $params); - } + /** + * , Returns a list of newsfeeds recommended to the current user. + * + * @param $access_token string + * @param $params array + * - integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours + * ago. + * - integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current + * time. + * - integer max_photos: Maximum number of photos to return. By default, '5'. + * - string start_from: 'new_from' value obtained in previous call. + * - integer count: Number of news items to return. + * - array fields: Additional fields of [vk.com/dev/fields|profiles] and + * [vk.com/dev/fields_groups|communities] to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getRecommended(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.getRecommended', $access_token, $params); + } - /** - * Returns communities and users that current user is suggested to follow. - * - * @param string $access_token - * @param array $params - * - @var integer offset: offset required to choose a particular subset of communities or users. - * - @var integer count: amount of communities or users to return. - * - @var boolean shuffle: shuffle the returned list or not. - * - @var array[NewsfeedFields] fields: list of extra fields to be returned. See available fields for [vk.com/dev/fields|users] and [vk.com/dev/fields_groups|communities]. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getSuggestedSources($access_token, array $params = []) { - return $this->request->post('newsfeed.getSuggestedSources', $access_token, $params); - } + /** + * Returns communities and users that current user is suggested to follow. + * + * @param $access_token string + * @param $params array + * - integer offset: offset required to choose a particular subset of communities or users. + * - integer count: amount of communities or users to return. + * - boolean shuffle: shuffle the returned list or not. + * - array fields: list of extra fields to be returned. See available fields for [vk.com/dev/fields|users] + * and [vk.com/dev/fields_groups|communities]. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSuggestedSources(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.getSuggestedSources', $access_token, $params); + } - /** - * Hides an item from the newsfeed. - * - * @param string $access_token - * @param array $params - * - @var IgnoreItemType type: Item type. Possible values: *'wall' – post on the wall,, *'tag' – tag on a photo,, *'profilephoto' – profile photo,, *'video' – video,, *'audio' – audio. - * - @var integer owner_id: Item owner's identifier (user or community), "Note that community id must be negative. 'owner_id=1' – user , 'owner_id=-1' – community " - * - @var integer item_id: Item identifier - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function ignoreItem($access_token, array $params = []) { - return $this->request->post('newsfeed.ignoreItem', $access_token, $params); - } + /** + * Hides an item from the newsfeed. + * + * @param $access_token string + * @param $params array + * - string type: Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a photo,, + * *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. + * - integer owner_id: Item owner's identifier (user or community), "Note that community id must be + * negative. 'owner_id=1' - user , 'owner_id=-1' - community " + * - integer item_id: Item identifier + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function ignoreItem(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.ignoreItem', $access_token, $params); + } - /** - * Creates and edits user newsfeed lists - * - * @param string $access_token - * @param array $params - * - @var integer list_id: numeric list identifier (if not sent, will be set automatically). - * - @var string title: list name. - * - @var array[integer] source_ids: users and communities identifiers to be added to the list. Community identifiers must be negative numbers. - * - @var boolean no_reposts: reposts display on and off ('1' is for off). - * @throws VKClientException - * @throws VKApiException - * @throws VKApiTooManyListsException Too many feed lists - * @return mixed - */ - public function saveList($access_token, array $params = []) { - return $this->request->post('newsfeed.saveList', $access_token, $params); - } + /** + * Creates and edits user newsfeed lists + * + * @param $access_token string + * @param $params array + * - integer list_id: numeric list identifier (if not sent, will be set automatically). + * - string title: list name. + * - array source_ids: users and communities identifiers to be added to the list. Community identifiers + * must be negative numbers. + * - boolean no_reposts: reposts display on and off ('1' is for off). + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function saveList(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.saveList', $access_token, $params); + } - /** - * Returns search results by statuses. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query string (e.g., 'New Year'). - * - @var boolean extended: '1' — to return additional information about the user or community that placed the post. - * - @var integer count: Number of posts to return. - * - @var number latitude: Geographical latitude point (in degrees, -90 to 90) within which to search. - * - @var number longitude: Geographical longitude point (in degrees, -180 to 180) within which to search. - * - @var integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago. - * - @var integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current time. - * - @var string start_from - * - @var array[NewsfeedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('newsfeed.search', $access_token, $params); - } + /** + * Returns search results by statuses. + * + * @param $access_token string + * @param $params array + * - string q: Search query string (e.g., 'New Year'). + * - boolean extended: '1' — to return additional information about the user or community that placed + * the post. + * - integer count: Number of posts to return. + * - number latitude: Geographical latitude point (in degrees, -90 to 90) within which to search. + * - number longitude: Geographical longitude point (in degrees, -180 to 180) within which to search. + * - integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours + * ago. + * - integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current + * time. + * - string start_from: + * - array fields: Additional fields of [vk.com/dev/fields|profiles] and + * [vk.com/dev/fields_groups|communities] to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.search', $access_token, $params); + } - /** - * Returns a hidden item to the newsfeed. - * - * @param string $access_token - * @param array $params - * - @var IgnoreItemType type: Item type. Possible values: *'wall' – post on the wall,, *'tag' – tag on a photo,, *'profilephoto' – profile photo,, *'video' – video,, *'audio' – audio. - * - @var integer owner_id: Item owner's identifier (user or community), "Note that community id must be negative. 'owner_id=1' – user , 'owner_id=-1' – community " - * - @var integer item_id: Item identifier - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function unignoreItem($access_token, array $params = []) { - return $this->request->post('newsfeed.unignoreItem', $access_token, $params); - } + /** + * Returns a hidden item to the newsfeed. + * + * @param $access_token string + * @param $params array + * - string type: Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a photo,, + * *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. + * - integer owner_id: Item owner's identifier (user or community), "Note that community id must be + * negative. 'owner_id=1' - user , 'owner_id=-1' - community " + * - integer item_id: Item identifier + * - string track_code: Track code of unignored item + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function unignoreItem(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.unignoreItem', $access_token, $params); + } - /** - * Unsubscribes the current user from specified newsfeeds. - * - * @param string $access_token - * @param array $params - * - @var NewsfeedType type: Type of object from which to unsubscribe: 'note' — note, 'photo' — photo, 'post' — post on user wall or community wall, 'topic' — topic, 'video' — video - * - @var integer owner_id: Object owner ID. - * - @var integer item_id: Object ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function unsubscribe($access_token, array $params = []) { - return $this->request->post('newsfeed.unsubscribe', $access_token, $params); - } + /** + * Unsubscribes the current user from specified newsfeeds. + * + * @param $access_token string + * @param $params array + * - NewsfeedUnsubscribeType type: Type of object from which to unsubscribe: 'note' — note, 'photo' — + * photo, 'post' — post on user wall or community wall, 'topic' — topic, 'video' — video + * @see NewsfeedUnsubscribeType + * - integer owner_id: Object owner ID. + * - integer item_id: Object ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function unsubscribe(string $access_token, array $params = array()) { + return $this->request->post('newsfeed.unsubscribe', $access_token, $params); + } } diff --git a/src/VK/Actions/Notes.php b/src/VK/Actions/Notes.php index f77f024..e4cf751 100644 --- a/src/VK/Actions/Notes.php +++ b/src/VK/Actions/Notes.php @@ -1,207 +1,226 @@ request = $request; - } + /** + * Notes constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Creates a new note for the current user. - * - * @param string $access_token - * @param array $params - * - @var string title: Note title. - * - @var string text: Note text. - * - @var array[string] privacy_view - * - @var array[string] privacy_comment - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function add($access_token, array $params = []) { - return $this->request->post('notes.add', $access_token, $params); - } + /** + * Creates a new note for the current user. + * + * @param $access_token string + * @param $params array + * - string title: Note title. + * - string text: Note text. + * - array privacy_view: + * - array privacy_comment: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function add(string $access_token, array $params = array()) { + return $this->request->post('notes.add', $access_token, $params); + } - /** - * Adds a new comment on a note. - * - * @param string $access_token - * @param array $params - * - @var integer note_id: Note ID. - * - @var integer owner_id: Note owner ID. - * - @var integer reply_to: ID of the user to whom the reply is addressed (if the comment is a reply to another comment). - * - @var string message: Comment text. - * - @var string guid - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessNoteException Access to note denied - * @throws VKApiAccessNoteCommentException You can't comment this note - * @return mixed - */ - public function createComment($access_token, array $params = []) { - return $this->request->post('notes.createComment', $access_token, $params); - } + /** + * Adds a new comment on a note. + * + * @param $access_token string + * @param $params array + * - integer note_id: Note ID. + * - integer owner_id: Note owner ID. + * - integer reply_to: ID of the user to whom the reply is addressed (if the comment is a reply to another + * comment). + * - string message: Comment text. + * - string guid: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function createComment(string $access_token, array $params = array()) { + return $this->request->post('notes.createComment', $access_token, $params); + } - /** - * Deletes a note of the current user. - * - * @param string $access_token - * @param array $params - * - @var integer note_id: Note ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamNoteIdException Note not found - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('notes.delete', $access_token, $params); - } + /** + * Deletes a note of the current user. + * + * @param $access_token string + * @param $params array + * - integer note_id: Note ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('notes.delete', $access_token, $params); + } - /** - * Deletes a comment on a note. - * - * @param string $access_token - * @param array $params - * - @var integer comment_id: Comment ID. - * - @var integer owner_id: Note owner ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessNoteException Access to note denied - * @throws VKApiAccessCommentException Access to comment denied - * @return mixed - */ - public function deleteComment($access_token, array $params = []) { - return $this->request->post('notes.deleteComment', $access_token, $params); - } + /** + * Deletes a comment on a note. + * + * @param $access_token string + * @param $params array + * - integer comment_id: Comment ID. + * - integer owner_id: Note owner ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function deleteComment(string $access_token, array $params = array()) { + return $this->request->post('notes.deleteComment', $access_token, $params); + } - /** - * Edits a note of the current user. - * - * @param string $access_token - * @param array $params - * - @var integer note_id: Note ID. - * - @var string title: Note title. - * - @var string text: Note text. - * - @var array[string] privacy_view - * - @var array[string] privacy_comment - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamNoteIdException Note not found - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('notes.edit', $access_token, $params); - } + /** + * Edits a note of the current user. + * + * @param $access_token string + * @param $params array + * - integer note_id: Note ID. + * - string title: Note title. + * - string text: Note text. + * - array privacy_view: + * - array privacy_comment: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('notes.edit', $access_token, $params); + } - /** - * Edits a comment on a note. - * - * @param string $access_token - * @param array $params - * - @var integer comment_id: Comment ID. - * - @var integer owner_id: Note owner ID. - * - @var string message: New comment text. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessCommentException Access to comment denied - * @return mixed - */ - public function editComment($access_token, array $params = []) { - return $this->request->post('notes.editComment', $access_token, $params); - } + /** + * Edits a comment on a note. + * + * @param $access_token string + * @param $params array + * - integer comment_id: Comment ID. + * - integer owner_id: Note owner ID. + * - string message: New comment text. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function editComment(string $access_token, array $params = array()) { + return $this->request->post('notes.editComment', $access_token, $params); + } - /** - * Returns a list of notes created by a user. - * - * @param string $access_token - * @param array $params - * - @var array[integer] note_ids: Note IDs. - * - @var integer user_id: Note owner ID. - * - @var integer offset - * - @var integer count: Number of notes to return. - * - @var NotesSort sort - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamNoteIdException Note not found - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('notes.get', $access_token, $params); - } + /** + * Returns a list of notes created by a user. + * + * @param $access_token string + * @param $params array + * - array note_ids: Note IDs. + * - integer user_id: Note owner ID. + * - integer offset: + * - integer count: Number of notes to return. + * - NotesGetSort sort: + * @see NotesGetSort + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('notes.get', $access_token, $params); + } - /** - * Returns a note by its ID. - * - * @param string $access_token - * @param array $params - * - @var integer note_id: Note ID. - * - @var integer owner_id: Note owner ID. - * - @var boolean need_wiki - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessNoteException Access to note denied - * @throws VKApiParamNoteIdException Note not found - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('notes.getById', $access_token, $params); - } + /** + * Returns a note by its ID. + * + * @param $access_token string + * @param $params array + * - integer note_id: Note ID. + * - integer owner_id: Note owner ID. + * - boolean need_wiki: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('notes.getById', $access_token, $params); + } - /** - * Returns a list of comments on a note. - * - * @param string $access_token - * @param array $params - * - @var integer note_id: Note ID. - * - @var integer owner_id: Note owner ID. - * - @var NotesSort sort - * - @var integer offset - * - @var integer count: Number of comments to return. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessNoteException Access to note denied - * @return mixed - */ - public function getComments($access_token, array $params = []) { - return $this->request->post('notes.getComments', $access_token, $params); - } + /** + * Returns a list of comments on a note. + * + * @param $access_token string + * @param $params array + * - integer note_id: Note ID. + * - integer owner_id: Note owner ID. + * - NotesGetCommentsSort sort: + * @see NotesGetCommentsSort + * - integer offset: + * - integer count: Number of comments to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getComments(string $access_token, array $params = array()) { + return $this->request->post('notes.getComments', $access_token, $params); + } - /** - * Restores a deleted comment on a note. - * - * @param string $access_token - * @param array $params - * - @var integer comment_id: Comment ID. - * - @var integer owner_id: Note owner ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessCommentException Access to comment denied - * @return mixed - */ - public function restoreComment($access_token, array $params = []) { - return $this->request->post('notes.restoreComment', $access_token, $params); - } + /** + * Restores a deleted comment on a note. + * + * @param $access_token string + * @param $params array + * - integer comment_id: Comment ID. + * - integer owner_id: Note owner ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function restoreComment(string $access_token, array $params = array()) { + return $this->request->post('notes.restoreComment', $access_token, $params); + } } diff --git a/src/VK/Actions/Notifications.php b/src/VK/Actions/Notifications.php index 48d0735..322574d 100644 --- a/src/VK/Actions/Notifications.php +++ b/src/VK/Actions/Notifications.php @@ -1,72 +1,92 @@ request = $request; - } + /** + * Notifications constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns a list of notifications about other users' feedback to the current user's wall posts. - * - * @param string $access_token - * @param array $params - * - @var integer count: Number of notifications to return. - * - @var string start_from - * - @var array[NotificationsFilters] filters: Type of notifications to return: 'wall' — wall posts, 'mentions' — mentions in wall posts, comments, or topics, 'comments' — comments to wall posts, photos, and videos, 'likes' — likes, 'reposted' — wall posts that are copied from the current user's wall, 'followers' — new followers, 'friends' — accepted friend requests - * - @var integer start_time: Earliest timestamp (in Unix time) of a notification to return. By default, 24 hours ago. - * - @var integer end_time: Latest timestamp (in Unix time) of a notification to return. By default, the current time. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('notifications.get', $access_token, $params); - } + /** + * Returns a list of notifications about other users' feedback to the current user's wall posts. + * + * @param $access_token string + * @param $params array + * - integer count: Number of notifications to return. + * - string start_from: + * - array filters: Type of notifications to return: 'wall' — wall posts, 'mentions' — mentions in + * wall posts, comments, or topics, 'comments' — comments to wall posts, photos, and videos, 'likes' — + * likes, 'reposted' — wall posts that are copied from the current user's wall, 'followers' — new + * followers, 'friends' — accepted friend requests + * - integer start_time: Earliest timestamp (in Unix time) of a notification to return. By default, 24 + * hours ago. + * - integer end_time: Latest timestamp (in Unix time) of a notification to return. By default, the + * current time. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('notifications.get', $access_token, $params); + } - /** - * Resets the counter of new notifications about other users' feedback to the current user's wall posts. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function markAsViewed($access_token) { - return $this->request->post('notifications.markAsViewed', $access_token); - } + /** + * Resets the counter of new notifications about other users' feedback to the current user's wall posts. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function markAsViewed(string $access_token, array $params = array()) { + return $this->request->post('notifications.markAsViewed', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var array[integer] user_ids - * - @var string message - * - @var string fragment - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiGroupAppIsNotInstalledInCommunityException Application is not installed in community - * @return mixed - */ - public function sendMessage($access_token, array $params = []) { - return $this->request->post('notifications.sendMessage', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - array user_ids: + * - string message: + * - string fragment: + * - integer group_id: + * - integer random_id: + * - NotificationsSendMessageSendingMode sending_mode: Type of sending (delivering) notifications: + * 'immediately' — push and bell notifications will be delivered as soon as possible, 'delayed' — push and + * bell notifications will be delivered in the most comfortable time for the user, 'delayed_push' — only push + * notifications will be delivered in the most comfortable time, while the bell notifications will be delivered + * as soon as possible + * @see NotificationsSendMessageSendingMode + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function sendMessage(string $access_token, array $params = array()) { + return $this->request->post('notifications.sendMessage', $access_token, $params); + } } diff --git a/src/VK/Actions/Orders.php b/src/VK/Actions/Orders.php index c84fb5a..c787b34 100644 --- a/src/VK/Actions/Orders.php +++ b/src/VK/Actions/Orders.php @@ -1,152 +1,179 @@ request = $request; - } + /** + * Orders constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * @param string $access_token - * @param array $params - * - @var integer user_id - * - @var integer subscription_id - * - @var boolean pending_cancel - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAppsSubscriptionNotFoundException Subscription not found - * @throws VKApiAppsSubscriptionInvalidStatusException Subscription is in invalid status - * @return mixed - */ - public function cancelSubscription($access_token, array $params = []) { - return $this->request->post('orders.cancelSubscription', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer subscription_id: + * - boolean pending_cancel: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function cancelSubscription(string $access_token, array $params = array()) { + return $this->request->post('orders.cancelSubscription', $access_token, $params); + } - /** - * Changes order status. - * - * @param string $access_token - * @param array $params - * - @var integer order_id: order ID. - * - @var OrdersAction action: action to be done with the order. Available actions: *cancel — to cancel unconfirmed order. *charge — to confirm unconfirmed order. Applies only if processing of [vk.com/dev/payments_status|order_change_state] notification failed. *refund — to cancel confirmed order. - * - @var integer app_order_id: internal ID of the order in the application. - * - @var boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By default — 0. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @throws VKApiActionFailedException Unable to process action - * @return mixed - */ - public function changeState($access_token, array $params = []) { - return $this->request->post('orders.changeState', $access_token, $params); - } + /** + * Changes order status. + * + * @param $access_token string + * @param $params array + * - integer order_id: order ID. + * - OrdersChangeStateAction action: action to be done with the order. Available actions: *cancel — to + * cancel unconfirmed order. *charge — to confirm unconfirmed order. Applies only if processing of + * [vk.com/dev/payments_status|order_change_state] notification failed. *refund — to cancel confirmed order. + * @see OrdersChangeStateAction + * - integer app_order_id: internal ID of the order in the application. + * - boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By + * default — 0. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function changeState(string $access_token, array $params = array()) { + return $this->request->post('orders.changeState', $access_token, $params); + } - /** - * Returns a list of orders. - * - * @param string $access_token - * @param array $params - * - @var integer offset - * - @var integer count: number of returned orders. - * - @var boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By default — 0. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('orders.get', $access_token, $params); - } + /** + * Returns a list of orders. + * + * @param $access_token string + * @param $params array + * - integer offset: + * - integer count: number of returned orders. + * - boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By + * default — 0. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('orders.get', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer user_id - * - @var array[string] votes - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getAmount($access_token, array $params = []) { - return $this->request->post('orders.getAmount', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - array votes: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAmount(string $access_token, array $params = array()) { + return $this->request->post('orders.getAmount', $access_token, $params); + } - /** - * Returns information about orders by their IDs. - * - * @param string $access_token - * @param array $params - * - @var integer order_id: order ID. - * - @var array[integer] order_ids: order IDs (when information about several orders is requested). - * - @var boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By default — 0. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('orders.getById', $access_token, $params); - } + /** + * Returns information about orders by their IDs. + * + * @param $access_token string + * @param $params array + * - integer order_id: order ID. + * - array order_ids: order IDs (when information about several orders is requested). + * - boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By + * default — 0. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('orders.getById', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer user_id - * - @var integer subscription_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAppsSubscriptionNotFoundException Subscription not found - * @return mixed - */ - public function getUserSubscriptionById($access_token, array $params = []) { - return $this->request->post('orders.getUserSubscriptionById', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer subscription_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getUserSubscriptionById(string $access_token, array $params = array()) { + return $this->request->post('orders.getUserSubscriptionById', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer user_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getUserSubscriptions($access_token, array $params = []) { - return $this->request->post('orders.getUserSubscriptions', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getUserSubscriptions(string $access_token, array $params = array()) { + return $this->request->post('orders.getUserSubscriptions', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer user_id - * - @var integer subscription_id - * - @var integer price - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAppsSubscriptionNotFoundException Subscription not found - * @throws VKApiAppsSubscriptionInvalidStatusException Subscription is in invalid status - * @return mixed - */ - public function updateSubscription($access_token, array $params = []) { - return $this->request->post('orders.updateSubscription', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer subscription_id: + * - integer price: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function updateSubscription(string $access_token, array $params = array()) { + return $this->request->post('orders.updateSubscription', $access_token, $params); + } } diff --git a/src/VK/Actions/Pages.php b/src/VK/Actions/Pages.php index fab4acf..d3e0a30 100644 --- a/src/VK/Actions/Pages.php +++ b/src/VK/Actions/Pages.php @@ -1,171 +1,187 @@ request = $request; - } + /** + * Pages constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Allows to clear the cache of particular 'external' pages which may be attached to VK posts. - * - * @param string $access_token - * @param array $params - * - @var string url: Address of the page where you need to refesh the cached version - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function clearCache($access_token, array $params = []) { - return $this->request->post('pages.clearCache', $access_token, $params); - } + /** + * Allows to clear the cache of particular 'external' pages which may be attached to VK posts. + * + * @param $access_token string + * @param $params array + * - string url: Address of the page where you need to refesh the cached version + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function clearCache(string $access_token, array $params = array()) { + return $this->request->post('pages.clearCache', $access_token, $params); + } - /** - * Returns information about a wiki page. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: Page owner ID. - * - @var integer page_id: Wiki page ID. - * - @var boolean global: '1' — to return information about a global wiki page - * - @var boolean site_preview: '1' — resulting wiki page is a preview for the attached link - * - @var string title: Wiki page title. - * - @var boolean need_source - * - @var boolean need_html: '1' — to return the page as HTML, - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('pages.get', $access_token, $params); - } + /** + * Returns information about a wiki page. + * + * @param $access_token string + * @param $params array + * - integer owner_id: Page owner ID. + * - integer page_id: Wiki page ID. + * - boolean global: '1' — to return information about a global wiki page + * - boolean site_preview: '1' — resulting wiki page is a preview for the attached link + * - string title: Wiki page title. + * - boolean need_source: + * - boolean need_html: '1' — to return the page as HTML, + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('pages.get', $access_token, $params); + } - /** - * Returns a list of all previous versions of a wiki page. - * - * @param string $access_token - * @param array $params - * - @var integer page_id: Wiki page ID. - * - @var integer group_id: ID of the community that owns the wiki page. - * - @var integer user_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessPageException Access to page denied - * @throws VKApiParamPageIdException Page not found - * @return mixed - */ - public function getHistory($access_token, array $params = []) { - return $this->request->post('pages.getHistory', $access_token, $params); - } + /** + * Returns a list of all previous versions of a wiki page. + * + * @param $access_token string + * @param $params array + * - integer page_id: Wiki page ID. + * - integer group_id: ID of the community that owns the wiki page. + * - integer user_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function getHistory(string $access_token, array $params = array()) { + return $this->request->post('pages.getHistory', $access_token, $params); + } - /** - * Returns a list of wiki pages in a group. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of the community that owns the wiki page. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessPageException Access to page denied - * @return mixed - */ - public function getTitles($access_token, array $params = []) { - return $this->request->post('pages.getTitles', $access_token, $params); - } + /** + * Returns a list of wiki pages in a group. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of the community that owns the wiki page. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getTitles(string $access_token, array $params = array()) { + return $this->request->post('pages.getTitles', $access_token, $params); + } - /** - * Returns the text of one of the previous versions of a wiki page. - * - * @param string $access_token - * @param array $params - * - @var integer version_id - * - @var integer group_id: ID of the community that owns the wiki page. - * - @var integer user_id - * - @var boolean need_html: '1' — to return the page as HTML - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessPageException Access to page denied - * @return mixed - */ - public function getVersion($access_token, array $params = []) { - return $this->request->post('pages.getVersion', $access_token, $params); - } + /** + * Returns the text of one of the previous versions of a wiki page. + * + * @param $access_token string + * @param $params array + * - integer version_id: + * - integer group_id: ID of the community that owns the wiki page. + * - integer user_id: + * - boolean need_html: '1' — to return the page as HTML + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getVersion(string $access_token, array $params = array()) { + return $this->request->post('pages.getVersion', $access_token, $params); + } - /** - * Returns HTML representation of the wiki markup. - * - * @param string $access_token - * @param array $params - * - @var string text: Text of the wiki page. - * - @var integer group_id: ID of the group in the context of which this markup is interpreted. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function parseWiki($access_token, array $params = []) { - return $this->request->post('pages.parseWiki', $access_token, $params); - } + /** + * Returns HTML representation of the wiki markup. + * + * @param $access_token string + * @param $params array + * - string text: Text of the wiki page. + * - integer group_id: ID of the group in the context of which this markup is interpreted. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function parseWiki(string $access_token, array $params = array()) { + return $this->request->post('pages.parseWiki', $access_token, $params); + } - /** - * Saves the text of a wiki page. - * - * @param string $access_token - * @param array $params - * - @var string text: Text of the wiki page in wiki-format. - * - @var integer page_id: Wiki page ID. The 'title' parameter can be passed instead of 'pid'. - * - @var integer group_id: ID of the community that owns the wiki page. - * - @var integer user_id: User ID - * - @var string title: Wiki page title. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessPageException Access to page denied - * @throws VKApiParamPageIdException Page not found - * @throws VKApiParamTitleException Invalid title - * @return mixed - */ - public function save($access_token, array $params = []) { - return $this->request->post('pages.save', $access_token, $params); - } + /** + * Saves the text of a wiki page. + * + * @param $access_token string + * @param $params array + * - string text: Text of the wiki page in wiki-format. + * - integer page_id: Wiki page ID. The 'title' parameter can be passed instead of 'pid'. + * - integer group_id: ID of the community that owns the wiki page. + * - integer user_id: User ID + * - string title: Wiki page title. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function save(string $access_token, array $params = array()) { + return $this->request->post('pages.save', $access_token, $params); + } - /** - * Saves modified read and edit access settings for a wiki page. - * - * @param string $access_token - * @param array $params - * - @var integer page_id: Wiki page ID. - * - @var integer group_id: ID of the community that owns the wiki page. - * - @var integer user_id - * - @var PagesView view: Who can view the wiki page: '1' — only community members, '2' — all users can view the page, '0' — only community managers - * - @var PagesEdit edit: Who can edit the wiki page: '1' — only community members, '2' — all users can edit the page, '0' — only community managers - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessPageException Access to page denied - * @throws VKApiParamPageIdException Page not found - * @return mixed - */ - public function saveAccess($access_token, array $params = []) { - return $this->request->post('pages.saveAccess', $access_token, $params); - } + /** + * Saves modified read and edit access settings for a wiki page. + * + * @param $access_token string + * @param $params array + * - integer page_id: Wiki page ID. + * - integer group_id: ID of the community that owns the wiki page. + * - integer user_id: + * - PagesSaveAccessView view: Who can view the wiki page: '1' — only community members, '2' — all + * users can view the page, '0' — only community managers + * @see PagesSaveAccessView + * - PagesSaveAccessEdit edit: Who can edit the wiki page: '1' — only community members, '2' — all + * users can edit the page, '0' — only community managers + * @see PagesSaveAccessEdit + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function saveAccess(string $access_token, array $params = array()) { + return $this->request->post('pages.saveAccess', $access_token, $params); + } } diff --git a/src/VK/Actions/Photos.php b/src/VK/Actions/Photos.php index f5f9096..9152ac8 100644 --- a/src/VK/Actions/Photos.php +++ b/src/VK/Actions/Photos.php @@ -1,855 +1,978 @@ request = $request; - } - - /** - * Confirms a tag on a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var string photo_id: Photo ID. - * - @var integer tag_id: Tag ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function confirmTag($access_token, array $params = []) { - return $this->request->post('photos.confirmTag', $access_token, $params); - } - - /** - * Allows to copy a photo to the "Saved photos" album - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: photo's owner ID - * - @var integer photo_id: photo ID - * - @var string access_key: for private photos - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function copy($access_token, array $params = []) { - return $this->request->post('photos.copy', $access_token, $params); - } - - /** - * Creates an empty photo album. - * - * @param string $access_token - * @param array $params - * - @var string title: Album title. - * - @var integer group_id: ID of the community in which the album will be created. - * - @var string description: Album description. - * - @var array[string] privacy_view - * - @var array[string] privacy_comment - * - @var boolean upload_by_admins_only - * - @var boolean comments_disabled - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAlbumsLimitException Albums number limit is reached - * @return mixed - */ - public function createAlbum($access_token, array $params = []) { - return $this->request->post('photos.createAlbum', $access_token, $params); - } - - /** - * Adds a new comment on the photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * - @var string message: Comment text. - * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — Media attachment owner ID. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" - * - @var boolean from_group: '1' — to post a comment from the community - * - @var integer reply_to_comment - * - @var integer sticker_id - * - @var string access_key - * - @var string guid - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function createComment($access_token, array $params = []) { - return $this->request->post('photos.createComment', $access_token, $params); - } - - /** - * Deletes a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('photos.delete', $access_token, $params); - } - - /** - * Deletes a photo album belonging to the current user. - * - * @param string $access_token - * @param array $params - * - @var integer album_id: Album ID. - * - @var integer group_id: ID of the community that owns the album. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamAlbumIdException Invalid album id - * @return mixed - */ - public function deleteAlbum($access_token, array $params = []) { - return $this->request->post('photos.deleteAlbum', $access_token, $params); - } - - /** - * Deletes a comment on the photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer comment_id: Comment ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteComment($access_token, array $params = []) { - return $this->request->post('photos.deleteComment', $access_token, $params); - } - - /** - * Edits the caption of a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * - @var string caption: New caption for the photo. If this parameter is not set, it is considered to be equal to an empty string. - * - @var number latitude - * - @var number longitude - * - @var string place_str - * - @var string foursquare_id - * - @var boolean delete_place - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('photos.edit', $access_token, $params); - } - - /** - * Edits information about a photo album. - * - * @param string $access_token - * @param array $params - * - @var integer album_id: ID of the photo album to be edited. - * - @var string title: New album title. - * - @var string description: New album description. - * - @var integer owner_id: ID of the user or community that owns the album. - * - @var array[string] privacy_view - * - @var array[string] privacy_comment - * - @var boolean upload_by_admins_only - * - @var boolean comments_disabled - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamAlbumIdException Invalid album id - * @return mixed - */ - public function editAlbum($access_token, array $params = []) { - return $this->request->post('photos.editAlbum', $access_token, $params); - } - - /** - * Edits a comment on a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer comment_id: Comment ID. - * - @var string message: New text of the comment. - * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — Media attachment owner ID. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function editComment($access_token, array $params = []) { - return $this->request->post('photos.editComment', $access_token, $params); - } - - /** - * Returns a list of a user's or community's photos. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photos. Use a negative value to designate a community ID. - * - @var string album_id: Photo album ID. To return information about photos from service albums, use the following string values: 'profile, wall, saved'. - * - @var array[string] photo_ids: Photo IDs. - * - @var boolean rev: Sort order: '1' — reverse chronological, '0' — chronological - * - @var boolean extended: '1' — to return additional 'likes', 'comments', and 'tags' fields, '0' — (default) - * - @var string feed_type: Type of feed obtained in 'feed' field of the method. - * - @var integer feed: unixtime, that can be obtained with [vk.com/dev/newsfeed.get|newsfeed.get] method in date field to get all photos uploaded by the user on a specific day, or photos the user has been tagged on. Also, 'uid' parameter of the user the event happened with shall be specified. - * - @var boolean photo_sizes: '1' — to return photo sizes in a [vk.com/dev/photo_sizes|special format] - * - @var integer offset - * - @var integer count - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('photos.get', $access_token, $params); - } - - /** - * Returns a list of a user's or community's photo albums. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the albums. - * - @var array[integer] album_ids: Album IDs. - * - @var integer offset: Offset needed to return a specific subset of albums. - * - @var integer count: Number of albums to return. - * - @var boolean need_system: '1' — to return system albums with negative IDs - * - @var boolean need_covers: '1' — to return an additional 'thumb_src' field, '0' — (default) - * - @var boolean photo_sizes: '1' — to return photo sizes in a - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getAlbums($access_token, array $params = []) { - return $this->request->post('photos.getAlbums', $access_token, $params); - } - - /** - * Returns the number of photo albums belonging to a user or community. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var integer group_id: Community ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getAlbumsCount($access_token, array $params = []) { - return $this->request->post('photos.getAlbumsCount', $access_token, $params); - } - - /** - * Returns a list of photos belonging to a user or community, in reverse chronological order. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of a user or community that owns the photos. Use a negative value to designate a community ID. - * - @var boolean extended: '1' — to return detailed information about photos - * - @var integer offset: Offset needed to return a specific subset of photos. By default, '0'. - * - @var integer count: Number of photos to return. - * - @var boolean photo_sizes: '1' – to return image sizes in [vk.com/dev/photo_sizes|special format]. - * - @var boolean 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) - * - @var boolean need_hidden: '1' – to show information about photos being hidden from the block above the wall. - * - @var boolean 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. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiBlockedException Content blocked - * @return mixed - */ - public function getAll($access_token, array $params = []) { - return $this->request->post('photos.getAll', $access_token, $params); - } - - /** - * Returns a list of comments on a specific photo album or all albums of the user sorted in reverse chronological order. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the album(s). - * - @var integer album_id: Album ID. If the parameter is not set, comments on all of the user's albums will be returned. - * - @var boolean need_likes: '1' — to return an additional 'likes' field, '0' — (default) - * - @var integer offset: Offset needed to return a specific subset of comments. By default, '0'. - * - @var integer count: Number of comments to return. By default, '20'. Maximum value, '100'. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamAlbumIdException Invalid album id - * @return mixed - */ - public function getAllComments($access_token, array $params = []) { - return $this->request->post('photos.getAllComments', $access_token, $params); - } - - /** - * Returns information about photos by their IDs. - * - * @param string $access_token - * @param array $params - * - @var array[string] photos: IDs separated with a comma, that are IDs of users who posted photos and IDs of photos themselves with an underscore character between such IDs. To get information about a photo in the group album, you shall specify group ID instead of user ID. Example: "1_129207899,6492_135055734, , -20629724_271945303" - * - @var boolean extended: '1' — to return additional fields, '0' — (default) - * - @var boolean photo_sizes: '1' — to return photo sizes in a - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('photos.getById', $access_token, $params); - } - - /** - * Returns an upload link for chat cover pictures. - * - * @param string $access_token - * @param array $params - * - @var integer chat_id: ID of the chat for which you want to upload a cover photo. - * - @var integer crop_x - * - @var integer crop_y - * - @var integer crop_width: Width (in pixels) of the photo after cropping. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getChatUploadServer($access_token, array $params = []) { - return $this->request->post('photos.getChatUploadServer', $access_token, $params); - } - - /** - * Returns a list of comments on a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * - @var boolean need_likes: '1' — to return an additional 'likes' field, '0' — (default) - * - @var integer start_comment_id - * - @var integer offset: Offset needed to return a specific subset of comments. By default, '0'. - * - @var integer count: Number of comments to return. - * - @var PhotosSort sort: Sort order: 'asc' — old first, 'desc' — new first - * - @var string access_key - * - @var boolean extended - * - @var array[PhotosFields] fields - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getComments($access_token, array $params = []) { - return $this->request->post('photos.getComments', $access_token, $params); - } - - /** - * Returns the server address for market album photo upload. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getMarketAlbumUploadServer($access_token, array $params = []) { - return $this->request->post('photos.getMarketAlbumUploadServer', $access_token, $params); - } - - /** - * Returns the server address for market photo upload. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var boolean main_photo: '1' if you want to upload the main item photo. - * - @var integer crop_x: X coordinate of the crop left upper corner. - * - @var integer crop_y: Y coordinate of the crop left upper corner. - * - @var integer crop_width: Width of the cropped photo in px. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getMarketUploadServer($access_token, array $params = []) { - return $this->request->post('photos.getMarketUploadServer', $access_token, $params); - } - - /** - * Returns the server address for photo upload in a private message for a user. - * - * @param string $access_token - * @param array $params - * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesDenySendException Can't send messages for users without permission - * @return mixed - */ - public function getMessagesUploadServer($access_token, array $params = []) { - return $this->request->post('photos.getMessagesUploadServer', $access_token, $params); - } - - /** - * Returns a list of photos with tags that have not been viewed. - * - * @param string $access_token - * @param array $params - * - @var integer offset: Offset needed to return a specific subset of photos. - * - @var integer count: Number of photos to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getNewTags($access_token, array $params = []) { - return $this->request->post('photos.getNewTags', $access_token, $params); - } - - /** - * Returns the server address for owner cover upload. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of community that owns the album (if the photo will be uploaded to a community album). - * - @var integer crop_x: X coordinate of the left-upper corner - * - @var integer crop_y: Y coordinate of the left-upper corner - * - @var integer crop_x2: X coordinate of the right-bottom corner - * - @var integer crop_y2: Y coordinate of the right-bottom corner - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getOwnerCoverPhotoUploadServer($access_token, array $params = []) { - return $this->request->post('photos.getOwnerCoverPhotoUploadServer', $access_token, $params); - } - - /** - * Returns an upload server address for a profile or community photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: identifier of a community or current user. "Note that community id must be negative. 'owner_id=1' – user, 'owner_id=-1' – community, " - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getOwnerPhotoUploadServer($access_token, array $params = []) { - return $this->request->post('photos.getOwnerPhotoUploadServer', $access_token, $params); - } - - /** - * Returns a list of tags on a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * - @var string access_key - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getTags($access_token, array $params = []) { - return $this->request->post('photos.getTags', $access_token, $params); - } - - /** - * Returns the server address for photo upload. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of community that owns the album (if the photo will be uploaded to a community album). - * - @var integer album_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getUploadServer($access_token, array $params = []) { - return $this->request->post('photos.getUploadServer', $access_token, $params); - } - - /** - * Returns a list of photos in which a user is tagged. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var integer offset: Offset needed to return a specific subset of photos. By default, '0'. - * - @var integer count: Number of photos to return. Maximum value is 1000. - * - @var boolean extended: '1' — to return an additional 'likes' field, '0' — (default) - * - @var string sort: Sort order: '1' — by date the tag was added in ascending order, '0' — by date the tag was added in descending order - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getUserPhotos($access_token, array $params = []) { - return $this->request->post('photos.getUserPhotos', $access_token, $params); - } - - /** - * Returns the server address for photo upload onto a user's wall. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: ID of community to whose wall the photo will be uploaded. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getWallUploadServer($access_token, array $params = []) { - return $this->request->post('photos.getWallUploadServer', $access_token, $params); - } - - /** - * Makes a photo into an album cover. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * - @var integer album_id: Album ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function makeCover($access_token, array $params = []) { - return $this->request->post('photos.makeCover', $access_token, $params); - } - - /** - * Moves a photo from one album to another. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer target_album_id: ID of the album to which the photo will be moved. - * - @var integer photo_id: Photo ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function move($access_token, array $params = []) { - return $this->request->post('photos.move', $access_token, $params); - } - - /** - * Adds a tag on the photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * - @var integer user_id: ID of the user to be tagged. - * - @var number x: Upper left-corner coordinate of the tagged area (as a percentage of the photo's width). - * - @var number y: Upper left-corner coordinate of the tagged area (as a percentage of the photo's height). - * - @var number x2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's width). - * - @var number y2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's height). - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function putTag($access_token, array $params = []) { - return $this->request->post('photos.putTag', $access_token, $params); - } - - /** - * Removes a tag from a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * - @var integer tag_id: Tag ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function removeTag($access_token, array $params = []) { - return $this->request->post('photos.removeTag', $access_token, $params); - } - - /** - * Reorders the album in the list of user albums. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the album. - * - @var integer album_id: Album ID. - * - @var integer before: ID of the album before which the album in question shall be placed. - * - @var integer after: ID of the album after which the album in question shall be placed. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function reorderAlbums($access_token, array $params = []) { - return $this->request->post('photos.reorderAlbums', $access_token, $params); - } - - /** - * Reorders the photo in the list of photos of the user album. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * - @var integer before: ID of the photo before which the photo in question shall be placed. - * - @var integer after: ID of the photo after which the photo in question shall be placed. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamPhotosException Invalid photos - * @return mixed - */ - public function reorderPhotos($access_token, array $params = []) { - return $this->request->post('photos.reorderPhotos', $access_token, $params); - } - - /** - * Reports (submits a complaint about) a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * - @var PhotosReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function report($access_token, array $params = []) { - return $this->request->post('photos.report', $access_token, $params); - } - - /** - * Reports (submits a complaint about) a comment on a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer comment_id: ID of the comment being reported. - * - @var PhotosReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function reportComment($access_token, array $params = []) { - return $this->request->post('photos.reportComment', $access_token, $params); - } - - /** - * Restores a deleted photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer photo_id: Photo ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function restore($access_token, array $params = []) { - return $this->request->post('photos.restore', $access_token, $params); - } - - /** - * Restores a deleted comment on a photo. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the photo. - * - @var integer comment_id: ID of the deleted comment. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function restoreComment($access_token, array $params = []) { - return $this->request->post('photos.restoreComment', $access_token, $params); - } - - /** - * Saves photos after successful uploading. - * - * @param string $access_token - * @param array $params - * - @var integer album_id: ID of the album to save photos to. - * - @var integer group_id: ID of the community to save photos to. - * - @var integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var string photos_list: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var number latitude: Geographical latitude, in degrees (from '-90' to '90'). - * - @var number longitude: Geographical longitude, in degrees (from '-180' to '180'). - * - @var string caption: Text describing the photo. 2048 digits max. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamAlbumIdException Invalid album id - * @throws VKApiParamServerException Invalid server - * @throws VKApiParamHashException Invalid hash - * @return mixed - */ - public function save($access_token, array $params = []) { - return $this->request->post('photos.save', $access_token, $params); - } - - /** - * Saves market album photos after successful uploading. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamHashException Invalid hash - * @throws VKApiParamPhotoException Invalid photo - * @return mixed - */ - public function saveMarketAlbumPhoto($access_token, array $params = []) { - return $this->request->post('photos.saveMarketAlbumPhoto', $access_token, $params); - } - - /** - * Saves market photos after successful uploading. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var string crop_data: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var string crop_hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamHashException Invalid hash - * @throws VKApiParamPhotoException Invalid photo - * @return mixed - */ - public function saveMarketPhoto($access_token, array $params = []) { - return $this->request->post('photos.saveMarketPhoto', $access_token, $params); - } - - /** - * Saves a photo after being successfully uploaded. URL obtained with [vk.com/dev/photos.getMessagesUploadServer|photos.getMessagesUploadServer] method. - * - * @param string $access_token - * @param array $params - * - @var string photo: Parameter returned when the photo is [vk.com/dev/upload_files|uploaded to the server]. - * - @var integer server - * - @var string hash - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamAlbumIdException Invalid album id - * @throws VKApiParamServerException Invalid server - * @throws VKApiParamHashException Invalid hash - * @return mixed - */ - public function saveMessagesPhoto($access_token, array $params = []) { - return $this->request->post('photos.saveMessagesPhoto', $access_token, $params); - } - - /** - * Saves cover photo after successful uploading. - * - * @param string $access_token - * @param array $params - * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - @var string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamPhotoException Invalid photo - * @return mixed - */ - public function saveOwnerCoverPhoto($access_token, array $params = []) { - return $this->request->post('photos.saveOwnerCoverPhoto', $access_token, $params); - } - - /** - * Saves a profile or community photo. Upload URL can be got with the [vk.com/dev/photos.getOwnerPhotoUploadServer|photos.getOwnerPhotoUploadServer] method. - * - * @param string $access_token - * @param array $params - * - @var string server: parameter returned after [vk.com/dev/upload_files|photo upload]. - * - @var string hash: parameter returned after [vk.com/dev/upload_files|photo upload]. - * - @var string photo: parameter returned after [vk.com/dev/upload_files|photo upload]. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamPhotoException Invalid photo - * @return mixed - */ - public function saveOwnerPhoto($access_token, array $params = []) { - return $this->request->post('photos.saveOwnerPhoto', $access_token, $params); - } - - /** - * Saves a photo to a user's or community's wall after being uploaded. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: ID of the user on whose wall the photo will be saved. - * - @var integer group_id: ID of community on whose wall the photo will be saved. - * - @var string photo: Parameter returned when the the photo is [vk.com/dev/upload_files|uploaded to the server]. - * - @var integer server - * - @var string hash - * - @var number latitude: Geographical latitude, in degrees (from '-90' to '90'). - * - @var number longitude: Geographical longitude, in degrees (from '-180' to '180'). - * - @var string caption: Text describing the photo. 2048 digits max. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiParamAlbumIdException Invalid album id - * @throws VKApiParamServerException Invalid server - * @throws VKApiParamHashException Invalid hash - * @return mixed - */ - public function saveWallPhoto($access_token, array $params = []) { - return $this->request->post('photos.saveWallPhoto', $access_token, $params); - } - - /** - * Returns a list of photos. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query string. - * - @var number lat: Geographical latitude, in degrees (from '-90' to '90'). - * - @var number long: Geographical longitude, in degrees (from '-180' to '180'). - * - @var integer start_time - * - @var integer end_time - * - @var integer sort: Sort order: - * - @var integer offset: Offset needed to return a specific subset of photos. - * - @var integer count: Number of photos to return. - * - @var integer radius: Radius of search in meters (works very approximately). Available values: '10', '100', '800', '6000', '50000'. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('photos.search', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Photos constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Confirms a tag on a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - string photo_id: Photo ID. + * - integer tag_id: Tag ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function confirmTag(string $access_token, array $params = array()) { + return $this->request->post('photos.confirmTag', $access_token, $params); + } + + /** + * Allows to copy a photo to the "Saved photos" album + * + * @param $access_token string + * @param $params array + * - integer owner_id: photo's owner ID + * - integer photo_id: photo ID + * - string access_key: for private photos + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function copy(string $access_token, array $params = array()) { + return $this->request->post('photos.copy', $access_token, $params); + } + + /** + * Creates an empty photo album. + * + * @param $access_token string + * @param $params array + * - string title: Album title. + * - integer group_id: ID of the community in which the album will be created. + * - string description: Album description. + * - array privacy_view: + * - array privacy_comment: + * - boolean upload_by_admins_only: + * - boolean comments_disabled: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function createAlbum(string $access_token, array $params = array()) { + return $this->request->post('photos.createAlbum', $access_token, $params); + } + + /** + * Adds a new comment on the photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * - string message: Comment text. + * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the + * following format: "_,_", '' — Type of media attachment: 'photo' + * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — Media attachment owner + * ID. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * - boolean from_group: '1' — to post a comment from the community + * - integer reply_to_comment: + * - integer sticker_id: + * - string access_key: + * - string guid: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function createComment(string $access_token, array $params = array()) { + return $this->request->post('photos.createComment', $access_token, $params); + } + + /** + * Deletes a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('photos.delete', $access_token, $params); + } + + /** + * Deletes a photo album belonging to the current user. + * + * @param $access_token string + * @param $params array + * - integer album_id: Album ID. + * - integer group_id: ID of the community that owns the album. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function deleteAlbum(string $access_token, array $params = array()) { + return $this->request->post('photos.deleteAlbum', $access_token, $params); + } + + /** + * Deletes a comment on the photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer comment_id: Comment ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteComment(string $access_token, array $params = array()) { + return $this->request->post('photos.deleteComment', $access_token, $params); + } + + /** + * Edits the caption of a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * - string caption: New caption for the photo. If this parameter is not set, it is considered to be equal + * to an empty string. + * - number latitude: + * - number longitude: + * - string place_str: + * - string foursquare_id: + * - boolean delete_place: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('photos.edit', $access_token, $params); + } + + /** + * Edits information about a photo album. + * + * @param $access_token string + * @param $params array + * - integer album_id: ID of the photo album to be edited. + * - string title: New album title. + * - string description: New album description. + * - integer owner_id: ID of the user or community that owns the album. + * - array privacy_view: + * - array privacy_comment: + * - boolean upload_by_admins_only: + * - boolean comments_disabled: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function editAlbum(string $access_token, array $params = array()) { + return $this->request->post('photos.editAlbum', $access_token, $params); + } + + /** + * Edits a comment on a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer comment_id: Comment ID. + * - string message: New text of the comment. + * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the + * following format: "_,_", '' — Type of media attachment: 'photo' + * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — Media attachment owner + * ID. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function editComment(string $access_token, array $params = array()) { + return $this->request->post('photos.editComment', $access_token, $params); + } + + /** + * Returns a list of a user's or community's photos. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photos. Use a negative value to designate + * a community ID. + * - string album_id: Photo album ID. To return information about photos from service albums, use the + * following string values: 'profile, wall, saved'. + * - array photo_ids: Photo IDs. + * - boolean rev: Sort order: '1' — reverse chronological, '0' — chronological + * - boolean extended: '1' — to return additional 'likes', 'comments', and 'tags' fields, '0' — + * (default) + * - string feed_type: Type of feed obtained in 'feed' field of the method. + * - integer feed: unixtime, that can be obtained with [vk.com/dev/newsfeed.get|newsfeed.get] method in + * date field to get all photos uploaded by the user on a specific day, or photos the user has been tagged on. + * Also, 'uid' parameter of the user the event happened with shall be specified. + * - boolean photo_sizes: '1' — to return photo sizes in a [vk.com/dev/photo_sizes|special format] + * - integer offset: + * - integer count: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('photos.get', $access_token, $params); + } + + /** + * Returns a list of a user's or community's photo albums. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the albums. + * - array album_ids: Album IDs. + * - integer offset: Offset needed to return a specific subset of albums. + * - integer count: Number of albums to return. + * - boolean need_system: '1' — to return system albums with negative IDs + * - boolean need_covers: '1' — to return an additional 'thumb_src' field, '0' — (default) + * - boolean photo_sizes: '1' — to return photo sizes in a + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAlbums(string $access_token, array $params = array()) { + return $this->request->post('photos.getAlbums', $access_token, $params); + } + + /** + * Returns the number of photo albums belonging to a user or community. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - integer group_id: Community ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAlbumsCount(string $access_token, array $params = array()) { + return $this->request->post('photos.getAlbumsCount', $access_token, $params); + } + + /** + * Returns a list of photos belonging to a user or community, in reverse chronological order. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of a user or community that owns the photos. Use a negative value to designate a + * community ID. + * - boolean extended: '1' — to return detailed information about photos + * - integer offset: Offset needed to return a specific subset of photos. By default, '0'. + * - integer count: Number of photos to return. + * - boolean photo_sizes: '1' - to return image sizes in [vk.com/dev/photo_sizes|special format]. + * - boolean 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) + * - boolean need_hidden: '1' - to show information about photos being hidden from the block above the + * wall. + * - boolean 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. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getAll(string $access_token, array $params = array()) { + return $this->request->post('photos.getAll', $access_token, $params); + } + + /** + * Returns a list of comments on a specific photo album or all albums of the user sorted in reverse chronological + * order. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the album(s). + * - integer album_id: Album ID. If the parameter is not set, comments on all of the user's albums will be + * returned. + * - boolean need_likes: '1' — to return an additional 'likes' field, '0' — (default) + * - integer offset: Offset needed to return a specific subset of comments. By default, '0'. + * - integer count: Number of comments to return. By default, '20'. Maximum value, '100'. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getAllComments(string $access_token, array $params = array()) { + return $this->request->post('photos.getAllComments', $access_token, $params); + } + + /** + * Returns information about photos by their IDs. + * + * @param $access_token string + * @param $params array + * - array photos: IDs separated with a comma, that are IDs of users who posted photos and IDs of photos + * themselves with an underscore character between such IDs. To get information about a photo in the group + * album, you shall specify group ID instead of user ID. Example: "1_129207899,6492_135055734, , + * -20629724_271945303" + * - boolean extended: '1' — to return additional fields, '0' — (default) + * - boolean photo_sizes: '1' — to return photo sizes in a + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('photos.getById', $access_token, $params); + } + + /** + * Returns an upload link for chat cover pictures. + * + * @param $access_token string + * @param $params array + * - integer chat_id: ID of the chat for which you want to upload a cover photo. + * - integer crop_x: + * - integer crop_y: + * - integer crop_width: Width (in pixels) of the photo after cropping. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getChatUploadServer(string $access_token, array $params = array()) { + return $this->request->post('photos.getChatUploadServer', $access_token, $params); + } + + /** + * Returns a list of comments on a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * - boolean need_likes: '1' — to return an additional 'likes' field, '0' — (default) + * - integer start_comment_id: + * - integer offset: Offset needed to return a specific subset of comments. By default, '0'. + * - integer count: Number of comments to return. + * - PhotosGetCommentsSort sort: Sort order: 'asc' — old first, 'desc' — new first + * @see PhotosGetCommentsSort + * - string access_key: + * - boolean extended: + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getComments(string $access_token, array $params = array()) { + return $this->request->post('photos.getComments', $access_token, $params); + } + + /** + * Returns the server address for market album photo upload. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getMarketAlbumUploadServer(string $access_token, array $params = array()) { + return $this->request->post('photos.getMarketAlbumUploadServer', $access_token, $params); + } + + /** + * Returns the server address for market photo upload. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - boolean main_photo: '1' if you want to upload the main item photo. + * - integer crop_x: X coordinate of the crop left upper corner. + * - integer crop_y: Y coordinate of the crop left upper corner. + * - integer crop_width: Width of the cropped photo in px. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getMarketUploadServer(string $access_token, array $params = array()) { + return $this->request->post('photos.getMarketUploadServer', $access_token, $params); + } + + /** + * Returns the server address for photo upload in a private message for a user. + * + * @param $access_token string + * @param $params array + * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat + * ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getMessagesUploadServer(string $access_token, array $params = array()) { + return $this->request->post('photos.getMessagesUploadServer', $access_token, $params); + } + + /** + * Returns a list of photos with tags that have not been viewed. + * + * @param $access_token string + * @param $params array + * - integer offset: Offset needed to return a specific subset of photos. + * - integer count: Number of photos to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getNewTags(string $access_token, array $params = array()) { + return $this->request->post('photos.getNewTags', $access_token, $params); + } + + /** + * Returns the server address for owner cover upload. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of community that owns the album (if the photo will be uploaded to a community + * album). + * - integer crop_x: X coordinate of the left-upper corner + * - integer crop_y: Y coordinate of the left-upper corner + * - integer crop_x2: X coordinate of the right-bottom corner + * - integer crop_y2: Y coordinate of the right-bottom corner + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getOwnerCoverPhotoUploadServer(string $access_token, array $params = array()) { + return $this->request->post('photos.getOwnerCoverPhotoUploadServer', $access_token, $params); + } + + /** + * Returns an upload server address for a profile or community photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: identifier of a community or current user. "Note that community id must be + * negative. 'owner_id=1' - user, 'owner_id=-1' - community, " + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getOwnerPhotoUploadServer(string $access_token, array $params = array()) { + return $this->request->post('photos.getOwnerPhotoUploadServer', $access_token, $params); + } + + /** + * Returns a list of tags on a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * - string access_key: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getTags(string $access_token, array $params = array()) { + return $this->request->post('photos.getTags', $access_token, $params); + } + + /** + * Returns the server address for photo upload. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of community that owns the album (if the photo will be uploaded to a community + * album). + * - integer album_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getUploadServer(string $access_token, array $params = array()) { + return $this->request->post('photos.getUploadServer', $access_token, $params); + } + + /** + * Returns a list of photos in which a user is tagged. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - integer offset: Offset needed to return a specific subset of photos. By default, '0'. + * - integer count: Number of photos to return. Maximum value is 1000. + * - boolean extended: '1' — to return an additional 'likes' field, '0' — (default) + * - string sort: Sort order: '1' — by date the tag was added in ascending order, '0' — by date the + * tag was added in descending order + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getUserPhotos(string $access_token, array $params = array()) { + return $this->request->post('photos.getUserPhotos', $access_token, $params); + } + + /** + * Returns the server address for photo upload onto a user's wall. + * + * @param $access_token string + * @param $params array + * - integer group_id: ID of community to whose wall the photo will be uploaded. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getWallUploadServer(string $access_token, array $params = array()) { + return $this->request->post('photos.getWallUploadServer', $access_token, $params); + } + + /** + * Makes a photo into an album cover. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * - integer album_id: Album ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function makeCover(string $access_token, array $params = array()) { + return $this->request->post('photos.makeCover', $access_token, $params); + } + + /** + * Moves a photo from one album to another. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer target_album_id: ID of the album to which the photo will be moved. + * - integer photo_id: Photo ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function move(string $access_token, array $params = array()) { + return $this->request->post('photos.move', $access_token, $params); + } + + /** + * Adds a tag on the photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * - integer user_id: ID of the user to be tagged. + * - number x: Upper left-corner coordinate of the tagged area (as a percentage of the photo's width). + * - number y: Upper left-corner coordinate of the tagged area (as a percentage of the photo's height). + * - number x2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's width). + * - number y2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's height). + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function putTag(string $access_token, array $params = array()) { + return $this->request->post('photos.putTag', $access_token, $params); + } + + /** + * Removes a tag from a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * - integer tag_id: Tag ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function removeTag(string $access_token, array $params = array()) { + return $this->request->post('photos.removeTag', $access_token, $params); + } + + /** + * Reorders the album in the list of user albums. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the album. + * - integer album_id: Album ID. + * - integer before: ID of the album before which the album in question shall be placed. + * - integer after: ID of the album after which the album in question shall be placed. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function reorderAlbums(string $access_token, array $params = array()) { + return $this->request->post('photos.reorderAlbums', $access_token, $params); + } + + /** + * Reorders the photo in the list of photos of the user album. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * - integer before: ID of the photo before which the photo in question shall be placed. + * - integer after: ID of the photo after which the photo in question shall be placed. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function reorderPhotos(string $access_token, array $params = array()) { + return $this->request->post('photos.reorderPhotos', $access_token, $params); + } + + /** + * Reports (submits a complaint about) a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * - PhotosReportReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - + * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse + * @see PhotosReportReason + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function report(string $access_token, array $params = array()) { + return $this->request->post('photos.report', $access_token, $params); + } + + /** + * Reports (submits a complaint about) a comment on a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer comment_id: ID of the comment being reported. + * - PhotosReportCommentReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' + * - extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse + * @see PhotosReportCommentReason + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function reportComment(string $access_token, array $params = array()) { + return $this->request->post('photos.reportComment', $access_token, $params); + } + + /** + * Restores a deleted photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer photo_id: Photo ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function restore(string $access_token, array $params = array()) { + return $this->request->post('photos.restore', $access_token, $params); + } + + /** + * Restores a deleted comment on a photo. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the photo. + * - integer comment_id: ID of the deleted comment. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function restoreComment(string $access_token, array $params = array()) { + return $this->request->post('photos.restoreComment', $access_token, $params); + } + + /** + * Saves photos after successful uploading. + * + * @param $access_token string + * @param $params array + * - integer album_id: ID of the album to save photos to. + * - integer group_id: ID of the community to save photos to. + * - integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - string photos_list: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - number latitude: Geographical latitude, in degrees (from '-90' to '90'). + * - number longitude: Geographical longitude, in degrees (from '-180' to '180'). + * - string caption: Text describing the photo. 2048 digits max. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function save(string $access_token, array $params = array()) { + return $this->request->post('photos.save', $access_token, $params); + } + + /** + * Saves market album photos after successful uploading. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function saveMarketAlbumPhoto(string $access_token, array $params = array()) { + return $this->request->post('photos.saveMarketAlbumPhoto', $access_token, $params); + } + + /** + * Saves market photos after successful uploading. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - string crop_data: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - string crop_hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function saveMarketPhoto(string $access_token, array $params = array()) { + return $this->request->post('photos.saveMarketPhoto', $access_token, $params); + } + + /** + * Saves a photo after being successfully uploaded. URL obtained with + * [vk.com/dev/photos.getMessagesUploadServer|photos.getMessagesUploadServer] method. + * + * @param $access_token string + * @param $params array + * - string photo: Parameter returned when the photo is [vk.com/dev/upload_files|uploaded to the server]. + * - integer server: + * - string hash: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function saveMessagesPhoto(string $access_token, array $params = array()) { + return $this->request->post('photos.saveMessagesPhoto', $access_token, $params); + } + + /** + * Saves cover photo after successful uploading. + * + * @param $access_token string + * @param $params array + * - string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function saveOwnerCoverPhoto(string $access_token, array $params = array()) { + return $this->request->post('photos.saveOwnerCoverPhoto', $access_token, $params); + } + + /** + * Saves a profile or community photo. Upload URL can be got with the + * [vk.com/dev/photos.getOwnerPhotoUploadServer|photos.getOwnerPhotoUploadServer] method. + * + * @param $access_token string + * @param $params array + * - string server: parameter returned after [vk.com/dev/upload_files|photo upload]. + * - string hash: parameter returned after [vk.com/dev/upload_files|photo upload]. + * - string photo: parameter returned after [vk.com/dev/upload_files|photo upload]. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function saveOwnerPhoto(string $access_token, array $params = array()) { + return $this->request->post('photos.saveOwnerPhoto', $access_token, $params); + } + + /** + * Saves a photo to a user's or community's wall after being uploaded. + * + * @param $access_token string + * @param $params array + * - integer user_id: ID of the user on whose wall the photo will be saved. + * - integer group_id: ID of community on whose wall the photo will be saved. + * - string photo: Parameter returned when the the photo is [vk.com/dev/upload_files|uploaded to the + * server]. + * - integer server: + * - string hash: + * - number latitude: Geographical latitude, in degrees (from '-90' to '90'). + * - number longitude: Geographical longitude, in degrees (from '-180' to '180'). + * - string caption: Text describing the photo. 2048 digits max. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function saveWallPhoto(string $access_token, array $params = array()) { + return $this->request->post('photos.saveWallPhoto', $access_token, $params); + } + + /** + * Returns a list of photos. + * + * @param $access_token string + * @param $params array + * - string q: Search query string. + * - number lat: Geographical latitude, in degrees (from '-90' to '90'). + * - number long: Geographical longitude, in degrees (from '-180' to '180'). + * - integer start_time: + * - integer end_time: + * - integer sort: Sort order: + * - integer offset: Offset needed to return a specific subset of photos. + * - integer count: Number of photos to return. + * - integer radius: Radius of search in meters (works very approximately). Available values: '10', '100', + * '800', '6000', '50000'. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('photos.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Podcasts.php b/src/VK/Actions/Podcasts.php new file mode 100644 index 0000000..0e50329 --- /dev/null +++ b/src/VK/Actions/Podcasts.php @@ -0,0 +1,41 @@ +request = $request; + } + + /** + * + * + * @param $access_token string + * @param $params array + * - string search_string: + * - integer offset: + * - integer count: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function searchPodcast(string $access_token, array $params = array()) { + return $this->request->post('podcasts.searchPodcast', $access_token, $params); + } +} diff --git a/src/VK/Actions/Polls.php b/src/VK/Actions/Polls.php index e0c45be..4488a42 100644 --- a/src/VK/Actions/Polls.php +++ b/src/VK/Actions/Polls.php @@ -1,161 +1,239 @@ request = $request; + } + + /** + * Adds the current user's vote to the selected answer in the poll. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a + * community ID. + * - integer poll_id: Poll ID. + * - array answer_ids: + * - boolean is_board: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function addVote(string $access_token, array $params = array()) { + return $this->request->post('polls.addVote', $access_token, $params); + } + + /** + * Creates polls that can be attached to the users' or communities' posts. + * + * @param $access_token string + * @param $params array + * - string question: question text + * - boolean is_anonymous: '1' - anonymous poll, participants list is hidden,, '0' - public poll, + * participants list is available,, Default value is '0'. + * - boolean is_multiple: + * - integer end_date: + * - integer owner_id: If a poll will be added to a communty it is required to send a negative group + * identifier. Current user by default. + * - integer app_id: + * - string add_answers: available answers list, for example: " ["yes","no","maybe"]", There can be from 1 + * to 10 answers. + * - integer photo_id: + * - PollsCreateBackgroundId background_id: + * @see PollsCreateBackgroundId + * - boolean disable_unvote: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function create(string $access_token, array $params = array()) { + return $this->request->post('polls.create', $access_token, $params); + } - /** - * Polls constructor. - * - * @param VKApiRequest $request - */ - public function __construct(VKApiRequest $request) { - $this->request = $request; - } + /** + * Deletes the current user's vote from the selected answer in the poll. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a + * community ID. + * - integer poll_id: Poll ID. + * - integer answer_id: Answer ID. + * - boolean is_board: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function deleteVote(string $access_token, array $params = array()) { + return $this->request->post('polls.deleteVote', $access_token, $params); + } - /** - * Adds the current user's vote to the selected answer in the poll. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. - * - @var integer poll_id: Poll ID. - * - @var array[integer] answer_ids - * - @var boolean is_board - * @throws VKClientException - * @throws VKApiException - * @throws VKApiPollsAccessException Access to poll denied - * @throws VKApiPollsAnswerIdException Invalid answer id - * @throws VKApiPollsPollIdException Invalid poll id - * @return mixed - */ - public function addVote($access_token, array $params = []) { - return $this->request->post('polls.addVote', $access_token, $params); - } + /** + * Edits created polls + * + * @param $access_token string + * @param $params array + * - integer owner_id: poll owner id + * - integer poll_id: edited poll's id + * - string question: new question text + * - string add_answers: answers list, for example: , "["yes","no","maybe"]" + * - string edit_answers: object containing answers that need to be edited,, key - answer id, value - new + * answer text. Example: {"382967099":"option1", "382967103":"option2"}" + * - string delete_answers: list of answer ids to be deleted. For example: "[382967099, 382967103]" + * - integer end_date: + * - integer photo_id: + * - PollsEditBackgroundId background_id: + * @see PollsEditBackgroundId + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('polls.edit', $access_token, $params); + } - /** - * Creates polls that can be attached to the users' or communities' posts. - * - * @param string $access_token - * @param array $params - * - @var string question: question text - * - @var boolean is_anonymous: '1' – anonymous poll, participants list is hidden,, '0' – public poll, participants list is available,, Default value is '0'. - * - @var boolean is_multiple - * - @var integer end_date - * - @var integer owner_id: If a poll will be added to a communty it is required to send a negative group identifier. Current user by default. - * - @var string add_answers: available answers list, for example: " ["yes","no","maybe"]", There can be from 1 to 10 answers. - * - @var integer photo_id - * - @var PollsBackgroundId background_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function create($access_token, array $params = []) { - return $this->request->post('polls.create', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getBackgrounds(string $access_token, array $params = array()) { + return $this->request->post('polls.getBackgrounds', $access_token, $params); + } - /** - * Deletes the current user's vote from the selected answer in the poll. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. - * - @var integer poll_id: Poll ID. - * - @var integer answer_id: Answer ID. - * - @var boolean is_board - * @throws VKClientException - * @throws VKApiException - * @throws VKApiPollsAccessException Access to poll denied - * @throws VKApiPollsAnswerIdException Invalid answer id - * @throws VKApiPollsPollIdException Invalid poll id - * @return mixed - */ - public function deleteVote($access_token, array $params = []) { - return $this->request->post('polls.deleteVote', $access_token, $params); - } + /** + * Returns detailed information about a poll by its ID. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a + * community ID. + * - boolean is_board: '1' - poll is in a board, '0' - poll is on a wall. '0' by default. + * - integer poll_id: Poll ID. + * - boolean extended: + * - integer friends_count: + * - array fields: + * - PollsGetByIdNameCase name_case: + * @see PollsGetByIdNameCase + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('polls.getById', $access_token, $params); + } - /** - * Edits created polls - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: poll owner id - * - @var integer poll_id: edited poll's id - * - @var string question: new question text - * - @var string add_answers: answers list, for example: , "["yes","no","maybe"]" - * - @var string edit_answers: object containing answers that need to be edited,, key – answer id, value – new answer text. Example: {"382967099":"option1", "382967103":"option2"}" - * - @var string delete_answers: list of answer ids to be deleted. For example: "[382967099, 382967103]" - * - @var integer end_date - * - @var integer photo_id - * - @var PollsBackgroundId background_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('polls.edit', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getPhotoUploadServer(string $access_token, array $params = array()) { + return $this->request->post('polls.getPhotoUploadServer', $access_token, $params); + } - /** - * Returns detailed information about a poll by its ID. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. - * - @var boolean is_board: '1' – poll is in a board, '0' – poll is on a wall. '0' by default. - * - @var integer poll_id: Poll ID. - * - @var boolean extended - * - @var integer friends_count - * - @var array[string] fields - * - @var PollsNameCase name_case - * @throws VKClientException - * @throws VKApiException - * @throws VKApiPollsAccessException Access to poll denied - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('polls.getById', $access_token, $params); - } + /** + * Returns a list of IDs of users who selected specific answers in the poll. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a + * community ID. + * - integer poll_id: Poll ID. + * - array answer_ids: Answer IDs. + * - boolean is_board: + * - boolean friends_only: '1' — to return only current user's friends, '0' — to return all users + * (default), + * - integer offset: Offset needed to return a specific subset of voters. '0' — (default) + * - integer count: Number of user IDs to return (if the 'friends_only' parameter is not set, maximum + * '1000', otherwise '10'). '100' — (default) + * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate + * (birthdate)', 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', + * 'contacts', 'education', 'online', 'counters'. + * - PollsGetVotersNameCase name_case: Case for declension of user name and surname: , 'nom' — + * nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental + * , 'abl' — prepositional + * @see PollsGetVotersNameCase + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function getVoters(string $access_token, array $params = array()) { + return $this->request->post('polls.getVoters', $access_token, $params); + } - /** - * Returns a list of IDs of users who selected specific answers in the poll. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. - * - @var integer poll_id: Poll ID. - * - @var array[integer] answer_ids: Answer IDs. - * - @var boolean is_board - * - @var boolean friends_only: '1' — to return only current user's friends, '0' — to return all users (default), - * - @var integer offset: Offset needed to return a specific subset of voters. '0' — (default) - * - @var integer count: Number of user IDs to return (if the 'friends_only' parameter is not set, maximum '1000', otherwise '10'). '100' — (default) - * - @var array[PollsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate (birthdate)', 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'. - * - @var PollsNameCase name_case: Case for declension of user name and surname: , 'nom' — nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional - * @throws VKClientException - * @throws VKApiException - * @throws VKApiPollsAccessException Access to poll denied - * @throws VKApiPollsAnswerIdException Invalid answer id - * @throws VKApiPollsPollIdException Invalid poll id - * @throws VKApiPollsAccessWithoutVoteException Access denied, please vote first - * @return mixed - */ - public function getVoters($access_token, array $params = []) { - return $this->request->post('polls.getVoters', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - string photo: + * - string hash: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function savePhoto(string $access_token, array $params = array()) { + return $this->request->post('polls.savePhoto', $access_token, $params); + } } diff --git a/src/VK/Actions/PrettyCards.php b/src/VK/Actions/PrettyCards.php index 0ad67b9..ab57221 100644 --- a/src/VK/Actions/PrettyCards.php +++ b/src/VK/Actions/PrettyCards.php @@ -1,119 +1,140 @@ request = $request; - } + /** + * PrettyCards constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var string photo - * - @var string title - * - @var string link - * - @var string price - * - @var string price_old - * - @var string button - * @throws VKClientException - * @throws VKApiException - * @throws VKApiPrettyCardsTooManyCardsException Too many cards - * @return mixed - */ - public function create($access_token, array $params = []) { - return $this->request->post('prettyCards.create', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - string photo: + * - string title: + * - string link: + * - string price: + * - string price_old: + * - string button: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function create(string $access_token, array $params = array()) { + return $this->request->post('prettyCards.create', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer card_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiPrettyCardsCardNotFoundException Card not found - * @throws VKApiPrettyCardsCardIsConnectedToPostException Card is connected to post - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('prettyCards.delete', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer card_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('prettyCards.delete', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer card_id - * - @var string photo - * - @var string title - * - @var string link - * - @var string price - * - @var string price_old - * - @var string button - * @throws VKClientException - * @throws VKApiException - * @throws VKApiPrettyCardsCardNotFoundException Card not found - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('prettyCards.edit', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer card_id: + * - string photo: + * - string title: + * - string link: + * - string price: + * - string price_old: + * - string button: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('prettyCards.edit', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer offset - * - @var integer count - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('prettyCards.get', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer offset: + * - integer count: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('prettyCards.get', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var array[integer] card_ids - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('prettyCards.getById', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - array card_ids: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('prettyCards.getById', $access_token, $params); + } - /** - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getUploadURL($access_token) { - return $this->request->post('prettyCards.getUploadURL', $access_token); - } + /** + * + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getUploadURL(string $access_token, array $params = array()) { + return $this->request->post('prettyCards.getUploadURL', $access_token, $params); + } } diff --git a/src/VK/Actions/Search.php b/src/VK/Actions/Search.php index c7ecdb3..1701cc0 100644 --- a/src/VK/Actions/Search.php +++ b/src/VK/Actions/Search.php @@ -1,44 +1,44 @@ request = $request; - } + /** + * Search constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Allows the programmer to do a quick search for any substring. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query string. - * - @var integer offset: Offset for querying specific result subset - * - @var integer limit: Maximum number of results to return. - * - @var array[string] filters - * - @var array[string] fields - * - @var boolean search_global - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getHints($access_token, array $params = []) { - return $this->request->post('search.getHints', $access_token, $params); - } + /** + * Allows the programmer to do a quick search for any substring. + * + * @param $access_token string + * @param $params array + * - string q: Search query string. + * - integer offset: Offset for querying specific result subset + * - integer limit: Maximum number of results to return. + * - array filters: + * - array fields: + * - boolean search_global: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getHints(string $access_token, array $params = array()) { + return $this->request->post('search.getHints', $access_token, $params); + } } diff --git a/src/VK/Actions/Secure.php b/src/VK/Actions/Secure.php index 72dbeed..1eb28fe 100644 --- a/src/VK/Actions/Secure.php +++ b/src/VK/Actions/Secure.php @@ -1,189 +1,212 @@ request = $request; - } + /** + * Secure constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Adds user activity information to an application - * - * @param string $access_token - * @param array $params - * - @var integer user_id: ID of a user to save the data - * - @var integer activity_id: there are 2 default activities: , * 1 – level. Works similar to ,, * 2 – points, saves points amount, Any other value is for saving completed missions - * - @var integer value: depends on activity_id: * 1 – number, current level number,, * 2 – number, current user's points amount, , Any other value is ignored - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAppsAlreadyUnlockedException This achievement is already unlocked - * @return mixed - */ - public function addAppEvent($access_token, array $params = []) { - return $this->request->post('secure.addAppEvent', $access_token, $params); - } + /** + * Adds user activity information to an application + * + * @param $access_token string + * @param $params array + * - integer user_id: ID of a user to save the data + * - integer activity_id: there are 2 default activities: , * 1 - level. Works similar to ,, * 2 - points, + * saves points amount, Any other value is for saving completed missions + * - integer value: depends on activity_id: * 1 - number, current level number,, * 2 - number, current + * user's points amount, , Any other value is ignored + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function addAppEvent(string $access_token, array $params = array()) { + return $this->request->post('secure.addAppEvent', $access_token, $params); + } - /** - * Checks the user authentication in 'IFrame' and 'Flash' apps using the 'access_token' parameter. - * - * @param string $access_token - * @param array $params - * - @var string token: client 'access_token' - * - @var string ip: user 'ip address'. Note that user may access using the 'ipv6' address, in this case it is required to transmit the 'ipv6' address. If not transmitted, the address will not be checked. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function checkToken($access_token, array $params = []) { - return $this->request->post('secure.checkToken', $access_token, $params); - } + /** + * Checks the user authentication in 'IFrame' and 'Flash' apps using the 'access_token' parameter. + * + * @param $access_token string + * @param $params array + * - string token: client 'access_token' + * - string ip: user 'ip address'. Note that user may access using the 'ipv6' address, in this case it is + * required to transmit the 'ipv6' address. If not transmitted, the address will not be checked. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function checkToken(string $access_token, array $params = array()) { + return $this->request->post('secure.checkToken', $access_token, $params); + } - /** - * Returns payment balance of the application in hundredth of a vote. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getAppBalance($access_token) { - return $this->request->post('secure.getAppBalance', $access_token); - } + /** + * Returns payment balance of the application in hundredth of a vote. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getAppBalance(string $access_token, array $params = array()) { + return $this->request->post('secure.getAppBalance', $access_token, $params); + } - /** - * Shows a list of SMS notifications sent by the application using [vk.com/dev/secure.sendSMSNotification|secure.sendSMSNotification] method. - * - * @param string $access_token - * @param array $params - * - @var integer user_id - * - @var integer date_from: filter by start date. It is set as UNIX-time. - * - @var integer date_to: filter by end date. It is set as UNIX-time. - * - @var integer limit: number of returned posts. By default — 1000. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getSMSHistory($access_token, array $params = []) { - return $this->request->post('secure.getSMSHistory', $access_token, $params); - } + /** + * Shows a list of SMS notifications sent by the application using + * [vk.com/dev/secure.sendSMSNotification|secure.sendSMSNotification] method. + * + * @param $access_token string + * @param $params array + * - integer user_id: + * - integer date_from: filter by start date. It is set as UNIX-time. + * - integer date_to: filter by end date. It is set as UNIX-time. + * - integer limit: number of returned posts. By default — 1000. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSMSHistory(string $access_token, array $params = array()) { + return $this->request->post('secure.getSMSHistory', $access_token, $params); + } - /** - * Shows history of votes transaction between users and the application. - * - * @param string $access_token - * @param array $params - * - @var integer type - * - @var integer uid_from - * - @var integer uid_to - * - @var integer date_from - * - @var integer date_to - * - @var integer limit - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getTransactionsHistory($access_token, array $params = []) { - return $this->request->post('secure.getTransactionsHistory', $access_token, $params); - } + /** + * Shows history of votes transaction between users and the application. + * + * @param $access_token string + * @param $params array + * - integer type: + * - integer uid_from: + * - integer uid_to: + * - integer date_from: + * - integer date_to: + * - integer limit: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getTransactionsHistory(string $access_token, array $params = array()) { + return $this->request->post('secure.getTransactionsHistory', $access_token, $params); + } - /** - * Returns one of the previously set game levels of one or more users in the application. - * - * @param string $access_token - * @param array $params - * - @var array[integer] user_ids - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getUserLevel($access_token, array $params = []) { - return $this->request->post('secure.getUserLevel', $access_token, $params); - } + /** + * Returns one of the previously set game levels of one or more users in the application. + * + * @param $access_token string + * @param $params array + * - array user_ids: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getUserLevel(string $access_token, array $params = array()) { + return $this->request->post('secure.getUserLevel', $access_token, $params); + } - /** - * Opens the game achievement and gives the user a sticker - * - * @param string $access_token - * @param array $params - * - @var array[integer] user_ids - * - @var integer achievement_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function giveEventSticker($access_token, array $params = []) { - return $this->request->post('secure.giveEventSticker', $access_token, $params); - } + /** + * Opens the game achievement and gives the user a sticker + * + * @param $access_token string + * @param $params array + * - array user_ids: + * - integer achievement_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function giveEventSticker(string $access_token, array $params = array()) { + return $this->request->post('secure.giveEventSticker', $access_token, $params); + } - /** - * Sends notification to the user. - * - * @param string $access_token - * @param array $params - * - @var array[integer] user_ids - * - @var integer user_id - * - @var string message: notification text which should be sent in 'UTF-8' encoding ('254' characters maximum). - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function sendNotification($access_token, array $params = []) { - return $this->request->post('secure.sendNotification', $access_token, $params); - } + /** + * Sends notification to the user. + * + * @param $access_token string + * @param $params array + * - array user_ids: + * - integer user_id: + * - string message: notification text which should be sent in 'UTF-8' encoding ('254' characters + * maximum). + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function sendNotification(string $access_token, array $params = array()) { + return $this->request->post('secure.sendNotification', $access_token, $params); + } - /** - * Sends 'SMS' notification to a user's mobile device. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: ID of the user to whom SMS notification is sent. The user shall allow the application to send him/her notifications (, +1). - * - @var string message: 'SMS' text to be sent in 'UTF-8' encoding. Only Latin letters and numbers are allowed. Maximum size is '160' characters. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiInsufficientFundsException Application has insufficient funds - * @throws VKApiMobileNotActivatedException The mobile number of the user is unknown - * @return mixed - */ - public function sendSMSNotification($access_token, array $params = []) { - return $this->request->post('secure.sendSMSNotification', $access_token, $params); - } + /** + * Sends 'SMS' notification to a user's mobile device. + * + * @param $access_token string + * @param $params array + * - integer user_id: ID of the user to whom SMS notification is sent. The user shall allow the + * application to send him/her notifications (, +1). + * - string message: 'SMS' text to be sent in 'UTF-8' encoding. Only Latin letters and numbers are + * allowed. Maximum size is '160' characters. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function sendSMSNotification(string $access_token, array $params = array()) { + return $this->request->post('secure.sendSMSNotification', $access_token, $params); + } - /** - * Sets a counter which is shown to the user in bold in the left menu. - * - * @param string $access_token - * @param array $params - * - @var array[string] counters - * - @var integer user_id - * - @var integer counter: counter value. - * - @var boolean increment - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessMenuException Access to the menu of the user denied - * @return mixed - */ - public function setCounter($access_token, array $params = []) { - return $this->request->post('secure.setCounter', $access_token, $params); - } + /** + * Sets a counter which is shown to the user in bold in the left menu. + * + * @param $access_token string + * @param $params array + * - array counters: + * - integer user_id: + * - integer counter: counter value. + * - boolean increment: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function setCounter(string $access_token, array $params = array()) { + return $this->request->post('secure.setCounter', $access_token, $params); + } } diff --git a/src/VK/Actions/Stats.php b/src/VK/Actions/Stats.php index 8480a17..630c058 100644 --- a/src/VK/Actions/Stats.php +++ b/src/VK/Actions/Stats.php @@ -1,76 +1,84 @@ request = $request; - } + /** + * Stats constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns statistics of a community or an application. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID. - * - @var integer app_id: Application ID. - * - @var integer timestamp_from - * - @var integer timestamp_to - * - @var string interval - * - @var integer intervals_count - * - @var array[string] filters - * - @var array[string] stats_groups - * - @var boolean extended - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('stats.get', $access_token, $params); - } + /** + * Returns statistics of a community or an application. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID. + * - integer app_id: Application ID. + * - integer timestamp_from: + * - integer timestamp_to: + * - StatsGetInterval interval: + * @see StatsGetInterval + * - integer intervals_count: + * - array filters: + * - array stats_groups: + * - boolean extended: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('stats.get', $access_token, $params); + } - /** - * Returns stats for a wall post. - * - * @param string $access_token - * @param array $params - * - @var string owner_id: post owner community id. Specify with "-" sign. - * - @var integer post_id: wall post id. Note that stats are available only for '300' last (newest) posts on a community wall. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAccessPostException Access to wall's post denied - * @return mixed - */ - public function getPostReach($access_token, array $params = []) { - return $this->request->post('stats.getPostReach', $access_token, $params); - } + /** + * Returns stats for a wall post. + * + * @param $access_token string + * @param $params array + * - string owner_id: post owner community id. Specify with "-" sign. + * - array post_ids: wall posts id + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getPostReach(string $access_token, array $params = array()) { + return $this->request->post('stats.getPostReach', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var string id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function trackVisitor($access_token, array $params = []) { - return $this->request->post('stats.trackVisitor', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - string id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function trackVisitor(string $access_token, array $params = array()) { + return $this->request->post('stats.trackVisitor', $access_token, $params); + } } diff --git a/src/VK/Actions/Status.php b/src/VK/Actions/Status.php index 8171f61..d6930f4 100644 --- a/src/VK/Actions/Status.php +++ b/src/VK/Actions/Status.php @@ -1,57 +1,60 @@ request = $request; - } + /** + * Status constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns data required to show the status of a user or community. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('status.get', $access_token, $params); - } + /** + * Returns data required to show the status of a user or community. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('status.get', $access_token, $params); + } - /** - * Sets a new status for the current user. - * - * @param string $access_token - * @param array $params - * - @var string text: Text of the new status. - * - @var integer group_id: Identifier of a community to set a status in. If left blank the status is set to current user. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiStatusNoAudioException User disabled track name broadcast - * @return mixed - */ - public function set($access_token, array $params = []) { - return $this->request->post('status.set', $access_token, $params); - } + /** + * Sets a new status for the current user. + * + * @param $access_token string + * @param $params array + * - string text: Text of the new status. + * - integer group_id: Identifier of a community to set a status in. If left blank the status is set to + * current user. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function set(string $access_token, array $params = array()) { + return $this->request->post('status.set', $access_token, $params); + } } diff --git a/src/VK/Actions/Storage.php b/src/VK/Actions/Storage.php index 43dcd18..26b5a71 100644 --- a/src/VK/Actions/Storage.php +++ b/src/VK/Actions/Storage.php @@ -1,78 +1,80 @@ request = $request; - } + /** + * Storage constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns a value of variable with the name set by key parameter. - * - * @param string $access_token - * @param array $params - * - @var string key - * - @var array[string] keys - * - @var integer user_id - * - @var boolean global - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('storage.get', $access_token, $params); - } + /** + * Returns a value of variable with the name set by key parameter. + * + * @param $access_token string + * @param $params array + * - string key: + * - array keys: + * - integer user_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('storage.get', $access_token, $params); + } - /** - * Returns the names of all variables. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: user id, whose variables names are returned if they were requested with a server method. - * - @var boolean global - * - @var integer offset - * - @var integer count: amount of variable names the info needs to be collected from. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getKeys($access_token, array $params = []) { - return $this->request->post('storage.getKeys', $access_token, $params); - } + /** + * Returns the names of all variables. + * + * @param $access_token string + * @param $params array + * - integer user_id: user id, whose variables names are returned if they were requested with a server + * method. + * - integer offset: + * - integer count: amount of variable names the info needs to be collected from. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getKeys(string $access_token, array $params = array()) { + return $this->request->post('storage.getKeys', $access_token, $params); + } - /** - * Saves a value of variable with the name set by 'key' parameter. - * - * @param string $access_token - * @param array $params - * - @var string key - * - @var string value - * - @var integer user_id - * - @var boolean global - * @throws VKClientException - * @throws VKApiException - * @throws VKApiLimitsException Out of limits - * @return mixed - */ - public function set($access_token, array $params = []) { - return $this->request->post('storage.set', $access_token, $params); - } + /** + * Saves a value of variable with the name set by 'key' parameter. + * + * @param $access_token string + * @param $params array + * - string key: + * - string value: + * - integer user_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function set(string $access_token, array $params = array()) { + return $this->request->post('storage.set', $access_token, $params); + } } diff --git a/src/VK/Actions/Store.php b/src/VK/Actions/Store.php new file mode 100644 index 0000000..57b5689 --- /dev/null +++ b/src/VK/Actions/Store.php @@ -0,0 +1,115 @@ +request = $request; + } + + /** + * Adds given sticker IDs to the list of user's favorite stickers + * + * @param $access_token string + * @param $params array + * - array sticker_ids: Sticker IDs to be added + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function addStickersToFavorite(string $access_token, array $params = array()) { + return $this->request->post('store.addStickersToFavorite', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getFavoriteStickers(string $access_token, array $params = array()) { + return $this->request->post('store.getFavoriteStickers', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - string type: + * - string merchant: + * - string section: + * - array product_ids: + * - array filters: + * - boolean extended: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getProducts(string $access_token, array $params = array()) { + return $this->request->post('store.getProducts', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - array stickers_ids: + * - array products_ids: + * - boolean aliases: + * - boolean all_products: + * - boolean need_stickers: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getStickersKeywords(string $access_token, array $params = array()) { + return $this->request->post('store.getStickersKeywords', $access_token, $params); + } + + /** + * Removes given sticker IDs from the list of user's favorite stickers + * + * @param $access_token string + * @param $params array + * - array sticker_ids: Sticker IDs to be removed + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function removeStickersFromFavorite(string $access_token, array $params = array()) { + return $this->request->post('store.removeStickersFromFavorite', $access_token, $params); + } +} diff --git a/src/VK/Actions/Stories.php b/src/VK/Actions/Stories.php index 394889f..19a2f80 100644 --- a/src/VK/Actions/Stories.php +++ b/src/VK/Actions/Stories.php @@ -1,246 +1,335 @@ request = $request; - } - - /** - * Allows to hide stories from chosen sources from current user's feed. - * - * @param string $access_token - * @param array $params - * - @var array[integer] owners_ids: List of sources IDs - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function banOwner($access_token, array $params = []) { - return $this->request->post('stories.banOwner', $access_token, $params); - } - - /** - * Allows to delete story. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: Story owner's ID. Current user id is used by default. - * - @var integer story_id: Story ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('stories.delete', $access_token, $params); - } - - /** - * Returns stories available for current user. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: Owner ID. - * - @var boolean extended: '1' — to return additional fields for users and communities. Default value is 0. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('stories.get', $access_token, $params); - } - - /** - * Returns list of sources hidden from current user's feed. - * - * @param string $access_token - * @param array $params - * - @var boolean extended: '1' — to return additional fields for users and communities. Default value is 0. - * - @var array[StoriesFields] fields: Additional fields to return - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getBanned($access_token, array $params = []) { - return $this->request->post('stories.getBanned', $access_token, $params); - } - - /** - * Returns story by its ID. - * - * @param string $access_token - * @param array $params - * - @var array[string] stories: Stories IDs separated by commas. Use format {owner_id}+'_'+{story_id}, for example, 12345_54331. - * - @var boolean extended: '1' — to return additional fields for users and communities. Default value is 0. - * - @var array[StoriesFields] fields: Additional fields to return - * @throws VKClientException - * @throws VKApiException - * @throws VKApiStoryExpiredException Story has already expired - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('stories.getById', $access_token, $params); - } - - /** - * Returns URL for uploading a story with photo. - * - * @param string $access_token - * @param array $params - * - @var boolean add_to_news: 1 — to add the story to friend's feed. - * - @var array[integer] user_ids: List of users IDs who can see the story. - * - @var string reply_to_story: ID of the story to reply with the current. - * - @var UploadLinkText link_text: Link text (for community's stories only). - * - @var string link_url: Link URL. Internal links on https://vk.com only. - * - @var integer group_id: ID of the community to upload the story (should be verified or with the "fire" icon). - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist - * @throws VKApiStoryIncorrectReplyPrivacyException Incorrect reply privacy - * @throws VKApiBlockedException Content blocked - * @return mixed - */ - public function getPhotoUploadServer($access_token, array $params = []) { - return $this->request->post('stories.getPhotoUploadServer', $access_token, $params); - } - - /** - * Returns replies to the story. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: Story owner ID. - * - @var integer story_id: Story ID. - * - @var string access_key: Access key for the private object. - * - @var boolean extended: '1' — to return additional fields for users and communities. Default value is 0. - * - @var array[StoriesFields] fields: Additional fields to return - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getReplies($access_token, array $params = []) { - return $this->request->post('stories.getReplies', $access_token, $params); - } - - /** - * Returns stories available for current user. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: Story owner ID. - * - @var integer story_id: Story ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getStats($access_token, array $params = []) { - return $this->request->post('stories.getStats', $access_token, $params); - } - - /** - * Allows to receive URL for uploading story with video. - * - * @param string $access_token - * @param array $params - * - @var boolean add_to_news: 1 — to add the story to friend's feed. - * - @var array[integer] user_ids: List of users IDs who can see the story. - * - @var string reply_to_story: ID of the story to reply with the current. - * - @var UploadLinkText link_text: Link text (for community's stories only). - * - @var string link_url: Link URL. Internal links on https://vk.com only. - * - @var integer group_id: ID of the community to upload the story (should be verified or with the "fire" icon). - * @throws VKClientException - * @throws VKApiException - * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist - * @throws VKApiStoryIncorrectReplyPrivacyException Incorrect reply privacy - * @throws VKApiBlockedException Content blocked - * @return mixed - */ - public function getVideoUploadServer($access_token, array $params = []) { - return $this->request->post('stories.getVideoUploadServer', $access_token, $params); - } - - /** - * Returns a list of story viewers. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: Story owner ID. - * - @var integer story_id: Story ID. - * - @var integer count: Maximum number of results. - * - @var integer offset: Offset needed to return a specific subset of results. - * - @var boolean extended: '1' — to return detailed information about photos - * @throws VKClientException - * @throws VKApiException - * @throws VKApiStoryExpiredException Story has already expired - * @return mixed - */ - public function getViewers($access_token, array $params = []) { - return $this->request->post('stories.getViewers', $access_token, $params); - } - - /** - * Hides all replies in the last 24 hours from the user to current user's stories. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user whose replies should be hidden. - * - @var integer group_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function hideAllReplies($access_token, array $params = []) { - return $this->request->post('stories.hideAllReplies', $access_token, $params); - } - - /** - * Hides the reply to the current user's story. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user whose replies should be hidden. - * - @var integer story_id: Story ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function hideReply($access_token, array $params = []) { - return $this->request->post('stories.hideReply', $access_token, $params); - } - - /** - * Allows to show stories from hidden sources in current user's feed. - * - * @param string $access_token - * @param array $params - * - @var array[integer] owners_ids: List of hidden sources to show stories from. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function unbanOwner($access_token, array $params = []) { - return $this->request->post('stories.unbanOwner', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Stories constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Allows to hide stories from chosen sources from current user's feed. + * + * @param $access_token string + * @param $params array + * - array owners_ids: List of sources IDs + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function banOwner(string $access_token, array $params = array()) { + return $this->request->post('stories.banOwner', $access_token, $params); + } + + /** + * Allows to delete story. + * + * @param $access_token string + * @param $params array + * - integer owner_id: Story owner's ID. Current user id is used by default. + * - integer story_id: Story ID. + * - array stories: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('stories.delete', $access_token, $params); + } + + /** + * Returns stories available for current user. + * + * @param $access_token string + * @param $params array + * - integer owner_id: Owner ID. + * - boolean extended: '1' — to return additional fields for users and communities. Default value is 0. + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('stories.get', $access_token, $params); + } + + /** + * Returns list of sources hidden from current user's feed. + * + * @param $access_token string + * @param $params array + * - boolean extended: '1' — to return additional fields for users and communities. Default value is 0. + * - array fields: Additional fields to return + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getBanned(string $access_token, array $params = array()) { + return $this->request->post('stories.getBanned', $access_token, $params); + } + + /** + * Returns story by its ID. + * + * @param $access_token string + * @param $params array + * - array stories: Stories IDs separated by commas. Use format {owner_id}+'_'+{story_id}, for example, + * 12345_54331. + * - boolean extended: '1' — to return additional fields for users and communities. Default value is 0. + * - array fields: Additional fields to return + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('stories.getById', $access_token, $params); + } + + /** + * Returns URL for uploading a story with photo. + * + * @param $access_token string + * @param $params array + * - boolean add_to_news: 1 — to add the story to friend's feed. + * - array user_ids: List of users IDs who can see the story. + * - string reply_to_story: ID of the story to reply with the current. + * - string link_text: Link text (for community's stories only). + * - string link_url: Link URL. Internal links on https://vk.com only. + * - integer group_id: ID of the community to upload the story (should be verified or with the "fire" + * icon). + * - string clickable_stickers: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function getPhotoUploadServer(string $access_token, array $params = array()) { + return $this->request->post('stories.getPhotoUploadServer', $access_token, $params); + } + + /** + * Returns replies to the story. + * + * @param $access_token string + * @param $params array + * - integer owner_id: Story owner ID. + * - integer story_id: Story ID. + * - string access_key: Access key for the private object. + * - boolean extended: '1' — to return additional fields for users and communities. Default value is 0. + * - array fields: Additional fields to return + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getReplies(string $access_token, array $params = array()) { + return $this->request->post('stories.getReplies', $access_token, $params); + } + + /** + * Returns stories available for current user. + * + * @param $access_token string + * @param $params array + * - integer owner_id: Story owner ID. + * - integer story_id: Story ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getStats(string $access_token, array $params = array()) { + return $this->request->post('stories.getStats', $access_token, $params); + } + + /** + * Allows to receive URL for uploading story with video. + * + * @param $access_token string + * @param $params array + * - boolean add_to_news: 1 — to add the story to friend's feed. + * - array user_ids: List of users IDs who can see the story. + * - string reply_to_story: ID of the story to reply with the current. + * - string link_text: Link text (for community's stories only). + * - string link_url: Link URL. Internal links on https://vk.com only. + * - integer group_id: ID of the community to upload the story (should be verified or with the "fire" + * icon). + * - string clickable_stickers: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function getVideoUploadServer(string $access_token, array $params = array()) { + return $this->request->post('stories.getVideoUploadServer', $access_token, $params); + } + + /** + * Returns a list of story viewers. + * + * @param $access_token string + * @param $params array + * - integer owner_id: Story owner ID. + * - integer story_id: Story ID. + * - integer count: Maximum number of results. + * - integer offset: Offset needed to return a specific subset of results. + * - boolean extended: '1' — to return detailed information about photos + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getViewers(string $access_token, array $params = array()) { + return $this->request->post('stories.getViewers', $access_token, $params); + } + + /** + * Hides all replies in the last 24 hours from the user to current user's stories. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user whose replies should be hidden. + * - integer group_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function hideAllReplies(string $access_token, array $params = array()) { + return $this->request->post('stories.hideAllReplies', $access_token, $params); + } + + /** + * Hides the reply to the current user's story. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user whose replies should be hidden. + * - integer story_id: Story ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function hideReply(string $access_token, array $params = array()) { + return $this->request->post('stories.hideReply', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - array upload_results: + * - boolean extended: + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function save(string $access_token, array $params = array()) { + return $this->request->post('stories.save', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - string q: + * - integer place_id: + * - number latitude: + * - number longitude: + * - integer radius: + * - integer mentioned_id: + * - integer count: + * - boolean extended: + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('stories.search', $access_token, $params); + } + + /** + * + * + * @param $access_token string + * @param $params array + * - string access_key: + * - string message: + * - boolean is_broadcast: + * - boolean is_anonymous: + * - boolean unseen_marker: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function sendInteraction(string $access_token, array $params = array()) { + return $this->request->post('stories.sendInteraction', $access_token, $params); + } + + /** + * Allows to show stories from hidden sources in current user's feed. + * + * @param $access_token string + * @param $params array + * - array owners_ids: List of hidden sources to show stories from. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function unbanOwner(string $access_token, array $params = array()) { + return $this->request->post('stories.unbanOwner', $access_token, $params); + } } diff --git a/src/VK/Actions/Streaming.php b/src/VK/Actions/Streaming.php index c840b53..fa8d4e3 100644 --- a/src/VK/Actions/Streaming.php +++ b/src/VK/Actions/Streaming.php @@ -1,50 +1,56 @@ request = $request; - } + /** + * Streaming constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Allows to receive data for the connection to Streaming API. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getServerUrl($access_token) { - return $this->request->post('streaming.getServerUrl', $access_token); - } + /** + * Allows to receive data for the connection to Streaming API. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getServerUrl(string $access_token, array $params = array()) { + return $this->request->post('streaming.getServerUrl', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var StreamingMonthlyTier monthly_tier - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function setSettings($access_token, array $params = []) { - return $this->request->post('streaming.setSettings', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - StreamingSetSettingsMonthlyTier monthly_tier: + * @see StreamingSetSettingsMonthlyTier + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function setSettings(string $access_token, array $params = array()) { + return $this->request->post('streaming.setSettings', $access_token, $params); + } } diff --git a/src/VK/Actions/Users.php b/src/VK/Actions/Users.php index 2eefe70..3370ccb 100644 --- a/src/VK/Actions/Users.php +++ b/src/VK/Actions/Users.php @@ -1,158 +1,172 @@ request = $request; - } + /** + * @var VKApiRequest + */ + private $request; - /** - * Returns detailed information on users. - * - * @param string $access_token - * @param array $params - * - @var array[string] user_ids: User IDs or screen names ('screen_name'). By default, current user ID. - * - @var array[UsersFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities', - * - @var UsersNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('users.get', $access_token, $params); - } + /** + * Users constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns a list of IDs of followers of the user in question, sorted by date added, most recent first. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var integer offset: Offset needed to return a specific subset of followers. - * - @var integer count: Number of followers to return. - * - @var array[UsersFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online'. - * - @var UsersNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getFollowers($access_token, array $params = []) { - return $this->request->post('users.getFollowers', $access_token, $params); - } + /** + * Returns detailed information on users. + * + * @param $access_token string + * @param $params array + * - array user_ids: User IDs or screen names ('screen_name'). By default, current user ID. + * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' + * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', + * 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', + * 'can_see_all_posts', 'can_post', 'universities', 'can_invite_to_chats' + * - UsersGetNameCase name_case: Case for declension of user name and surname: 'nom' — nominative + * (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — + * prepositional + * @see UsersGetNameCase + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('users.get', $access_token, $params); + } - /** - * Returns a list of IDs of users and communities followed by the user. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: User ID. - * - @var boolean extended: '1' — to return a combined list of users and communities, '0' — to return separate lists of users and communities (default) - * - @var integer offset: Offset needed to return a specific subset of subscriptions. - * - @var integer count: Number of users and communities to return. - * - @var array[UsersFields] fields - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getSubscriptions($access_token, array $params = []) { - return $this->request->post('users.getSubscriptions', $access_token, $params); - } + /** + * Returns a list of IDs of followers of the user in question, sorted by date added, most recent first. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - integer offset: Offset needed to return a specific subset of followers. + * - integer count: Number of followers to return. + * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' + * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', + * 'contacts', 'education', 'online'. + * - UsersGetFollowersNameCase name_case: Case for declension of user name and surname: 'nom' — + * nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , + * 'abl' — prepositional + * @see UsersGetFollowersNameCase + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getFollowers(string $access_token, array $params = array()) { + return $this->request->post('users.getFollowers', $access_token, $params); + } - /** - * Returns information whether a user installed the application. - * - * @param string $access_token - * @param array $params - * - @var integer user_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function isAppUser($access_token, array $params = []) { - return $this->request->post('users.isAppUser', $access_token, $params); - } + /** + * Returns a list of IDs of users and communities followed by the user. + * + * @param $access_token string + * @param $params array + * - integer user_id: User ID. + * - boolean extended: '1' — to return a combined list of users and communities, '0' — to return + * separate lists of users and communities (default) + * - integer offset: Offset needed to return a specific subset of subscriptions. + * - integer count: Number of users and communities to return. + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getSubscriptions(string $access_token, array $params = array()) { + return $this->request->post('users.getSubscriptions', $access_token, $params); + } - /** - * Reports (submits a complain about) a user. - * - * @param string $access_token - * @param array $params - * - @var integer user_id: ID of the user about whom a complaint is being made. - * - @var UsersType type: Type of complaint: 'porn' – pornography, 'spam' – spamming, 'insult' – abusive behavior, 'advertisement' – disruptive advertisements - * - @var string comment: Comment describing the complaint. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function report($access_token, array $params = []) { - return $this->request->post('users.report', $access_token, $params); - } + /** + * Reports (submits a complain about) a user. + * + * @param $access_token string + * @param $params array + * - integer user_id: ID of the user about whom a complaint is being made. + * - UsersReportType type: Type of complaint: 'porn' - pornography, 'spam' - spamming, 'insult' - abusive + * behavior, 'advertisement' - disruptive advertisements + * @see UsersReportType + * - string comment: Comment describing the complaint. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function report(string $access_token, array $params = array()) { + return $this->request->post('users.report', $access_token, $params); + } - /** - * Returns a list of users matching the search criteria. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query string (e.g., 'Vasya Babich'). - * - @var UsersSort sort: Sort order: '1' — by date registered, '0' — by rating - * - @var integer offset: Offset needed to return a specific subset of users. - * - @var integer count: Number of users to return. - * - @var array[UsersFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', - * - @var integer city: City ID. - * - @var integer country: Country ID. - * - @var string hometown: City name in a string. - * - @var integer university_country: ID of the country where the user graduated. - * - @var integer university: ID of the institution of higher education. - * - @var integer university_year: Year of graduation from an institution of higher education. - * - @var integer university_faculty: Faculty ID. - * - @var integer university_chair: Chair ID. - * - @var UsersSex sex: '1' — female, '2' — male, '0' — any (default) - * - @var UsersStatus status: Relationship status: '1' — Not married, '2' — In a relationship, '3' — Engaged, '4' — Married, '5' — It's complicated, '6' — Actively searching, '7' — In love - * - @var integer age_from: Minimum age. - * - @var integer age_to: Maximum age. - * - @var integer birth_day: Day of birth. - * - @var integer birth_month: Month of birth. - * - @var integer birth_year: Year of birth. - * - @var boolean online: '1' — online only, '0' — all users - * - @var boolean has_photo: '1' — with photo only, '0' — all users - * - @var integer school_country: ID of the country where users finished school. - * - @var integer school_city: ID of the city where users finished school. - * - @var integer school_class - * - @var integer school: ID of the school. - * - @var integer school_year: School graduation year. - * - @var string religion: Users' religious affiliation. - * - @var string interests: Users' interests. - * - @var string company: Name of the company where users work. - * - @var string position: Job position. - * - @var integer group_id: ID of a community to search in communities. - * - @var array[string] from_list - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('users.search', $access_token, $params); - } + /** + * Returns a list of users matching the search criteria. + * + * @param $access_token string + * @param $params array + * - string q: Search query string (e.g., 'Vasya Babich'). + * - UsersSearchSort sort: Sort order: '1' — by date registered, '0' — by rating + * @see UsersSearchSort + * - integer offset: Offset needed to return a specific subset of users. + * - integer count: Number of users to return. + * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' + * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', + * 'contacts', 'education', 'online', + * - integer city: City ID. + * - integer country: Country ID. + * - string hometown: City name in a string. + * - integer university_country: ID of the country where the user graduated. + * - integer university: ID of the institution of higher education. + * - integer university_year: Year of graduation from an institution of higher education. + * - integer university_faculty: Faculty ID. + * - integer university_chair: Chair ID. + * - UsersSearchSex sex: '1' — female, '2' — male, '0' — any (default) + * @see UsersSearchSex + * - UsersSearchStatus status: Relationship status: '1' — Not married, '2' — In a relationship, '3' + * — Engaged, '4' — Married, '5' — It's complicated, '6' — Actively searching, '7' — In love + * @see UsersSearchStatus + * - integer age_from: Minimum age. + * - integer age_to: Maximum age. + * - integer birth_day: Day of birth. + * - integer birth_month: Month of birth. + * - integer birth_year: Year of birth. + * - boolean online: '1' — online only, '0' — all users + * - boolean has_photo: '1' — with photo only, '0' — all users + * - integer school_country: ID of the country where users finished school. + * - integer school_city: ID of the city where users finished school. + * - integer school_class: + * - integer school: ID of the school. + * - integer school_year: School graduation year. + * - string religion: Users' religious affiliation. + * - string company: Name of the company where users work. + * - string position: Job position. + * - integer group_id: ID of a community to search in communities. + * - array from_list: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('users.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Utils.php b/src/VK/Actions/Utils.php index 7c6d478..2bdf89c 100644 --- a/src/VK/Actions/Utils.php +++ b/src/VK/Actions/Utils.php @@ -1,132 +1,149 @@ request = $request; - } + /** + * Utils constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Checks whether a link is blocked in VK. - * - * @param string $access_token - * @param array $params - * - @var string url: Link to check (e.g., 'http://google.com'). - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function checkLink($access_token, array $params = []) { - return $this->request->post('utils.checkLink', $access_token, $params); - } + /** + * Checks whether a link is blocked in VK. + * + * @param $access_token string + * @param $params array + * - string url: Link to check (e.g., 'http://google.com'). + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function checkLink(string $access_token, array $params = array()) { + return $this->request->post('utils.checkLink', $access_token, $params); + } - /** - * Deletes shortened link from user's list. - * - * @param string $access_token - * @param array $params - * - @var string key: Link key (characters after vk.cc/). - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteFromLastShortened($access_token, array $params = []) { - return $this->request->post('utils.deleteFromLastShortened', $access_token, $params); - } + /** + * Deletes shortened link from user's list. + * + * @param $access_token string + * @param $params array + * - string key: Link key (characters after vk.cc/). + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteFromLastShortened(string $access_token, array $params = array()) { + return $this->request->post('utils.deleteFromLastShortened', $access_token, $params); + } - /** - * Returns a list of user's shortened links. - * - * @param string $access_token - * @param array $params - * - @var integer count: Number of links to return. - * - @var integer offset: Offset needed to return a specific subset of links. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getLastShortenedLinks($access_token, array $params = []) { - return $this->request->post('utils.getLastShortenedLinks', $access_token, $params); - } + /** + * Returns a list of user's shortened links. + * + * @param $access_token string + * @param $params array + * - integer count: Number of links to return. + * - integer offset: Offset needed to return a specific subset of links. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getLastShortenedLinks(string $access_token, array $params = array()) { + return $this->request->post('utils.getLastShortenedLinks', $access_token, $params); + } - /** - * Returns stats data for shortened link. - * - * @param string $access_token - * @param array $params - * - @var string key: Link key (characters after vk.cc/). - * - @var UtilsSource source: Source of scope - * - @var string access_key: Access key for private link stats. - * - @var UtilsInterval interval: Interval. - * - @var integer intervals_count: Number of intervals to return. - * - @var boolean extended: 1 — to return extended stats data (sex, age, geo). 0 — to return views number only. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function getLinkStats($access_token, array $params = []) { - return $this->request->post('utils.getLinkStats', $access_token, $params); - } + /** + * Returns stats data for shortened link. + * + * @param $access_token string + * @param $params array + * - string key: Link key (characters after vk.cc/). + * - UtilsGetLinkStatsSource source: Source of scope + * @see UtilsGetLinkStatsSource + * - string access_key: Access key for private link stats. + * - UtilsGetLinkStatsInterval interval: Interval. + * @see UtilsGetLinkStatsInterval + * - integer intervals_count: Number of intervals to return. + * - boolean extended: 1 — to return extended stats data (sex, age, geo). 0 — to return views number + * only. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getLinkStats(string $access_token, array $params = array()) { + return $this->request->post('utils.getLinkStats', $access_token, $params); + } - /** - * Returns the current time of the VK server. - * - * @param string $access_token - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getServerTime($access_token) { - return $this->request->post('utils.getServerTime', $access_token); - } + /** + * Returns the current time of the VK server. + * + * @param $access_token string + * @param $params array + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getServerTime(string $access_token, array $params = array()) { + return $this->request->post('utils.getServerTime', $access_token, $params); + } - /** - * Allows to receive a link shortened via vk.cc. - * - * @param string $access_token - * @param array $params - * - @var string url: URL to be shortened. - * - @var boolean private: 1 — private stats, 0 — public stats. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getShortLink($access_token, array $params = []) { - return $this->request->post('utils.getShortLink', $access_token, $params); - } + /** + * Allows to receive a link shortened via vk.cc. + * + * @param $access_token string + * @param $params array + * - string url: URL to be shortened. + * - boolean private: 1 — private stats, 0 — public stats. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getShortLink(string $access_token, array $params = array()) { + return $this->request->post('utils.getShortLink', $access_token, $params); + } - /** - * Detects a type of object (e.g., user, community, application) and its ID by screen name. - * - * @param string $access_token - * @param array $params - * - @var string screen_name: Screen name of the user, community (e.g., 'apiclub,' 'andrew', or 'rules_of_war'), or application. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function resolveScreenName($access_token, array $params = []) { - return $this->request->post('utils.resolveScreenName', $access_token, $params); - } + /** + * Detects a type of object (e.g., user, community, application) and its ID by screen name. + * + * @param $access_token string + * @param $params array + * - string screen_name: Screen name of the user, community (e.g., 'apiclub,' 'andrew', or + * 'rules_of_war'), or application. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function resolveScreenName(string $access_token, array $params = array()) { + return $this->request->post('utils.resolveScreenName', $access_token, $params); + } } diff --git a/src/VK/Actions/Video.php b/src/VK/Actions/Video.php index e6bec87..cdcb4a9 100644 --- a/src/VK/Actions/Video.php +++ b/src/VK/Actions/Video.php @@ -1,481 +1,560 @@ request = $request; - } + /** + * Video constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Adds a video to a user or community page. - * - * @param string $access_token - * @param array $params - * - @var integer target_id: identifier of a user or community to add a video to. Use a negative value to designate a community ID. - * - @var integer video_id: Video ID. - * - @var integer owner_id: ID of the user or community that owns the video. Use a negative value to designate a community ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @throws VKApiVideoAlreadyAddedException This video is already added - * @return mixed - */ - public function add($access_token, array $params = []) { - return $this->request->post('video.add', $access_token, $params); - } + /** + * Adds a video to a user or community page. + * + * @param $access_token string + * @param $params array + * - integer target_id: identifier of a user or community to add a video to. Use a negative value to + * designate a community ID. + * - integer video_id: Video ID. + * - integer owner_id: ID of the user or community that owns the video. Use a negative value to designate + * a community ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function add(string $access_token, array $params = array()) { + return $this->request->post('video.add', $access_token, $params); + } - /** - * Creates an empty album for videos. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID (if the album will be created in a community). - * - @var string title: Album title. - * - @var array[VideoPrivacy] privacy: new access permissions for the album. Possible values: , *'0' – all users,, *'1' – friends only,, *'2' – friends and friends of friends,, *'3' – "only me". - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @throws VKApiAlbumsLimitException Albums number limit is reached - * @return mixed - */ - public function addAlbum($access_token, array $params = []) { - return $this->request->post('video.addAlbum', $access_token, $params); - } + /** + * Creates an empty album for videos. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID (if the album will be created in a community). + * - string title: Album title. + * - array privacy: new access permissions for the album. Possible values: , *'0' - all users,, *'1' - + * friends only,, *'2' - friends and friends of friends,, *'3' - "only me". + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function addAlbum(string $access_token, array $params = array()) { + return $this->request->post('video.addAlbum', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer target_id - * - @var integer album_id - * - @var array[integer] album_ids - * - @var integer owner_id - * - @var integer video_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @throws VKApiVideoAlreadyAddedException This video is already added - * @return mixed - */ - public function addToAlbum($access_token, array $params = []) { - return $this->request->post('video.addToAlbum', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer target_id: + * - integer album_id: + * - array album_ids: + * - integer owner_id: + * - integer video_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function addToAlbum(string $access_token, array $params = array()) { + return $this->request->post('video.addToAlbum', $access_token, $params); + } - /** - * Adds a new comment on a video. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer video_id: Video ID. - * - @var string message: New comment text. - * - @var array[string] attachments: List of objects attached to the comment, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" - * - @var boolean from_group: '1' — to post the comment from a community name (only if 'owner_id'<0) - * - @var integer reply_to_comment - * - @var integer sticker_id - * - @var string guid - * @throws VKClientException - * @throws VKApiException - * @throws VKApiVideoCommentsClosedException Comments for this video are closed - * @return mixed - */ - public function createComment($access_token, array $params = []) { - return $this->request->post('video.createComment', $access_token, $params); - } + /** + * Adds a new comment on a video. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video. + * - integer video_id: Video ID. + * - string message: New comment text. + * - array attachments: List of objects attached to the comment, in the following format: + * "_,_", '' — Type of media attachment: 'photo' — photo, 'video' + * — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. + * '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * - boolean from_group: '1' — to post the comment from a community name (only if 'owner_id'<0) + * - integer reply_to_comment: + * - integer sticker_id: + * - string guid: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function createComment(string $access_token, array $params = array()) { + return $this->request->post('video.createComment', $access_token, $params); + } - /** - * Deletes a video from a user or community page. - * - * @param string $access_token - * @param array $params - * - @var integer video_id: Video ID. - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer target_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('video.delete', $access_token, $params); - } + /** + * Deletes a video from a user or community page. + * + * @param $access_token string + * @param $params array + * - integer video_id: Video ID. + * - integer owner_id: ID of the user or community that owns the video. + * - integer target_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('video.delete', $access_token, $params); + } - /** - * Deletes a video album. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID (if the album is owned by a community). - * - @var integer album_id: Album ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @return mixed - */ - public function deleteAlbum($access_token, array $params = []) { - return $this->request->post('video.deleteAlbum', $access_token, $params); - } + /** + * Deletes a video album. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID (if the album is owned by a community). + * - integer album_id: Album ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function deleteAlbum(string $access_token, array $params = array()) { + return $this->request->post('video.deleteAlbum', $access_token, $params); + } - /** - * Deletes a comment on a video. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer comment_id: ID of the comment to be deleted. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function deleteComment($access_token, array $params = []) { - return $this->request->post('video.deleteComment', $access_token, $params); - } + /** + * Deletes a comment on a video. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video. + * - integer comment_id: ID of the comment to be deleted. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function deleteComment(string $access_token, array $params = array()) { + return $this->request->post('video.deleteComment', $access_token, $params); + } - /** - * Edits information about a video on a user or community page. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer video_id: Video ID. - * - @var string name: New video title. - * - @var string desc: New video description. - * - @var array[string] privacy_view: Privacy settings in a [vk.com/dev/privacy_setting|special format]. Privacy setting is available for videos uploaded to own profile by user. - * - @var array[string] privacy_comment: Privacy settings for comments in a [vk.com/dev/privacy_setting|special format]. - * - @var boolean no_comments: Disable comments for the group video. - * - @var boolean repeat: '1' — to repeat the playback of the video, '0' — to play the video once, - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('video.edit', $access_token, $params); - } + /** + * Edits information about a video on a user or community page. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video. + * - integer video_id: Video ID. + * - string name: New video title. + * - string desc: New video description. + * - array privacy_view: Privacy settings in a [vk.com/dev/privacy_setting|special format]. Privacy + * setting is available for videos uploaded to own profile by user. + * - array privacy_comment: Privacy settings for comments in a [vk.com/dev/privacy_setting|special + * format]. + * - boolean no_comments: Disable comments for the group video. + * - boolean repeat: '1' — to repeat the playback of the video, '0' — to play the video once, + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('video.edit', $access_token, $params); + } - /** - * Edits the title of a video album. - * - * @param string $access_token - * @param array $params - * - @var integer group_id: Community ID (if the album edited is owned by a community). - * - @var integer album_id: Album ID. - * - @var string title: New album title. - * - @var array[VideoPrivacy] privacy: new access permissions for the album. Possible values: , *'0' – all users,, *'1' – friends only,, *'2' – friends and friends of friends,, *'3' – "only me". - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @return mixed - */ - public function editAlbum($access_token, array $params = []) { - return $this->request->post('video.editAlbum', $access_token, $params); - } + /** + * Edits the title of a video album. + * + * @param $access_token string + * @param $params array + * - integer group_id: Community ID (if the album edited is owned by a community). + * - integer album_id: Album ID. + * - string title: New album title. + * - array privacy: new access permissions for the album. Possible values: , *'0' - all users,, *'1' - + * friends only,, *'2' - friends and friends of friends,, *'3' - "only me". + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function editAlbum(string $access_token, array $params = array()) { + return $this->request->post('video.editAlbum', $access_token, $params); + } - /** - * Edits the text of a comment on a video. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer comment_id: Comment ID. - * - @var string message: New comment text. - * - @var array[string] attachments: List of objects attached to the comment, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function editComment($access_token, array $params = []) { - return $this->request->post('video.editComment', $access_token, $params); - } + /** + * Edits the text of a comment on a video. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video. + * - integer comment_id: Comment ID. + * - string message: New comment text. + * - array attachments: List of objects attached to the comment, in the following format: + * "_,_", '' — Type of media attachment: 'photo' — photo, 'video' + * — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. + * '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function editComment(string $access_token, array $params = array()) { + return $this->request->post('video.editComment', $access_token, $params); + } - /** - * Returns detailed information about videos. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video(s). - * - @var array[string] videos: Video IDs, in the following format: "_,_", Use a negative value to designate a community ID. Example: "-4363_136089719,13245770_137352259" - * - @var integer album_id: ID of the album containing the video(s). - * - @var integer count: Number of videos to return. - * - @var integer offset: Offset needed to return a specific subset of videos. - * - @var boolean extended: '1' — to return an extended response with additional fields - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('video.get', $access_token, $params); - } + /** + * Returns detailed information about videos. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video(s). + * - array videos: Video IDs, in the following format: "_,_", Use + * a negative value to designate a community ID. Example: "-4363_136089719,13245770_137352259" + * - integer album_id: ID of the album containing the video(s). + * - integer count: Number of videos to return. + * - integer offset: Offset needed to return a specific subset of videos. + * - boolean extended: '1' — to return an extended response with additional fields + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('video.get', $access_token, $params); + } - /** - * Returns video album info - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: identifier of a user or community to add a video to. Use a negative value to designate a community ID. - * - @var integer album_id: Album ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @return mixed - */ - public function getAlbumById($access_token, array $params = []) { - return $this->request->post('video.getAlbumById', $access_token, $params); - } + /** + * Returns video album info + * + * @param $access_token string + * @param $params array + * - integer owner_id: identifier of a user or community to add a video to. Use a negative value to + * designate a community ID. + * - integer album_id: Album ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getAlbumById(string $access_token, array $params = array()) { + return $this->request->post('video.getAlbumById', $access_token, $params); + } - /** - * Returns a list of video albums owned by a user or community. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video album(s). - * - @var integer offset: Offset needed to return a specific subset of video albums. - * - @var integer count: Number of video albums to return. - * - @var boolean extended: '1' — to return additional information about album privacy settings for the current user - * - @var boolean need_system - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @return mixed - */ - public function getAlbums($access_token, array $params = []) { - return $this->request->post('video.getAlbums', $access_token, $params); - } + /** + * Returns a list of video albums owned by a user or community. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video album(s). + * - integer offset: Offset needed to return a specific subset of video albums. + * - integer count: Number of video albums to return. + * - boolean extended: '1' — to return additional information about album privacy settings for the + * current user + * - boolean need_system: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getAlbums(string $access_token, array $params = array()) { + return $this->request->post('video.getAlbums', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer target_id - * - @var integer owner_id - * - @var integer video_id - * - @var boolean extended - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @return mixed - */ - public function getAlbumsByVideo($access_token, array $params = []) { - return $this->request->post('video.getAlbumsByVideo', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer target_id: + * - integer owner_id: + * - integer video_id: + * - boolean extended: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getAlbumsByVideo(string $access_token, array $params = array()) { + return $this->request->post('video.getAlbumsByVideo', $access_token, $params); + } - /** - * Returns a list of comments on a video. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer video_id: Video ID. - * - @var boolean need_likes: '1' — to return an additional 'likes' field - * - @var integer start_comment_id - * - @var integer offset: Offset needed to return a specific subset of comments. - * - @var integer count: Number of comments to return. - * - @var VideoSort sort: Sort order: 'asc' — oldest comment first, 'desc' — newest comment first - * - @var boolean extended - * - @var array[string] fields - * @throws VKClientException - * @throws VKApiException - * @throws VKApiVideoCommentsClosedException Comments for this video are closed - * @return mixed - */ - public function getComments($access_token, array $params = []) { - return $this->request->post('video.getComments', $access_token, $params); - } + /** + * Returns a list of comments on a video. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video. + * - integer video_id: Video ID. + * - boolean need_likes: '1' — to return an additional 'likes' field + * - integer start_comment_id: + * - integer offset: Offset needed to return a specific subset of comments. + * - integer count: Number of comments to return. + * - VideoGetCommentsSort sort: Sort order: 'asc' — oldest comment first, 'desc' — newest comment + * first + * @see VideoGetCommentsSort + * - boolean extended: + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getComments(string $access_token, array $params = array()) { + return $this->request->post('video.getComments', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer target_id - * - @var integer album_id - * - @var array[integer] album_ids - * - @var integer owner_id - * - @var integer video_id - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @return mixed - */ - public function removeFromAlbum($access_token, array $params = []) { - return $this->request->post('video.removeFromAlbum', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer target_id: + * - integer album_id: + * - array album_ids: + * - integer owner_id: + * - integer video_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function removeFromAlbum(string $access_token, array $params = array()) { + return $this->request->post('video.removeFromAlbum', $access_token, $params); + } - /** - * Reorders the album in the list of user video albums. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the albums.. - * - @var integer album_id: Album ID. - * - @var integer before: ID of the album before which the album in question shall be placed. - * - @var integer after: ID of the album after which the album in question shall be placed. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @throws VKApiNotFoundException Not found - * @return mixed - */ - public function reorderAlbums($access_token, array $params = []) { - return $this->request->post('video.reorderAlbums', $access_token, $params); - } + /** + * Reorders the album in the list of user video albums. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the albums.. + * - integer album_id: Album ID. + * - integer before: ID of the album before which the album in question shall be placed. + * - integer after: ID of the album after which the album in question shall be placed. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function reorderAlbums(string $access_token, array $params = array()) { + return $this->request->post('video.reorderAlbums', $access_token, $params); + } - /** - * Reorders the video in the video album. - * - * @param string $access_token - * @param array $params - * - @var integer target_id: ID of the user or community that owns the album with videos. - * - @var integer album_id: ID of the video album. - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer video_id: ID of the video. - * - @var integer before_owner_id: ID of the user or community that owns the video before which the video in question shall be placed. - * - @var integer before_video_id: ID of the video before which the video in question shall be placed. - * - @var integer after_owner_id: ID of the user or community that owns the video after which the photo in question shall be placed. - * - @var integer after_video_id: ID of the video after which the photo in question shall be placed. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @return mixed - */ - public function reorderVideos($access_token, array $params = []) { - return $this->request->post('video.reorderVideos', $access_token, $params); - } + /** + * Reorders the video in the video album. + * + * @param $access_token string + * @param $params array + * - integer target_id: ID of the user or community that owns the album with videos. + * - integer album_id: ID of the video album. + * - integer owner_id: ID of the user or community that owns the video. + * - integer video_id: ID of the video. + * - integer before_owner_id: ID of the user or community that owns the video before which the video in + * question shall be placed. + * - integer before_video_id: ID of the video before which the video in question shall be placed. + * - integer after_owner_id: ID of the user or community that owns the video after which the photo in + * question shall be placed. + * - integer after_video_id: ID of the video after which the photo in question shall be placed. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function reorderVideos(string $access_token, array $params = array()) { + return $this->request->post('video.reorderVideos', $access_token, $params); + } - /** - * Reports (submits a complaint about) a video. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer video_id: Video ID. - * - @var VideoReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse - * - @var string comment: Comment describing the complaint. - * - @var string search_query: (If the video was found in search results.) Search query string. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function report($access_token, array $params = []) { - return $this->request->post('video.report', $access_token, $params); - } + /** + * Reports (submits a complaint about) a video. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video. + * - integer video_id: Video ID. + * - VideoReportReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - + * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse + * @see VideoReportReason + * - string comment: Comment describing the complaint. + * - string search_query: (If the video was found in search results.) Search query string. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function report(string $access_token, array $params = array()) { + return $this->request->post('video.report', $access_token, $params); + } - /** - * Reports (submits a complaint about) a comment on a video. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer comment_id: ID of the comment being reported. - * - @var VideoReason reason: Reason for the complaint: , 0 – spam , 1 – child pornography , 2 – extremism , 3 – violence , 4 – drug propaganda , 5 – adult material , 6 – insult, abuse - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function reportComment($access_token, array $params = []) { - return $this->request->post('video.reportComment', $access_token, $params); - } + /** + * Reports (submits a complaint about) a comment on a video. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video. + * - integer comment_id: ID of the comment being reported. + * - VideoReportCommentReason reason: Reason for the complaint: , 0 - spam , 1 - child pornography , 2 - + * extremism , 3 - violence , 4 - drug propaganda , 5 - adult material , 6 - insult, abuse + * @see VideoReportCommentReason + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function reportComment(string $access_token, array $params = array()) { + return $this->request->post('video.reportComment', $access_token, $params); + } - /** - * Restores a previously deleted video. - * - * @param string $access_token - * @param array $params - * - @var integer video_id: Video ID. - * - @var integer owner_id: ID of the user or community that owns the video. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function restore($access_token, array $params = []) { - return $this->request->post('video.restore', $access_token, $params); - } + /** + * Restores a previously deleted video. + * + * @param $access_token string + * @param $params array + * - integer video_id: Video ID. + * - integer owner_id: ID of the user or community that owns the video. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function restore(string $access_token, array $params = array()) { + return $this->request->post('video.restore', $access_token, $params); + } - /** - * Restores a previously deleted comment on a video. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the video. - * - @var integer comment_id: ID of the deleted comment. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function restoreComment($access_token, array $params = []) { - return $this->request->post('video.restoreComment', $access_token, $params); - } + /** + * Restores a previously deleted comment on a video. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the video. + * - integer comment_id: ID of the deleted comment. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function restoreComment(string $access_token, array $params = array()) { + return $this->request->post('video.restoreComment', $access_token, $params); + } - /** - * Returns a server address (required for upload) and video data. - * - * @param string $access_token - * @param array $params - * - @var string name: Name of the video. - * - @var string description: Description of the video. - * - @var boolean is_private: '1' — to designate the video as private (send it via a private message), the video will not appear on the user's video list and will not be available by ID for other users, '0' — not to designate the video as private - * - @var boolean wallpost: '1' — to post the saved video on a user's wall, '0' — not to post the saved video on a user's wall - * - @var string link: URL for embedding the video from an external website. - * - @var integer group_id: ID of the community in which the video will be saved. By default, the current user's page. - * - @var integer album_id: ID of the album to which the saved video will be added. - * - @var array[string] privacy_view - * - @var array[string] privacy_comment - * - @var boolean no_comments - * - @var boolean repeat: '1' — to repeat the playback of the video, '0' — to play the video once, - * - @var boolean compression - * @throws VKClientException - * @throws VKApiException - * @throws VKApiAccessVideoException Access denied - * @throws VKApiWallAddPostException Access to adding post denied - * @throws VKApiWallAdsPublishedException Advertisement post was recently added - * @return mixed - */ - public function save($access_token, array $params = []) { - return $this->request->post('video.save', $access_token, $params); - } + /** + * Returns a server address (required for upload) and video data. + * + * @param $access_token string + * @param $params array + * - string name: Name of the video. + * - string description: Description of the video. + * - boolean is_private: '1' — to designate the video as private (send it via a private message), the + * video will not appear on the user's video list and will not be available by ID for other users, '0' — not + * to designate the video as private + * - boolean wallpost: '1' — to post the saved video on a user's wall, '0' — not to post the saved + * video on a user's wall + * - string link: URL for embedding the video from an external website. + * - integer group_id: ID of the community in which the video will be saved. By default, the current + * user's page. + * - integer album_id: ID of the album to which the saved video will be added. + * - array privacy_view: + * - array privacy_comment: + * - boolean no_comments: + * - boolean repeat: '1' — to repeat the playback of the video, '0' — to play the video once, + * - boolean compression: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function save(string $access_token, array $params = array()) { + return $this->request->post('video.save', $access_token, $params); + } - /** - * Returns a list of videos under the set search criterion. - * - * @param string $access_token - * @param array $params - * - @var string q: Search query string (e.g., 'The Beatles'). - * - @var VideoSort sort: Sort order: '1' — by duration, '2' — by relevance, '0' — by date added - * - @var integer hd: If not null, only searches for high-definition videos. - * - @var boolean adult: '1' — to disable the Safe Search filter, '0' — to enable the Safe Search filter - * - @var array[VideoFilters] filters: Filters to apply: 'youtube' — return YouTube videos only, 'vimeo' — return Vimeo videos only, 'short' — return short videos only, 'long' — return long videos only - * - @var boolean search_own - * - @var integer offset: Offset needed to return a specific subset of videos. - * - @var integer longer - * - @var integer shorter - * - @var integer count: Number of videos to return. - * - @var boolean extended - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('video.search', $access_token, $params); - } + /** + * Returns a list of videos under the set search criterion. + * + * @param $access_token string + * @param $params array + * - string q: Search query string (e.g., 'The Beatles'). + * - VideoSearchSort sort: Sort order: '1' — by duration, '2' — by relevance, '0' — by date added + * @see VideoSearchSort + * - integer hd: If not null, only searches for high-definition videos. + * - boolean adult: '1' — to disable the Safe Search filter, '0' — to enable the Safe Search filter + * - array filters: Filters to apply: 'youtube' — return YouTube videos only, 'vimeo' — return Vimeo + * videos only, 'short' — return short videos only, 'long' — return long videos only + * - boolean search_own: + * - integer offset: Offset needed to return a specific subset of videos. + * - integer longer: + * - integer shorter: + * - integer count: Number of videos to return. + * - boolean extended: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('video.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Wall.php b/src/VK/Actions/Wall.php index 6809c62..9db8e92 100644 --- a/src/VK/Actions/Wall.php +++ b/src/VK/Actions/Wall.php @@ -1,477 +1,610 @@ request = $request; + } + + /** + * + * + * @param $access_token string + * @param $params array + * - string link: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function checkCopyrightLink(string $access_token, array $params = array()) { + return $this->request->post('wall.checkCopyrightLink', $access_token, $params); + } - /** - * Wall constructor. - * - * @param VKApiRequest $request - */ - public function __construct(VKApiRequest $request) { - $this->request = $request; - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer post_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function closeComments(string $access_token, array $params = array()) { + return $this->request->post('wall.closeComments', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer post_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function closeComments($access_token, array $params = []) { - return $this->request->post('wall.closeComments', $access_token, $params); - } + /** + * Adds a comment to a post on a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer post_id: Post ID. + * - integer from_group: Group ID. + * - string message: (Required if 'attachments' is not set.) Text of the comment. + * - integer reply_to_comment: ID of comment to reply. + * - array attachments: (Required if 'message' is not set.) List of media objects attached to the comment, + * in the following format: "_,_", '' — Type of media ojbect: 'photo' + * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. + * '' — Media ID. For example: "photo100172_166443618,photo66748_265827614" + * - integer sticker_id: Sticker ID. + * - string guid: Unique identifier to avoid repeated comments. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function createComment(string $access_token, array $params = array()) { + return $this->request->post('wall.createComment', $access_token, $params); + } - /** - * Adds a comment to a post on a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer post_id: Post ID. - * - @var integer from_group: Group ID. - * - @var string message: (Required if 'attachments' is not set.) Text of the comment. - * - @var integer reply_to_comment: ID of comment to reply. - * - @var array[string] attachments: (Required if 'message' is not set.) List of media objects attached to the comment, in the following format: "_,_", '' — Type of media ojbect: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media ID. For example: "photo100172_166443618,photo66748_265827614" - * - @var integer sticker_id: Sticker ID. - * - @var string guid: Unique identifier to avoid repeated comments. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAccessAddReplyException Access to status replies denied - * @throws VKApiWallReplyOwnerFloodException Too many replies - * @throws VKApiWallLinksForbiddenException Hyperlinks are forbidden - * @throws VKApiWallAccessRepliesException Access to post comments denied - * @return mixed - */ - public function createComment($access_token, array $params = []) { - return $this->request->post('wall.createComment', $access_token, $params); - } + /** + * Deletes a post from a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer post_id: ID of the post to be deleted. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function delete(string $access_token, array $params = array()) { + return $this->request->post('wall.delete', $access_token, $params); + } - /** - * Deletes a post from a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer post_id: ID of the post to be deleted. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAccessPostException Access to wall's post denied - * @return mixed - */ - public function delete($access_token, array $params = []) { - return $this->request->post('wall.delete', $access_token, $params); - } + /** + * Deletes a comment on a post on a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer comment_id: Comment ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function deleteComment(string $access_token, array $params = array()) { + return $this->request->post('wall.deleteComment', $access_token, $params); + } - /** - * Deletes a comment on a post on a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer comment_id: Comment ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAccessCommentException Access to wall's comment denied - * @return mixed - */ - public function deleteComment($access_token, array $params = []) { - return $this->request->post('wall.deleteComment', $access_token, $params); - } + /** + * Edits a post on a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer post_id: + * - boolean friends_only: + * - string message: (Required if 'attachments' is not set.) Text of the post. + * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the + * following format: "_,_", '' — Type of media attachment: 'photo' + * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media + * application owner. '' — Media application ID. Example: + * "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. + * Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an + * error is thrown." + * - string services: + * - boolean signed: + * - integer publish_date: + * - number lat: + * - number long: + * - integer place_id: + * - boolean mark_as_ads: + * - boolean close_comments: + * - integer donut_paid_duration: + * - integer poster_bkg_id: + * - integer poster_bkg_owner_id: + * - string poster_bkg_access_hash: + * - string copyright: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function edit(string $access_token, array $params = array()) { + return $this->request->post('wall.edit', $access_token, $params); + } - /** - * Edits a post on a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer post_id - * - @var boolean friends_only - * - @var string message: (Required if 'attachments' is not set.) Text of the post. - * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media application owner. '' — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error is thrown." - * - @var string services - * - @var boolean signed - * - @var integer publish_date - * - @var number lat - * - @var number long - * - @var integer place_id - * - @var boolean mark_as_ads - * - @var boolean close_comments - * - @var integer poster_bkg_id - * - @var integer poster_bkg_owner_id - * - @var string poster_bkg_access_hash - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAdsPostLimitReachedException Too many ads posts - * @return mixed - */ - public function edit($access_token, array $params = []) { - return $this->request->post('wall.edit', $access_token, $params); - } + /** + * Allows to edit hidden post. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer post_id: Post ID. Used for publishing of scheduled and suggested posts. + * - string message: (Required if 'attachments' is not set.) Text of the post. + * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the + * following format: "_,_", '' — Type of media attachment: 'photo' + * — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, + * 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' + * — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an + * external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more + * than one link is being attached, an error will be thrown." + * - boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be + * signed with the name of the posting user, '0' — post will not be signed (default) + * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - integer place_id: ID of the location where the user was tagged. + * - string link_button: Link button ID + * - string link_title: Link title + * - string link_image: Link image url + * - string link_video: Link video ID in format "_" + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function editAdsStealth(string $access_token, array $params = array()) { + return $this->request->post('wall.editAdsStealth', $access_token, $params); + } - /** - * Allows to edit hidden post. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer post_id: Post ID. Used for publishing of scheduled and suggested posts. - * - @var string message: (Required if 'attachments' is not set.) Text of the post. - * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error will be thrown." - * - @var boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be signed with the name of the posting user, '0' — post will not be signed (default) - * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - @var integer place_id: ID of the location where the user was tagged. - * - @var string link_button: Link button ID - * - @var string link_title: Link title - * - @var string link_image: Link image url - * - @var string link_video: Link video ID in format "_" - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAdsPostLimitReachedException Too many ads posts - * @return mixed - */ - public function editAdsStealth($access_token, array $params = []) { - return $this->request->post('wall.editAdsStealth', $access_token, $params); - } + /** + * Edits a comment on a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer comment_id: Comment ID. + * - string message: New comment text. + * - array attachments: List of objects attached to the comment, in the following format: , + * "_,_", '' — Type of media attachment: 'photo' — photo, 'video' + * — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. + * '' — Media attachment ID. For example: "photo100172_166443618,photo66748_265827614" + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function editComment(string $access_token, array $params = array()) { + return $this->request->post('wall.editComment', $access_token, $params); + } - /** - * Edits a comment on a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer comment_id: Comment ID. - * - @var string message: New comment text. - * - @var array[string] attachments: List of objects attached to the comment, in the following format: , "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. '' — Media attachment ID. For example: "photo100172_166443618,photo66748_265827614" - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function editComment($access_token, array $params = []) { - return $this->request->post('wall.editComment', $access_token, $params); - } + /** + * Returns a list of posts on a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a + * negative value to designate a community ID. + * - string domain: User or community short address. + * - integer offset: Offset needed to return a specific subset of posts. + * - integer count: Number of posts to return (maximum 100). + * - string filter: + * - boolean extended: '1' — to return 'wall', 'profiles', and 'groups' fields, '0' — to return no + * additional fields (default) + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function get(string $access_token, array $params = array()) { + return $this->request->post('wall.get', $access_token, $params); + } - /** - * Returns a list of posts on a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. - * - @var string domain: User or community short address. - * - @var integer offset: Offset needed to return a specific subset of posts. - * - @var integer count: Number of posts to return (maximum 100). - * - @var WallFilter filter: Filter to apply: 'owner' — posts by the wall owner, 'others' — posts by someone else, 'all' — posts by the wall owner and others (default), 'postponed' — timed posts (only available for calls with an 'access_token'), 'suggests' — suggested posts on a community wall - * - @var boolean extended: '1' — to return 'wall', 'profiles', and 'groups' fields, '0' — to return no additional fields (default) - * - @var array[WallFields] fields - * @throws VKClientException - * @throws VKApiException - * @throws VKApiBlockedException Content blocked - * @return mixed - */ - public function get($access_token, array $params = []) { - return $this->request->post('wall.get', $access_token, $params); - } + /** + * Returns a list of posts from user or community walls by their IDs. + * + * @param $access_token string + * @param $params array + * - array posts: User or community IDs and post IDs, separated by underscores. Use a negative value to + * designate a community ID. Example: "93388_21539,93388_20904,2943_4276,-1_1" + * - boolean extended: '1' — to return user and community objects needed to display posts, '0' — no + * additional fields are returned (default) + * - integer copy_history_depth: Sets the number of parent elements to include in the array 'copy_history' + * that is returned if the post is a repost from another wall. + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getById(string $access_token, array $params = array()) { + return $this->request->post('wall.getById', $access_token, $params); + } - /** - * Returns a list of posts from user or community walls by their IDs. - * - * @param string $access_token - * @param array $params - * - @var array[string] posts: User or community IDs and post IDs, separated by underscores. Use a negative value to designate a community ID. Example: "93388_21539,93388_20904,2943_4276,-1_1" - * - @var boolean extended: '1' — to return user and community objects needed to display posts, '0' — no additional fields are returned (default) - * - @var integer copy_history_depth: Sets the number of parent elements to include in the array 'copy_history' that is returned if the post is a repost from another wall. - * - @var array[WallFields] fields - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getById($access_token, array $params = []) { - return $this->request->post('wall.getById', $access_token, $params); - } + /** + * Returns a comment on a post on a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer comment_id: Comment ID. + * - boolean extended: + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getComment(string $access_token, array $params = array()) { + return $this->request->post('wall.getComment', $access_token, $params); + } - /** - * Returns a list of comments on a post on a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer post_id: Post ID. - * - @var boolean need_likes: '1' — to return the 'likes' field, '0' — not to return the 'likes' field (default) - * - @var integer start_comment_id - * - @var integer offset: Offset needed to return a specific subset of comments. - * - @var integer count: Number of comments to return (maximum 100). - * - @var WallSort sort: Sort order: 'asc' — chronological, 'desc' — reverse chronological - * - @var integer preview_length: Number of characters at which to truncate comments when previewed. By default, '90'. Specify '0' if you do not want to truncate comments. - * - @var boolean extended - * - @var array[WallFields] fields - * - @var integer comment_id: Comment ID. - * - @var integer thread_items_count: Count items in threads. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAccessRepliesException Access to post comments denied - * @return mixed - */ - public function getComments($access_token, array $params = []) { - return $this->request->post('wall.getComments', $access_token, $params); - } + /** + * Returns a list of comments on a post on a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer post_id: Post ID. + * - boolean need_likes: '1' — to return the 'likes' field, '0' — not to return the 'likes' field + * (default) + * - integer start_comment_id: + * - integer offset: Offset needed to return a specific subset of comments. + * - integer count: Number of comments to return (maximum 100). + * - WallGetCommentsSort sort: Sort order: 'asc' — chronological, 'desc' — reverse chronological + * @see WallGetCommentsSort + * - integer preview_length: Number of characters at which to truncate comments when previewed. By + * default, '90'. Specify '0' if you do not want to truncate comments. + * - boolean extended: + * - array fields: + * - integer comment_id: Comment ID. + * - integer thread_items_count: Count items in threads. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function getComments(string $access_token, array $params = array()) { + return $this->request->post('wall.getComments', $access_token, $params); + } - /** - * Returns information about reposts of a post on user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. By default, current user ID. Use a negative value to designate a community ID. - * - @var integer post_id: Post ID. - * - @var integer offset: Offset needed to return a specific subset of reposts. - * - @var integer count: Number of reposts to return. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getReposts($access_token, array $params = []) { - return $this->request->post('wall.getReposts', $access_token, $params); - } + /** + * Returns information about reposts of a post on user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. By default, current user ID. Use a negative value to + * designate a community ID. + * - integer post_id: Post ID. + * - integer offset: Offset needed to return a specific subset of reposts. + * - integer count: Number of reposts to return. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getReposts(string $access_token, array $params = array()) { + return $this->request->post('wall.getReposts', $access_token, $params); + } - /** - * @param string $access_token - * @param array $params - * - @var integer owner_id - * - @var integer post_id - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function openComments($access_token, array $params = []) { - return $this->request->post('wall.openComments', $access_token, $params); - } + /** + * + * + * @param $access_token string + * @param $params array + * - integer owner_id: + * - integer post_id: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function openComments(string $access_token, array $params = array()) { + return $this->request->post('wall.openComments', $access_token, $params); + } - /** - * Pins the post on wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. - * - @var integer post_id: Post ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function pin($access_token, array $params = []) { - return $this->request->post('wall.pin', $access_token, $params); - } + /** + * Pins the post on wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a + * negative value to designate a community ID. + * - integer post_id: Post ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function pin(string $access_token, array $params = array()) { + return $this->request->post('wall.pin', $access_token, $params); + } - /** - * Adds a new post on a user wall or community wall. Can also be used to publish suggested or scheduled posts. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var boolean friends_only: '1' — post will be available to friends only, '0' — post will be available to all users (default) - * - @var boolean from_group: For a community: '1' — post will be published by the community, '0' — post will be published by the user (default) - * - @var string message: (Required if 'attachments' is not set.) Text of the post. - * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error will be thrown." - * - @var string services: List of services or websites the update will be exported to, if the user has so requested. Sample values: 'twitter', 'facebook'. - * - @var boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be signed with the name of the posting user, '0' — post will not be signed (default) - * - @var integer publish_date: Publication date (in Unix time). If used, posting will be delayed until the set time. - * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - @var integer place_id: ID of the location where the user was tagged. - * - @var integer post_id: Post ID. Used for publishing of scheduled and suggested posts. - * - @var string guid - * - @var boolean mark_as_ads - * - @var boolean close_comments - * - @var boolean mute_notifications - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAdsPublishedException Advertisement post was recently added - * @throws VKApiWallAddPostException Access to adding post denied - * @throws VKApiWallTooManyRecipientsException Too many recipients - * @throws VKApiWallLinksForbiddenException Hyperlinks are forbidden - * @throws VKApiWallAdsPostLimitReachedException Too many ads posts - * @return mixed - */ - public function post($access_token, array $params = []) { - return $this->request->post('wall.post', $access_token, $params); - } + /** + * Adds a new post on a user wall or community wall. Can also be used to publish suggested or scheduled posts. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - boolean friends_only: '1' — post will be available to friends only, '0' — post will be available + * to all users (default) + * - boolean from_group: For a community: '1' — post will be published by the community, '0' — post + * will be published by the user (default) + * - string message: (Required if 'attachments' is not set.) Text of the post. + * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the + * following format: "_,_", '' — Type of media attachment: 'photo' + * — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, + * 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' + * — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an + * external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more + * than one link is being attached, an error will be thrown." + * - string services: List of services or websites the update will be exported to, if the user has so + * requested. Sample values: 'twitter', 'facebook'. + * - boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be + * signed with the name of the posting user, '0' — post will not be signed (default) + * - integer publish_date: Publication date (in Unix time). If used, posting will be delayed until the set + * time. + * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - integer place_id: ID of the location where the user was tagged. + * - integer post_id: Post ID. Used for publishing of scheduled and suggested posts. + * - string guid: + * - boolean mark_as_ads: + * - boolean close_comments: + * - integer donut_paid_duration: + * - boolean mute_notifications: + * - string copyright: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function post(string $access_token, array $params = array()) { + return $this->request->post('wall.post', $access_token, $params); + } - /** - * Allows to create hidden post which will not be shown on the community's wall and can be used for creating an ad with type "Community post". - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var string message: (Required if 'attachments' is not set.) Text of the post. - * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error will be thrown." - * - @var boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be signed with the name of the posting user, '0' — post will not be signed (default) - * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - @var integer place_id: ID of the location where the user was tagged. - * - @var string guid: Unique identifier to avoid duplication the same post. - * - @var string link_button: Link button ID - * - @var string link_title: Link title - * - @var string link_image: Link image url - * - @var string link_video: Link video ID in format "_" - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAdsPublishedException Advertisement post was recently added - * @throws VKApiWallAddPostException Access to adding post denied - * @throws VKApiWallTooManyRecipientsException Too many recipients - * @throws VKApiWallLinksForbiddenException Hyperlinks are forbidden - * @return mixed - */ - public function postAdsStealth($access_token, array $params = []) { - return $this->request->post('wall.postAdsStealth', $access_token, $params); - } + /** + * Allows to create hidden post which will not be shown on the community's wall and can be used for creating an ad + * with type "Community post". + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - string message: (Required if 'attachments' is not set.) Text of the post. + * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the + * following format: "_,_", '' — Type of media attachment: 'photo' + * — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, + * 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' + * — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an + * external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more + * than one link is being attached, an error will be thrown." + * - boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be + * signed with the name of the posting user, '0' — post will not be signed (default) + * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - integer place_id: ID of the location where the user was tagged. + * - string guid: Unique identifier to avoid duplication the same post. + * - string link_button: Link button ID + * - string link_title: Link title + * - string link_image: Link image url + * - string link_video: Link video ID in format "_" + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function postAdsStealth(string $access_token, array $params = array()) { + return $this->request->post('wall.postAdsStealth', $access_token, $params); + } - /** - * Reports (submits a complaint about) a comment on a post on a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the wall. - * - @var integer comment_id: Comment ID. - * - @var WallReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function reportComment($access_token, array $params = []) { - return $this->request->post('wall.reportComment', $access_token, $params); - } + /** + * Reports (submits a complaint about) a comment on a post on a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the wall. + * - integer comment_id: Comment ID. + * - WallReportCommentReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - + * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse + * @see WallReportCommentReason + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function reportComment(string $access_token, array $params = array()) { + return $this->request->post('wall.reportComment', $access_token, $params); + } - /** - * Reports (submits a complaint about) a post on a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the wall. - * - @var integer post_id: Post ID. - * - @var WallReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function reportPost($access_token, array $params = []) { - return $this->request->post('wall.reportPost', $access_token, $params); - } + /** + * Reports (submits a complaint about) a post on a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the wall. + * - integer post_id: Post ID. + * - WallReportPostReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - + * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse + * @see WallReportPostReason + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function reportPost(string $access_token, array $params = array()) { + return $this->request->post('wall.reportPost', $access_token, $params); + } - /** - * Reposts (copies) an object to a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var string object: ID of the object to be reposted on the wall. Example: "wall66748_3675" - * - @var string message: Comment to be added along with the reposted object. - * - @var integer group_id: Target community ID when reposting to a community. - * - @var boolean mark_as_ads - * - @var boolean mute_notifications - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAdsPublishedException Advertisement post was recently added - * @throws VKApiWallAddPostException Access to adding post denied - * @throws VKApiWallAdsPostLimitReachedException Too many ads posts - * @return mixed - */ - public function repost($access_token, array $params = []) { - return $this->request->post('wall.repost', $access_token, $params); - } + /** + * Reposts (copies) an object to a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - string object: ID of the object to be reposted on the wall. Example: "wall66748_3675" + * - string message: Comment to be added along with the reposted object. + * - integer group_id: Target community ID when reposting to a community. + * - boolean mark_as_ads: + * - boolean mute_notifications: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * @throws undefined + * + */ + public function repost(string $access_token, array $params = array()) { + return $this->request->post('wall.repost', $access_token, $params); + } - /** - * Restores a post deleted from a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID from whose wall the post was deleted. Use a negative value to designate a community ID. - * - @var integer post_id: ID of the post to be restored. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAccessPostException Access to wall's post denied - * @throws VKApiWallAddPostException Access to adding post denied - * @return mixed - */ - public function restore($access_token, array $params = []) { - return $this->request->post('wall.restore', $access_token, $params); - } + /** + * Restores a post deleted from a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID from whose wall the post was deleted. Use a negative value + * to designate a community ID. + * - integer post_id: ID of the post to be restored. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * @throws undefined + * + */ + public function restore(string $access_token, array $params = array()) { + return $this->request->post('wall.restore', $access_token, $params); + } - /** - * Restores a comment deleted from a user wall or community wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - @var integer comment_id: Comment ID. - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAccessCommentException Access to wall's comment denied - * @return mixed - */ - public function restoreComment($access_token, array $params = []) { - return $this->request->post('wall.restoreComment', $access_token, $params); - } + /** + * Restores a comment deleted from a user wall or community wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - integer comment_id: Comment ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function restoreComment(string $access_token, array $params = array()) { + return $this->request->post('wall.restoreComment', $access_token, $params); + } - /** - * Allows to search posts on user or community walls. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: user or community id. "Remember that for a community 'owner_id' must be negative." - * - @var string domain: user or community screen name. - * - @var string query: search query string. - * - @var boolean owners_only: '1' – returns only page owner's posts. - * - @var integer count: count of posts to return. - * - @var integer offset: Offset needed to return a specific subset of posts. - * - @var boolean extended: show extended post info. - * - @var array[WallFields] fields - * @throws VKClientException - * @throws VKApiException - * @throws VKApiWallAccessPostException Access to wall's post denied - * @return mixed - */ - public function search($access_token, array $params = []) { - return $this->request->post('wall.search', $access_token, $params); - } + /** + * Allows to search posts on user or community walls. + * + * @param $access_token string + * @param $params array + * - integer owner_id: user or community id. "Remember that for a community 'owner_id' must be negative." + * - string domain: user or community screen name. + * - string query: search query string. + * - boolean owners_only: '1' - returns only page owner's posts. + * - integer count: count of posts to return. + * - integer offset: Offset needed to return a specific subset of posts. + * - boolean extended: show extended post info. + * - array fields: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * @throws undefined + * + */ + public function search(string $access_token, array $params = array()) { + return $this->request->post('wall.search', $access_token, $params); + } - /** - * Unpins the post on wall. - * - * @param string $access_token - * @param array $params - * - @var integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. - * - @var integer post_id: Post ID. - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function unpin($access_token, array $params = []) { - return $this->request->post('wall.unpin', $access_token, $params); - } + /** + * Unpins the post on wall. + * + * @param $access_token string + * @param $params array + * - integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a + * negative value to designate a community ID. + * - integer post_id: Post ID. + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function unpin(string $access_token, array $params = array()) { + return $this->request->post('wall.unpin', $access_token, $params); + } } diff --git a/src/VK/Actions/Widgets.php b/src/VK/Actions/Widgets.php index c8658a5..ba2cc25 100644 --- a/src/VK/Actions/Widgets.php +++ b/src/VK/Actions/Widgets.php @@ -1,63 +1,66 @@ request = $request; - } + /** + * Widgets constructor. + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Gets a list of comments for the page added through the [vk.com/dev/Comments|Comments widget]. - * - * @param string $access_token - * @param array $params - * - @var integer widget_api_id - * - @var string url - * - @var string page_id - * - @var string order - * - @var array[WidgetsFields] fields - * - @var integer offset - * - @var integer count - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getComments($access_token, array $params = []) { - return $this->request->post('widgets.getComments', $access_token, $params); - } + /** + * Gets a list of comments for the page added through the [vk.com/dev/Comments|Comments widget]. + * + * @param $access_token string + * @param $params array + * - integer widget_api_id: + * - string url: + * - string page_id: + * - string order: + * - array fields: + * - integer offset: + * - integer count: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getComments(string $access_token, array $params = array()) { + return $this->request->post('widgets.getComments', $access_token, $params); + } - /** - * Gets a list of application/site pages where the [vk.com/dev/Comments|Comments widget] or [vk.com/dev/Like|Like widget] is installed. - * - * @param string $access_token - * @param array $params - * - @var integer widget_api_id - * - @var string order - * - @var string period - * - @var integer offset - * - @var integer count - * @throws VKClientException - * @throws VKApiException - * @return mixed - */ - public function getPages($access_token, array $params = []) { - return $this->request->post('widgets.getPages', $access_token, $params); - } + /** + * Gets a list of application/site pages where the [vk.com/dev/Comments|Comments widget] or [vk.com/dev/Like|Like + * widget] is installed. + * + * @param $access_token string + * @param $params array + * - integer widget_api_id: + * - string order: + * - string period: + * - integer offset: + * - integer count: + * + * @return mixed + * @throws VKClientException in case of network error + * @throws VKApiException in case of API error + * + */ + public function getPages(string $access_token, array $params = array()) { + return $this->request->post('widgets.getPages', $access_token, $params); + } } diff --git a/src/VK/Client/Enums/VKLanguage.php b/src/VK/Client/Enum/VKLanguage.php old mode 100755 new mode 100644 similarity index 89% rename from src/VK/Client/Enums/VKLanguage.php rename to src/VK/Client/Enum/VKLanguage.php index 486ed38..610bb68 --- a/src/VK/Client/Enums/VKLanguage.php +++ b/src/VK/Client/Enum/VKLanguage.php @@ -1,6 +1,6 @@ apps) { - $this->apps = new Apps($this->request); + public function adsweb(): Adsweb { + if (!$this->adsweb) { + $this->adsweb = new Adsweb($this->request); } - return $this->apps; + return $this->adsweb; } /** @@ -287,6 +313,17 @@ public function appWidgets(): AppWidgets { return $this->appWidgets; } + /** + * @return Apps + */ + public function apps(): Apps { + if (!$this->apps) { + $this->apps = new Apps($this->request); + } + + return $this->apps; + } + /** * @return Auth */ @@ -332,18 +369,25 @@ public function docs(): Docs { } /** - * @param string $access_token - * @param array $params - * - @var string code: VKScript code - * - * @return array + * @return Donut + */ + public function donut(): Donut { + if (!$this->donut) { + $this->donut = new Donut($this->request); + } + + return $this->donut; + } + + /** + * @return DownloadedGames */ - public function execute($access_token, $params = []): array { - if (!$this->execute) { - $this->execute = $this->request->post('execute', $access_token, $params); + public function downloadedGames(): DownloadedGames { + if (!$this->downloadedGames) { + $this->downloadedGames = new DownloadedGames($this->request); } - return $this->execute; + return $this->downloadedGames; } /** @@ -390,17 +434,6 @@ public function groups(): Groups { return $this->groups; } - /** - * @return Leads - */ - public function leads(): Leads { - if (!$this->leads) { - $this->leads = new Leads($this->request); - } - - return $this->leads; - } - /** * @return Likes */ @@ -500,6 +533,17 @@ public function photos(): Photos { return $this->photos; } + /** + * @return Podcasts + */ + public function podcasts(): Podcasts { + if (!$this->podcasts) { + $this->podcasts = new Podcasts($this->request); + } + + return $this->podcasts; + } + /** * @return Polls */ @@ -511,6 +555,17 @@ public function polls(): Polls { return $this->polls; } + /** + * @return PrettyCards + */ + public function prettyCards(): PrettyCards { + if (!$this->prettyCards) { + $this->prettyCards = new PrettyCards($this->request); + } + + return $this->prettyCards; + } + /** * @return Search */ @@ -566,6 +621,17 @@ public function storage(): Storage { return $this->storage; } + /** + * @return Store + */ + public function store(): Store { + if (!$this->store) { + $this->store = new Store($this->request); + } + + return $this->store; + } + /** * @return Stories */ diff --git a/src/VK/Exceptions/Api/ExceptionMapper.php b/src/VK/Exceptions/Api/ExceptionMapper.php index c8edc97..36356ce 100644 --- a/src/VK/Exceptions/Api/ExceptionMapper.php +++ b/src/VK/Exceptions/Api/ExceptionMapper.php @@ -1,92 +1,307 @@ getErrorCode()) { - case 1: - return new VKApiUnknownException($error); - case 2: - return new VKApiDisabledException($error); - case 3: - return new VKApiMethodException($error); - case 4: - return new VKApiSignatureException($error); - case 5: - return new VKApiAuthException($error); - case 6: - return new VKApiTooManyException($error); - case 7: - return new VKApiPermissionException($error); - case 8: - return new VKApiRequestException($error); - case 9: - return new VKApiFloodException($error); - case 10: - return new VKApiServerException($error); - case 11: - return new VKApiEnabledInTestException($error); - case 14: - return new VKApiCaptchaException($error); - case 15: - return new VKApiAccessException($error); - case 16: - return new VKApiAuthHttpsException($error); - case 17: - return new VKApiAuthValidationException($error); - case 18: - return new VKApiUserDeletedException($error); - case 20: - return new VKApiMethodPermissionException($error); - case 21: - return new VKApiMethodAdsException($error); - case 23: - return new VKApiMethodDisabledException($error); - case 24: - return new VKApiNeedConfirmationException($error); - case 25: - return new VKApiNeedTokenConfirmationException($error); - case 27: - return new VKApiGroupAuthException($error); - case 28: - return new VKApiAppAuthException($error); - case 29: - return new VKApiRateLimitException($error); - case 30: - return new VKApiPrivateProfileException($error); - case 100: - return new VKApiParamException($error); - case 101: - return new VKApiParamApiIdException($error); - case 113: - return new VKApiParamUserIdException($error); - case 150: - return new VKApiParamTimestampException($error); - case 200: - return new VKApiAccessAlbumException($error); - case 201: - return new VKApiAccessAudioException($error); - case 203: - return new VKApiAccessGroupException($error); - case 300: - return new VKApiAlbumFullException($error); - case 500: - return new VKApiVotesPermissionException($error); - case 600: - return new VKApiAdsPermissionException($error); - case 603: - return new VKApiAdsSpecificException($error); - default: - return new VKApiException($error->getErrorCode(), $error->getErrorMsg(), $error);} - } + public static function parse(VKApiError $error) { + switch ($error->getErrorCode()) { + case 12: + return new VKApiUnableToCompileCodeException($error); + case 13: + return new VKApiRuntimeOccurredDuringCodeInvocationException($error); + case 19: + return new VKApiContentBlockedException($error); + case 22: + return new VKApiUploadException($error); + case 35: + return new VKApiClientUpdateNeededException($error); + case 36: + return new VKApiMethodExecutionWasInterruptedDueToTimeoutException($error); + case 103: + return new VKApiOutOfLimitsException($error); + case 104: + return new VKApiNotFoundException($error); + case 105: + return new VKApiCouldntSaveFileException($error); + case 106: + return new VKApiUnableToProcessActionException($error); + case 114: + return new VKApiInvalidAlbumIdException($error); + case 118: + return new VKApiInvalidServerException($error); + case 119: + return new VKApiInvalidTitleException($error); + case 121: + return new VKApiInvalidHashException($error); + case 122: + return new VKApiInvalidPhotosException($error); + case 125: + return new VKApiInvalidGroupIdException($error); + case 129: + return new VKApiInvalidPhotoException($error); + case 140: + return new VKApiPageNotFoundException($error); + case 141: + return new VKApiAccessToPageDeniedException($error); + case 146: + return new VKApiTheMobileNumberOfTheUserIsUnknownException($error); + case 147: + return new VKApiApplicationHasInsufficientFundsException($error); + case 148: + return new VKApiAccessToTheMenuOfTheUserDeniedException($error); + case 171: + return new VKApiInvalidListIdException($error); + case 173: + return new VKApiReachedTheMaximumNumberOfListsException($error); + case 174: + return new VKApiCannotAddUserHimselfAsFriendException($error); + case 175: + return new VKApiCannotAddThisUserToFriendsAsTheyHavePutYouOnTheirBlacklistException($error); + case 176: + return new VKApiCannotAddThisUserToFriendsAsYouPutHimOnBlacklistException($error); + case 177: + return new VKApiCannotAddThisUserToFriendsAsUserNotFoundException($error); + case 180: + return new VKApiNoteNotFoundException($error); + case 181: + return new VKApiAccessToNoteDeniedException($error); + case 182: + return new VKApiYouCantCommentThisNoteException($error); + case 183: + return new VKApiAccessToCommentDeniedException($error); + case 204: + return new VKApiAccessDeniedException($error); + case 205: + return new VKApiAccessDeniedException($error); + case 210: + return new VKApiAccessToWallsPostDeniedException($error); + case 211: + return new VKApiAccessToWallsCommentDeniedException($error); + case 212: + return new VKApiAccessToPostCommentsDeniedException($error); + case 213: + return new VKApiAccessToStatusRepliesDeniedException($error); + case 214: + return new VKApiAccessToAddingPostDeniedException($error); + case 219: + return new VKApiAdvertisementPostWasRecentlyAddedException($error); + case 220: + return new VKApiTooManyRecipientsException($error); + case 221: + return new VKApiUserDisabledTrackNameBroadcastException($error); + case 222: + return new VKApiHyperlinksAreForbiddenException($error); + case 223: + return new VKApiTooManyRepliesException($error); + case 224: + return new VKApiTooManyAdsPostsException($error); + case 225: + return new VKApiDonutIsDisabledException($error); + case 232: + return new VKApiReactionCanNotBeAppliedToTheObjectException($error); + case 250: + return new VKApiAccessToPollDeniedException($error); + case 251: + return new VKApiInvalidPollIdException($error); + case 252: + return new VKApiInvalidAnswerIdException($error); + case 253: + return new VKApiAccessDeniedPleaseVoteFirstException($error); + case 260: + return new VKApiAccessToTheGroupsListIsDeniedDueToTheUsersPrivacySettingsException($error); + case 302: + return new VKApiAlbumsNumberLimitIsReachedException($error); + case 601: + return new VKApiPermissionDenied.YouHaveRequestedTooManyActionsThisDay.TryLater.Exception($error); + case 602: + return new VKApiSomePartOfTheRequestHasNotBeenCompletedException($error); + case 629: + return new VKApiObjectDeletedException($error); + case 700: + return new VKApiCannotEditCreatorRoleException($error); + case 701: + return new VKApiUserShouldBeInClubException($error); + case 702: + return new VKApiTooManyOfficersInClubException($error); + case 703: + return new VKApiYouNeedToEnable2faForThisActionException($error); + case 704: + return new VKApiUserNeedsToEnable2faForThisActionException($error); + case 706: + return new VKApiTooManyAddressesInClubException($error); + case 711: + return new VKApiApplicationIsNotInstalledInCommunityException($error); + case 714: + return new VKApiInviteLinkIsInvalid-ExpiredDeletedOrNotExistsException($error); + case 800: + return new VKApiThisVideoIsAlreadyAddedException($error); + case 801: + return new VKApiCommentsForThisVideoAreClosedException($error); + case 900: + return new VKApiCantSendMessagesForUsersFromBlacklistException($error); + case 901: + return new VKApiCantSendMessagesForUsersWithoutPermissionException($error); + case 902: + return new VKApiCantSendMessagesToThisUserDueToTheirPrivacySettingsException($error); + case 907: + return new VKApiValueOfTsOrPtsIsTooOldException($error); + case 908: + return new VKApiValueOfTsOrPtsIsTooNewException($error); + case 909: + return new VKApiCantEditThisMessageBecauseItsTooOldException($error); + case 910: + return new VKApiCantSentThisMessageBecauseItsTooBigException($error); + case 911: + return new VKApiKeyboardFormatIsInvalidException($error); + case 912: + return new VKApiThisIsAChatBotFeatureChangeThisStatusInSettingsException($error); + case 913: + return new VKApiTooManyForwardedMessagesException($error); + case 914: + return new VKApiMessageIsTooLongException($error); + case 917: + return new VKApiYouDontHaveAccessToThisChatException($error); + case 919: + return new VKApiYouCantSeeInviteLinkForThisChatException($error); + case 920: + return new VKApiCantEditThisKindOfMessageException($error); + case 921: + return new VKApiCantForwardTheseMessagesException($error); + case 924: + return new VKApiCantDeleteThisMessageForEverybodyException($error); + case 925: + return new VKApiYouAreNotAdminOfThisChatException($error); + case 927: + return new VKApiChatDoesNotExistException($error); + case 931: + return new VKApiYouCantChangeInviteLinkForThisChatException($error); + case 932: + return new VKApiYourCommunityCantInteractWithThisPeerException($error); + case 935: + return new VKApiUserNotFoundInChatException($error); + case 936: + return new VKApiContactNotFoundException($error); + case 939: + return new VKApiMessageRequestAlreadySentException($error); + case 940: + return new VKApiTooManyPostsInMessagesException($error); + case 942: + return new VKApiCannotPinOne-timeStoryException($error); + case 943: + return new VKApiCannotUseThisIntentException($error); + case 944: + return new VKApiLimitsOverflowForThisIntentException($error); + case 945: + return new VKApiChatWasDisabledException($error); + case 946: + return new VKApiChatNotSupportedException($error); + case 947: + return new VKApiCantAddUserToChatBecauseUserHasNoAccessToGroupException($error); + case 949: + return new VKApiCantEditPinnedMessageYetException($error); + case 950: + return new VKApiCantSendMessageReplyTimedOutException($error); + case 1105: + return new VKApiTooManyAuthAttemptsTryAgainLaterException($error); + case 1150: + return new VKApiInvalidDocumentIdException($error); + case 1151: + return new VKApiAccessToDocumentDeletingIsDeniedException($error); + case 1152: + return new VKApiInvalidDocumentTitleException($error); + case 1153: + return new VKApiAccessToDocumentIsDeniedException($error); + case 1160: + return new VKApiOriginalPhotoWasChangedException($error); + case 1170: + return new VKApiTooManyFeedListsException($error); + case 1251: + return new VKApiThisAchievementIsAlreadyUnlockedException($error); + case 1256: + return new VKApiSubscriptionNotFoundException($error); + case 1257: + return new VKApiSubscriptionIsInInvalidStatusException($error); + case 1260: + return new VKApiInvalidScreenNameException($error); + case 1310: + return new VKApiCatalogIsNotAvailableForThisUserException($error); + case 1311: + return new VKApiCatalogCategoriesAreNotAvailableForThisUserException($error); + case 1400: + return new VKApiTooLateForRestoreException($error); + case 1401: + return new VKApiCommentsForThisMarketAreClosedException($error); + case 1402: + return new VKApiAlbumNotFoundException($error); + case 1403: + return new VKApiItemNotFoundException($error); + case 1404: + return new VKApiItemAlreadyAddedToAlbumException($error); + case 1405: + return new VKApiTooManyItemsException($error); + case 1406: + return new VKApiTooManyItemsInAlbumException($error); + case 1407: + return new VKApiTooManyAlbumsException($error); + case 1408: + return new VKApiItemHasBadLinksInDescriptionException($error); + case 1409: + return new VKApiExtendedMarketNotEnabledException($error); + case 1413: + return new VKApiGroupingAlreadyHasSuchVariantException($error); + case 1416: + return new VKApiVariantNotFoundException($error); + case 1417: + return new VKApiPropertyNotFoundException($error); + case 1425: + return new VKApiGroupingMustHaveTwoOrMoreItemsException($error); + case 1426: + return new VKApiItemMustHaveDistinctPropertiesException($error); + case 1427: + return new VKApiCartIsEmptyException($error); + case 1429: + return new VKApiSpecifyWidthLengthHeightAndWeightAllTogetherException($error); + case 1430: + return new VKApiVkPayStatusCanNotBeChangedException($error); + case 1431: + return new VKApiMarketWasAlreadyEnabledInThisGroupException($error); + case 1432: + return new VKApiMarketWasAlreadyDisabledInThisGroupException($error); + case 1433: + return new VKApiInvalidImageCropFormatException($error); + case 1434: + return new VKApiCropBottomRightCornerIsOutsideOfTheImageException($error); + case 1435: + return new VKApiCropSizeIsLessThanTheMinimumException($error); + case 1438: + return new VKApiMarketNotEnabledException($error); + case 1600: + return new VKApiStoryHasAlreadyExpiredException($error); + case 1602: + return new VKApiIncorrectReplyPrivacyException($error); + case 1900: + return new VKApiCardNotFoundException($error); + case 1901: + return new VKApiTooManyCardsException($error); + case 1902: + return new VKApiCardIsConnectedToPostException($error); + case 2000: + return new VKApiServersNumberLimitIsReachedException($error); + case 2100: + return new VKApiStickersAreNotPurchasedException($error); + case 2101: + return new VKApiTooManyFavoriteStickersException($error); + case 2102: + return new VKApiStickersAreNotFavoriteException($error); + case 3102: + return new VKApiSpecifiedLinkIsIncorrect(cantFindSource)Exception($error); + case 3800: + return new VKApiCantSetAliexpressTagToThisTypeOfObjectException($error); + default: + return new VKApiException($error->getErrorCode(), $error->getErrorMsg(), $error); + } + } } diff --git a/src/VK/Exceptions/Api/VKApiAccessAlbumException.php b/src/VK/Exceptions/Api/VKApiAccessAlbumException.php deleted file mode 100644 index e921632..0000000 --- a/src/VK/Exceptions/Api/VKApiAccessAlbumException.php +++ /dev/null @@ -1,19 +0,0 @@ - Date: Fri, 7 May 2021 22:58:52 +0300 Subject: [PATCH 7/7] Revert "5.120 => 5.130" This reverts commit 8c7426751a59d432f22a1629253d28402eacde2a. --- src/VK/Actions/Account.php | 646 +++-- src/VK/Actions/Ads.php | 1500 +++++------- src/VK/Actions/Adsweb.php | 138 -- src/VK/Actions/AppWidgets.php | 266 +- src/VK/Actions/Apps.php | 412 ++-- src/VK/Actions/Auth.php | 86 +- src/VK/Actions/Board.php | 529 ++-- src/VK/Actions/Database.php | 443 ++-- src/VK/Actions/Docs.php | 427 ++-- src/VK/Actions/Donut.php | 94 - src/VK/Actions/DownloadedGames.php | 42 - .../AccountSaveProfileInfoBdateVisibility.php | 9 - .../Enum/AccountSaveProfileInfoRelation.php | 14 - .../Enum/AccountSaveProfileInfoSex.php | 9 - src/VK/Actions/Enum/AdsCheckLinkLinkType.php | 11 - .../Enum/AdsGetDemographicsIdsType.php | 8 - .../Actions/Enum/AdsGetDemographicsPeriod.php | 9 - .../Actions/Enum/AdsGetPostsReachIdsType.php | 8 - .../Actions/Enum/AdsGetStatisticsIdsType.php | 10 - .../Actions/Enum/AdsGetStatisticsPeriod.php | 9 - src/VK/Actions/Enum/AdsGetSuggestionsLang.php | 9 - .../Actions/Enum/AdsGetSuggestionsSection.php | 18 - .../Enum/AdsGetTargetingStatsAdFormat.php | 14 - .../Actions/Enum/AdsGetUploadURLAdFormat.php | 11 - ...idgetsGetAppImageUploadServerImageType.php | 11 - .../Enum/AppWidgetsGetAppImagesImageType.php | 11 - ...getsGetGroupImageUploadServerImageType.php | 11 - .../AppWidgetsGetGroupImagesImageType.php | 11 - src/VK/Actions/Enum/AppWidgetsUpdateType.php | 15 - src/VK/Actions/Enum/AppsGetCatalogFilter.php | 10 - src/VK/Actions/Enum/AppsGetCatalogSort.php | 11 - .../Actions/Enum/AppsGetFriendsListType.php | 8 - .../Actions/Enum/AppsGetLeaderboardType.php | 9 - src/VK/Actions/Enum/AppsGetNameCase.php | 12 - src/VK/Actions/Enum/AppsGetPlatform.php | 10 - src/VK/Actions/Enum/AppsGetScopesType.php | 8 - src/VK/Actions/Enum/AppsSendRequestType.php | 8 - src/VK/Actions/Enum/BoardGetCommentsSort.php | 8 - src/VK/Actions/Enum/BoardGetTopicsOrder.php | 11 - src/VK/Actions/Enum/BoardGetTopicsPreview.php | 9 - .../Enum/DocsGetMessagesUploadServerType.php | 9 - src/VK/Actions/Enum/DocsGetType.php | 15 - src/VK/Actions/Enum/FaveAddTagPosition.php | 8 - src/VK/Actions/Enum/FaveGetItemType.php | 16 - src/VK/Actions/Enum/FaveGetPagesType.php | 9 - src/VK/Actions/Enum/FaveSetTagsItemType.php | 16 - src/VK/Actions/Enum/FriendsGetNameCase.php | 12 - src/VK/Actions/Enum/FriendsGetOrder.php | 11 - .../Actions/Enum/FriendsGetRequestsSort.php | 9 - .../Enum/FriendsGetSuggestionsNameCase.php | 12 - src/VK/Actions/Enum/FriendsSearchNameCase.php | 12 - .../Enum/GroupsAddAddressWorkInfoStatus.php | 11 - src/VK/Actions/Enum/GroupsCreateSubtype.php | 10 - src/VK/Actions/Enum/GroupsCreateType.php | 9 - .../Enum/GroupsEditAddressWorkInfoStatus.php | 11 - src/VK/Actions/Enum/GroupsEditAgeLimits.php | 9 - .../Enum/GroupsGetInvitedUsersNameCase.php | 12 - .../Actions/Enum/GroupsGetMembersFilter.php | 10 - src/VK/Actions/Enum/GroupsGetMembersSort.php | 10 - src/VK/Actions/Enum/GroupsSearchSort.php | 12 - src/VK/Actions/Enum/GroupsSearchType.php | 9 - src/VK/Actions/Enum/GroupsTagAddTagColor.php | 26 - src/VK/Actions/Enum/GroupsTagBindAct.php | 8 - .../Actions/Enum/GroupsToggleMarketState.php | 9 - src/VK/Actions/Enum/LikesGetListFilter.php | 8 - .../Actions/Enum/LikesGetListFriendsOnly.php | 10 - .../Enum/MarketEditOrderPaymentStatus.php | 9 - src/VK/Actions/Enum/MarketGetCommentsSort.php | 8 - .../Enum/MarketReportCommentReason.php | 13 - src/VK/Actions/Enum/MarketReportReason.php | 13 - src/VK/Actions/Enum/MarketSearchRev.php | 8 - src/VK/Actions/Enum/MarketSearchSort.php | 10 - src/VK/Actions/Enum/MarketSearchStatus.php | 8 - .../Enum/MessagesGetConversationsFilter.php | 10 - ...MessagesGetHistoryAttachmentsMediaType.php | 16 - src/VK/Actions/Enum/MessagesGetHistoryRev.php | 8 - .../Enum/MessagesGetIntentUsersIntent.php | 9 - src/VK/Actions/Enum/MessagesSendIntent.php | 17 - .../Actions/Enum/MessagesSetActivityType.php | 11 - .../Enum/NewsfeedGetBannedNameCase.php | 12 - .../Actions/Enum/NewsfeedUnsubscribeType.php | 11 - src/VK/Actions/Enum/NotesGetCommentsSort.php | 8 - src/VK/Actions/Enum/NotesGetSort.php | 8 - .../NotificationsSendMessageSendingMode.php | 9 - .../Actions/Enum/OrdersChangeStateAction.php | 9 - src/VK/Actions/Enum/PagesSaveAccessEdit.php | 9 - src/VK/Actions/Enum/PagesSaveAccessView.php | 9 - src/VK/Actions/Enum/PhotosGetCommentsSort.php | 8 - .../Enum/PhotosReportCommentReason.php | 13 - src/VK/Actions/Enum/PhotosReportReason.php | 13 - .../Actions/Enum/PollsCreateBackgroundId.php | 13 - src/VK/Actions/Enum/PollsEditBackgroundId.php | 14 - src/VK/Actions/Enum/PollsGetByIdNameCase.php | 12 - .../Actions/Enum/PollsGetVotersNameCase.php | 12 - src/VK/Actions/Enum/StatsGetInterval.php | 11 - .../Enum/StreamingSetSettingsMonthlyTier.php | 13 - .../Enum/UsersGetFollowersNameCase.php | 12 - src/VK/Actions/Enum/UsersGetNameCase.php | 12 - src/VK/Actions/Enum/UsersReportType.php | 10 - src/VK/Actions/Enum/UsersSearchSex.php | 9 - src/VK/Actions/Enum/UsersSearchSort.php | 8 - src/VK/Actions/Enum/UsersSearchStatus.php | 14 - .../Enum/UtilsGetLinkStatsInterval.php | 11 - .../Actions/Enum/UtilsGetLinkStatsSource.php | 8 - src/VK/Actions/Enum/VideoGetCommentsSort.php | 8 - .../Actions/Enum/VideoReportCommentReason.php | 13 - src/VK/Actions/Enum/VideoReportReason.php | 13 - src/VK/Actions/Enum/VideoSearchSort.php | 9 - src/VK/Actions/Enum/WallGetCommentsSort.php | 8 - .../Actions/Enum/WallReportCommentReason.php | 13 - src/VK/Actions/Enum/WallReportPostReason.php | 13 - .../Actions/Enums/AccountBdateVisibility.php | 19 + src/VK/Actions/Enums/AccountFields.php | 31 + src/VK/Actions/Enums/AccountFilter.php | 47 + src/VK/Actions/Enums/AccountRelation.php | 39 + src/VK/Actions/Enums/AccountSex.php | 19 + src/VK/Actions/Enums/AdsAdFormat.php | 27 + src/VK/Actions/Enums/AdsIdsType.php | 23 + src/VK/Actions/Enums/AdsLang.php | 19 + src/VK/Actions/Enums/AdsLinkType.php | 27 + src/VK/Actions/Enums/AdsPeriod.php | 19 + src/VK/Actions/Enums/AdsSection.php | 55 + src/VK/Actions/Enums/AppWidgetsType.php | 43 + src/VK/Actions/Enums/AppsFields.php | 275 +++ src/VK/Actions/Enums/AppsFilter.php | 23 + src/VK/Actions/Enums/AppsNameCase.php | 31 + src/VK/Actions/Enums/AppsPlatform.php | 23 + src/VK/Actions/Enums/AppsSort.php | 27 + src/VK/Actions/Enums/AppsType.php | 15 + src/VK/Actions/Enums/BoardOrder.php | 27 + src/VK/Actions/Enums/BoardPreview.php | 19 + src/VK/Actions/Enums/BoardSort.php | 15 + src/VK/Actions/Enums/DocsType.php | 19 + src/VK/Actions/Enums/FaveFields.php | 407 ++++ src/VK/Actions/Enums/FaveItemType.php | 39 + src/VK/Actions/Enums/FaveType.php | 19 + src/VK/Actions/Enums/FriendsFields.php | 275 +++ src/VK/Actions/Enums/FriendsFilter.php | 19 + src/VK/Actions/Enums/FriendsNameCase.php | 31 + src/VK/Actions/Enums/FriendsOrder.php | 15 + src/VK/Actions/Enums/FriendsSort.php | 15 + .../Enums/Groups/AddressWorkInfoStatus.php | 27 + src/VK/Actions/Enums/Groups/GroupAccess.php | 19 + .../Actions/Enums/Groups/GroupAgeLimits.php | 19 + src/VK/Actions/Enums/Groups/GroupAudio.php | 19 + src/VK/Actions/Enums/Groups/GroupDocs.php | 19 + .../Enums/Groups/GroupMarketCurrency.php | 27 + src/VK/Actions/Enums/Groups/GroupPhotos.php | 19 + src/VK/Actions/Enums/Groups/GroupRole.php | 19 + src/VK/Actions/Enums/Groups/GroupSubject.php | 175 ++ src/VK/Actions/Enums/Groups/GroupTopics.php | 19 + src/VK/Actions/Enums/Groups/GroupVideo.php | 19 + src/VK/Actions/Enums/Groups/GroupWall.php | 23 + src/VK/Actions/Enums/Groups/GroupWiki.php | 19 + src/VK/Actions/Enums/GroupsAccess.php | 19 + src/VK/Actions/Enums/GroupsAgeLimits.php | 19 + src/VK/Actions/Enums/GroupsAudio.php | 19 + src/VK/Actions/Enums/GroupsDocs.php | 19 + src/VK/Actions/Enums/GroupsFields.php | 275 +++ src/VK/Actions/Enums/GroupsFilter.php | 15 + src/VK/Actions/Enums/GroupsMarketCurrency.php | 27 + src/VK/Actions/Enums/GroupsNameCase.php | 31 + src/VK/Actions/Enums/GroupsPhotos.php | 19 + src/VK/Actions/Enums/GroupsRole.php | 19 + src/VK/Actions/Enums/GroupsSort.php | 31 + src/VK/Actions/Enums/GroupsSubject.php | 175 ++ src/VK/Actions/Enums/GroupsSubtype.php | 23 + src/VK/Actions/Enums/GroupsTopics.php | 19 + src/VK/Actions/Enums/GroupsType.php | 19 + src/VK/Actions/Enums/GroupsVideo.php | 19 + src/VK/Actions/Enums/GroupsWall.php | 23 + src/VK/Actions/Enums/GroupsWiki.php | 19 + src/VK/Actions/Enums/GroupsWorkInfoStatus.php | 27 + src/VK/Actions/Enums/LeadsStatus.php | 27 + src/VK/Actions/Enums/LikesFilter.php | 15 + src/VK/Actions/Enums/LikesFriendsOnly.php | 23 + src/VK/Actions/Enums/LikesType.php | 55 + src/VK/Actions/Enums/MarketFields.php | 275 +++ src/VK/Actions/Enums/MarketReason.php | 35 + src/VK/Actions/Enums/MarketRev.php | 15 + src/VK/Actions/Enums/MarketSort.php | 23 + src/VK/Actions/Enums/MarketStatus.php | 15 + src/VK/Actions/Enums/MessagesFields.php | 275 +++ src/VK/Actions/Enums/MessagesFilter.php | 31 + src/VK/Actions/Enums/MessagesMediaType.php | 47 + src/VK/Actions/Enums/MessagesRev.php | 15 + .../Actions/Enums/Newsfeed/IgnoreItemType.php | 31 + src/VK/Actions/Enums/NewsfeedFields.php | 407 ++++ src/VK/Actions/Enums/NewsfeedFilters.php | 27 + src/VK/Actions/Enums/NewsfeedNameCase.php | 31 + src/VK/Actions/Enums/NewsfeedType.php | 27 + src/VK/Actions/Enums/NotesSort.php | 15 + src/VK/Actions/Enums/NotificationsFilters.php | 35 + src/VK/Actions/Enums/OrdersAction.php | 19 + src/VK/Actions/Enums/PagesEdit.php | 19 + src/VK/Actions/Enums/PagesView.php | 19 + src/VK/Actions/Enums/PhotosFields.php | 275 +++ src/VK/Actions/Enums/PhotosReason.php | 35 + src/VK/Actions/Enums/PhotosSort.php | 15 + src/VK/Actions/Enums/PollsBackgroundId.php | 39 + src/VK/Actions/Enums/PollsFields.php | 275 +++ src/VK/Actions/Enums/PollsNameCase.php | 31 + .../Actions/Enums/Stories/UploadLinkText.php | 87 + src/VK/Actions/Enums/StoriesFields.php | 407 ++++ src/VK/Actions/Enums/StoriesLinkText.php | 87 + src/VK/Actions/Enums/StreamingMonthlyTier.php | 35 + src/VK/Actions/Enums/UsersFields.php | 275 +++ src/VK/Actions/Enums/UsersNameCase.php | 31 + src/VK/Actions/Enums/UsersSex.php | 19 + src/VK/Actions/Enums/UsersSort.php | 15 + src/VK/Actions/Enums/UsersStatus.php | 39 + src/VK/Actions/Enums/UsersType.php | 23 + src/VK/Actions/Enums/UtilsInterval.php | 27 + src/VK/Actions/Enums/UtilsSource.php | 15 + src/VK/Actions/Enums/VideoFilters.php | 23 + src/VK/Actions/Enums/VideoPrivacy.php | 23 + src/VK/Actions/Enums/VideoReason.php | 35 + src/VK/Actions/Enums/VideoSort.php | 19 + src/VK/Actions/Enums/WallFields.php | 407 ++++ src/VK/Actions/Enums/WallFilter.php | 27 + src/VK/Actions/Enums/WallReason.php | 35 + src/VK/Actions/Enums/WallSort.php | 15 + src/VK/Actions/Enums/WidgetsFields.php | 275 +++ src/VK/Actions/Fave.php | 701 +++--- src/VK/Actions/Friends.php | 688 +++--- src/VK/Actions/Gifts.php | 60 +- src/VK/Actions/Groups.php | 2132 ++++++++--------- src/VK/Actions/Leads.php | 137 ++ src/VK/Actions/Likes.php | 207 +- src/VK/Actions/Market.php | 1148 ++++----- src/VK/Actions/Messages.php | 1651 ++++++------- src/VK/Actions/Newsfeed.php | 592 ++--- src/VK/Actions/Notes.php | 393 ++- src/VK/Actions/Notifications.php | 138 +- src/VK/Actions/Orders.php | 295 ++- src/VK/Actions/Pages.php | 322 ++- src/VK/Actions/Photos.php | 1815 +++++++------- src/VK/Actions/Podcasts.php | 41 - src/VK/Actions/Polls.php | 368 ++- src/VK/Actions/PrettyCards.php | 227 +- src/VK/Actions/Search.php | 66 +- src/VK/Actions/Secure.php | 361 ++- src/VK/Actions/Stats.php | 134 +- src/VK/Actions/Status.php | 93 +- src/VK/Actions/Storage.php | 132 +- src/VK/Actions/Store.php | 115 - src/VK/Actions/Stories.php | 563 ++--- src/VK/Actions/Streaming.php | 82 +- src/VK/Actions/Users.php | 300 ++- src/VK/Actions/Utils.php | 247 +- src/VK/Actions/Video.php | 973 ++++---- src/VK/Actions/Wall.php | 1023 ++++---- src/VK/Actions/Widgets.php | 105 +- src/VK/Client/{Enum => Enums}/VKLanguage.php | 2 +- src/VK/Client/VKApiClient.php | 140 +- src/VK/Exceptions/Api/ExceptionMapper.php | 383 +-- .../Api/VKApiAccessAlbumException.php | 19 + .../Api/VKApiAccessAudioException.php | 19 + .../Api/VKApiAccessCommentException.php | 19 + .../Api/VKApiAccessDeniedException.php | 16 - ...piAccessDeniedPleaseVoteFirstException.php | 16 - .../Exceptions/Api/VKApiAccessException.php | 19 + .../Api/VKApiAccessGroupException.php | 19 + .../Api/VKApiAccessGroupsException.php | 19 + .../Api/VKApiAccessMarketException.php | 19 + .../Api/VKApiAccessMenuException.php | 19 + .../Api/VKApiAccessNoteCommentException.php | 19 + .../Api/VKApiAccessNoteException.php | 19 + .../Api/VKApiAccessPageException.php | 19 + ...VKApiAccessToAddingPostDeniedException.php | 16 - .../VKApiAccessToCommentDeniedException.php | 16 - ...essToDocumentDeletingIsDeniedException.php | 16 - ...VKApiAccessToDocumentIsDeniedException.php | 16 - .../Api/VKApiAccessToNoteDeniedException.php | 16 - .../Api/VKApiAccessToPageDeniedException.php | 16 - .../Api/VKApiAccessToPollDeniedException.php | 16 - ...ApiAccessToPostCommentsDeniedException.php | 16 - ...piAccessToStatusRepliesDeniedException.php | 16 - ...dDueToTheUsersPrivacySettingsException.php | 16 - ...ccessToTheMenuOfTheUserDeniedException.php | 16 - ...ApiAccessToWallsCommentDeniedException.php | 16 - .../VKApiAccessToWallsPostDeniedException.php | 16 - .../Api/VKApiAccessVideoException.php | 19 + .../Api/VKApiActionFailedException.php | 19 + .../Api/VKApiAdsObjectDeletedException.php | 19 + .../Api/VKApiAdsPartialSuccessException.php | 19 + .../Api/VKApiAdsPermissionException.php | 19 + .../Api/VKApiAdsSpecificException.php | 19 + ...rtisementPostWasRecentlyAddedException.php | 16 - .../Api/VKApiAlbumFullException.php | 19 + .../Api/VKApiAlbumNotFoundException.php | 16 - .../Api/VKApiAlbumsLimitException.php | 19 + ...ApiAlbumsNumberLimitIsReachedException.php | 16 - .../Exceptions/Api/VKApiAppAuthException.php | 19 + ...plicationHasInsufficientFundsException.php | 16 - ...tionIsNotInstalledInCommunityException.php | 16 - .../Api/VKApiAppsAlreadyUnlockedException.php | 19 + ...AppsSubscriptionInvalidStatusException.php | 19 + ...VKApiAppsSubscriptionNotFoundException.php | 19 + .../Api/VKApiAuthDelayException.php | 19 + src/VK/Exceptions/Api/VKApiAuthException.php | 19 + .../Api/VKApiAuthFloodException.php | 19 + .../Api/VKApiAuthHttpsException.php | 19 + .../Api/VKApiAuthValidationException.php | 19 + .../Exceptions/Api/VKApiBlockedException.php | 19 + .../VKApiCallbackApiServersLimitException.php | 19 + ...heyHavePutYouOnTheirBlacklistException.php | 16 - ...isUserToFriendsAsUserNotFoundException.php | 16 - ...FriendsAsYouPutHimOnBlacklistException.php | 16 - ...iCannotAddUserHimselfAsFriendException.php | 16 - .../VKApiCannotEditCreatorRoleException.php | 16 - .../VKApiCannotPinOne-timeStoryException.php | 16 - .../Api/VKApiCannotUseThisIntentException.php | 16 - ...BecauseUserHasNoAccessToGroupException.php | 16 - ...DeleteThisMessageForEverybodyException.php | 16 - ...VKApiCantEditPinnedMessageYetException.php | 16 - ...KApiCantEditThisKindOfMessageException.php | 16 - ...itThisMessageBecauseItsTooOldException.php | 16 - ...VKApiCantForwardTheseMessagesException.php | 16 - ...iCantSendMessageReplyTimedOutException.php | 16 - ...MessagesForUsersFromBlacklistException.php | 16 - ...agesForUsersWithoutPermissionException.php | 16 - ...UserDueToTheirPrivacySettingsException.php | 16 - ...ntThisMessageBecauseItsTooBigException.php | 16 - ...iexpressTagToThisTypeOfObjectException.php | 16 - .../Exceptions/Api/VKApiCaptchaException.php | 19 + .../VKApiCardIsConnectedToPostException.php | 16 - .../Api/VKApiCardNotFoundException.php | 16 - .../Api/VKApiCartIsEmptyException.php | 16 - ...iesAreNotAvailableForThisUserException.php | 16 - ...alogIsNotAvailableForThisUserException.php | 16 - .../Api/VKApiChatDoesNotExistException.php | 16 - .../Api/VKApiChatNotSupportedException.php | 16 - .../Api/VKApiChatWasDisabledException.php | 16 - .../Api/VKApiClientUpdateNeededException.php | 16 - ...ommentsForThisMarketAreClosedException.php | 16 - ...CommentsForThisVideoAreClosedException.php | 16 - ...ApiCommunitiesCatalogDisabledException.php | 19 + ...CommunitiesCategoriesDisabledException.php | 19 + .../Exceptions/Api/VKApiCompileException.php | 19 + .../Api/VKApiContactNotFoundException.php | 16 - .../Api/VKApiContentBlockedException.php | 16 - .../Api/VKApiCouldntSaveFileException.php | 16 - ...ightCornerIsOutsideOfTheImageException.php | 16 - ...iCropSizeIsLessThanTheMinimumException.php | 16 - .../Exceptions/Api/VKApiDisabledException.php | 19 + .../Api/VKApiDonutIsDisabledException.php | 16 - .../Api/VKApiEnabledInTestException.php | 19 + ...VKApiExtendedMarketNotEnabledException.php | 16 - src/VK/Exceptions/Api/VKApiFloodException.php | 19 + .../Api/VKApiFriendsAddEnemyException.php | 19 + .../Api/VKApiFriendsAddInEnemyException.php | 19 + .../Api/VKApiFriendsAddNotFoundException.php | 19 + .../Api/VKApiFriendsAddYourselfException.php | 19 + .../Api/VKApiFriendsListIdException.php | 19 + .../Api/VKApiFriendsListLimitException.php | 19 + ...pAppIsNotInstalledInCommunityException.php | 19 + .../Api/VKApiGroupAuthException.php | 19 + .../Api/VKApiGroupChangeCreatorException.php | 19 + .../Api/VKApiGroupHostNeed2faException.php | 19 + .../Api/VKApiGroupNeed2faException.php | 19 + .../Api/VKApiGroupNotInClubException.php | 19 + .../VKApiGroupTooManyAddressesException.php | 19 + .../VKApiGroupTooManyOfficersException.php | 19 + ...GroupingAlreadyHasSuchVariantException.php | 16 - ...roupingMustHaveTwoOrMoreItemsException.php | 16 - .../VKApiHyperlinksAreForbiddenException.php | 16 - .../VKApiIncorrectReplyPrivacyException.php | 16 - .../Api/VKApiInsufficientFundsException.php | 19 + .../Api/VKApiInvalidAddressException.php | 19 + .../Api/VKApiInvalidAlbumIdException.php | 16 - .../Api/VKApiInvalidAnswerIdException.php | 16 - .../Api/VKApiInvalidDocumentIdException.php | 16 - .../VKApiInvalidDocumentTitleException.php | 16 - .../Api/VKApiInvalidGroupIdException.php | 16 - .../Api/VKApiInvalidHashException.php | 16 - .../VKApiInvalidImageCropFormatException.php | 16 - .../Api/VKApiInvalidListIdException.php | 16 - .../Api/VKApiInvalidPhotoException.php | 16 - .../Api/VKApiInvalidPhotosException.php | 16 - .../Api/VKApiInvalidPollIdException.php | 16 - .../Api/VKApiInvalidScreenNameException.php | 16 - .../Api/VKApiInvalidServerException.php | 16 - .../Api/VKApiInvalidTitleException.php | 16 - ...lid-ExpiredDeletedOrNotExistsException.php | 16 - .../VKApiItemAlreadyAddedToAlbumException.php | 16 - ...iItemHasBadLinksInDescriptionException.php | 16 - ...temMustHaveDistinctPropertiesException.php | 16 - .../Api/VKApiItemNotFoundException.php | 16 - .../VKApiKeyboardFormatIsInvalidException.php | 16 - .../Exceptions/Api/VKApiLimitsException.php | 19 + ...piLimitsOverflowForThisIntentException.php | 16 - .../Api/VKApiMarketAlbumNotFoundException.php | 19 + .../VKApiMarketCommentsClosedException.php | 19 + ...emsMustHaveDistinctPropertiesException.php | 19 + ...ingMustContainMoreThanOneItemException.php | 19 + .../VKApiMarketItemAlreadyAddedException.php | 19 + .../VKApiMarketItemHasBadLinksException.php | 19 + .../Api/VKApiMarketItemNotFoundException.php | 19 + .../Api/VKApiMarketNotEnabledException.php | 16 - .../VKApiMarketPropertyNotFoundException.php | 19 + .../VKApiMarketRestoreTooLateException.php | 19 + .../Api/VKApiMarketTooManyAlbumsException.php | 19 + .../Api/VKApiMarketTooManyItemsException.php | 19 + ...KApiMarketTooManyItemsInAlbumException.php | 19 + .../VKApiMarketVariantNotFoundException.php | 19 + ...WasAlreadyDisabledInThisGroupException.php | 16 - ...tWasAlreadyEnabledInThisGroupException.php | 16 - .../Api/VKApiMessageIsTooLongException.php | 16 - ...KApiMessageRequestAlreadySentException.php | 16 - ...iMessagesCantChangeInviteLinkException.php | 19 + ...VKApiMessagesCantDeleteForAllException.php | 19 + .../Api/VKApiMessagesCantFwdException.php | 19 + ...piMessagesCantPinOneTimeStoryException.php | 19 + ...KApiMessagesCantSeeInviteLinkException.php | 19 + .../VKApiMessagesChatBotFeatureException.php | 19 + .../VKApiMessagesChatNotAdminException.php | 19 + .../VKApiMessagesChatNotExistException.php | 19 + ...VKApiMessagesChatUserNoAccessException.php | 19 + ...KApiMessagesChatUserNotInChatException.php | 19 + .../VKApiMessagesContactNotFoundException.php | 19 + .../Api/VKApiMessagesDenySendException.php | 19 + .../Api/VKApiMessagesEditExpiredException.php | 19 + ...ApiMessagesEditKindDisallowedException.php | 19 + .../VKApiMessagesGroupPeerAccessException.php | 19 + .../VKApiMessagesKeyboardInvalidException.php | 19 + ...agesMessageRequestAlreadySendException.php | 19 + ...agesMessageRequestAlreadySentException.php | 19 + .../Api/VKApiMessagesPrivacyException.php | 19 + .../Api/VKApiMessagesTooBigException.php | 19 + .../VKApiMessagesTooLongForwardsException.php | 19 + .../VKApiMessagesTooLongMessageException.php | 19 + .../VKApiMessagesTooManyPostsException.php | 19 + .../Api/VKApiMessagesTooNewPtsException.php | 19 + .../Api/VKApiMessagesTooOldPtsException.php | 19 + .../Api/VKApiMessagesUserBlockedException.php | 19 + .../Api/VKApiMethodAdsException.php | 19 + .../Api/VKApiMethodDisabledException.php | 19 + .../Exceptions/Api/VKApiMethodException.php | 19 + ...ionWasInterruptedDueToTimeoutException.php | 16 - .../Api/VKApiMethodPermissionException.php | 19 + .../Api/VKApiMobileNotActivatedException.php | 19 + .../Api/VKApiNeedConfirmationException.php | 19 + .../VKApiNeedTokenConfirmationException.php | 19 + .../Exceptions/Api/VKApiNotFoundException.php | 19 +- .../Api/VKApiNoteNotFoundException.php | 16 - .../Api/VKApiObjectDeletedException.php | 16 - .../VKApiOriginalPhotoWasChangedException.php | 16 - .../Api/VKApiOutOfLimitsException.php | 16 - .../Api/VKApiPageNotFoundException.php | 16 - .../Api/VKApiParamAlbumIdException.php | 19 + .../Api/VKApiParamApiIdException.php | 19 + .../Api/VKApiParamDocAccessException.php | 19 + .../VKApiParamDocDeleteAccessException.php | 19 + .../Api/VKApiParamDocIdException.php | 19 + .../Api/VKApiParamDocTitleException.php | 19 + src/VK/Exceptions/Api/VKApiParamException.php | 19 + .../Api/VKApiParamGroupIdException.php | 19 + .../Api/VKApiParamHashException.php | 19 + .../Api/VKApiParamNoteIdException.php | 19 + .../Api/VKApiParamPageIdException.php | 19 + .../Api/VKApiParamPhoneException.php | 19 + .../Api/VKApiParamPhotoException.php | 19 + .../Api/VKApiParamPhotosException.php | 19 + .../Api/VKApiParamServerException.php | 19 + .../Api/VKApiParamTimestampException.php | 19 + .../Api/VKApiParamTitleException.php | 19 + .../Api/VKApiParamUserIdException.php | 19 + ...oManyActionsThisDay.TryLater.Exception.php | 16 - .../Api/VKApiPermissionException.php | 19 + .../Api/VKApiPhoneAlreadyUsedException.php | 19 + .../Api/VKApiPhotoChangedException.php | 19 + .../Api/VKApiPollsAccessException.php | 19 + .../VKApiPollsAccessWithoutVoteException.php | 19 + .../Api/VKApiPollsAnswerIdException.php | 19 + .../Api/VKApiPollsPollIdException.php | 19 + ...ttyCardsCardIsConnectedToPostException.php | 19 + .../VKApiPrettyCardsCardNotFoundException.php | 19 + .../VKApiPrettyCardsTooManyCardsException.php | 19 + .../Api/VKApiPrivateProfileException.php | 19 + .../Api/VKApiPropertyNotFoundException.php | 16 - .../Api/VKApiRateLimitException.php | 19 + ...eachedTheMaximumNumberOfListsException.php | 16 - ...ionCanNotBeAppliedToTheObjectException.php | 16 - .../Exceptions/Api/VKApiRequestException.php | 19 + .../Exceptions/Api/VKApiRuntimeException.php | 19 + ...eOccurredDuringCodeInvocationException.php | 16 - .../Exceptions/Api/VKApiSaveFileException.php | 19 + .../Exceptions/Api/VKApiServerException.php | 19 + ...piServersNumberLimitIsReachedException.php | 16 - .../Api/VKApiSignatureException.php | 19 + ...TheRequestHasNotBeenCompletedException.php | 16 - ...nkIsIncorrect(cantFindSource)Exception.php | 16 - ...gthHeightAndWeightAllTogetherException.php | 16 - .../Api/VKApiStatusNoAudioException.php | 19 + .../VKApiStickersAreNotFavoriteException.php | 16 - .../VKApiStickersAreNotPurchasedException.php | 16 - .../Api/VKApiStoryExpiredException.php | 19 + .../VKApiStoryHasAlreadyExpiredException.php | 16 - ...ApiStoryIncorrectReplyPrivacyException.php | 19 + ...SubscriptionIsInInvalidStatusException.php | 16 - .../VKApiSubscriptionNotFoundException.php | 16 - ...obileNumberOfTheUserIsUnknownException.php | 16 - ...sAchievementIsAlreadyUnlockedException.php | 16 - ...ureChangeThisStatusInSettingsException.php | 16 - .../VKApiThisVideoIsAlreadyAddedException.php | 16 - .../Api/VKApiTooLateForRestoreException.php | 16 - .../VKApiTooManyAddressesInClubException.php | 16 - .../Api/VKApiTooManyAdsPostsException.php | 16 - .../Api/VKApiTooManyAlbumsException.php | 16 - ...ManyAuthAttemptsTryAgainLaterException.php | 16 - .../Api/VKApiTooManyCardsException.php | 16 - .../Exceptions/Api/VKApiTooManyException.php | 19 + .../VKApiTooManyFavoriteStickersException.php | 16 - .../Api/VKApiTooManyFeedListsException.php | 16 - ...VKApiTooManyForwardedMessagesException.php | 16 - .../Api/VKApiTooManyItemsException.php | 16 - .../Api/VKApiTooManyItemsInAlbumException.php | 16 - .../Api/VKApiTooManyListsException.php | 19 + .../VKApiTooManyOfficersInClubException.php | 16 - .../VKApiTooManyPostsInMessagesException.php | 16 - .../Api/VKApiTooManyRecipientsException.php | 16 - .../Api/VKApiTooManyRepliesException.php | 16 - .../Api/VKApiUnableToCompileCodeException.php | 16 - .../VKApiUnableToProcessActionException.php | 16 - .../Exceptions/Api/VKApiUnknownException.php | 19 + .../Exceptions/Api/VKApiUploadException.php | 19 +- .../Api/VKApiUserDeletedException.php | 19 + ...serDisabledTrackNameBroadcastException.php | 16 - ...NeedsToEnable2faForThisActionException.php | 16 - .../Api/VKApiUserNotFoundInChatException.php | 16 - .../Api/VKApiUserShouldBeInClubException.php | 16 - .../VKApiValueOfTsOrPtsIsTooNewException.php | 16 - .../VKApiValueOfTsOrPtsIsTooOldException.php | 16 - .../Api/VKApiVariantNotFoundException.php | 16 - .../Api/VKApiVideoAlreadyAddedException.php | 19 + .../Api/VKApiVideoCommentsClosedException.php | 19 + ...ApiVkPayStatusCanNotBeChangedException.php | 16 - src/VK/Exceptions/Api/VKApiVotesException.php | 19 + .../Api/VKApiVotesPermissionException.php | 19 + .../Api/VKApiWallAccessAddReplyException.php | 19 + .../Api/VKApiWallAccessCommentException.php | 19 + .../Api/VKApiWallAccessPostException.php | 19 + .../Api/VKApiWallAccessRepliesException.php | 19 + .../Api/VKApiWallAddPostException.php | 19 + .../VKApiWallAdsPostLimitReachedException.php | 19 + .../Api/VKApiWallAdsPublishedException.php | 19 + .../Api/VKApiWallLinksForbiddenException.php | 19 + .../Api/VKApiWallReplyOwnerFloodException.php | 19 + .../VKApiWallTooManyRecipientsException.php | 19 + .../Api/VKApiWeightedFloodException.php | 19 + ...VKApiYouAreNotAdminOfThisChatException.php | 16 - ...ntChangeInviteLinkForThisChatException.php | 16 - .../VKApiYouCantCommentThisNoteException.php | 16 - ...uCantSeeInviteLinkForThisChatException.php | 16 - ...piYouDontHaveAccessToThisChatException.php | 16 - ...uNeedToEnable2faForThisActionException.php | 16 - ...unityCantInteractWithThisPeerException.php | 16 - 558 files changed, 18797 insertions(+), 14781 deletions(-) delete mode 100644 src/VK/Actions/Adsweb.php delete mode 100644 src/VK/Actions/Donut.php delete mode 100644 src/VK/Actions/DownloadedGames.php delete mode 100644 src/VK/Actions/Enum/AccountSaveProfileInfoBdateVisibility.php delete mode 100644 src/VK/Actions/Enum/AccountSaveProfileInfoRelation.php delete mode 100644 src/VK/Actions/Enum/AccountSaveProfileInfoSex.php delete mode 100644 src/VK/Actions/Enum/AdsCheckLinkLinkType.php delete mode 100644 src/VK/Actions/Enum/AdsGetDemographicsIdsType.php delete mode 100644 src/VK/Actions/Enum/AdsGetDemographicsPeriod.php delete mode 100644 src/VK/Actions/Enum/AdsGetPostsReachIdsType.php delete mode 100644 src/VK/Actions/Enum/AdsGetStatisticsIdsType.php delete mode 100644 src/VK/Actions/Enum/AdsGetStatisticsPeriod.php delete mode 100644 src/VK/Actions/Enum/AdsGetSuggestionsLang.php delete mode 100644 src/VK/Actions/Enum/AdsGetSuggestionsSection.php delete mode 100644 src/VK/Actions/Enum/AdsGetTargetingStatsAdFormat.php delete mode 100644 src/VK/Actions/Enum/AdsGetUploadURLAdFormat.php delete mode 100644 src/VK/Actions/Enum/AppWidgetsGetAppImageUploadServerImageType.php delete mode 100644 src/VK/Actions/Enum/AppWidgetsGetAppImagesImageType.php delete mode 100644 src/VK/Actions/Enum/AppWidgetsGetGroupImageUploadServerImageType.php delete mode 100644 src/VK/Actions/Enum/AppWidgetsGetGroupImagesImageType.php delete mode 100644 src/VK/Actions/Enum/AppWidgetsUpdateType.php delete mode 100644 src/VK/Actions/Enum/AppsGetCatalogFilter.php delete mode 100644 src/VK/Actions/Enum/AppsGetCatalogSort.php delete mode 100644 src/VK/Actions/Enum/AppsGetFriendsListType.php delete mode 100644 src/VK/Actions/Enum/AppsGetLeaderboardType.php delete mode 100644 src/VK/Actions/Enum/AppsGetNameCase.php delete mode 100644 src/VK/Actions/Enum/AppsGetPlatform.php delete mode 100644 src/VK/Actions/Enum/AppsGetScopesType.php delete mode 100644 src/VK/Actions/Enum/AppsSendRequestType.php delete mode 100644 src/VK/Actions/Enum/BoardGetCommentsSort.php delete mode 100644 src/VK/Actions/Enum/BoardGetTopicsOrder.php delete mode 100644 src/VK/Actions/Enum/BoardGetTopicsPreview.php delete mode 100644 src/VK/Actions/Enum/DocsGetMessagesUploadServerType.php delete mode 100644 src/VK/Actions/Enum/DocsGetType.php delete mode 100644 src/VK/Actions/Enum/FaveAddTagPosition.php delete mode 100644 src/VK/Actions/Enum/FaveGetItemType.php delete mode 100644 src/VK/Actions/Enum/FaveGetPagesType.php delete mode 100644 src/VK/Actions/Enum/FaveSetTagsItemType.php delete mode 100644 src/VK/Actions/Enum/FriendsGetNameCase.php delete mode 100644 src/VK/Actions/Enum/FriendsGetOrder.php delete mode 100644 src/VK/Actions/Enum/FriendsGetRequestsSort.php delete mode 100644 src/VK/Actions/Enum/FriendsGetSuggestionsNameCase.php delete mode 100644 src/VK/Actions/Enum/FriendsSearchNameCase.php delete mode 100644 src/VK/Actions/Enum/GroupsAddAddressWorkInfoStatus.php delete mode 100644 src/VK/Actions/Enum/GroupsCreateSubtype.php delete mode 100644 src/VK/Actions/Enum/GroupsCreateType.php delete mode 100644 src/VK/Actions/Enum/GroupsEditAddressWorkInfoStatus.php delete mode 100644 src/VK/Actions/Enum/GroupsEditAgeLimits.php delete mode 100644 src/VK/Actions/Enum/GroupsGetInvitedUsersNameCase.php delete mode 100644 src/VK/Actions/Enum/GroupsGetMembersFilter.php delete mode 100644 src/VK/Actions/Enum/GroupsGetMembersSort.php delete mode 100644 src/VK/Actions/Enum/GroupsSearchSort.php delete mode 100644 src/VK/Actions/Enum/GroupsSearchType.php delete mode 100644 src/VK/Actions/Enum/GroupsTagAddTagColor.php delete mode 100644 src/VK/Actions/Enum/GroupsTagBindAct.php delete mode 100644 src/VK/Actions/Enum/GroupsToggleMarketState.php delete mode 100644 src/VK/Actions/Enum/LikesGetListFilter.php delete mode 100644 src/VK/Actions/Enum/LikesGetListFriendsOnly.php delete mode 100644 src/VK/Actions/Enum/MarketEditOrderPaymentStatus.php delete mode 100644 src/VK/Actions/Enum/MarketGetCommentsSort.php delete mode 100644 src/VK/Actions/Enum/MarketReportCommentReason.php delete mode 100644 src/VK/Actions/Enum/MarketReportReason.php delete mode 100644 src/VK/Actions/Enum/MarketSearchRev.php delete mode 100644 src/VK/Actions/Enum/MarketSearchSort.php delete mode 100644 src/VK/Actions/Enum/MarketSearchStatus.php delete mode 100644 src/VK/Actions/Enum/MessagesGetConversationsFilter.php delete mode 100644 src/VK/Actions/Enum/MessagesGetHistoryAttachmentsMediaType.php delete mode 100644 src/VK/Actions/Enum/MessagesGetHistoryRev.php delete mode 100644 src/VK/Actions/Enum/MessagesGetIntentUsersIntent.php delete mode 100644 src/VK/Actions/Enum/MessagesSendIntent.php delete mode 100644 src/VK/Actions/Enum/MessagesSetActivityType.php delete mode 100644 src/VK/Actions/Enum/NewsfeedGetBannedNameCase.php delete mode 100644 src/VK/Actions/Enum/NewsfeedUnsubscribeType.php delete mode 100644 src/VK/Actions/Enum/NotesGetCommentsSort.php delete mode 100644 src/VK/Actions/Enum/NotesGetSort.php delete mode 100644 src/VK/Actions/Enum/NotificationsSendMessageSendingMode.php delete mode 100644 src/VK/Actions/Enum/OrdersChangeStateAction.php delete mode 100644 src/VK/Actions/Enum/PagesSaveAccessEdit.php delete mode 100644 src/VK/Actions/Enum/PagesSaveAccessView.php delete mode 100644 src/VK/Actions/Enum/PhotosGetCommentsSort.php delete mode 100644 src/VK/Actions/Enum/PhotosReportCommentReason.php delete mode 100644 src/VK/Actions/Enum/PhotosReportReason.php delete mode 100644 src/VK/Actions/Enum/PollsCreateBackgroundId.php delete mode 100644 src/VK/Actions/Enum/PollsEditBackgroundId.php delete mode 100644 src/VK/Actions/Enum/PollsGetByIdNameCase.php delete mode 100644 src/VK/Actions/Enum/PollsGetVotersNameCase.php delete mode 100644 src/VK/Actions/Enum/StatsGetInterval.php delete mode 100644 src/VK/Actions/Enum/StreamingSetSettingsMonthlyTier.php delete mode 100644 src/VK/Actions/Enum/UsersGetFollowersNameCase.php delete mode 100644 src/VK/Actions/Enum/UsersGetNameCase.php delete mode 100644 src/VK/Actions/Enum/UsersReportType.php delete mode 100644 src/VK/Actions/Enum/UsersSearchSex.php delete mode 100644 src/VK/Actions/Enum/UsersSearchSort.php delete mode 100644 src/VK/Actions/Enum/UsersSearchStatus.php delete mode 100644 src/VK/Actions/Enum/UtilsGetLinkStatsInterval.php delete mode 100644 src/VK/Actions/Enum/UtilsGetLinkStatsSource.php delete mode 100644 src/VK/Actions/Enum/VideoGetCommentsSort.php delete mode 100644 src/VK/Actions/Enum/VideoReportCommentReason.php delete mode 100644 src/VK/Actions/Enum/VideoReportReason.php delete mode 100644 src/VK/Actions/Enum/VideoSearchSort.php delete mode 100644 src/VK/Actions/Enum/WallGetCommentsSort.php delete mode 100644 src/VK/Actions/Enum/WallReportCommentReason.php delete mode 100644 src/VK/Actions/Enum/WallReportPostReason.php create mode 100644 src/VK/Actions/Enums/AccountBdateVisibility.php create mode 100644 src/VK/Actions/Enums/AccountFields.php create mode 100644 src/VK/Actions/Enums/AccountFilter.php create mode 100644 src/VK/Actions/Enums/AccountRelation.php create mode 100644 src/VK/Actions/Enums/AccountSex.php create mode 100644 src/VK/Actions/Enums/AdsAdFormat.php create mode 100644 src/VK/Actions/Enums/AdsIdsType.php create mode 100644 src/VK/Actions/Enums/AdsLang.php create mode 100644 src/VK/Actions/Enums/AdsLinkType.php create mode 100644 src/VK/Actions/Enums/AdsPeriod.php create mode 100644 src/VK/Actions/Enums/AdsSection.php create mode 100644 src/VK/Actions/Enums/AppWidgetsType.php create mode 100644 src/VK/Actions/Enums/AppsFields.php create mode 100644 src/VK/Actions/Enums/AppsFilter.php create mode 100644 src/VK/Actions/Enums/AppsNameCase.php create mode 100644 src/VK/Actions/Enums/AppsPlatform.php create mode 100644 src/VK/Actions/Enums/AppsSort.php create mode 100644 src/VK/Actions/Enums/AppsType.php create mode 100644 src/VK/Actions/Enums/BoardOrder.php create mode 100644 src/VK/Actions/Enums/BoardPreview.php create mode 100644 src/VK/Actions/Enums/BoardSort.php create mode 100644 src/VK/Actions/Enums/DocsType.php create mode 100644 src/VK/Actions/Enums/FaveFields.php create mode 100644 src/VK/Actions/Enums/FaveItemType.php create mode 100644 src/VK/Actions/Enums/FaveType.php create mode 100644 src/VK/Actions/Enums/FriendsFields.php create mode 100644 src/VK/Actions/Enums/FriendsFilter.php create mode 100644 src/VK/Actions/Enums/FriendsNameCase.php create mode 100644 src/VK/Actions/Enums/FriendsOrder.php create mode 100644 src/VK/Actions/Enums/FriendsSort.php create mode 100644 src/VK/Actions/Enums/Groups/AddressWorkInfoStatus.php create mode 100644 src/VK/Actions/Enums/Groups/GroupAccess.php create mode 100644 src/VK/Actions/Enums/Groups/GroupAgeLimits.php create mode 100644 src/VK/Actions/Enums/Groups/GroupAudio.php create mode 100644 src/VK/Actions/Enums/Groups/GroupDocs.php create mode 100644 src/VK/Actions/Enums/Groups/GroupMarketCurrency.php create mode 100644 src/VK/Actions/Enums/Groups/GroupPhotos.php create mode 100644 src/VK/Actions/Enums/Groups/GroupRole.php create mode 100644 src/VK/Actions/Enums/Groups/GroupSubject.php create mode 100644 src/VK/Actions/Enums/Groups/GroupTopics.php create mode 100644 src/VK/Actions/Enums/Groups/GroupVideo.php create mode 100644 src/VK/Actions/Enums/Groups/GroupWall.php create mode 100644 src/VK/Actions/Enums/Groups/GroupWiki.php create mode 100644 src/VK/Actions/Enums/GroupsAccess.php create mode 100644 src/VK/Actions/Enums/GroupsAgeLimits.php create mode 100644 src/VK/Actions/Enums/GroupsAudio.php create mode 100644 src/VK/Actions/Enums/GroupsDocs.php create mode 100644 src/VK/Actions/Enums/GroupsFields.php create mode 100644 src/VK/Actions/Enums/GroupsFilter.php create mode 100644 src/VK/Actions/Enums/GroupsMarketCurrency.php create mode 100644 src/VK/Actions/Enums/GroupsNameCase.php create mode 100644 src/VK/Actions/Enums/GroupsPhotos.php create mode 100644 src/VK/Actions/Enums/GroupsRole.php create mode 100644 src/VK/Actions/Enums/GroupsSort.php create mode 100644 src/VK/Actions/Enums/GroupsSubject.php create mode 100644 src/VK/Actions/Enums/GroupsSubtype.php create mode 100644 src/VK/Actions/Enums/GroupsTopics.php create mode 100644 src/VK/Actions/Enums/GroupsType.php create mode 100644 src/VK/Actions/Enums/GroupsVideo.php create mode 100644 src/VK/Actions/Enums/GroupsWall.php create mode 100644 src/VK/Actions/Enums/GroupsWiki.php create mode 100644 src/VK/Actions/Enums/GroupsWorkInfoStatus.php create mode 100644 src/VK/Actions/Enums/LeadsStatus.php create mode 100644 src/VK/Actions/Enums/LikesFilter.php create mode 100644 src/VK/Actions/Enums/LikesFriendsOnly.php create mode 100644 src/VK/Actions/Enums/LikesType.php create mode 100644 src/VK/Actions/Enums/MarketFields.php create mode 100644 src/VK/Actions/Enums/MarketReason.php create mode 100644 src/VK/Actions/Enums/MarketRev.php create mode 100644 src/VK/Actions/Enums/MarketSort.php create mode 100644 src/VK/Actions/Enums/MarketStatus.php create mode 100644 src/VK/Actions/Enums/MessagesFields.php create mode 100644 src/VK/Actions/Enums/MessagesFilter.php create mode 100644 src/VK/Actions/Enums/MessagesMediaType.php create mode 100644 src/VK/Actions/Enums/MessagesRev.php create mode 100644 src/VK/Actions/Enums/Newsfeed/IgnoreItemType.php create mode 100644 src/VK/Actions/Enums/NewsfeedFields.php create mode 100644 src/VK/Actions/Enums/NewsfeedFilters.php create mode 100644 src/VK/Actions/Enums/NewsfeedNameCase.php create mode 100644 src/VK/Actions/Enums/NewsfeedType.php create mode 100644 src/VK/Actions/Enums/NotesSort.php create mode 100644 src/VK/Actions/Enums/NotificationsFilters.php create mode 100644 src/VK/Actions/Enums/OrdersAction.php create mode 100644 src/VK/Actions/Enums/PagesEdit.php create mode 100644 src/VK/Actions/Enums/PagesView.php create mode 100644 src/VK/Actions/Enums/PhotosFields.php create mode 100644 src/VK/Actions/Enums/PhotosReason.php create mode 100644 src/VK/Actions/Enums/PhotosSort.php create mode 100644 src/VK/Actions/Enums/PollsBackgroundId.php create mode 100644 src/VK/Actions/Enums/PollsFields.php create mode 100644 src/VK/Actions/Enums/PollsNameCase.php create mode 100644 src/VK/Actions/Enums/Stories/UploadLinkText.php create mode 100644 src/VK/Actions/Enums/StoriesFields.php create mode 100644 src/VK/Actions/Enums/StoriesLinkText.php create mode 100644 src/VK/Actions/Enums/StreamingMonthlyTier.php create mode 100644 src/VK/Actions/Enums/UsersFields.php create mode 100644 src/VK/Actions/Enums/UsersNameCase.php create mode 100644 src/VK/Actions/Enums/UsersSex.php create mode 100644 src/VK/Actions/Enums/UsersSort.php create mode 100644 src/VK/Actions/Enums/UsersStatus.php create mode 100644 src/VK/Actions/Enums/UsersType.php create mode 100644 src/VK/Actions/Enums/UtilsInterval.php create mode 100644 src/VK/Actions/Enums/UtilsSource.php create mode 100644 src/VK/Actions/Enums/VideoFilters.php create mode 100644 src/VK/Actions/Enums/VideoPrivacy.php create mode 100644 src/VK/Actions/Enums/VideoReason.php create mode 100644 src/VK/Actions/Enums/VideoSort.php create mode 100644 src/VK/Actions/Enums/WallFields.php create mode 100644 src/VK/Actions/Enums/WallFilter.php create mode 100644 src/VK/Actions/Enums/WallReason.php create mode 100644 src/VK/Actions/Enums/WallSort.php create mode 100644 src/VK/Actions/Enums/WidgetsFields.php create mode 100644 src/VK/Actions/Leads.php delete mode 100644 src/VK/Actions/Podcasts.php delete mode 100644 src/VK/Actions/Store.php rename src/VK/Client/{Enum => Enums}/VKLanguage.php (89%) mode change 100644 => 100755 create mode 100644 src/VK/Exceptions/Api/VKApiAccessAlbumException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessAudioException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessCommentException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessDeniedPleaseVoteFirstException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessGroupException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessGroupsException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessMarketException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessMenuException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessNoteCommentException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessNoteException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessPageException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToAddingPostDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToCommentDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToDocumentDeletingIsDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToDocumentIsDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToNoteDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToPageDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToPollDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToPostCommentsDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToStatusRepliesDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToTheGroupsListIsDeniedDueToTheUsersPrivacySettingsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToTheMenuOfTheUserDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToWallsCommentDeniedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAccessToWallsPostDeniedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAccessVideoException.php create mode 100644 src/VK/Exceptions/Api/VKApiActionFailedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAdsObjectDeletedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAdsPartialSuccessException.php create mode 100644 src/VK/Exceptions/Api/VKApiAdsPermissionException.php create mode 100644 src/VK/Exceptions/Api/VKApiAdsSpecificException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAdvertisementPostWasRecentlyAddedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAlbumFullException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAlbumNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiAlbumsLimitException.php delete mode 100644 src/VK/Exceptions/Api/VKApiAlbumsNumberLimitIsReachedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAppAuthException.php delete mode 100644 src/VK/Exceptions/Api/VKApiApplicationHasInsufficientFundsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiApplicationIsNotInstalledInCommunityException.php create mode 100644 src/VK/Exceptions/Api/VKApiAppsAlreadyUnlockedException.php create mode 100644 src/VK/Exceptions/Api/VKApiAppsSubscriptionInvalidStatusException.php create mode 100644 src/VK/Exceptions/Api/VKApiAppsSubscriptionNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiAuthDelayException.php create mode 100644 src/VK/Exceptions/Api/VKApiAuthException.php create mode 100644 src/VK/Exceptions/Api/VKApiAuthFloodException.php create mode 100644 src/VK/Exceptions/Api/VKApiAuthHttpsException.php create mode 100644 src/VK/Exceptions/Api/VKApiAuthValidationException.php create mode 100644 src/VK/Exceptions/Api/VKApiBlockedException.php create mode 100644 src/VK/Exceptions/Api/VKApiCallbackApiServersLimitException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCannotAddThisUserToFriendsAsTheyHavePutYouOnTheirBlacklistException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCannotAddThisUserToFriendsAsUserNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCannotAddThisUserToFriendsAsYouPutHimOnBlacklistException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCannotAddUserHimselfAsFriendException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCannotEditCreatorRoleException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCannotPinOne-timeStoryException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCannotUseThisIntentException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantAddUserToChatBecauseUserHasNoAccessToGroupException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantDeleteThisMessageForEverybodyException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantEditPinnedMessageYetException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantEditThisKindOfMessageException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantEditThisMessageBecauseItsTooOldException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantForwardTheseMessagesException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantSendMessageReplyTimedOutException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantSendMessagesForUsersFromBlacklistException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantSendMessagesForUsersWithoutPermissionException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantSendMessagesToThisUserDueToTheirPrivacySettingsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantSentThisMessageBecauseItsTooBigException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCantSetAliexpressTagToThisTypeOfObjectException.php create mode 100644 src/VK/Exceptions/Api/VKApiCaptchaException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCardIsConnectedToPostException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCardNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCartIsEmptyException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCatalogCategoriesAreNotAvailableForThisUserException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCatalogIsNotAvailableForThisUserException.php delete mode 100644 src/VK/Exceptions/Api/VKApiChatDoesNotExistException.php delete mode 100644 src/VK/Exceptions/Api/VKApiChatNotSupportedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiChatWasDisabledException.php delete mode 100644 src/VK/Exceptions/Api/VKApiClientUpdateNeededException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCommentsForThisMarketAreClosedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCommentsForThisVideoAreClosedException.php create mode 100644 src/VK/Exceptions/Api/VKApiCommunitiesCatalogDisabledException.php create mode 100644 src/VK/Exceptions/Api/VKApiCommunitiesCategoriesDisabledException.php create mode 100644 src/VK/Exceptions/Api/VKApiCompileException.php delete mode 100644 src/VK/Exceptions/Api/VKApiContactNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiContentBlockedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCouldntSaveFileException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCropBottomRightCornerIsOutsideOfTheImageException.php delete mode 100644 src/VK/Exceptions/Api/VKApiCropSizeIsLessThanTheMinimumException.php create mode 100644 src/VK/Exceptions/Api/VKApiDisabledException.php delete mode 100644 src/VK/Exceptions/Api/VKApiDonutIsDisabledException.php create mode 100644 src/VK/Exceptions/Api/VKApiEnabledInTestException.php delete mode 100644 src/VK/Exceptions/Api/VKApiExtendedMarketNotEnabledException.php create mode 100644 src/VK/Exceptions/Api/VKApiFloodException.php create mode 100644 src/VK/Exceptions/Api/VKApiFriendsAddEnemyException.php create mode 100644 src/VK/Exceptions/Api/VKApiFriendsAddInEnemyException.php create mode 100644 src/VK/Exceptions/Api/VKApiFriendsAddNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiFriendsAddYourselfException.php create mode 100644 src/VK/Exceptions/Api/VKApiFriendsListIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiFriendsListLimitException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupAppIsNotInstalledInCommunityException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupAuthException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupChangeCreatorException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupHostNeed2faException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupNeed2faException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupNotInClubException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupTooManyAddressesException.php create mode 100644 src/VK/Exceptions/Api/VKApiGroupTooManyOfficersException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupingAlreadyHasSuchVariantException.php delete mode 100644 src/VK/Exceptions/Api/VKApiGroupingMustHaveTwoOrMoreItemsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiHyperlinksAreForbiddenException.php delete mode 100644 src/VK/Exceptions/Api/VKApiIncorrectReplyPrivacyException.php create mode 100644 src/VK/Exceptions/Api/VKApiInsufficientFundsException.php create mode 100644 src/VK/Exceptions/Api/VKApiInvalidAddressException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidAlbumIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidAnswerIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidDocumentIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidDocumentTitleException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidGroupIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidHashException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidImageCropFormatException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidListIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidPhotoException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidPhotosException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidPollIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidScreenNameException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidServerException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInvalidTitleException.php delete mode 100644 src/VK/Exceptions/Api/VKApiInviteLinkIsInvalid-ExpiredDeletedOrNotExistsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiItemAlreadyAddedToAlbumException.php delete mode 100644 src/VK/Exceptions/Api/VKApiItemHasBadLinksInDescriptionException.php delete mode 100644 src/VK/Exceptions/Api/VKApiItemMustHaveDistinctPropertiesException.php delete mode 100644 src/VK/Exceptions/Api/VKApiItemNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiKeyboardFormatIsInvalidException.php create mode 100644 src/VK/Exceptions/Api/VKApiLimitsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiLimitsOverflowForThisIntentException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketAlbumNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketCommentsClosedException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketGroupingItemsMustHaveDistinctPropertiesException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketGroupingMustContainMoreThanOneItemException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketItemAlreadyAddedException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketItemHasBadLinksException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketItemNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketNotEnabledException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketPropertyNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketRestoreTooLateException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketTooManyAlbumsException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketTooManyItemsException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketTooManyItemsInAlbumException.php create mode 100644 src/VK/Exceptions/Api/VKApiMarketVariantNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketWasAlreadyDisabledInThisGroupException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMarketWasAlreadyEnabledInThisGroupException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessageIsTooLongException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMessageRequestAlreadySentException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantChangeInviteLinkException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantDeleteForAllException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantFwdException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantPinOneTimeStoryException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesCantSeeInviteLinkException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatBotFeatureException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatNotAdminException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatNotExistException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatUserNoAccessException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesChatUserNotInChatException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesContactNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesDenySendException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesEditExpiredException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesEditKindDisallowedException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesGroupPeerAccessException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesKeyboardInvalidException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesMessageRequestAlreadySendException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesMessageRequestAlreadySentException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesPrivacyException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooBigException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooLongForwardsException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooLongMessageException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooManyPostsException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooNewPtsException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesTooOldPtsException.php create mode 100644 src/VK/Exceptions/Api/VKApiMessagesUserBlockedException.php create mode 100644 src/VK/Exceptions/Api/VKApiMethodAdsException.php create mode 100644 src/VK/Exceptions/Api/VKApiMethodDisabledException.php create mode 100644 src/VK/Exceptions/Api/VKApiMethodException.php delete mode 100644 src/VK/Exceptions/Api/VKApiMethodExecutionWasInterruptedDueToTimeoutException.php create mode 100644 src/VK/Exceptions/Api/VKApiMethodPermissionException.php create mode 100644 src/VK/Exceptions/Api/VKApiMobileNotActivatedException.php create mode 100644 src/VK/Exceptions/Api/VKApiNeedConfirmationException.php create mode 100644 src/VK/Exceptions/Api/VKApiNeedTokenConfirmationException.php delete mode 100644 src/VK/Exceptions/Api/VKApiNoteNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiObjectDeletedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiOriginalPhotoWasChangedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiOutOfLimitsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPageNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamAlbumIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamApiIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamDocAccessException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamDocDeleteAccessException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamDocIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamDocTitleException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamGroupIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamHashException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamNoteIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamPageIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamPhoneException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamPhotoException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamPhotosException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamServerException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamTimestampException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamTitleException.php create mode 100644 src/VK/Exceptions/Api/VKApiParamUserIdException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPermissionDenied.YouHaveRequestedTooManyActionsThisDay.TryLater.Exception.php create mode 100644 src/VK/Exceptions/Api/VKApiPermissionException.php create mode 100644 src/VK/Exceptions/Api/VKApiPhoneAlreadyUsedException.php create mode 100644 src/VK/Exceptions/Api/VKApiPhotoChangedException.php create mode 100644 src/VK/Exceptions/Api/VKApiPollsAccessException.php create mode 100644 src/VK/Exceptions/Api/VKApiPollsAccessWithoutVoteException.php create mode 100644 src/VK/Exceptions/Api/VKApiPollsAnswerIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiPollsPollIdException.php create mode 100644 src/VK/Exceptions/Api/VKApiPrettyCardsCardIsConnectedToPostException.php create mode 100644 src/VK/Exceptions/Api/VKApiPrettyCardsCardNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiPrettyCardsTooManyCardsException.php create mode 100644 src/VK/Exceptions/Api/VKApiPrivateProfileException.php delete mode 100644 src/VK/Exceptions/Api/VKApiPropertyNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiRateLimitException.php delete mode 100644 src/VK/Exceptions/Api/VKApiReachedTheMaximumNumberOfListsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiReactionCanNotBeAppliedToTheObjectException.php create mode 100644 src/VK/Exceptions/Api/VKApiRequestException.php create mode 100644 src/VK/Exceptions/Api/VKApiRuntimeException.php delete mode 100644 src/VK/Exceptions/Api/VKApiRuntimeOccurredDuringCodeInvocationException.php create mode 100644 src/VK/Exceptions/Api/VKApiSaveFileException.php create mode 100644 src/VK/Exceptions/Api/VKApiServerException.php delete mode 100644 src/VK/Exceptions/Api/VKApiServersNumberLimitIsReachedException.php create mode 100644 src/VK/Exceptions/Api/VKApiSignatureException.php delete mode 100644 src/VK/Exceptions/Api/VKApiSomePartOfTheRequestHasNotBeenCompletedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiSpecifiedLinkIsIncorrect(cantFindSource)Exception.php delete mode 100644 src/VK/Exceptions/Api/VKApiSpecifyWidthLengthHeightAndWeightAllTogetherException.php create mode 100644 src/VK/Exceptions/Api/VKApiStatusNoAudioException.php delete mode 100644 src/VK/Exceptions/Api/VKApiStickersAreNotFavoriteException.php delete mode 100644 src/VK/Exceptions/Api/VKApiStickersAreNotPurchasedException.php create mode 100644 src/VK/Exceptions/Api/VKApiStoryExpiredException.php delete mode 100644 src/VK/Exceptions/Api/VKApiStoryHasAlreadyExpiredException.php create mode 100644 src/VK/Exceptions/Api/VKApiStoryIncorrectReplyPrivacyException.php delete mode 100644 src/VK/Exceptions/Api/VKApiSubscriptionIsInInvalidStatusException.php delete mode 100644 src/VK/Exceptions/Api/VKApiSubscriptionNotFoundException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTheMobileNumberOfTheUserIsUnknownException.php delete mode 100644 src/VK/Exceptions/Api/VKApiThisAchievementIsAlreadyUnlockedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiThisIsAChatBotFeatureChangeThisStatusInSettingsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiThisVideoIsAlreadyAddedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooLateForRestoreException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyAddressesInClubException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyAdsPostsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyAlbumsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyAuthAttemptsTryAgainLaterException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyCardsException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyFavoriteStickersException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyFeedListsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyForwardedMessagesException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyItemsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyItemsInAlbumException.php create mode 100644 src/VK/Exceptions/Api/VKApiTooManyListsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyOfficersInClubException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyPostsInMessagesException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyRecipientsException.php delete mode 100644 src/VK/Exceptions/Api/VKApiTooManyRepliesException.php delete mode 100644 src/VK/Exceptions/Api/VKApiUnableToCompileCodeException.php delete mode 100644 src/VK/Exceptions/Api/VKApiUnableToProcessActionException.php create mode 100644 src/VK/Exceptions/Api/VKApiUnknownException.php create mode 100644 src/VK/Exceptions/Api/VKApiUserDeletedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiUserDisabledTrackNameBroadcastException.php delete mode 100644 src/VK/Exceptions/Api/VKApiUserNeedsToEnable2faForThisActionException.php delete mode 100644 src/VK/Exceptions/Api/VKApiUserNotFoundInChatException.php delete mode 100644 src/VK/Exceptions/Api/VKApiUserShouldBeInClubException.php delete mode 100644 src/VK/Exceptions/Api/VKApiValueOfTsOrPtsIsTooNewException.php delete mode 100644 src/VK/Exceptions/Api/VKApiValueOfTsOrPtsIsTooOldException.php delete mode 100644 src/VK/Exceptions/Api/VKApiVariantNotFoundException.php create mode 100644 src/VK/Exceptions/Api/VKApiVideoAlreadyAddedException.php create mode 100644 src/VK/Exceptions/Api/VKApiVideoCommentsClosedException.php delete mode 100644 src/VK/Exceptions/Api/VKApiVkPayStatusCanNotBeChangedException.php create mode 100644 src/VK/Exceptions/Api/VKApiVotesException.php create mode 100644 src/VK/Exceptions/Api/VKApiVotesPermissionException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallAccessAddReplyException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallAccessCommentException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallAccessPostException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallAccessRepliesException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallAddPostException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallAdsPostLimitReachedException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallAdsPublishedException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallLinksForbiddenException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallReplyOwnerFloodException.php create mode 100644 src/VK/Exceptions/Api/VKApiWallTooManyRecipientsException.php create mode 100644 src/VK/Exceptions/Api/VKApiWeightedFloodException.php delete mode 100644 src/VK/Exceptions/Api/VKApiYouAreNotAdminOfThisChatException.php delete mode 100644 src/VK/Exceptions/Api/VKApiYouCantChangeInviteLinkForThisChatException.php delete mode 100644 src/VK/Exceptions/Api/VKApiYouCantCommentThisNoteException.php delete mode 100644 src/VK/Exceptions/Api/VKApiYouCantSeeInviteLinkForThisChatException.php delete mode 100644 src/VK/Exceptions/Api/VKApiYouDontHaveAccessToThisChatException.php delete mode 100644 src/VK/Exceptions/Api/VKApiYouNeedToEnable2faForThisActionException.php delete mode 100644 src/VK/Exceptions/Api/VKApiYourCommunityCantInteractWithThisPeerException.php diff --git a/src/VK/Actions/Account.php b/src/VK/Actions/Account.php index 6554236..7859e66 100644 --- a/src/VK/Actions/Account.php +++ b/src/VK/Actions/Account.php @@ -1,381 +1,323 @@ request = $request; - } + /** + * Account constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function ban(string $access_token, array $params = array()) { - return $this->request->post('account.ban', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function ban($access_token, array $params = []) { + return $this->request->post('account.ban', $access_token, $params); + } - /** - * Changes a user password after access is successfully restored with the [vk.com/dev/auth.restore|auth.restore] - * method. - * - * @param $access_token string - * @param $params array - * - string restore_sid: Session id received after the [vk.com/dev/auth.restore|auth.restore] method is - * executed. (If the password is changed right after the access was restored) - * - string change_password_hash: Hash received after a successful OAuth authorization with a code got by - * SMS. (If the password is changed right after the access was restored) - * - string old_password: Current user password. - * - string new_password: New password that will be set as a current - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function changePassword(string $access_token, array $params = array()) { - return $this->request->post('account.changePassword', $access_token, $params); - } + /** + * Changes a user password after access is successfully restored with the [vk.com/dev/auth.restore|auth.restore] method. + * + * @param string $access_token + * @param array $params + * - @var string restore_sid: Session id received after the [vk.com/dev/auth.restore|auth.restore] method is executed. (If the password is changed right after the access was restored) + * - @var string change_password_hash: Hash received after a successful OAuth authorization with a code got by SMS. (If the password is changed right after the access was restored) + * - @var string old_password: Current user password. + * - @var string new_password: New password that will be set as a current + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function changePassword($access_token, array $params = []) { + return $this->request->post('account.changePassword', $access_token, $params); + } - /** - * Returns a list of active ads (offers) which executed by the user will bring him/her respective number of votes - * to his balance in the application. - * - * @param $access_token string - * @param $params array - * - integer offset: - * - integer count: Number of results to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getActiveOffers(string $access_token, array $params = array()) { - return $this->request->post('account.getActiveOffers', $access_token, $params); - } + /** + * Returns a list of active ads (offers) which executed by the user will bring him/her respective number of votes to his balance in the application. + * + * @param string $access_token + * @param array $params + * - @var integer offset + * - @var integer count: Number of results to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getActiveOffers($access_token, array $params = []) { + return $this->request->post('account.getActiveOffers', $access_token, $params); + } - /** - * Gets settings of the user in this application. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID whose settings information shall be got. By default: current user. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAppPermissions(string $access_token, array $params = array()) { - return $this->request->post('account.getAppPermissions', $access_token, $params); - } + /** + * Gets settings of the user in this application. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID whose settings information shall be got. By default: current user. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getAppPermissions($access_token, array $params = []) { + return $this->request->post('account.getAppPermissions', $access_token, $params); + } - /** - * Returns a user's blacklist. - * - * @param $access_token string - * @param $params array - * - integer offset: Offset needed to return a specific subset of results. - * - integer count: Number of results to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getBanned(string $access_token, array $params = array()) { - return $this->request->post('account.getBanned', $access_token, $params); - } + /** + * Returns a user's blacklist. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of results. + * - @var integer count: Number of results to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getBanned($access_token, array $params = []) { + return $this->request->post('account.getBanned', $access_token, $params); + } - /** - * Returns non-null values of user counters. - * - * @param $access_token string - * @param $params array - * - array filter: Counters to be returned. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCounters(string $access_token, array $params = array()) { - return $this->request->post('account.getCounters', $access_token, $params); - } + /** + * Returns non-null values of user counters. + * + * @param string $access_token + * @param array $params + * - @var array[AccountFilter] filter: Counters to be returned. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCounters($access_token, array $params = []) { + return $this->request->post('account.getCounters', $access_token, $params); + } - /** - * Returns current account info. - * - * @param $access_token string - * @param $params array - * - array fields: Fields to return. Possible values: *'country' — user country,, *'https_required' — - * is "HTTPS only" option enabled,, *'own_posts_default' — is "Show my posts only" option is enabled,, - * *'no_wall_replies' — are wall replies disabled or not,, *'intro' — is intro passed by user or not,, - * *'lang' — user language. By default: all. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getInfo(string $access_token, array $params = array()) { - return $this->request->post('account.getInfo', $access_token, $params); - } + /** + * Returns current account info. + * + * @param string $access_token + * @param array $params + * - @var array[AccountFields] fields: Fields to return. Possible values: *'country' — user country,, *'https_required' — is "HTTPS only" option enabled,, *'own_posts_default' — is "Show my posts only" option is enabled,, *'no_wall_replies' — are wall replies disabled or not,, *'intro' — is intro passed by user or not,, *'lang' — user language. By default: all. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getInfo($access_token, array $params = []) { + return $this->request->post('account.getInfo', $access_token, $params); + } - /** - * Returns the current account info. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getProfileInfo(string $access_token, array $params = array()) { - return $this->request->post('account.getProfileInfo', $access_token, $params); - } + /** + * Returns the current account info. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getProfileInfo($access_token) { + return $this->request->post('account.getProfileInfo', $access_token); + } - /** - * Gets settings of push notifications. - * - * @param $access_token string - * @param $params array - * - string device_id: Unique device ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getPushSettings(string $access_token, array $params = array()) { - return $this->request->post('account.getPushSettings', $access_token, $params); - } + /** + * Gets settings of push notifications. + * + * @param string $access_token + * @param array $params + * - @var string device_id: Unique device ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getPushSettings($access_token, array $params = []) { + return $this->request->post('account.getPushSettings', $access_token, $params); + } - /** - * Subscribes an iOS/Android/Windows Phone-based device to receive push notifications - * - * @param $access_token string - * @param $params array - * - string token: Device token used to send notifications. (for mpns, the token shall be URL for sending - * of notifications) - * - string device_model: String name of device model. - * - integer device_year: Device year. - * - string device_id: Unique device ID. - * - string system_version: String version of device operating system. - * - string settings: Push settings in a [vk.com/dev/push_settings|special format]. - * - boolean sandbox: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function registerDevice(string $access_token, array $params = array()) { - return $this->request->post('account.registerDevice', $access_token, $params); - } + /** + * Subscribes an iOS/Android/Windows Phone-based device to receive push notifications + * + * @param string $access_token + * @param array $params + * - @var string token: Device token used to send notifications. (for mpns, the token shall be URL for sending of notifications) + * - @var string device_model: String name of device model. + * - @var integer device_year: Device year. + * - @var string device_id: Unique device ID. + * - @var string system_version: String version of device operating system. + * - @var string settings: Push settings in a [vk.com/dev/push_settings|special format]. + * - @var boolean sandbox + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function registerDevice($access_token, array $params = []) { + return $this->request->post('account.registerDevice', $access_token, $params); + } - /** - * Edits current profile info. - * - * @param $access_token string - * @param $params array - * - string first_name: User first name. - * - string last_name: User last name. - * - string maiden_name: User maiden name (female only) - * - string screen_name: User screen name. - * - integer cancel_request_id: ID of the name change request to be canceled. If this parameter is sent, - * all the others are ignored. - * - AccountSaveProfileInfoSex sex: User sex. Possible values: , * '1' - female,, * '2' - male. - * @see AccountSaveProfileInfoSex - * - AccountSaveProfileInfoRelation relation: User relationship status. Possible values: , * '1' - - * single,, * '2' - in a relationship,, * '3' - engaged,, * '4' - married,, * '5' - it's complicated,, * '6' - - * actively searching,, * '7' - in love,, * '0' - not specified. - * @see AccountSaveProfileInfoRelation - * - integer relation_partner_id: ID of the relationship partner. - * - string bdate: User birth date, format: DD.MM.YYYY. - * - AccountSaveProfileInfoBdateVisibility bdate_visibility: Birth date visibility. Returned values: , * - * '1' - show birth date,, * '2' - show only month and day,, * '0' - hide birth date. - * @see AccountSaveProfileInfoBdateVisibility - * - string home_town: User home town. - * - integer country_id: User country. - * - integer city_id: User city. - * - string status: Status text. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function saveProfileInfo(string $access_token, array $params = array()) { - return $this->request->post('account.saveProfileInfo', $access_token, $params); - } + /** + * Edits current profile info. + * + * @param string $access_token + * @param array $params + * - @var string first_name: User first name. + * - @var string last_name: User last name. + * - @var string maiden_name: User maiden name (female only) + * - @var string screen_name: User screen name. + * - @var integer cancel_request_id: ID of the name change request to be canceled. If this parameter is sent, all the others are ignored. + * - @var AccountSex sex: User sex. Possible values: , * '1' – female,, * '2' – male. + * - @var AccountRelation relation: User relationship status. Possible values: , * '1' – single,, * '2' – in a relationship,, * '3' – engaged,, * '4' – married,, * '5' – it's complicated,, * '6' – actively searching,, * '7' – in love,, * '0' – not specified. + * - @var integer relation_partner_id: ID of the relationship partner. + * - @var string bdate: User birth date, format: DD.MM.YYYY. + * - @var AccountBdateVisibility bdate_visibility: Birth date visibility. Returned values: , * '1' – show birth date,, * '2' – show only month and day,, * '0' – hide birth date. + * - @var string home_town: User home town. + * - @var integer country_id: User country. + * - @var integer city_id: User city. + * - @var string status: Status text. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiInvalidAddressException Invalid screen name + * @return mixed + */ + public function saveProfileInfo($access_token, array $params = []) { + return $this->request->post('account.saveProfileInfo', $access_token, $params); + } - /** - * Allows to edit the current account info. - * - * @param $access_token string - * @param $params array - * - string name: Setting name. - * - string value: Setting value. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function setInfo(string $access_token, array $params = array()) { - return $this->request->post('account.setInfo', $access_token, $params); - } + /** + * Allows to edit the current account info. + * + * @param string $access_token + * @param array $params + * - @var string name: Setting name. + * - @var string value: Setting value. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setInfo($access_token, array $params = []) { + return $this->request->post('account.setInfo', $access_token, $params); + } - /** - * Sets an application screen name (up to 17 characters), that is shown to the user in the left menu. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - string name: Application screen name. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function setNameInMenu(string $access_token, array $params = array()) { - return $this->request->post('account.setNameInMenu', $access_token, $params); - } + /** + * Sets an application screen name (up to 17 characters), that is shown to the user in the left menu. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var string name: Application screen name. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessMenuException Access to the menu of the user denied + * @return mixed + */ + public function setNameInMenu($access_token, array $params = []) { + return $this->request->post('account.setNameInMenu', $access_token, $params); + } - /** - * Marks a current user as offline. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function setOffline(string $access_token, array $params = array()) { - return $this->request->post('account.setOffline', $access_token, $params); - } + /** + * Marks a current user as offline. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setOffline($access_token) { + return $this->request->post('account.setOffline', $access_token); + } - /** - * Marks the current user as online for 15 minutes. - * - * @param $access_token string - * @param $params array - * - boolean voip: '1' if videocalls are available for current device. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function setOnline(string $access_token, array $params = array()) { - return $this->request->post('account.setOnline', $access_token, $params); - } + /** + * Marks the current user as online for 15 minutes. + * + * @param string $access_token + * @param array $params + * - @var boolean voip: '1' if videocalls are available for current device. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setOnline($access_token, array $params = []) { + return $this->request->post('account.setOnline', $access_token, $params); + } - /** - * Change push settings. - * - * @param $access_token string - * @param $params array - * - string device_id: Unique device ID. - * - string settings: Push settings in a [vk.com/dev/push_settings|special format]. - * - string key: Notification key. - * - array value: New value for the key in a [vk.com/dev/push_settings|special format]. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function setPushSettings(string $access_token, array $params = array()) { - return $this->request->post('account.setPushSettings', $access_token, $params); - } + /** + * Change push settings. + * + * @param string $access_token + * @param array $params + * - @var string device_id: Unique device ID. + * - @var string settings: Push settings in a [vk.com/dev/push_settings|special format]. + * - @var string key: Notification key. + * - @var array[string] value: New value for the key in a [vk.com/dev/push_settings|special format]. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setPushSettings($access_token, array $params = []) { + return $this->request->post('account.setPushSettings', $access_token, $params); + } - /** - * Mutes push notifications for the set period of time. - * - * @param $access_token string - * @param $params array - * - string device_id: Unique device ID. - * - integer time: Time in seconds for what notifications should be disabled. '-1' to disable forever. - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat - * ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " - * - integer sound: '1' — to enable sound in this dialog, '0' — to disable sound. Only if 'peer_id' - * contains user or community ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function setSilenceMode(string $access_token, array $params = array()) { - return $this->request->post('account.setSilenceMode', $access_token, $params); - } + /** + * Mutes push notifications for the set period of time. + * + * @param string $access_token + * @param array $params + * - @var string device_id: Unique device ID. + * - @var integer time: Time in seconds for what notifications should be disabled. '-1' to disable forever. + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * - @var integer sound: '1' — to enable sound in this dialog, '0' — to disable sound. Only if 'peer_id' contains user or community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setSilenceMode($access_token, array $params = []) { + return $this->request->post('account.setSilenceMode', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function unban(string $access_token, array $params = array()) { - return $this->request->post('account.unban', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function unban($access_token, array $params = []) { + return $this->request->post('account.unban', $access_token, $params); + } - /** - * Unsubscribes a device from push notifications. - * - * @param $access_token string - * @param $params array - * - string device_id: Unique device ID. - * - boolean sandbox: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function unregisterDevice(string $access_token, array $params = array()) { - return $this->request->post('account.unregisterDevice', $access_token, $params); - } + /** + * Unsubscribes a device from push notifications. + * + * @param string $access_token + * @param array $params + * - @var string device_id: Unique device ID. + * - @var boolean sandbox + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function unregisterDevice($access_token, array $params = []) { + return $this->request->post('account.unregisterDevice', $access_token, $params); + } } diff --git a/src/VK/Actions/Ads.php b/src/VK/Actions/Ads.php index b7e47f4..97e033f 100644 --- a/src/VK/Actions/Ads.php +++ b/src/VK/Actions/Ads.php @@ -1,878 +1,640 @@ request = $request; - } - - /** - * Adds managers and/or supervisors to advertising account. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - array data: Serialized JSON array of objects that describe added managers. Description of - * 'user_specification' objects see below. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function addOfficeUsers(string $access_token, array $params = array()) { - return $this->request->post('ads.addOfficeUsers', $access_token, $params); - } - - /** - * Allows to check the ad link. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - AdsCheckLinkLinkType link_type: Object type: *'community' — community,, *'post' — community - * post,, *'application' — VK application,, *'video' — video,, *'site' — external site. - * @see AdsCheckLinkLinkType - * - string link_url: Object URL. - * - integer campaign_id: Campaign ID - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function checkLink(string $access_token, array $params = array()) { - return $this->request->post('ads.checkLink', $access_token, $params); - } - - /** - * Creates ads. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string data: Serialized JSON array of objects that describe created ads. Description of - * 'ad_specification' objects see below. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function createAds(string $access_token, array $params = array()) { - return $this->request->post('ads.createAds', $access_token, $params); - } - - /** - * Creates advertising campaigns. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string data: Serialized JSON array of objects that describe created campaigns. Description of - * 'campaign_specification' objects see below. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function createCampaigns(string $access_token, array $params = array()) { - return $this->request->post('ads.createCampaigns', $access_token, $params); - } - - /** - * Creates clients of an advertising agency. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string data: Serialized JSON array of objects that describe created campaigns. Description of - * 'client_specification' objects see below. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function createClients(string $access_token, array $params = array()) { - return $this->request->post('ads.createClients', $access_token, $params); - } - - /** - * Creates a group to re-target ads for users who visited advertiser's site (viewed information about the product, - * registered, etc.). - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account - * where the group will be created. - * - string name: Name of the target group — a string up to 64 characters long. - * - integer lifetime: 'For groups with auditory created with pixel code only.', , Number of days after - * that users will be automatically removed from the group. - * - integer target_pixel_id: - * - string target_pixel_rules: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function createTargetGroup(string $access_token, array $params = array()) { - return $this->request->post('ads.createTargetGroup', $access_token, $params); - } - - /** - * Archives ads. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string ids: Serialized JSON array with ad IDs. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function deleteAds(string $access_token, array $params = array()) { - return $this->request->post('ads.deleteAds', $access_token, $params); - } - - /** - * Archives advertising campaigns. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string ids: Serialized JSON array with IDs of deleted campaigns. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function deleteCampaigns(string $access_token, array $params = array()) { - return $this->request->post('ads.deleteCampaigns', $access_token, $params); - } - - /** - * Archives clients of an advertising agency. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string ids: Serialized JSON array with IDs of deleted clients. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function deleteClients(string $access_token, array $params = array()) { - return $this->request->post('ads.deleteClients', $access_token, $params); - } - - /** - * Deletes a retarget group. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account - * where the group will be created. - * - integer target_group_id: Group ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function deleteTargetGroup(string $access_token, array $params = array()) { - return $this->request->post('ads.deleteTargetGroup', $access_token, $params); - } - - /** - * Returns a list of advertising accounts. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAccounts(string $access_token, array $params = array()) { - return $this->request->post('ads.getAccounts', $access_token, $params); - } - - /** - * Returns number of ads. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads - * will be shown. - * - string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the - * parameter is null, ads of all campaigns will be shown. - * - integer client_id: 'Available and required for advertising agencies.' ID of the client ads are - * retrieved from. - * - boolean include_deleted: Flag that specifies whether archived ads shall be shown: *0 — show only - * active ads,, *1 — show all ads. - * - boolean only_deleted: Flag that specifies whether to show only archived ads: *0 — show all ads,, *1 - * — show only archived ads. Available when include_deleted flag is *1 - * - integer limit: Limit of number of returned ads. Used only if ad_ids parameter is null, and - * 'campaign_ids' parameter contains ID of only one campaign. - * - integer offset: Offset. Used in the same cases as 'limit' parameter. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getAds(string $access_token, array $params = array()) { - return $this->request->post('ads.getAds', $access_token, $params); - } - - /** - * Returns descriptions of ad layouts. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads - * will be shown. - * - string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the - * parameter is null, ads of all campaigns will be shown. - * - integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. - * - boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 — show only - * active ads,, *1 — show all ads. - * - integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and - * 'campaign_ids' parameter contains ID of only one campaign. - * - integer offset: Offset. Used in the same cases as 'limit' parameter. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getAdsLayout(string $access_token, array $params = array()) { - return $this->request->post('ads.getAdsLayout', $access_token, $params); - } - - /** - * Returns ad targeting parameters. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads - * will be shown. - * - string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the - * parameter is null, ads of all campaigns will be shown. - * - integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. - * - boolean include_deleted: flag that specifies whether archived ads shall be shown: *0 — show only - * active ads,, *1 — show all ads. - * - integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and - * 'campaign_ids' parameter contains ID of only one campaign. - * - integer offset: Offset needed to return a specific subset of results. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getAdsTargeting(string $access_token, array $params = array()) { - return $this->request->post('ads.getAdsTargeting', $access_token, $params); - } - - /** - * Returns current budget of the advertising account. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getBudget(string $access_token, array $params = array()) { - return $this->request->post('ads.getBudget', $access_token, $params); - } - - /** - * Returns a list of campaigns in an advertising account. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - integer client_id: 'For advertising agencies'. ID of the client advertising campaigns are retrieved - * from. - * - boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 — show only - * active campaigns,, *1 — show all campaigns. - * - string campaign_ids: Filter of advertising campaigns to show. Serialized JSON array with campaign - * IDs. Only campaigns that exist in 'campaign_ids' and belong to the specified advertising account will be - * shown. If the parameter is null, all campaigns will be shown. - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getCampaigns(string $access_token, array $params = array()) { - return $this->request->post('ads.getCampaigns', $access_token, $params); - } - - /** - * Returns a list of possible ad categories. - * - * @param $access_token string - * @param $params array - * - string lang: Language. The full list of supported languages is [vk.com/dev/api_requests|here]. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCategories(string $access_token, array $params = array()) { - return $this->request->post('ads.getCategories', $access_token, $params); - } - - /** - * Returns a list of advertising agency's clients. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getClients(string $access_token, array $params = array()) { - return $this->request->post('ads.getClients', $access_token, $params); - } - - /** - * Returns demographics for ads or campaigns. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - AdsGetDemographicsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — - * ads,, *campaign — campaigns. - * @see AdsGetDemographicsIdsType - * - string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in - * 'ids_type'. Maximum 2000 objects. - * - AdsGetDemographicsPeriod period: Data grouping by dates: *day — statistics by days,, *month — - * statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary - * limits. - * @see AdsGetDemographicsPeriod - * - string date_from: Date to show statistics from. For different value of 'period' different date format - * is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, - * *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0. - * - string date_to: Date to show statistics to. For different value of 'period' different date format is - * used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, - * example: 2011-09 — September 2011, **0 — current month,, *overall: 0. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getDemographics(string $access_token, array $params = array()) { - return $this->request->post('ads.getDemographics', $access_token, $params); - } - - /** - * Returns information about current state of a counter — number of remaining runs of methods and time to the - * next counter nulling in seconds. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getFloodStats(string $access_token, array $params = array()) { - return $this->request->post('ads.getFloodStats', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer account_id: - * - integer client_id: - * - string requests_ids: - * - integer offset: - * - integer limit: - * - string sort_by: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getLookalikeRequests(string $access_token, array $params = array()) { - return $this->request->post('ads.getLookalikeRequests', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - string artist_name: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function getMusicians(string $access_token, array $params = array()) { - return $this->request->post('ads.getMusicians', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - array ids: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getMusiciansByIds(string $access_token, array $params = array()) { - return $this->request->post('ads.getMusiciansByIds', $access_token, $params); - } - - /** - * Returns a list of managers and supervisors of advertising account. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getOfficeUsers(string $access_token, array $params = array()) { - return $this->request->post('ads.getOfficeUsers', $access_token, $params); - } - - /** - * Returns detailed statistics of promoted posts reach from campaigns and ads. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - AdsGetPostsReachIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, - * *campaign — campaigns. - * @see AdsGetPostsReachIdsType - * - string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in - * 'ids_type'. Maximum 100 objects. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getPostsReach(string $access_token, array $params = array()) { - return $this->request->post('ads.getPostsReach', $access_token, $params); - } - - /** - * Returns a reason of ad rejection for pre-moderation. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - integer ad_id: Ad ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getRejectionReason(string $access_token, array $params = array()) { - return $this->request->post('ads.getRejectionReason', $access_token, $params); - } - - /** - * Returns statistics of performance indicators for ads, campaigns, clients or the whole account. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - AdsGetStatisticsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, - * *campaign — campaigns,, *client — clients,, *office — account. - * @see AdsGetStatisticsIdsType - * - string ids: IDs requested ads, campaigns, clients or account, separated with a comma, depending on - * the value set in 'ids_type'. Maximum 2000 objects. - * - AdsGetStatisticsPeriod period: Data grouping by dates: *day — statistics by days,, *month — - * statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary - * limits. - * @see AdsGetStatisticsPeriod - * - string date_from: Date to show statistics from. For different value of 'period' different date format - * is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, - * *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0. - * - string date_to: Date to show statistics to. For different value of 'period' different date format is - * used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, - * example: 2011-09 — September 2011, **0 — current month,, *overall: 0. - * - array stats_fields: Additional fields to add to statistics - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getStatistics(string $access_token, array $params = array()) { - return $this->request->post('ads.getStatistics', $access_token, $params); - } - - /** - * Returns a set of auto-suggestions for various targeting parameters. - * - * @param $access_token string - * @param $params array - * - AdsGetSuggestionsSection section: Section, suggestions are retrieved in. Available values: *countries - * — request of a list of countries. If q is not set or blank, a short list of countries is shown. Otherwise, - * a full list of countries is shown. *regions — requested list of regions. 'country' parameter is required. - * *cities — requested list of cities. 'country' parameter is required. *districts — requested list of - * districts. 'cities' parameter is required. *stations — requested list of subway stations. 'cities' - * parameter is required. *streets — requested list of streets. 'cities' parameter is required. *schools — - * requested list of educational organizations. 'cities' parameter is required. *interests — requested list - * of interests. *positions — requested list of positions (professions). *group_types — requested list of - * group types. *religions — requested list of religious commitments. *browsers — requested list of - * browsers and mobile devices. - * @see AdsGetSuggestionsSection - * - string ids: Objects IDs separated by commas. If the parameter is passed, 'q, country, cities' should - * not be passed. - * - string q: Filter-line of the request (for countries, regions, cities, streets, schools, interests, - * positions). - * - integer country: ID of the country objects are searched in. - * - string cities: IDs of cities where objects are searched in, separated with a comma. - * - AdsGetSuggestionsLang lang: Language of the returned string values. Supported languages: *ru — - * Russian,, *ua — Ukrainian,, *en — English. - * @see AdsGetSuggestionsLang - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSuggestions(string $access_token, array $params = array()) { - return $this->request->post('ads.getSuggestions', $access_token, $params); - } - - /** - * Returns a list of target groups. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account - * where the group will be created. - * - boolean extended: '1' — to return pixel code. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getTargetGroups(string $access_token, array $params = array()) { - return $this->request->post('ads.getTargetGroups', $access_token, $params); - } - - /** - * Returns the size of targeting audience, and also recommended values for CPC and CPM. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - integer client_id: - * - string criteria: Serialized JSON object that describes targeting parameters. Description of - * 'criteria' object see below. - * - integer ad_id: ID of an ad which targeting parameters shall be analyzed. - * - AdsGetTargetingStatsAdFormat ad_format: Ad format. Possible values: *'1' — image and text,, *'2' - * — big image,, *'3' — exclusive format,, *'4' — community, square image,, *'7' — special app format,, - * *'8' — special community format,, *'9' — post in community,, *'10' — app board. - * @see AdsGetTargetingStatsAdFormat - * - string ad_platform: Platforms to use for ad showing. Possible values: (for 'ad_format' = '1'), *'0' - * — VK and partner sites,, *'1' — VK only. (for 'ad_format' = '9'), *'all' — all platforms,, *'desktop' - * — desktop version,, *'mobile' — mobile version and apps. - * - string ad_platform_no_wall: - * - string ad_platform_no_ad_network: - * - string publisher_platforms: - * - string link_url: URL for the advertised object. - * - string link_domain: Domain of the advertised object. - * - boolean need_precise: Additionally return recommended cpc and cpm to reach 5,10..95 percents of - * audience. - * - integer impressions_limit_period: Impressions limit period in seconds, must be a multiple of - * 86400(day) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getTargetingStats(string $access_token, array $params = array()) { - return $this->request->post('ads.getTargetingStats', $access_token, $params); - } - - /** - * Returns URL to upload an ad photo to. - * - * @param $access_token string - * @param $params array - * - AdsGetUploadURLAdFormat ad_format: Ad format: *1 — image and text,, *2 — big image,, *3 — - * exclusive format,, *4 — community, square image,, *7 — special app format. - * @see AdsGetUploadURLAdFormat - * - integer icon: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getUploadURL(string $access_token, array $params = array()) { - return $this->request->post('ads.getUploadURL', $access_token, $params); - } - - /** - * Returns URL to upload an ad video to. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getVideoUploadURL(string $access_token, array $params = array()) { - return $this->request->post('ads.getVideoUploadURL', $access_token, $params); - } - - /** - * Imports a list of advertiser's contacts to count VK registered users against the target group. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account - * where the group will be created. - * - integer target_group_id: Target group ID. - * - string contacts: List of phone numbers, emails or user IDs separated with a comma. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function importTargetContacts(string $access_token, array $params = array()) { - return $this->request->post('ads.importTargetContacts', $access_token, $params); - } - - /** - * Removes managers and/or supervisors from advertising account. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string ids: Serialized JSON array with IDs of deleted managers. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function removeOfficeUsers(string $access_token, array $params = array()) { - return $this->request->post('ads.removeOfficeUsers', $access_token, $params); - } - - /** - * Edits ads. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string data: Serialized JSON array of objects that describe changes in ads. Description of - * 'ad_edit_specification' objects see below. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function updateAds(string $access_token, array $params = array()) { - return $this->request->post('ads.updateAds', $access_token, $params); - } - - /** - * Edits advertising campaigns. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string data: Serialized JSON array of objects that describe changes in campaigns. Description of - * 'campaign_mod' objects see below. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function updateCampaigns(string $access_token, array $params = array()) { - return $this->request->post('ads.updateCampaigns', $access_token, $params); - } - - /** - * Edits clients of an advertising agency. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - string data: Serialized JSON array of objects that describe changes in clients. Description of - * 'client_mod' objects see below. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function updateClients(string $access_token, array $params = array()) { - return $this->request->post('ads.updateClients', $access_token, $params); - } - - /** - * Adds managers and/or supervisors to advertising account. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - array data: Serialized JSON array of objects that describe added managers. Description of - * 'user_specification' objects see below. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function updateOfficeUsers(string $access_token, array $params = array()) { - return $this->request->post('ads.updateOfficeUsers', $access_token, $params); - } - - /** - * Edits a retarget group. - * - * @param $access_token string - * @param $params array - * - integer account_id: Advertising account ID. - * - integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account - * where the group will be created. - * - integer target_group_id: Group ID. - * - string name: New name of the target group — a string up to 64 characters long. - * - string domain: Domain of the site where user accounting code will be placed. - * - integer lifetime: 'Only for the groups that get audience from sites with user accounting code.', Time - * in days when users added to a retarget group will be automatically excluded from it. '0' - automatic - * exclusion is off. - * - integer target_pixel_id: - * - string target_pixel_rules: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function updateTargetGroup(string $access_token, array $params = array()) { - return $this->request->post('ads.updateTargetGroup', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Ads constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Adds managers and/or supervisors to advertising account. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string data: Serialized JSON array of objects that describe added managers. Description of 'user_specification' objects see below. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function addOfficeUsers($access_token, array $params = []) { + return $this->request->post('ads.addOfficeUsers', $access_token, $params); + } + + /** + * Allows to check the ad link. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var AdsLinkType link_type: Object type: *'community' — community,, *'post' — community post,, *'application' — VK application,, *'video' — video,, *'site' — external site. + * - @var string link_url: Object URL. + * - @var integer campaign_id: Campaign ID + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function checkLink($access_token, array $params = []) { + return $this->request->post('ads.checkLink', $access_token, $params); + } + + /** + * Creates ads. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string data: Serialized JSON array of objects that describe created ads. Description of 'ad_specification' objects see below. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function createAds($access_token, array $params = []) { + return $this->request->post('ads.createAds', $access_token, $params); + } + + /** + * Creates advertising campaigns. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string data: Serialized JSON array of objects that describe created campaigns. Description of 'campaign_specification' objects see below. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function createCampaigns($access_token, array $params = []) { + return $this->request->post('ads.createCampaigns', $access_token, $params); + } + + /** + * Creates clients of an advertising agency. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string data: Serialized JSON array of objects that describe created campaigns. Description of 'client_specification' objects see below. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function createClients($access_token, array $params = []) { + return $this->request->post('ads.createClients', $access_token, $params); + } + + /** + * Creates a group to re-target ads for users who visited advertiser's site (viewed information about the product, registered, etc.). + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account where the group will be created. + * - @var string name: Name of the target group — a string up to 64 characters long. + * - @var integer lifetime: 'For groups with auditory created with pixel code only.', , Number of days after that users will be automatically removed from the group. + * - @var integer target_pixel_id + * - @var string target_pixel_rules + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function createTargetGroup($access_token, array $params = []) { + return $this->request->post('ads.createTargetGroup', $access_token, $params); + } + + /** + * Archives ads. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string ids: Serialized JSON array with ad IDs. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAdsObjectDeletedException Object deleted + * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function deleteAds($access_token, array $params = []) { + return $this->request->post('ads.deleteAds', $access_token, $params); + } + + /** + * Archives advertising campaigns. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string ids: Serialized JSON array with IDs of deleted campaigns. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAdsObjectDeletedException Object deleted + * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function deleteCampaigns($access_token, array $params = []) { + return $this->request->post('ads.deleteCampaigns', $access_token, $params); + } + + /** + * Archives clients of an advertising agency. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string ids: Serialized JSON array with IDs of deleted clients. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAdsObjectDeletedException Object deleted + * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function deleteClients($access_token, array $params = []) { + return $this->request->post('ads.deleteClients', $access_token, $params); + } + + /** + * Deletes a retarget group. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created. + * - @var integer target_group_id: Group ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function deleteTargetGroup($access_token, array $params = []) { + return $this->request->post('ads.deleteTargetGroup', $access_token, $params); + } + + /** + * Returns a list of advertising accounts. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getAccounts($access_token) { + return $this->request->post('ads.getAccounts', $access_token); + } + + /** + * Returns number of ads. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads will be shown. + * - @var string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the parameter is null, ads of all campaigns will be shown. + * - @var integer client_id: 'Available and required for advertising agencies.' ID of the client ads are retrieved from. + * - @var boolean include_deleted: Flag that specifies whether archived ads shall be shown: *0 — show only active ads,, *1 — show all ads. + * - @var integer limit: Limit of number of returned ads. Used only if ad_ids parameter is null, and 'campaign_ids' parameter contains ID of only one campaign. + * - @var integer offset: Offset. Used in the same cases as 'limit' parameter. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getAds($access_token, array $params = []) { + return $this->request->post('ads.getAds', $access_token, $params); + } + + /** + * Returns descriptions of ad layouts. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads will be shown. + * - @var string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the parameter is null, ads of all campaigns will be shown. + * - @var integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. + * - @var boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 — show only active ads,, *1 — show all ads. + * - @var integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and 'campaign_ids' parameter contains ID of only one campaign. + * - @var integer offset: Offset. Used in the same cases as 'limit' parameter. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getAdsLayout($access_token, array $params = []) { + return $this->request->post('ads.getAdsLayout', $access_token, $params); + } + + /** + * Returns ad targeting parameters. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string ad_ids: Filter by ads. Serialized JSON array with ad IDs. If the parameter is null, all ads will be shown. + * - @var string campaign_ids: Filter by advertising campaigns. Serialized JSON array with campaign IDs. If the parameter is null, ads of all campaigns will be shown. + * - @var integer client_id: 'For advertising agencies.' ID of the client ads are retrieved from. + * - @var boolean include_deleted: flag that specifies whether archived ads shall be shown: *0 — show only active ads,, *1 — show all ads. + * - @var integer limit: Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and 'campaign_ids' parameter contains ID of only one campaign. + * - @var integer offset: Offset needed to return a specific subset of results. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getAdsTargeting($access_token, array $params = []) { + return $this->request->post('ads.getAdsTargeting', $access_token, $params); + } + + /** + * Returns current budget of the advertising account. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getBudget($access_token, array $params = []) { + return $this->request->post('ads.getBudget', $access_token, $params); + } + + /** + * Returns a list of campaigns in an advertising account. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var integer client_id: 'For advertising agencies'. ID of the client advertising campaigns are retrieved from. + * - @var boolean include_deleted: Flag that specifies whether archived ads shall be shown. *0 — show only active campaigns,, *1 — show all campaigns. + * - @var string campaign_ids: Filter of advertising campaigns to show. Serialized JSON array with campaign IDs. Only campaigns that exist in 'campaign_ids' and belong to the specified advertising account will be shown. If the parameter is null, all campaigns will be shown. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getCampaigns($access_token, array $params = []) { + return $this->request->post('ads.getCampaigns', $access_token, $params); + } + + /** + * Returns a list of possible ad categories. + * + * @param string $access_token + * @param array $params + * - @var string lang: Language. The full list of supported languages is [vk.com/dev/api_requests|here]. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCategories($access_token, array $params = []) { + return $this->request->post('ads.getCategories', $access_token, $params); + } + + /** + * Returns a list of advertising agency's clients. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getClients($access_token, array $params = []) { + return $this->request->post('ads.getClients', $access_token, $params); + } + + /** + * Returns demographics for ads or campaigns. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var AdsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns. + * - @var string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in 'ids_type'. Maximum 2000 objects. + * - @var AdsPeriod period: Data grouping by dates: *day — statistics by days,, *month — statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary limits. + * - @var string date_from: Date to show statistics from. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0. + * - @var string date_to: Date to show statistics to. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — current month,, *overall: 0. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getDemographics($access_token, array $params = []) { + return $this->request->post('ads.getDemographics', $access_token, $params); + } + + /** + * Returns information about current state of a counter — number of remaining runs of methods and time to the next counter nulling in seconds. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getFloodStats($access_token, array $params = []) { + return $this->request->post('ads.getFloodStats', $access_token, $params); + } + + /** + * Returns a list of managers and supervisors of advertising account. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getOfficeUsers($access_token, array $params = []) { + return $this->request->post('ads.getOfficeUsers', $access_token, $params); + } + + /** + * Returns detailed statistics of promoted posts reach from campaigns and ads. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var AdsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns. + * - @var string ids: IDs requested ads or campaigns, separated with a comma, depending on the value set in 'ids_type'. Maximum 100 objects. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getPostsReach($access_token, array $params = []) { + return $this->request->post('ads.getPostsReach', $access_token, $params); + } + + /** + * Returns a reason of ad rejection for pre-moderation. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var integer ad_id: Ad ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getRejectionReason($access_token, array $params = []) { + return $this->request->post('ads.getRejectionReason', $access_token, $params); + } + + /** + * Returns statistics of performance indicators for ads, campaigns, clients or the whole account. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var AdsIdsType ids_type: Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns,, *client — clients,, *office — account. + * - @var string ids: IDs requested ads, campaigns, clients or account, separated with a comma, depending on the value set in 'ids_type'. Maximum 2000 objects. + * - @var AdsPeriod period: Data grouping by dates: *day — statistics by days,, *month — statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary limits. + * - @var string date_from: Date to show statistics from. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0. + * - @var string date_to: Date to show statistics to. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — current month,, *overall: 0. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getStatistics($access_token, array $params = []) { + return $this->request->post('ads.getStatistics', $access_token, $params); + } + + /** + * Returns a set of auto-suggestions for various targeting parameters. + * + * @param string $access_token + * @param array $params + * - @var AdsSection section: Section, suggestions are retrieved in. Available values: *countries — request of a list of countries. If q is not set or blank, a short list of countries is shown. Otherwise, a full list of countries is shown. *regions — requested list of regions. 'country' parameter is required. *cities — requested list of cities. 'country' parameter is required. *districts — requested list of districts. 'cities' parameter is required. *stations — requested list of subway stations. 'cities' parameter is required. *streets — requested list of streets. 'cities' parameter is required. *schools — requested list of educational organizations. 'cities' parameter is required. *interests — requested list of interests. *positions — requested list of positions (professions). *group_types — requested list of group types. *religions — requested list of religious commitments. *browsers — requested list of browsers and mobile devices. + * - @var string ids: Objects IDs separated by commas. If the parameter is passed, 'q, country, cities' should not be passed. + * - @var string q: Filter-line of the request (for countries, regions, cities, streets, schools, interests, positions). + * - @var integer country: ID of the country objects are searched in. + * - @var string cities: IDs of cities where objects are searched in, separated with a comma. + * - @var AdsLang lang: Language of the returned string values. Supported languages: *ru — Russian,, *ua — Ukrainian,, *en — English. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getSuggestions($access_token, array $params = []) { + return $this->request->post('ads.getSuggestions', $access_token, $params); + } + + /** + * Returns a list of target groups. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var integer client_id: 'Only for advertising agencies.', ID of the client with the advertising account where the group will be created. + * - @var boolean extended: '1' — to return pixel code. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getTargetGroups($access_token, array $params = []) { + return $this->request->post('ads.getTargetGroups', $access_token, $params); + } + + /** + * Returns the size of targeting audience, and also recommended values for CPC and CPM. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var integer client_id + * - @var string criteria: Serialized JSON object that describes targeting parameters. Description of 'criteria' object see below. + * - @var integer ad_id: ID of an ad which targeting parameters shall be analyzed. + * - @var AdsAdFormat ad_format: Ad format. Possible values: *'1' — image and text,, *'2' — big image,, *'3' — exclusive format,, *'4' — community, square image,, *'7' — special app format,, *'8' — special community format,, *'9' — post in community,, *'10' — app board. + * - @var string ad_platform: Platforms to use for ad showing. Possible values: (for 'ad_format' = '1'), *'0' — VK and partner sites,, *'1' — VK only. (for 'ad_format' = '9'), *'all' — all platforms,, *'desktop' — desktop version,, *'mobile' — mobile version and apps. + * - @var string ad_platform_no_wall + * - @var string ad_platform_no_ad_network + * - @var string link_url: URL for the advertised object. + * - @var string link_domain: Domain of the advertised object. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function getTargetingStats($access_token, array $params = []) { + return $this->request->post('ads.getTargetingStats', $access_token, $params); + } + + /** + * Returns URL to upload an ad photo to. + * + * @param string $access_token + * @param array $params + * - @var AdsAdFormat ad_format: Ad format: *1 — image and text,, *2 — big image,, *3 — exclusive format,, *4 — community, square image,, *7 — special app format. + * - @var integer icon + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getUploadURL($access_token, array $params = []) { + return $this->request->post('ads.getUploadURL', $access_token, $params); + } + + /** + * Returns URL to upload an ad video to. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getVideoUploadURL($access_token) { + return $this->request->post('ads.getVideoUploadURL', $access_token); + } + + /** + * Imports a list of advertiser's contacts to count VK registered users against the target group. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created. + * - @var integer target_group_id: Target group ID. + * - @var string contacts: List of phone numbers, emails or user IDs separated with a comma. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function importTargetContacts($access_token, array $params = []) { + return $this->request->post('ads.importTargetContacts', $access_token, $params); + } + + /** + * Removes managers and/or supervisors from advertising account. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string ids: Serialized JSON array with IDs of deleted managers. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function removeOfficeUsers($access_token, array $params = []) { + return $this->request->post('ads.removeOfficeUsers', $access_token, $params); + } + + /** + * Edits ads. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string data: Serialized JSON array of objects that describe changes in ads. Description of 'ad_edit_specification' objects see below. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function updateAds($access_token, array $params = []) { + return $this->request->post('ads.updateAds', $access_token, $params); + } + + /** + * Edits advertising campaigns. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string data: Serialized JSON array of objects that describe changes in campaigns. Description of 'campaign_mod' objects see below. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAdsPartialSuccessException Some part of the request has not been completed + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function updateCampaigns($access_token, array $params = []) { + return $this->request->post('ads.updateCampaigns', $access_token, $params); + } + + /** + * Edits clients of an advertising agency. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var string data: Serialized JSON array of objects that describe changes in clients. Description of 'client_mod' objects see below. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function updateClients($access_token, array $params = []) { + return $this->request->post('ads.updateClients', $access_token, $params); + } + + /** + * Edits a retarget group. + * + * @param string $access_token + * @param array $params + * - @var integer account_id: Advertising account ID. + * - @var integer client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created. + * - @var integer target_group_id: Group ID. + * - @var string name: New name of the target group — a string up to 64 characters long. + * - @var string domain: Domain of the site where user accounting code will be placed. + * - @var integer lifetime: 'Only for the groups that get audience from sites with user accounting code.', Time in days when users added to a retarget group will be automatically excluded from it. '0' – automatic exclusion is off. + * - @var integer target_pixel_id + * - @var string target_pixel_rules + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWeightedFloodException Permission denied. You have requested too many actions this day. Try later. + * @return mixed + */ + public function updateTargetGroup($access_token, array $params = []) { + return $this->request->post('ads.updateTargetGroup', $access_token, $params); + } } diff --git a/src/VK/Actions/Adsweb.php b/src/VK/Actions/Adsweb.php deleted file mode 100644 index 1e2d812..0000000 --- a/src/VK/Actions/Adsweb.php +++ /dev/null @@ -1,138 +0,0 @@ -request = $request; - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer office_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAdCategories(string $access_token, array $params = array()) { - return $this->request->post('adsweb.getAdCategories', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAdUnitCode(string $access_token, array $params = array()) { - return $this->request->post('adsweb.getAdUnitCode', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer office_id: - * - string sites_ids: - * - string ad_units_ids: - * - string fields: - * - integer limit: - * - integer offset: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAdUnits(string $access_token, array $params = array()) { - return $this->request->post('adsweb.getAdUnits', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer office_id: - * - string sites_ids: - * - integer limit: - * - integer offset: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getFraudHistory(string $access_token, array $params = array()) { - return $this->request->post('adsweb.getFraudHistory', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer office_id: - * - string sites_ids: - * - string fields: - * - integer limit: - * - integer offset: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSites(string $access_token, array $params = array()) { - return $this->request->post('adsweb.getSites', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer office_id: - * - string ids_type: - * - string ids: - * - string period: - * - string date_from: - * - string date_to: - * - string fields: - * - integer limit: - * - string page_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getStatistics(string $access_token, array $params = array()) { - return $this->request->post('adsweb.getStatistics', $access_token, $params); - } -} diff --git a/src/VK/Actions/AppWidgets.php b/src/VK/Actions/AppWidgets.php index 61b3237..14896d6 100644 --- a/src/VK/Actions/AppWidgets.php +++ b/src/VK/Actions/AppWidgets.php @@ -1,177 +1,171 @@ request = $request; - } + /** + * AppWidgets constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns a URL for uploading a photo to the community collection for community app widgets - * - * @param $access_token string - * @param $params array - * - AppWidgetsGetAppImageUploadServerImageType image_type: - * @see AppWidgetsGetAppImageUploadServerImageType - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAppImageUploadServer(string $access_token, array $params = array()) { - return $this->request->post('appWidgets.getAppImageUploadServer', $access_token, $params); - } + /** + * Returns URL to upload an app widget photo. + * + * @param string $access_token + * @param array $params + * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function getAppImageUploadServer($access_token, $params = []) { + return $this->request->post('appWidgets.getAppImageUploadServer', $access_token, $params); + } - /** - * Returns an app collection of images for community app widgets - * - * @param $access_token string - * @param $params array - * - integer offset: Offset needed to return a specific subset of images. - * - integer count: Maximum count of results. - * - AppWidgetsGetAppImagesImageType image_type: - * @see AppWidgetsGetAppImagesImageType - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAppImages(string $access_token, array $params = array()) { + /** + * Returns a collection of application images. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of images. + * - @var integer count: Number of objects to return. + * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function getAppImages($access_token, $params = []) { return $this->request->post('appWidgets.getAppImages', $access_token, $params); } - /** - * Returns a URL for uploading a photo to the community collection for community app widgets - * - * @param $access_token string - * @param $params array - * - AppWidgetsGetGroupImageUploadServerImageType image_type: - * @see AppWidgetsGetGroupImageUploadServerImageType - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getGroupImageUploadServer(string $access_token, array $params = array()) { + /** + * Returns the server address for community photo upload. + * + * @param string $access_token + * @param array $params + * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @return mixed + */ + public function getGroupImageUploadServer($access_token, $params = []) { return $this->request->post('appWidgets.getGroupImageUploadServer', $access_token, $params); } /** - * Returns a community collection of images for community app widgets - * - * @param $access_token string - * @param $params array - * - integer offset: Offset needed to return a specific subset of images. - * - integer count: Maximum count of results. - * - AppWidgetsGetGroupImagesImageType image_type: - * @see AppWidgetsGetGroupImagesImageType - * + * Returns a collection of application images. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of images. + * - @var integer count: Number of objects to return. + * - @var string image_type: Type of image. Values: *'24x24',, *'50x50',, *'160x160',, *'160x240',, *'510x128' + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * */ - public function getGroupImages(string $access_token, array $params = array()) { + public function getGroupImages($access_token, $params = []) { return $this->request->post('appWidgets.getGroupImages', $access_token, $params); } /** - * Returns an image for community app widgets by its ID - * - * @param $access_token string - * @param $params array - * - array images: List of images IDs - * + * Returns a collection of application images by id. + * + * @param string $access_token + * @param array $params + * - @var array[string] images: List of images ID + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * */ - public function getImagesById(string $access_token, array $params = array()) { - return $this->request->post('appWidgets.getImagesById', $access_token, $params); + public function getGroupImagesById($access_token, $params = []) { + return $this->request->post('appWidgets.getGroupImagesById', $access_token, $params); } /** - * Allows to save image into app collection for community app widgets - * - * @param $access_token string - * @param $params array - * - string hash: Parameter returned when photo is uploaded to server - * - string image: Parameter returned when photo is uploaded to server - * + * Saves app photos after successful uploading. + * + * @param string $access_token + * @param array $params + * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string image: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * */ - public function saveAppImage(string $access_token, array $params = array()) { + public function saveAppImage($access_token, $params = []) { return $this->request->post('appWidgets.saveAppImage', $access_token, $params); } /** - * Allows to save image into community collection for community app widgets - * - * @param $access_token string - * @param $params array - * - string hash: Parameter returned when photo is uploaded to server - * - string image: Parameter returned when photo is uploaded to server - * + * Saves app photos into community after successful uploading. + * + * @param string $access_token + * @param array $params + * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string image: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * */ - public function saveGroupImage(string $access_token, array $params = array()) { + public function saveGroupImage($access_token, $params = []) { return $this->request->post('appWidgets.saveGroupImage', $access_token, $params); } - /** - * Allows to update community app widget - * - * @param $access_token string - * @param $params array - * - string code: - * - AppWidgetsUpdateType type: - * @see AppWidgetsUpdateType - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function update(string $access_token, array $params = array()) { - return $this->request->post('appWidgets.update', $access_token, $params); - } + /** + * Allows to update community app widget + * + * @param string $access_token + * @param array $params + * - @var string code + * - @var AppWidgetsType type + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCompileException Unable to compile code + * @throws VKApiRuntimeException Runtime error occurred during code invocation + * @throws VKApiBlockedException Content blocked + * @throws VKApiWallAccessPostException Access to wall's post denied + * @throws VKApiWallAccessRepliesException Access to post comments denied + * @throws VKApiParamGroupIdException Invalid group id + * @return mixed + */ + public function update($access_token, array $params = []) { + return $this->request->post('appWidgets.update', $access_token, $params); + } } diff --git a/src/VK/Actions/Apps.php b/src/VK/Actions/Apps.php index d06b25d..fd9a03c 100644 --- a/src/VK/Actions/Apps.php +++ b/src/VK/Actions/Apps.php @@ -1,261 +1,169 @@ request = $request; - } - - /** - * Deletes all request notifications from the current app. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteAppRequests(string $access_token, array $params = array()) { - return $this->request->post('apps.deleteAppRequests', $access_token, $params); - } - - /** - * Returns applications data. - * - * @param $access_token string - * @param $params array - * - integer app_id: Application ID - * - array app_ids: List of application ID - * - AppsGetPlatform platform: platform. Possible values: *'ios' — iOS,, *'android' — Android,, - * *'winphone' — Windows Phone,, *'web' — приложения на vk.com. By default: 'web'. - * @see AppsGetPlatform - * - boolean extended: - * - boolean return_friends: - * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' - * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', - * 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', - * 'can_see_all_posts', 'can_post', 'universities', (only if return_friends - 1) - * - AppsGetNameCase name_case: Case for declension of user name and surname: 'nom' — nominative - * (default),, 'gen' — genitive,, 'dat' — dative,, 'acc' — accusative,, 'ins' — instrumental,, 'abl' - * — prepositional. (only if 'return_friends' = '1') - * @see AppsGetNameCase - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('apps.get', $access_token, $params); - } - - /** - * Returns a list of applications (apps) available to users in the App Catalog. - * - * @param $access_token string - * @param $params array - * - AppsGetCatalogSort sort: Sort order: 'popular_today' — popular for one day (default), 'visitors' - * — by visitors number , 'create_date' — by creation date, 'growth_rate' — by growth rate, - * 'popular_week' — popular for one week - * @see AppsGetCatalogSort - * - integer offset: Offset required to return a specific subset of apps. - * - integer count: Number of apps to return. - * - string platform: - * - boolean extended: '1' — to return additional fields 'screenshots', 'MAU', 'catalog_position', and - * 'international'. If set, 'count' must be less than or equal to '100'. '0' — not to return additional - * fields (default). - * - boolean return_friends: - * - array fields: - * - string name_case: - * - string q: Search query string. - * - integer genre_id: - * - AppsGetCatalogFilter filter: 'installed' — to return list of installed apps (only for mobile - * platform). - * @see AppsGetCatalogFilter - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCatalog(string $access_token, array $params = array()) { - return $this->request->post('apps.getCatalog', $access_token, $params); - } - - /** - * Creates friends list for requests and invites in current app. - * - * @param $access_token string - * @param $params array - * - boolean extended: - * - integer count: List size. - * - integer offset: - * - AppsGetFriendsListType type: List type. Possible values: * 'invite' — available for invites (don't - * play the game),, * 'request' — available for request (play the game). By default: 'invite'. - * @see AppsGetFriendsListType - * - array fields: Additional profile fields, see [vk.com/dev/fields|description]. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getFriendsList(string $access_token, array $params = array()) { - return $this->request->post('apps.getFriendsList', $access_token, $params); - } - - /** - * Returns players rating in the game. - * - * @param $access_token string - * @param $params array - * - AppsGetLeaderboardType type: Leaderboard type. Possible values: *'level' — by level,, *'points' — - * by mission points,, *'score' — by score (). - * @see AppsGetLeaderboardType - * - boolean global: Rating type. Possible values: *'1' — global rating among all players,, *'0' — - * rating among user friends. - * - boolean extended: 1 — to return additional info about users - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getLeaderboard(string $access_token, array $params = array()) { - return $this->request->post('apps.getLeaderboard', $access_token, $params); - } - - /** - * Returns policies and terms given to a mini app. - * - * @param $access_token string - * @param $params array - * - integer app_id: Mini App ID - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getMiniAppPolicies(string $access_token, array $params = array()) { - return $this->request->post('apps.getMiniAppPolicies', $access_token, $params); - } - - /** - * Returns scopes for auth - * - * @param $access_token string - * @param $params array - * - AppsGetScopesType type: - * @see AppsGetScopesType - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getScopes(string $access_token, array $params = array()) { - return $this->request->post('apps.getScopes', $access_token, $params); - } - - /** - * Returns user score in app - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getScore(string $access_token, array $params = array()) { - return $this->request->post('apps.getScore', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer promo_id: Id of game promo action - * - integer user_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function promoHasActiveGift(string $access_token, array $params = array()) { - return $this->request->post('apps.promoHasActiveGift', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer promo_id: Id of game promo action - * - integer user_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function promoUseGift(string $access_token, array $params = array()) { - return $this->request->post('apps.promoUseGift', $access_token, $params); - } - - /** - * Sends a request to another user in an app that uses VK authorization. - * - * @param $access_token string - * @param $params array - * - integer user_id: id of the user to send a request - * - string text: request text - * - AppsSendRequestType type: request type. Values: 'invite' - if the request is sent to a user who does - * not have the app installed,, 'request' - if a user has already installed the app - * @see AppsSendRequestType - * - string name: - * - string key: special string key to be sent with the request - * - boolean separate: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function sendRequest(string $access_token, array $params = array()) { - return $this->request->post('apps.sendRequest', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Apps constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Deletes all request notifications from the current app. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteAppRequests($access_token) { + return $this->request->post('apps.deleteAppRequests', $access_token); + } + + /** + * Returns applications data. + * + * @param string $access_token + * @param array $params + * - @var integer app_id: Application ID + * - @var array[string] app_ids: List of application ID + * - @var AppsPlatform platform: platform. Possible values: *'ios' — iOS,, *'android' — Android,, *'winphone' — Windows Phone,, *'web' — приложения на vk.com. By default: 'web'. + * - @var boolean extended + * - @var boolean return_friends + * - @var array[AppsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities', (only if return_friends - 1) + * - @var AppsNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default),, 'gen' — genitive,, 'dat' — dative,, 'acc' — accusative,, 'ins' — instrumental,, 'abl' — prepositional. (only if 'return_friends' = '1') + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('apps.get', $access_token, $params); + } + + /** + * Returns a list of applications (apps) available to users in the App Catalog. + * + * @param string $access_token + * @param array $params + * - @var AppsSort sort: Sort order: 'popular_today' — popular for one day (default), 'visitors' — by visitors number , 'create_date' — by creation date, 'growth_rate' — by growth rate, 'popular_week' — popular for one week + * - @var integer offset: Offset required to return a specific subset of apps. + * - @var integer count: Number of apps to return. + * - @var string platform + * - @var boolean extended: '1' — to return additional fields 'screenshots', 'MAU', 'catalog_position', and 'international'. If set, 'count' must be less than or equal to '100'. '0' — not to return additional fields (default). + * - @var boolean return_friends + * - @var array[AppsFields] fields + * - @var string name_case + * - @var string q: Search query string. + * - @var integer genre_id + * - @var AppsFilter filter: 'installed' — to return list of installed apps (only for mobile platform). + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCatalog($access_token, array $params = []) { + return $this->request->post('apps.getCatalog', $access_token, $params); + } + + /** + * Creates friends list for requests and invites in current app. + * + * @param string $access_token + * @param array $params + * - @var boolean extended + * - @var integer count: List size. + * - @var integer offset + * - @var AppsType type: List type. Possible values: * 'invite' — available for invites (don't play the game),, * 'request' — available for request (play the game). By default: 'invite'. + * - @var array[AppsFields] fields: Additional profile fields, see [vk.com/dev/fields|description]. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getFriendsList($access_token, array $params = []) { + return $this->request->post('apps.getFriendsList', $access_token, $params); + } + + /** + * Returns players rating in the game. + * + * @param string $access_token + * @param array $params + * - @var AppsType type: Leaderboard type. Possible values: *'level' — by level,, *'points' — by mission points,, *'score' — by score (). + * - @var boolean global: Rating type. Possible values: *'1' — global rating among all players,, *'0' — rating among user friends. + * - @var boolean extended: 1 — to return additional info about users + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getLeaderboard($access_token, array $params = []) { + return $this->request->post('apps.getLeaderboard', $access_token, $params); + } + + /** + * Returns scopes for auth + * + * @param string $access_token + * @param array $params + * - @var AppsType type + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getScopes($access_token, array $params = []) { + return $this->request->post('apps.getScopes', $access_token, $params); + } + + /** + * Returns user score in app + * + * @param string $access_token + * @param array $params + * - @var integer user_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getScore($access_token, array $params = []) { + return $this->request->post('apps.getScore', $access_token, $params); + } + + /** + * Sends a request to another user in an app that uses VK authorization. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: id of the user to send a request + * - @var string text: request text + * - @var AppsType type: request type. Values: 'invite' – if the request is sent to a user who does not have the app installed,, 'request' – if a user has already installed the app + * - @var string name + * - @var string key: special string key to be sent with the request + * - @var boolean separate + * @throws VKClientException + * @throws VKApiException + * @throws VKApiFloodException Flood control + * @return mixed + */ + public function sendRequest($access_token, array $params = []) { + return $this->request->post('apps.sendRequest', $access_token, $params); + } } diff --git a/src/VK/Actions/Auth.php b/src/VK/Actions/Auth.php index 544230e..51a69b0 100644 --- a/src/VK/Actions/Auth.php +++ b/src/VK/Actions/Auth.php @@ -1,43 +1,65 @@ request = $request; + } - /** - * Auth constructor. - * @param VKApiRequest $request - */ - public function __construct(VKApiRequest $request) { - $this->request = $request; - } + /** + * Checks a user's phone number for correctness. + * + * @param string $access_token + * @param array $params + * - @var string phone: Phone number. + * - @var integer client_id: User ID. + * - @var string client_secret + * - @var boolean auth_by_phone + * @throws VKClientException + * @throws VKApiException + * @throws VKApiPhoneAlreadyUsedException This phone number is used by another user + * @throws VKApiAuthDelayException Processing.. Try later + * @throws VKApiParamPhoneException Invalid phone number + * @return mixed + */ + public function checkPhone($access_token, array $params = []) { + return $this->request->post('auth.checkPhone', $access_token, $params); + } - /** - * Allows to restore account access using a code received via SMS. " This method is only available for apps with - * [vk.com/dev/auth_direct|Direct authorization] access. " - * - * @param $access_token string - * @param $params array - * - string phone: User phone number. - * - string last_name: User last name. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function restore(string $access_token, array $params = array()) { - return $this->request->post('auth.restore', $access_token, $params); - } + /** + * Allows to restore account access using a code received via SMS. " This method is only available for apps with [vk.com/dev/auth_direct|Direct authorization] access. " + * + * @param string $access_token + * @param array $params + * - @var string phone: User phone number. + * - @var string last_name: User last name. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAuthFloodException Too many auth attempts, try again later + * @return mixed + */ + public function restore($access_token, array $params = []) { + return $this->request->post('auth.restore', $access_token, $params); + } } diff --git a/src/VK/Actions/Board.php b/src/VK/Actions/Board.php index dc44614..a3ca234 100644 --- a/src/VK/Actions/Board.php +++ b/src/VK/Actions/Board.php @@ -1,298 +1,249 @@ request = $request; - } - - /** - * Creates a new topic on a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - string title: Topic title. - * - string text: Text of the topic. - * - boolean from_group: For a community: '1' — to post the topic as by the community, '0' — to post - * the topic as by the user (default) - * - array attachments: List of media objects attached to the topic, in the following format: - * "_,_", '' — Type of media object: 'photo' — photo, 'video' — - * video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media - * ID. Example: "photo100172_166443618,photo66748_265827614", , "NOTE: If you try to attach more than one - * reference, an error will be thrown.", - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function addTopic(string $access_token, array $params = array()) { - return $this->request->post('board.addTopic', $access_token, $params); - } - - /** - * Closes a topic on a community's discussion board so that comments cannot be posted. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function closeTopic(string $access_token, array $params = array()) { - return $this->request->post('board.closeTopic', $access_token, $params); - } - - /** - * Adds a comment on a topic on a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: ID of the topic to be commented on. - * - string message: (Required if 'attachments' is not set.) Text of the comment. - * - array attachments: (Required if 'text' is not set.) List of media objects attached to the comment, in - * the following format: "_,_", '' — Type of media object: 'photo' - * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. - * '' — Media ID. - * - boolean from_group: '1' — to post the comment as by the community, '0' — to post the comment as - * by the user (default) - * - integer sticker_id: Sticker ID. - * - string guid: Unique identifier to avoid repeated comments. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function createComment(string $access_token, array $params = array()) { - return $this->request->post('board.createComment', $access_token, $params); - } - - /** - * Deletes a comment on a topic on a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - integer comment_id: Comment ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteComment(string $access_token, array $params = array()) { - return $this->request->post('board.deleteComment', $access_token, $params); - } - - /** - * Deletes a topic from a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteTopic(string $access_token, array $params = array()) { - return $this->request->post('board.deleteTopic', $access_token, $params); - } - - /** - * Edits a comment on a topic on a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - integer comment_id: ID of the comment on the topic. - * - string message: (Required if 'attachments' is not set). New comment text. - * - array attachments: (Required if 'message' is not set.) List of media objects attached to the comment, - * in the following format: "_,_", '' — Type of media object: 'photo' - * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. - * '' — Media ID. Example: "photo100172_166443618,photo66748_265827614" - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function editComment(string $access_token, array $params = array()) { - return $this->request->post('board.editComment', $access_token, $params); - } - - /** - * Edits the title of a topic on a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - string title: New title of the topic. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function editTopic(string $access_token, array $params = array()) { - return $this->request->post('board.editTopic', $access_token, $params); - } - - /** - * Pins a topic (fixes its place) to the top of a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function fixTopic(string $access_token, array $params = array()) { - return $this->request->post('board.fixTopic', $access_token, $params); - } - - /** - * Returns a list of comments on a topic on a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - boolean need_likes: '1' — to return the 'likes' field, '0' — not to return the 'likes' field - * (default) - * - integer start_comment_id: - * - integer offset: Offset needed to return a specific subset of comments. - * - integer count: Number of comments to return. - * - boolean extended: '1' — to return information about users who posted comments, '0' — to return no - * additional fields (default) - * - BoardGetCommentsSort sort: Sort order: 'asc' — by creation date in chronological order, 'desc' — - * by creation date in reverse chronological order, - * @see BoardGetCommentsSort - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getComments(string $access_token, array $params = array()) { - return $this->request->post('board.getComments', $access_token, $params); - } - - /** - * Returns a list of topics on a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - array topic_ids: IDs of topics to be returned (100 maximum). By default, all topics are returned. If - * this parameter is set, the 'order', 'offset', and 'count' parameters are ignored. - * - BoardGetTopicsOrder order: Sort order: '1' — by date updated in reverse chronological order. '2' - * — by date created in reverse chronological order. '-1' — by date updated in chronological order. '-2' - * — by date created in chronological order. If no sort order is specified, topics are returned in the order - * specified by the group administrator. Pinned topics are returned first, regardless of the sorting. - * @see BoardGetTopicsOrder - * - integer offset: Offset needed to return a specific subset of topics. - * - integer count: Number of topics to return. - * - boolean extended: '1' — to return information about users who created topics or who posted there - * last, '0' — to return no additional fields (default) - * - BoardGetTopicsPreview preview: '1' — to return the first comment in each topic,, '2' — to return - * the last comment in each topic,, '0' — to return no comments. By default: '0'. - * @see BoardGetTopicsPreview - * - integer preview_length: Number of characters after which to truncate the previewed comment. To - * preview the full comment, specify '0'. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getTopics(string $access_token, array $params = array()) { - return $this->request->post('board.getTopics', $access_token, $params); - } - - /** - * Re-opens a previously closed topic on a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function openTopic(string $access_token, array $params = array()) { - return $this->request->post('board.openTopic', $access_token, $params); - } - - /** - * Restores a comment deleted from a topic on a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - integer comment_id: Comment ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function restoreComment(string $access_token, array $params = array()) { - return $this->request->post('board.restoreComment', $access_token, $params); - } - - /** - * Unpins a pinned topic from the top of a community's discussion board. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the discussion board. - * - integer topic_id: Topic ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function unfixTopic(string $access_token, array $params = array()) { - return $this->request->post('board.unfixTopic', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Board constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Creates a new topic on a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var string title: Topic title. + * - @var string text: Text of the topic. + * - @var boolean from_group: For a community: '1' — to post the topic as by the community, '0' — to post the topic as by the user (default) + * - @var array[string] attachments: List of media objects attached to the topic, in the following format: "_,_", '' — Type of media object: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media ID. Example: "photo100172_166443618,photo66748_265827614", , "NOTE: If you try to attach more than one reference, an error will be thrown.", + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function addTopic($access_token, array $params = []) { + return $this->request->post('board.addTopic', $access_token, $params); + } + + /** + * Closes a topic on a community's discussion board so that comments cannot be posted. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function closeTopic($access_token, array $params = []) { + return $this->request->post('board.closeTopic', $access_token, $params); + } + + /** + * Adds a comment on a topic on a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: ID of the topic to be commented on. + * - @var string message: (Required if 'attachments' is not set.) Text of the comment. + * - @var array[string] attachments: (Required if 'text' is not set.) List of media objects attached to the comment, in the following format: "_,_", '' — Type of media object: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media ID. + * - @var boolean from_group: '1' — to post the comment as by the community, '0' — to post the comment as by the user (default) + * - @var integer sticker_id: Sticker ID. + * - @var string guid: Unique identifier to avoid repeated comments. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function createComment($access_token, array $params = []) { + return $this->request->post('board.createComment', $access_token, $params); + } + + /** + * Deletes a comment on a topic on a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * - @var integer comment_id: Comment ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteComment($access_token, array $params = []) { + return $this->request->post('board.deleteComment', $access_token, $params); + } + + /** + * Deletes a topic from a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteTopic($access_token, array $params = []) { + return $this->request->post('board.deleteTopic', $access_token, $params); + } + + /** + * Edits a comment on a topic on a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * - @var integer comment_id: ID of the comment on the topic. + * - @var string message: (Required if 'attachments' is not set). New comment text. + * - @var array[string] attachments: (Required if 'message' is not set.) List of media objects attached to the comment, in the following format: "_,_", '' — Type of media object: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media ID. Example: "photo100172_166443618,photo66748_265827614" + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function editComment($access_token, array $params = []) { + return $this->request->post('board.editComment', $access_token, $params); + } + + /** + * Edits the title of a topic on a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * - @var string title: New title of the topic. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function editTopic($access_token, array $params = []) { + return $this->request->post('board.editTopic', $access_token, $params); + } + + /** + * Pins a topic (fixes its place) to the top of a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function fixTopic($access_token, array $params = []) { + return $this->request->post('board.fixTopic', $access_token, $params); + } + + /** + * Returns a list of comments on a topic on a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * - @var boolean need_likes: '1' — to return the 'likes' field, '0' — not to return the 'likes' field (default) + * - @var integer start_comment_id + * - @var integer offset: Offset needed to return a specific subset of comments. + * - @var integer count: Number of comments to return. + * - @var boolean extended: '1' — to return information about users who posted comments, '0' — to return no additional fields (default) + * - @var BoardSort sort: Sort order: 'asc' — by creation date in chronological order, 'desc' — by creation date in reverse chronological order, + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getComments($access_token, array $params = []) { + return $this->request->post('board.getComments', $access_token, $params); + } + + /** + * Returns a list of topics on a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var array[integer] topic_ids: IDs of topics to be returned (100 maximum). By default, all topics are returned. If this parameter is set, the 'order', 'offset', and 'count' parameters are ignored. + * - @var BoardOrder order: Sort order: '1' — by date updated in reverse chronological order. '2' — by date created in reverse chronological order. '-1' — by date updated in chronological order. '-2' — by date created in chronological order. If no sort order is specified, topics are returned in the order specified by the group administrator. Pinned topics are returned first, regardless of the sorting. + * - @var integer offset: Offset needed to return a specific subset of topics. + * - @var integer count: Number of topics to return. + * - @var boolean extended: '1' — to return information about users who created topics or who posted there last, '0' — to return no additional fields (default) + * - @var BoardPreview preview: '1' — to return the first comment in each topic,, '2' — to return the last comment in each topic,, '0' — to return no comments. By default: '0'. + * - @var integer preview_length: Number of characters after which to truncate the previewed comment. To preview the full comment, specify '0'. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getTopics($access_token, array $params = []) { + return $this->request->post('board.getTopics', $access_token, $params); + } + + /** + * Re-opens a previously closed topic on a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function openTopic($access_token, array $params = []) { + return $this->request->post('board.openTopic', $access_token, $params); + } + + /** + * Restores a comment deleted from a topic on a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * - @var integer comment_id: Comment ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function restoreComment($access_token, array $params = []) { + return $this->request->post('board.restoreComment', $access_token, $params); + } + + /** + * Unpins a pinned topic from the top of a community's discussion board. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the discussion board. + * - @var integer topic_id: Topic ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function unfixTopic($access_token, array $params = []) { + return $this->request->post('board.unfixTopic', $access_token, $params); + } } diff --git a/src/VK/Actions/Database.php b/src/VK/Actions/Database.php index d19e033..f4b523e 100644 --- a/src/VK/Actions/Database.php +++ b/src/VK/Actions/Database.php @@ -1,243 +1,218 @@ request = $request; - } - - /** - * Returns list of chairs on a specified faculty. - * - * @param $access_token string - * @param $params array - * - integer faculty_id: id of the faculty to get chairs from - * - integer offset: offset required to get a certain subset of chairs - * - integer count: amount of chairs to get - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getChairs(string $access_token, array $params = array()) { - return $this->request->post('database.getChairs', $access_token, $params); - } - - /** - * Returns a list of cities. - * - * @param $access_token string - * @param $params array - * - integer country_id: Country ID. - * - integer region_id: Region ID. - * - string q: Search query. - * - boolean need_all: '1' — to return all cities in the country, '0' — to return major cities in the - * country (default), - * - integer offset: Offset needed to return a specific subset of cities. - * - integer count: Number of cities to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCities(string $access_token, array $params = array()) { - return $this->request->post('database.getCities', $access_token, $params); - } - - /** - * Returns information about cities by their IDs. - * - * @param $access_token string - * @param $params array - * - array city_ids: City IDs. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCitiesById(string $access_token, array $params = array()) { - return $this->request->post('database.getCitiesById', $access_token, $params); - } - - /** - * Returns a list of countries. - * - * @param $access_token string - * @param $params array - * - boolean 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). - * - string code: Country codes in [vk.com/dev/country_codes|ISO 3166-1 alpha-2] standard. - * - integer offset: Offset needed to return a specific subset of countries. - * - integer count: Number of countries to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCountries(string $access_token, array $params = array()) { - return $this->request->post('database.getCountries', $access_token, $params); - } - - /** - * Returns information about countries by their IDs. - * - * @param $access_token string - * @param $params array - * - array country_ids: Country IDs. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCountriesById(string $access_token, array $params = array()) { - return $this->request->post('database.getCountriesById', $access_token, $params); - } - - /** - * Returns a list of faculties (i.e., university departments). - * - * @param $access_token string - * @param $params array - * - integer university_id: University ID. - * - integer offset: Offset needed to return a specific subset of faculties. - * - integer count: Number of faculties to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getFaculties(string $access_token, array $params = array()) { - return $this->request->post('database.getFaculties', $access_token, $params); - } - - /** - * Get metro stations by city - * - * @param $access_token string - * @param $params array - * - integer city_id: - * - integer offset: - * - integer count: - * - boolean extended: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getMetroStations(string $access_token, array $params = array()) { - return $this->request->post('database.getMetroStations', $access_token, $params); - } - - /** - * Get metro station by his id - * - * @param $access_token string - * @param $params array - * - array station_ids: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getMetroStationsById(string $access_token, array $params = array()) { - return $this->request->post('database.getMetroStationsById', $access_token, $params); - } - - /** - * Returns a list of regions. - * - * @param $access_token string - * @param $params array - * - integer country_id: Country ID, received in [vk.com/dev/database.getCountries|database.getCountries] - * method. - * - string q: Search query. - * - integer offset: Offset needed to return specific subset of regions. - * - integer count: Number of regions to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getRegions(string $access_token, array $params = array()) { - return $this->request->post('database.getRegions', $access_token, $params); - } - - /** - * Returns a list of school classes specified for the country. - * - * @param $access_token string - * @param $params array - * - integer country_id: Country ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSchoolClasses(string $access_token, array $params = array()) { - return $this->request->post('database.getSchoolClasses', $access_token, $params); - } - - /** - * Returns a list of schools. - * - * @param $access_token string - * @param $params array - * - string q: Search query. - * - integer city_id: City ID. - * - integer offset: Offset needed to return a specific subset of schools. - * - integer count: Number of schools to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSchools(string $access_token, array $params = array()) { - return $this->request->post('database.getSchools', $access_token, $params); - } - - /** - * Returns a list of higher education institutions. - * - * @param $access_token string - * @param $params array - * - string q: Search query. - * - integer country_id: Country ID. - * - integer city_id: City ID. - * - integer offset: Offset needed to return a specific subset of universities. - * - integer count: Number of universities to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getUniversities(string $access_token, array $params = array()) { - return $this->request->post('database.getUniversities', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Database constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Returns list of chairs on a specified faculty. + * + * @param string $access_token + * @param array $params + * - @var integer faculty_id: id of the faculty to get chairs from + * - @var integer offset: offset required to get a certain subset of chairs + * - @var integer count: amount of chairs to get + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getChairs($access_token, array $params = []) { + return $this->request->post('database.getChairs', $access_token, $params); + } + + /** + * Returns a list of cities. + * + * @param string $access_token + * @param array $params + * - @var integer country_id: Country ID. + * - @var integer region_id: Region ID. + * - @var string q: Search query. + * - @var boolean need_all: '1' — to return all cities in the country, '0' — to return major cities in the country (default), + * - @var integer offset: Offset needed to return a specific subset of cities. + * - @var integer count: Number of cities to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCities($access_token, array $params = []) { + return $this->request->post('database.getCities', $access_token, $params); + } + + /** + * Returns information about cities by their IDs. + * + * @param string $access_token + * @param array $params + * - @var array[integer] city_ids: City IDs. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCitiesById($access_token, array $params = []) { + return $this->request->post('database.getCitiesById', $access_token, $params); + } + + /** + * Returns a list of countries. + * + * @param string $access_token + * @param array $params + * - @var boolean 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). + * - @var string code: Country codes in [vk.com/dev/country_codes|ISO 3166-1 alpha-2] standard. + * - @var integer offset: Offset needed to return a specific subset of countries. + * - @var integer count: Number of countries to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCountries($access_token, array $params = []) { + return $this->request->post('database.getCountries', $access_token, $params); + } + + /** + * Returns information about countries by their IDs. + * + * @param string $access_token + * @param array $params + * - @var array[integer] country_ids: Country IDs. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCountriesById($access_token, array $params = []) { + return $this->request->post('database.getCountriesById', $access_token, $params); + } + + /** + * Returns a list of faculties (i.e., university departments). + * + * @param string $access_token + * @param array $params + * - @var integer university_id: University ID. + * - @var integer offset: Offset needed to return a specific subset of faculties. + * - @var integer count: Number of faculties to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getFaculties($access_token, array $params = []) { + return $this->request->post('database.getFaculties', $access_token, $params); + } + + /** + * Get metro stations by city + * + * @param string $access_token + * @param array $params + * - @var integer city_id + * - @var integer offset + * - @var integer count + * - @var boolean extended + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getMetroStations($access_token, array $params = []) { + return $this->request->post('database.getMetroStations', $access_token, $params); + } + + /** + * Get metro station by his id + * + * @param string $access_token + * @param array $params + * - @var array[integer] station_ids + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getMetroStationsById($access_token, array $params = []) { + return $this->request->post('database.getMetroStationsById', $access_token, $params); + } + + /** + * Returns a list of regions. + * + * @param string $access_token + * @param array $params + * - @var integer country_id: Country ID, received in [vk.com/dev/database.getCountries|database.getCountries] method. + * - @var string q: Search query. + * - @var integer offset: Offset needed to return specific subset of regions. + * - @var integer count: Number of regions to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getRegions($access_token, array $params = []) { + return $this->request->post('database.getRegions', $access_token, $params); + } + + /** + * Returns a list of school classes specified for the country. + * + * @param string $access_token + * @param array $params + * - @var integer country_id: Country ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getSchoolClasses($access_token, array $params = []) { + return $this->request->post('database.getSchoolClasses', $access_token, $params); + } + + /** + * Returns a list of schools. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query. + * - @var integer city_id: City ID. + * - @var integer offset: Offset needed to return a specific subset of schools. + * - @var integer count: Number of schools to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getSchools($access_token, array $params = []) { + return $this->request->post('database.getSchools', $access_token, $params); + } + + /** + * Returns a list of higher education institutions. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query. + * - @var integer country_id: Country ID. + * - @var integer city_id: City ID. + * - @var integer offset: Offset needed to return a specific subset of universities. + * - @var integer count: Number of universities to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getUniversities($access_token, array $params = []) { + return $this->request->post('database.getUniversities', $access_token, $params); + } } diff --git a/src/VK/Actions/Docs.php b/src/VK/Actions/Docs.php index 9f6cb9c..299b103 100644 --- a/src/VK/Actions/Docs.php +++ b/src/VK/Actions/Docs.php @@ -1,237 +1,208 @@ request = $request; - } - - /** - * Copies a document to a user's or community's document list. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the document. Use a negative value to - * designate a community ID. - * - integer doc_id: Document ID. - * - string access_key: Access key. This parameter is required if 'access_key' was returned with the - * document's data. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function add(string $access_token, array $params = array()) { - return $this->request->post('docs.add', $access_token, $params); - } - - /** - * Deletes a user or community document. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the document. Use a negative value to - * designate a community ID. - * - integer doc_id: Document ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('docs.delete', $access_token, $params); - } - - /** - * Edits a document. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer doc_id: Document ID. - * - string title: Document title. - * - array tags: Document tags. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('docs.edit', $access_token, $params); - } - - /** - * Returns detailed information about user or community documents. - * - * @param $access_token string - * @param $params array - * - integer count: Number of documents to return. By default, all documents. - * - integer offset: Offset needed to return a specific subset of documents. - * - DocsGetType type: - * @see DocsGetType - * - integer owner_id: ID of the user or community that owns the documents. Use a negative value to - * designate a community ID. - * - boolean return_tags: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('docs.get', $access_token, $params); - } - - /** - * Returns information about documents by their IDs. - * - * @param $access_token string - * @param $params array - * - array docs: Document IDs. Example: , "66748_91488,66748_91455", - * - boolean return_tags: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('docs.getById', $access_token, $params); - } - - /** - * Returns the server address for document upload. - * - * @param $access_token string - * @param $params array - * - DocsGetMessagesUploadServerType type: Document type. - * @see DocsGetMessagesUploadServerType - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat - * ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getMessagesUploadServer(string $access_token, array $params = array()) { - return $this->request->post('docs.getMessagesUploadServer', $access_token, $params); - } - - /** - * Returns documents types available for current user. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the documents. Use a negative value to - * designate a community ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getTypes(string $access_token, array $params = array()) { - return $this->request->post('docs.getTypes', $access_token, $params); - } - - /** - * Returns the server address for document upload. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID (if the document will be uploaded to the community). - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getUploadServer(string $access_token, array $params = array()) { - return $this->request->post('docs.getUploadServer', $access_token, $params); - } - - /** - * Returns the server address for document upload onto a user's or community's wall. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID (if the document will be uploaded to the community). - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getWallUploadServer(string $access_token, array $params = array()) { - return $this->request->post('docs.getWallUploadServer', $access_token, $params); - } - - /** - * Saves a document after [vk.com/dev/upload_files_2|uploading it to a server]. - * - * @param $access_token string - * @param $params array - * - string file: This parameter is returned when the file is [vk.com/dev/upload_files_2|uploaded to the - * server]. - * - string title: Document title. - * - string tags: Document tags. - * - boolean return_tags: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function save(string $access_token, array $params = array()) { - return $this->request->post('docs.save', $access_token, $params); - } - - /** - * Returns a list of documents matching the search criteria. - * - * @param $access_token string - * @param $params array - * - string q: Search query string. - * - boolean search_own: - * - integer count: Number of results to return. - * - integer offset: Offset needed to return a specific subset of results. - * - boolean return_tags: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('docs.search', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Docs constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Copies a document to a user's or community's document list. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the document. Use a negative value to designate a community ID. + * - @var integer doc_id: Document ID. + * - @var string access_key: Access key. This parameter is required if 'access_key' was returned with the document's data. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function add($access_token, array $params = []) { + return $this->request->post('docs.add', $access_token, $params); + } + + /** + * Deletes a user or community document. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the document. Use a negative value to designate a community ID. + * - @var integer doc_id: Document ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamDocDeleteAccessException Access to document deleting is denied + * @throws VKApiParamDocIdException Invalid document id + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('docs.delete', $access_token, $params); + } + + /** + * Edits a document. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer doc_id: Document ID. + * - @var string title: Document title. + * - @var array[string] tags: Document tags. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamDocAccessException Access to document is denied + * @throws VKApiParamDocIdException Invalid document id + * @throws VKApiParamDocTitleException Invalid document title + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('docs.edit', $access_token, $params); + } + + /** + * Returns detailed information about user or community documents. + * + * @param string $access_token + * @param array $params + * - @var integer count: Number of documents to return. By default, all documents. + * - @var integer offset: Offset needed to return a specific subset of documents. + * - @var DocsType type + * - @var integer owner_id: ID of the user or community that owns the documents. Use a negative value to designate a community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('docs.get', $access_token, $params); + } + + /** + * Returns information about documents by their IDs. + * + * @param string $access_token + * @param array $params + * - @var array[string] docs: Document IDs. Example: , "66748_91488,66748_91455", + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('docs.getById', $access_token, $params); + } + + /** + * Returns the server address for document upload. + * + * @param string $access_token + * @param array $params + * - @var DocsType type: Document type. + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesDenySendException Can't send messages for users without permission + * @return mixed + */ + public function getMessagesUploadServer($access_token, array $params = []) { + return $this->request->post('docs.getMessagesUploadServer', $access_token, $params); + } + + /** + * Returns documents types available for current user. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the documents. Use a negative value to designate a community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getTypes($access_token, array $params = []) { + return $this->request->post('docs.getTypes', $access_token, $params); + } + + /** + * Returns the server address for document upload. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID (if the document will be uploaded to the community). + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getUploadServer($access_token, array $params = []) { + return $this->request->post('docs.getUploadServer', $access_token, $params); + } + + /** + * Returns the server address for document upload onto a user's or community's wall. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID (if the document will be uploaded to the community). + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getWallUploadServer($access_token, array $params = []) { + return $this->request->post('docs.getWallUploadServer', $access_token, $params); + } + + /** + * Saves a document after [vk.com/dev/upload_files_2|uploading it to a server]. + * + * @param string $access_token + * @param array $params + * - @var string file: This parameter is returned when the file is [vk.com/dev/upload_files_2|uploaded to the server]. + * - @var string title: Document title. + * - @var string tags: Document tags. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiSaveFileException Couldn't save file + * @return mixed + */ + public function save($access_token, array $params = []) { + return $this->request->post('docs.save', $access_token, $params); + } + + /** + * Returns a list of documents matching the search criteria. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query string. + * - @var boolean search_own + * - @var integer count: Number of results to return. + * - @var integer offset: Offset needed to return a specific subset of results. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('docs.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Donut.php b/src/VK/Actions/Donut.php deleted file mode 100644 index 42c6ac2..0000000 --- a/src/VK/Actions/Donut.php +++ /dev/null @@ -1,94 +0,0 @@ -request = $request; - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer offset: - * - integer count: - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getFriends(string $access_token, array $params = array()) { - return $this->request->post('donut.getFriends', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getSubscription(string $access_token, array $params = array()) { - return $this->request->post('donut.getSubscription', $access_token, $params); - } - - /** - * Returns a list of user's VK Donut subscriptions. - * - * @param $access_token string - * @param $params array - * - array fields: - * - integer offset: - * - integer count: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSubscriptions(string $access_token, array $params = array()) { - return $this->request->post('donut.getSubscriptions', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function isDon(string $access_token, array $params = array()) { - return $this->request->post('donut.isDon', $access_token, $params); - } -} diff --git a/src/VK/Actions/DownloadedGames.php b/src/VK/Actions/DownloadedGames.php deleted file mode 100644 index a4f84b4..0000000 --- a/src/VK/Actions/DownloadedGames.php +++ /dev/null @@ -1,42 +0,0 @@ -request = $request; - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function getPaidStatus(string $access_token, array $params = array()) { - return $this->request->post('downloadedGames.getPaidStatus', $access_token, $params); - } -} diff --git a/src/VK/Actions/Enum/AccountSaveProfileInfoBdateVisibility.php b/src/VK/Actions/Enum/AccountSaveProfileInfoBdateVisibility.php deleted file mode 100644 index fffe35d..0000000 --- a/src/VK/Actions/Enum/AccountSaveProfileInfoBdateVisibility.php +++ /dev/null @@ -1,9 +0,0 @@ -request = $request; - } + /** + * @var VKApiRequest + */ + private $request; - /** - * - * - * @param $access_token string - * @param $params array - * - string url: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function addArticle(string $access_token, array $params = array()) { - return $this->request->post('fave.addArticle', $access_token, $params); - } + /** + * Fave constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Adds a link to user faves. - * - * @param $access_token string - * @param $params array - * - string link: Link URL. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function addLink(string $access_token, array $params = array()) { - return $this->request->post('fave.addLink', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var string url + * @throws VKClientException + * @throws VKApiException + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function addArticle($access_token, array $params = []) { + return $this->request->post('fave.addArticle', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function addPage(string $access_token, array $params = array()) { - return $this->request->post('fave.addPage', $access_token, $params); - } + /** + * Adds a link to user faves. + * + * @param string $access_token + * @param array $params + * - @var string link: Link URL. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function addLink($access_token, array $params = []) { + return $this->request->post('fave.addLink', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer id: - * - string access_key: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function addPost(string $access_token, array $params = array()) { - return $this->request->post('fave.addPost', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer user_id + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function addPage($access_token, array $params = []) { + return $this->request->post('fave.addPage', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer id: - * - string access_key: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function addProduct(string $access_token, array $params = array()) { - return $this->request->post('fave.addProduct', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer id + * - @var string access_key + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function addPost($access_token, array $params = []) { + return $this->request->post('fave.addPost', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - string name: - * - FaveAddTagPosition position: - * @see FaveAddTagPosition - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function addTag(string $access_token, array $params = array()) { - return $this->request->post('fave.addTag', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer id + * - @var string access_key + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function addProduct($access_token, array $params = []) { + return $this->request->post('fave.addProduct', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer id: - * - string access_key: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function addVideo(string $access_token, array $params = array()) { - return $this->request->post('fave.addVideo', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var string name + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @return mixed + */ + public function addTag($access_token, array $params = []) { + return $this->request->post('fave.addTag', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer id: - * - string name: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function editTag(string $access_token, array $params = array()) { - return $this->request->post('fave.editTag', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer id + * - @var string access_key + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function addVideo($access_token, array $params = []) { + return $this->request->post('fave.addVideo', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - boolean extended: '1' — to return additional 'wall', 'profiles', and 'groups' fields. By default: - * '0'. - * - FaveGetItemType item_type: - * @see FaveGetItemType - * - integer tag_id: Tag ID. - * - integer offset: Offset needed to return a specific subset of users. - * - integer count: Number of users to return. - * - string fields: - * - boolean is_from_snackbar: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('fave.get', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer id + * - @var string name + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function editTag($access_token, array $params = []) { + return $this->request->post('fave.editTag', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer offset: - * - integer count: - * - FaveGetPagesType type: - * @see FaveGetPagesType - * - array fields: - * - integer tag_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getPages(string $access_token, array $params = array()) { - return $this->request->post('fave.getPages', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var boolean extended: '1' — to return additional 'wall', 'profiles', and 'groups' fields. By default: '0'. + * - @var FaveItemType item_type + * - @var integer tag_id: Tag ID. + * - @var integer offset: Offset needed to return a specific subset of users. + * - @var integer count: Number of users to return. + * - @var string fields + * - @var boolean is_from_snackbar + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('fave.get', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getTags(string $access_token, array $params = array()) { - return $this->request->post('fave.getTags', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer offset + * - @var integer count + * - @var FaveType type + * - @var array[FaveFields] fields + * - @var integer tag_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getPages($access_token, array $params = []) { + return $this->request->post('fave.getPages', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function markSeen(string $access_token, array $params = array()) { - return $this->request->post('fave.markSeen', $access_token, $params); - } + /** + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getTags($access_token) { + return $this->request->post('fave.getTags', $access_token); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer article_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function removeArticle(string $access_token, array $params = array()) { - return $this->request->post('fave.removeArticle', $access_token, $params); - } + /** + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function markSeen($access_token) { + return $this->request->post('fave.markSeen', $access_token); + } - /** - * Removes link from the user's faves. - * - * @param $access_token string - * @param $params array - * - string link_id: Link ID (can be obtained by [vk.com/dev/faves.getLinks|faves.getLinks] method). - * - string link: Link URL - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function removeLink(string $access_token, array $params = array()) { - return $this->request->post('fave.removeLink', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer article_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function removeArticle($access_token, array $params = []) { + return $this->request->post('fave.removeArticle', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function removePage(string $access_token, array $params = array()) { - return $this->request->post('fave.removePage', $access_token, $params); - } + /** + * Removes link from the user's faves. + * + * @param string $access_token + * @param array $params + * - @var string link_id: Link ID (can be obtained by [vk.com/dev/faves.getLinks|faves.getLinks] method). + * - @var string link: Link URL + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function removeLink($access_token, array $params = []) { + return $this->request->post('fave.removeLink', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function removePost(string $access_token, array $params = array()) { - return $this->request->post('fave.removePost', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer user_id + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function removePage($access_token, array $params = []) { + return $this->request->post('fave.removePage', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function removeProduct(string $access_token, array $params = array()) { - return $this->request->post('fave.removeProduct', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function removePost($access_token, array $params = []) { + return $this->request->post('fave.removePost', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function removeTag(string $access_token, array $params = array()) { - return $this->request->post('fave.removeTag', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function removeProduct($access_token, array $params = []) { + return $this->request->post('fave.removeProduct', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function removeVideo(string $access_token, array $params = array()) { - return $this->request->post('fave.removeVideo', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function removeTag($access_token, array $params = []) { + return $this->request->post('fave.removeTag', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - array ids: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function reorderTags(string $access_token, array $params = array()) { - return $this->request->post('fave.reorderTags', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var array[integer] ids + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function reorderTags($access_token, array $params = []) { + return $this->request->post('fave.reorderTags', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer group_id: - * - array tag_ids: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function setPageTags(string $access_token, array $params = array()) { - return $this->request->post('fave.setPageTags', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer user_id + * - @var integer group_id + * - @var array[integer] tag_ids + * @throws VKClientException + * @throws VKApiException + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function setPageTags($access_token, array $params = []) { + return $this->request->post('fave.setPageTags', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - FaveSetTagsItemType item_type: - * @see FaveSetTagsItemType - * - integer item_owner_id: - * - integer item_id: - * - array tag_ids: - * - string link_id: - * - string link_url: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function setTags(string $access_token, array $params = array()) { - return $this->request->post('fave.setTags', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var FaveItemType item_type + * - @var integer item_owner_id + * - @var integer item_id + * - @var array[integer] tag_ids + * - @var string link_id + * - @var string link_url + * @throws VKClientException + * @throws VKApiException + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function setTags($access_token, array $params = []) { + return $this->request->post('fave.setTags', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function trackPageInteraction(string $access_token, array $params = array()) { - return $this->request->post('fave.trackPageInteraction', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer user_id + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function trackPageInteraction($access_token, array $params = []) { + return $this->request->post('fave.trackPageInteraction', $access_token, $params); + } } diff --git a/src/VK/Actions/Friends.php b/src/VK/Actions/Friends.php index 642ac79..320faab 100644 --- a/src/VK/Actions/Friends.php +++ b/src/VK/Actions/Friends.php @@ -1,409 +1,335 @@ request = $request; - } + /** + * Friends constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Approves or creates a friend request. - * - * @param $access_token string - * @param $params array - * - integer user_id: ID of the user whose friend request will be approved or to whom a friend request - * will be sent. - * - string text: Text of the message (up to 500 characters) for the friend request, if any. - * - boolean follow: '1' to pass an incoming request to followers list. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function add(string $access_token, array $params = array()) { - return $this->request->post('friends.add', $access_token, $params); - } + /** + * Approves or creates a friend request. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: ID of the user whose friend request will be approved or to whom a friend request will be sent. + * - @var string text: Text of the message (up to 500 characters) for the friend request, if any. + * - @var boolean follow: '1' to pass an incoming request to followers list. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiFriendsAddInEnemyException Cannot add this user to friends as they have put you on their blacklist + * @throws VKApiFriendsAddEnemyException Cannot add this user to friends as you put him on blacklist + * @throws VKApiFriendsAddYourselfException Cannot add user himself as friend + * @throws VKApiFriendsAddNotFoundException Cannot add this user to friends as user not found + * @return mixed + */ + public function add($access_token, array $params = []) { + return $this->request->post('friends.add', $access_token, $params); + } - /** - * Creates a new friend list for the current user. - * - * @param $access_token string - * @param $params array - * - string name: Name of the friend list. - * - array user_ids: IDs of users to be added to the friend list. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function addList(string $access_token, array $params = array()) { - return $this->request->post('friends.addList', $access_token, $params); - } + /** + * Creates a new friend list for the current user. + * + * @param string $access_token + * @param array $params + * - @var string name: Name of the friend list. + * - @var array[integer] user_ids: IDs of users to be added to the friend list. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiFriendsListLimitException Reached the maximum number of lists + * @return mixed + */ + public function addList($access_token, array $params = []) { + return $this->request->post('friends.addList', $access_token, $params); + } - /** - * Checks the current user's friendship status with other specified users. - * - * @param $access_token string - * @param $params array - * - array user_ids: IDs of the users whose friendship status to check. - * - boolean need_sign: '1' — to return 'sign' field. 'sign' is - * md5("{id}_{user_id}_{friends_status}_{application_secret}"), where id is current user ID. This field allows - * to check that data has not been modified by the client. By default: '0'. - * - boolean extended: Return friend request read_state field - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function areFriends(string $access_token, array $params = array()) { - return $this->request->post('friends.areFriends', $access_token, $params); - } + /** + * Checks the current user's friendship status with other specified users. + * + * @param string $access_token + * @param array $params + * - @var array[integer] user_ids: IDs of the users whose friendship status to check. + * - @var boolean need_sign: '1' — to return 'sign' field. 'sign' is md5("{id}_{user_id}_{friends_status}_{application_secret}"), where id is current user ID. This field allows to check that data has not been modified by the client. By default: '0'. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function areFriends($access_token, array $params = []) { + return $this->request->post('friends.areFriends', $access_token, $params); + } - /** - * Declines a friend request or deletes a user from the current user's friend list. - * - * @param $access_token string - * @param $params array - * - integer user_id: ID of the user whose friend request is to be declined or who is to be deleted from - * the current user's friend list. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('friends.delete', $access_token, $params); - } + /** + * Declines a friend request or deletes a user from the current user's friend list. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: ID of the user whose friend request is to be declined or who is to be deleted from the current user's friend list. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('friends.delete', $access_token, $params); + } - /** - * Marks all incoming friend requests as viewed. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteAllRequests(string $access_token, array $params = array()) { - return $this->request->post('friends.deleteAllRequests', $access_token, $params); - } + /** + * Marks all incoming friend requests as viewed. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteAllRequests($access_token) { + return $this->request->post('friends.deleteAllRequests', $access_token); + } - /** - * Deletes a friend list of the current user. - * - * @param $access_token string - * @param $params array - * - integer list_id: ID of the friend list to delete. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function deleteList(string $access_token, array $params = array()) { - return $this->request->post('friends.deleteList', $access_token, $params); - } + /** + * Deletes a friend list of the current user. + * + * @param string $access_token + * @param array $params + * - @var integer list_id: ID of the friend list to delete. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiFriendsListIdException Invalid list id + * @return mixed + */ + public function deleteList($access_token, array $params = []) { + return $this->request->post('friends.deleteList', $access_token, $params); + } - /** - * Edits the friend lists of the selected user. - * - * @param $access_token string - * @param $params array - * - integer user_id: ID of the user whose friend list is to be edited. - * - array list_ids: IDs of the friend lists to which to add the user. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('friends.edit', $access_token, $params); - } + /** + * Edits the friend lists of the selected user. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: ID of the user whose friend list is to be edited. + * - @var array[integer] list_ids: IDs of the friend lists to which to add the user. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('friends.edit', $access_token, $params); + } - /** - * Edits a friend list of the current user. - * - * @param $access_token string - * @param $params array - * - string name: Name of the friend list. - * - integer list_id: Friend list ID. - * - array user_ids: IDs of users in the friend list. - * - array add_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to add to the friend - * list. - * - array delete_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to delete from the - * friend list. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function editList(string $access_token, array $params = array()) { - return $this->request->post('friends.editList', $access_token, $params); - } + /** + * Edits a friend list of the current user. + * + * @param string $access_token + * @param array $params + * - @var string name: Name of the friend list. + * - @var integer list_id: Friend list ID. + * - @var array[integer] user_ids: IDs of users in the friend list. + * - @var array[integer] add_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to add to the friend list. + * - @var array[integer] delete_user_ids: (Applies if 'user_ids' parameter is not set.), User IDs to delete from the friend list. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiFriendsListIdException Invalid list id + * @return mixed + */ + public function editList($access_token, array $params = []) { + return $this->request->post('friends.editList', $access_token, $params); + } - /** - * Returns a list of user IDs or detailed information about a user's friends. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. By default, the current user ID. - * - FriendsGetOrder order: Sort order: , 'name' — by name (enabled only if the 'fields' parameter is - * used), 'hints' — by rating, similar to how friends are sorted in My friends section, , This parameter is - * available only for [vk.com/dev/standalone|desktop applications]. - * @see FriendsGetOrder - * - integer list_id: ID of the friend list returned by the [vk.com/dev/friends.getLists|friends.getLists] - * method to be used as the source. This parameter is taken into account only when the uid parameter is set to - * the current user ID. This parameter is available only for [vk.com/dev/standalone|desktop applications]. - * - integer count: Number of friends to return. - * - integer offset: Offset needed to return a specific subset of friends. - * - array fields: Profile fields to return. Sample values: 'uid', 'first_name', 'last_name', 'nickname', - * 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'domain', - * 'has_mobile', 'rate', 'contacts', 'education'. - * - FriendsGetNameCase name_case: Case for declension of user name and surname: , 'nom' — nominative - * (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' - * — prepositional - * @see FriendsGetNameCase - * - string ref: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('friends.get', $access_token, $params); - } + /** + * Returns a list of user IDs or detailed information about a user's friends. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. By default, the current user ID. + * - @var FriendsOrder order: Sort order: , 'name' — by name (enabled only if the 'fields' parameter is used), 'hints' — by rating, similar to how friends are sorted in My friends section, , This parameter is available only for [vk.com/dev/standalone|desktop applications]. + * - @var integer list_id: ID of the friend list returned by the [vk.com/dev/friends.getLists|friends.getLists] method to be used as the source. This parameter is taken into account only when the uid parameter is set to the current user ID. This parameter is available only for [vk.com/dev/standalone|desktop applications]. + * - @var integer count: Number of friends to return. + * - @var integer offset: Offset needed to return a specific subset of friends. + * - @var array[FriendsFields] fields: Profile fields to return. Sample values: 'uid', 'first_name', 'last_name', 'nickname', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'domain', 'has_mobile', 'rate', 'contacts', 'education'. + * - @var FriendsNameCase name_case: Case for declension of user name and surname: , 'nom' — nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional + * - @var string ref + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('friends.get', $access_token, $params); + } - /** - * Returns a list of IDs of the current user's friends who installed the application. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAppUsers(string $access_token, array $params = array()) { - return $this->request->post('friends.getAppUsers', $access_token, $params); - } + /** + * Returns a list of IDs of the current user's friends who installed the application. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getAppUsers($access_token) { + return $this->request->post('friends.getAppUsers', $access_token); + } - /** - * Returns a list of the current user's friends whose phone numbers, validated or specified in a profile, are in a - * given list. - * - * @param $access_token string - * @param $params array - * - array phones: List of phone numbers in MSISDN format (maximum 1000). Example: - * "+79219876543,+79111234567" - * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' - * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', - * 'contacts', 'education', 'online, counters'. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getByPhones(string $access_token, array $params = array()) { - return $this->request->post('friends.getByPhones', $access_token, $params); - } + /** + * Returns a list of the current user's friends whose phone numbers, validated or specified in a profile, are in a given list. + * + * @param string $access_token + * @param array $params + * - @var array[string] phones: List of phone numbers in MSISDN format (maximum 1000). Example: "+79219876543,+79111234567" + * - @var array[FriendsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online, counters'. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getByPhones($access_token, array $params = []) { + return $this->request->post('friends.getByPhones', $access_token, $params); + } - /** - * Returns a list of the user's friend lists. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - boolean return_system: '1' — to return system friend lists. By default: '0'. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getLists(string $access_token, array $params = array()) { - return $this->request->post('friends.getLists', $access_token, $params); - } + /** + * Returns a list of the user's friend lists. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var boolean return_system: '1' — to return system friend lists. By default: '0'. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getLists($access_token, array $params = []) { + return $this->request->post('friends.getLists', $access_token, $params); + } - /** - * Returns a list of user IDs of the mutual friends of two users. - * - * @param $access_token string - * @param $params array - * - integer source_uid: ID of the user whose friends will be checked against the friends of the user - * specified in 'target_uid'. - * - integer target_uid: ID of the user whose friends will be checked against the friends of the user - * specified in 'source_uid'. - * - array target_uids: IDs of the users whose friends will be checked against the friends of the user - * specified in 'source_uid'. - * - string order: Sort order: 'random' — random order - * - integer count: Number of mutual friends to return. - * - integer offset: Offset needed to return a specific subset of mutual friends. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getMutual(string $access_token, array $params = array()) { - return $this->request->post('friends.getMutual', $access_token, $params); - } + /** + * Returns a list of user IDs of the mutual friends of two users. + * + * @param string $access_token + * @param array $params + * - @var integer source_uid: ID of the user whose friends will be checked against the friends of the user specified in 'target_uid'. + * - @var integer target_uid: ID of the user whose friends will be checked against the friends of the user specified in 'source_uid'. + * - @var array[integer] target_uids: IDs of the users whose friends will be checked against the friends of the user specified in 'source_uid'. + * - @var string order: Sort order: 'random' — random order + * - @var integer count: Number of mutual friends to return. + * - @var integer offset: Offset needed to return a specific subset of mutual friends. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getMutual($access_token, array $params = []) { + return $this->request->post('friends.getMutual', $access_token, $params); + } - /** - * Returns a list of user IDs of a user's friends who are online. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - integer list_id: Friend list ID. If this parameter is not set, information about all online friends - * is returned. - * - boolean online_mobile: '1' — to return an additional 'online_mobile' field, '0' — (default), - * - string order: Sort order: 'random' — random order - * - integer count: Number of friends to return. - * - integer offset: Offset needed to return a specific subset of friends. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getOnline(string $access_token, array $params = array()) { - return $this->request->post('friends.getOnline', $access_token, $params); - } + /** + * Returns a list of user IDs of a user's friends who are online. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var integer list_id: Friend list ID. If this parameter is not set, information about all online friends is returned. + * - @var boolean online_mobile: '1' — to return an additional 'online_mobile' field, '0' — (default), + * - @var string order: Sort order: 'random' — random order + * - @var integer count: Number of friends to return. + * - @var integer offset: Offset needed to return a specific subset of friends. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getOnline($access_token, array $params = []) { + return $this->request->post('friends.getOnline', $access_token, $params); + } - /** - * Returns a list of user IDs of the current user's recently added friends. - * - * @param $access_token string - * @param $params array - * - integer count: Number of recently added friends to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getRecent(string $access_token, array $params = array()) { - return $this->request->post('friends.getRecent', $access_token, $params); - } + /** + * Returns a list of user IDs of the current user's recently added friends. + * + * @param string $access_token + * @param array $params + * - @var integer count: Number of recently added friends to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getRecent($access_token, array $params = []) { + return $this->request->post('friends.getRecent', $access_token, $params); + } - /** - * Returns information about the current user's incoming and outgoing friend requests. - * - * @param $access_token string - * @param $params array - * - integer offset: Offset needed to return a specific subset of friend requests. - * - integer count: Number of friend requests to return (default 100, maximum 1000). - * - boolean extended: '1' — to return response messages from users who have sent a friend request or, - * if 'suggested' is set to '1', to return a list of suggested friends - * - boolean need_mutual: '1' — to return a list of mutual friends (up to 20), if any - * - boolean out: '1' — to return outgoing requests, '0' — to return incoming requests (default) - * - FriendsGetRequestsSort sort: Sort order: '1' — by number of mutual friends, '0' — by date - * @see FriendsGetRequestsSort - * - boolean need_viewed: - * - boolean suggested: '1' — to return a list of suggested friends, '0' — to return friend requests - * (default) - * - string ref: - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getRequests(string $access_token, array $params = array()) { - return $this->request->post('friends.getRequests', $access_token, $params); - } + /** + * Returns information about the current user's incoming and outgoing friend requests. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of friend requests. + * - @var integer count: Number of friend requests to return (default 100, maximum 1000). + * - @var boolean extended: '1' — to return response messages from users who have sent a friend request or, if 'suggested' is set to '1', to return a list of suggested friends + * - @var boolean need_mutual: '1' — to return a list of mutual friends (up to 20), if any + * - @var boolean out: '1' — to return outgoing requests, '0' — to return incoming requests (default) + * - @var FriendsSort sort: Sort order: '1' — by number of mutual friends, '0' — by date + * - @var boolean need_viewed + * - @var boolean suggested: '1' — to return a list of suggested friends, '0' — to return friend requests (default) + * - @var string ref + * - @var array[FriendsFields] fields + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getRequests($access_token, array $params = []) { + return $this->request->post('friends.getRequests', $access_token, $params); + } - /** - * Returns a list of profiles of users whom the current user may know. - * - * @param $access_token string - * @param $params array - * - array filter: Types of potential friends to return: 'mutual' — users with many mutual friends , - * 'contacts' — users found with the [vk.com/dev/account.importContacts|account.importContacts] method , - * 'mutual_contacts' — users who imported the same contacts as the current user with the - * [vk.com/dev/account.importContacts|account.importContacts] method - * - integer count: Number of suggestions to return. - * - integer offset: Offset needed to return a specific subset of suggestions. - * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' - * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', - * 'contacts', 'education', 'online', 'counters'. - * - FriendsGetSuggestionsNameCase name_case: Case for declension of user name and surname: , 'nom' — - * nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental - * , 'abl' — prepositional - * @see FriendsGetSuggestionsNameCase - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSuggestions(string $access_token, array $params = array()) { - return $this->request->post('friends.getSuggestions', $access_token, $params); - } + /** + * Returns a list of profiles of users whom the current user may know. + * + * @param string $access_token + * @param array $params + * - @var array[FriendsFilter] filter: Types of potential friends to return: 'mutual' — users with many mutual friends , 'contacts' — users found with the [vk.com/dev/account.importContacts|account.importContacts] method , 'mutual_contacts' — users who imported the same contacts as the current user with the [vk.com/dev/account.importContacts|account.importContacts] method + * - @var integer count: Number of suggestions to return. + * - @var integer offset: Offset needed to return a specific subset of suggestions. + * - @var array[FriendsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'. + * - @var FriendsNameCase name_case: Case for declension of user name and surname: , 'nom' — nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getSuggestions($access_token, array $params = []) { + return $this->request->post('friends.getSuggestions', $access_token, $params); + } - /** - * Returns a list of friends matching the search criteria. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - string q: Search query string (e.g., 'Vasya Babich'). - * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' - * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', - * 'contacts', 'education', 'online', - * - FriendsSearchNameCase name_case: Case for declension of user name and surname: 'nom' — nominative - * (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — - * prepositional - * @see FriendsSearchNameCase - * - integer offset: Offset needed to return a specific subset of friends. - * - integer count: Number of friends to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('friends.search', $access_token, $params); - } + /** + * Returns a list of friends matching the search criteria. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var string q: Search query string (e.g., 'Vasya Babich'). + * - @var array[FriendsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', + * - @var FriendsNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional + * - @var integer offset: Offset needed to return a specific subset of friends. + * - @var integer count: Number of friends to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('friends.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Gifts.php b/src/VK/Actions/Gifts.php index 2bffd59..e7a6367 100644 --- a/src/VK/Actions/Gifts.php +++ b/src/VK/Actions/Gifts.php @@ -1,41 +1,41 @@ request = $request; - } + /** + * Gifts constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns a list of user gifts. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - integer count: Number of gifts to return. - * - integer offset: Offset needed to return a specific subset of results. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('gifts.get', $access_token, $params); - } + /** + * Returns a list of user gifts. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var integer count: Number of gifts to return. + * - @var integer offset: Offset needed to return a specific subset of results. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('gifts.get', $access_token, $params); + } } diff --git a/src/VK/Actions/Groups.php b/src/VK/Actions/Groups.php index 8197e89..a8614da 100644 --- a/src/VK/Actions/Groups.php +++ b/src/VK/Actions/Groups.php @@ -1,1229 +1,1025 @@ request = $request; - } + /** + * Groups constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - string title: - * - string address: - * - string additional_address: - * - integer country_id: - * - integer city_id: - * - integer metro_id: - * - number latitude: - * - number longitude: - * - string phone: - * - GroupsAddAddressWorkInfoStatus work_info_status: - * @see GroupsAddAddressWorkInfoStatus - * - string timetable: - * - boolean is_main_address: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function addAddress(string $access_token, array $params = array()) { - return $this->request->post('groups.addAddress', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * - @var string title + * - @var string address + * - @var string additional_address + * - @var integer country_id + * - @var integer city_id + * - @var integer metro_id + * - @var number latitude + * - @var number longitude + * - @var string phone + * - @var AddressWorkInfoStatus work_info_status: Status of information about timetable + * - @var string timetable + * - @var boolean is_main_address + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings + * @throws VKApiNotFoundException Not found + * @throws VKApiGroupTooManyAddressesException Too many addresses in club + * @return mixed + */ + public function addAddress($access_token, array $params = []) { + return $this->request->post('groups.addAddress', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - string url: - * - string title: - * - string secret_key: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function addCallbackServer(string $access_token, array $params = array()) { - return $this->request->post('groups.addCallbackServer', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * - @var string url + * - @var string title + * - @var string secret_key + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCallbackApiServersLimitException Servers number limit is reached + * @return mixed + */ + public function addCallbackServer($access_token, array $params = []) { + return $this->request->post('groups.addCallbackServer', $access_token, $params); + } - /** - * Allows to add a link to the community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - string link: Link URL. - * - string text: Description text for the link. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function addLink(string $access_token, array $params = array()) { - return $this->request->post('groups.addLink', $access_token, $params); - } + /** + * Allows to add a link to the community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var string link: Link URL. + * - @var string text: Description text for the link. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function addLink($access_token, array $params = []) { + return $this->request->post('groups.addLink', $access_token, $params); + } - /** - * Allows to approve join request to the community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer user_id: User ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function approveRequest(string $access_token, array $params = array()) { - return $this->request->post('groups.approveRequest', $access_token, $params); - } + /** + * Allows to approve join request to the community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer user_id: User ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @return mixed + */ + public function approveRequest($access_token, array $params = []) { + return $this->request->post('groups.approveRequest', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer owner_id: - * - integer end_date: - * - integer reason: - * - string comment: - * - boolean comment_visible: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function ban(string $access_token, array $params = array()) { - return $this->request->post('groups.ban', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * - @var integer owner_id + * - @var integer end_date + * - @var integer reason + * - @var string comment + * - @var boolean comment_visible + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function ban($access_token, array $params = []) { + return $this->request->post('groups.ban', $access_token, $params); + } - /** - * Creates a new community. - * - * @param $access_token string - * @param $params array - * - string title: Community title. - * - string description: Community description (ignored for 'type' = 'public'). - * - GroupsCreateType type: Community type. Possible values: *'group' - group,, *'event' - event,, - * *'public' - public page - * @see GroupsCreateType - * - integer public_category: Category ID (for 'type' = 'public' only). - * - GroupsCreateSubtype subtype: Public page subtype. Possible values: *'1' - place or small business,, - * *'2' - company, organization or website,, *'3' - famous person or group of people,, *'4' - product or work - * of art. - * @see GroupsCreateSubtype - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function create(string $access_token, array $params = array()) { - return $this->request->post('groups.create', $access_token, $params); - } + /** + * Creates a new community. + * + * @param string $access_token + * @param array $params + * - @var string title: Community title. + * - @var string description: Community description (ignored for 'type' = 'public'). + * - @var GroupsType type: Community type. Possible values: *'group' – group,, *'event' – event,, *'public' – public page + * - @var integer public_category: Category ID (for 'type' = 'public' only). + * - @var GroupsSubtype subtype: Public page subtype. Possible values: *'1' – place or small business,, *'2' – company, organization or website,, *'3' – famous person or group of people,, *'4' – product or work of art. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @return mixed + */ + public function create($access_token, array $params = []) { + return $this->request->post('groups.create', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer address_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function deleteAddress(string $access_token, array $params = array()) { - return $this->request->post('groups.deleteAddress', $access_token, $params); - } + /** + * Delete community address. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Group ID + * - @var integer address_id: Address ID + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function deleteAddress($access_token, array $params = []) { + return $this->request->post('groups.deleteAddress', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer server_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function deleteCallbackServer(string $access_token, array $params = array()) { - return $this->request->post('groups.deleteCallbackServer', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * - @var integer server_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function deleteCallbackServer($access_token, array $params = []) { + return $this->request->post('groups.deleteCallbackServer', $access_token, $params); + } - /** - * Allows to delete a link from the community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer link_id: Link ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteLink(string $access_token, array $params = array()) { - return $this->request->post('groups.deleteLink', $access_token, $params); - } + /** + * Allows to delete a link from the community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer link_id: Link ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteLink($access_token, array $params = []) { + return $this->request->post('groups.deleteLink', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function disableOnline(string $access_token, array $params = array()) { - return $this->request->post('groups.disableOnline', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function disableOnline($access_token, array $params = []) { + return $this->request->post('groups.disableOnline', $access_token, $params); + } - /** - * Edits a community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - string title: Community title. - * - string description: Community description. - * - string screen_name: Community screen name. - * - integer access: Community type. Possible values: *'0' - open,, *'1' - closed,, *'2' - private. - * - string website: Website that will be displayed in the community information field. - * - string subject: Community subject. Possible values: , *'1' - auto/moto,, *'2' - activity holidays,, - * *'3' - business,, *'4' - pets,, *'5' - health,, *'6' - dating and communication, , *'7' - games,, *'8' - IT - * (computers and software),, *'9' - cinema,, *'10' - beauty and fashion,, *'11' - cooking,, *'12' - art and - * culture,, *'13' - literature,, *'14' - mobile services and internet,, *'15' - music,, *'16' - science and - * technology,, *'17' - real estate,, *'18' - news and media,, *'19' - security,, *'20' - education,, *'21' - - * home and renovations,, *'22' - politics,, *'23' - food,, *'24' - industry,, *'25' - travel,, *'26' - work,, - * *'27' - entertainment,, *'28' - religion,, *'29' - family,, *'30' - sports,, *'31' - insurance,, *'32' - - * television,, *'33' - goods and services,, *'34' - hobbies,, *'35' - finance,, *'36' - photo,, *'37' - - * esoterics,, *'38' - electronics and appliances,, *'39' - erotic,, *'40' - humor,, *'41' - society, - * humanities,, *'42' - design and graphics. - * - string email: Organizer email (for events). - * - string phone: Organizer phone number (for events). - * - string rss: RSS feed address for import (available only to communities with special permission. - * Contact vk.com/support to get it. - * - integer event_start_date: Event start date in Unixtime format. - * - integer event_finish_date: Event finish date in Unixtime format. - * - integer event_group_id: Organizer community ID (for events only). - * - integer public_category: Public page category ID. - * - integer public_subcategory: Public page subcategory ID. - * - string public_date: Founding date of a company or organization owning the community in "dd.mm.YYYY" - * format. - * - integer wall: Wall settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (groups - * and events only),, *'3' - closed (groups and events only). - * - integer topics: Board topics settings. Possbile values: , *'0' - disabled,, *'1' - open,, *'2' - - * limited (for groups and events only). - * - integer photos: Photos settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for - * groups and events only). - * - integer video: Video settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for - * groups and events only). - * - integer audio: Audio settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited (for - * groups and events only). - * - boolean links: Links settings (for public pages only). Possible values: *'0' - disabled,, *'1' - - * enabled. - * - boolean events: Events settings (for public pages only). Possible values: *'0' - disabled,, *'1' - - * enabled. - * - boolean places: Places settings (for public pages only). Possible values: *'0' - disabled,, *'1' - - * enabled. - * - boolean contacts: Contacts settings (for public pages only). Possible values: *'0' - disabled,, *'1' - * - enabled. - * - integer docs: Documents settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited - * (for groups and events only). - * - integer wiki: Wiki pages settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited - * (for groups and events only). - * - boolean messages: Community messages. Possible values: *'0' — disabled,, *'1' — enabled. - * - boolean articles: - * - boolean addresses: - * - GroupsEditAgeLimits age_limits: Community age limits. Possible values: *'1' — no limits,, *'2' — - * 16+,, *'3' — 18+. - * @see GroupsEditAgeLimits - * - boolean market: Market settings. Possible values: *'0' - disabled,, *'1' - enabled. - * - boolean market_comments: market comments settings. Possible values: *'0' - disabled,, *'1' - enabled. - * - array market_country: Market delivery countries. - * - array market_city: Market delivery cities (if only one country is specified). - * - integer market_currency: Market currency settings. Possbile values: , *'643' - Russian rubles,, - * *'980' - Ukrainian hryvnia,, *'398' - Kazakh tenge,, *'978' - Euro,, *'840' - US dollars - * - integer market_contact: Seller contact for market. Set '0' for community messages. - * - integer market_wiki: ID of a wiki page with market description. - * - boolean obscene_filter: Obscene expressions filter in comments. Possible values: , *'0' - disabled,, - * *'1' - enabled. - * - boolean obscene_stopwords: Stopwords filter in comments. Possible values: , *'0' - disabled,, *'1' - - * enabled. - * - array obscene_words: Keywords for stopwords filter. - * - integer main_section: - * - integer secondary_section: - * - integer country: Country of the community. - * - integer city: City of the community. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('groups.edit', $access_token, $params); - } + /** + * Edits a community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var string title: Community title. + * - @var string description: Community description. + * - @var string screen_name: Community screen name. + * - @var GroupAccess access: Community type. Possible values: *'0' – open,, *'1' – closed,, *'2' – private. + * - @var string website: Website that will be displayed in the community information field. + * - @var GroupSubject subject: Community subject. Possible values: , *'1' – auto/moto,, *'2' – activity holidays,, *'3' – business,, *'4' – pets,, *'5' – health,, *'6' – dating and communication, , *'7' – games,, *'8' – IT (computers and software),, *'9' – cinema,, *'10' – beauty and fashion,, *'11' – cooking,, *'12' – art and culture,, *'13' – literature,, *'14' – mobile services and internet,, *'15' – music,, *'16' – science and technology,, *'17' – real estate,, *'18' – news and media,, *'19' – security,, *'20' – education,, *'21' – home and renovations,, *'22' – politics,, *'23' – food,, *'24' – industry,, *'25' – travel,, *'26' – work,, *'27' – entertainment,, *'28' – religion,, *'29' – family,, *'30' – sports,, *'31' – insurance,, *'32' – television,, *'33' – goods and services,, *'34' – hobbies,, *'35' – finance,, *'36' – photo,, *'37' – esoterics,, *'38' – electronics and appliances,, *'39' – erotic,, *'40' – humor,, *'41' – society, humanities,, *'42' – design and graphics. + * - @var string email: Organizer email (for events). + * - @var string phone: Organizer phone number (for events). + * - @var string rss: RSS feed address for import (available only to communities with special permission. Contact vk.com/support to get it. + * - @var integer event_start_date: Event start date in Unixtime format. + * - @var integer event_finish_date: Event finish date in Unixtime format. + * - @var integer event_group_id: Organizer community ID (for events only). + * - @var integer public_category: Public page category ID. + * - @var integer public_subcategory: Public page subcategory ID. + * - @var string public_date: Founding date of a company or organization owning the community in "dd.mm.YYYY" format. + * - @var GroupWall wall: Wall settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (groups and events only),, *'3' – closed (groups and events only). + * - @var GroupTopics topics: Board topics settings. Possbile values: , *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). + * - @var GroupPhotos photos: Photos settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). + * - @var GroupVideo video: Video settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). + * - @var GroupAudio audio: Audio settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). + * - @var boolean links: Links settings (for public pages only). Possible values: *'0' – disabled,, *'1' – enabled. + * - @var boolean events: Events settings (for public pages only). Possible values: *'0' – disabled,, *'1' – enabled. + * - @var boolean places: Places settings (for public pages only). Possible values: *'0' – disabled,, *'1' – enabled. + * - @var boolean contacts: Contacts settings (for public pages only). Possible values: *'0' – disabled,, *'1' – enabled. + * - @var GroupDocs docs: Documents settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). + * - @var GroupWiki wiki: Wiki pages settings. Possible values: *'0' – disabled,, *'1' – open,, *'2' – limited (for groups and events only). + * - @var boolean messages: Community messages. Possible values: *'0' — disabled,, *'1' — enabled. + * - @var boolean articles + * - @var boolean addresses + * - @var GroupAgeLimits age_limits: Community age limits. Possible values: *'1' — no limits,, *'2' — 16+,, *'3' — 18+. + * - @var boolean market: Market settings. Possible values: *'0' – disabled,, *'1' – enabled. + * - @var boolean market_comments: market comments settings. Possible values: *'0' – disabled,, *'1' – enabled. + * - @var array[integer] market_country: Market delivery countries. + * - @var array[integer] market_city: Market delivery cities (if only one country is specified). + * - @var GroupMarketCurrency market_currency: Market currency settings. Possbile values: , *'643' – Russian rubles,, *'980' – Ukrainian hryvnia,, *'398' – Kazakh tenge,, *'978' – Euro,, *'840' – US dollars + * - @var integer market_contact: Seller contact for market. Set '0' for community messages. + * - @var integer market_wiki: ID of a wiki page with market description. + * - @var boolean obscene_filter: Obscene expressions filter in comments. Possible values: , *'0' – disabled,, *'1' – enabled. + * - @var boolean obscene_stopwords: Stopwords filter in comments. Possible values: , *'0' – disabled,, *'1' – enabled. + * - @var array[string] obscene_words: Keywords for stopwords filter. + * - @var integer main_section + * - @var integer secondary_section + * - @var integer country: Country of the community. + * - @var integer city: City of the community. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiInvalidAddressException Invalid screen name + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('groups.edit', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer address_id: - * - string title: - * - string address: - * - string additional_address: - * - integer country_id: - * - integer city_id: - * - integer metro_id: - * - number latitude: - * - number longitude: - * - string phone: - * - GroupsEditAddressWorkInfoStatus work_info_status: - * @see GroupsEditAddressWorkInfoStatus - * - string timetable: - * - boolean is_main_address: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function editAddress(string $access_token, array $params = array()) { - return $this->request->post('groups.editAddress', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * - @var integer address_id + * - @var string title + * - @var string address + * - @var string additional_address + * - @var integer country_id + * - @var integer city_id + * - @var integer metro_id + * - @var number latitude + * - @var number longitude + * - @var string phone + * - @var AddressWorkInfoStatus work_info_status: Status of information about timetable + * - @var string timetable + * - @var boolean is_main_address + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings + * @throws VKApiNotFoundException Not found + * @throws VKApiGroupTooManyAddressesException Too many addresses in club + * @return mixed + */ + public function editAddress($access_token, array $params = []) { + return $this->request->post('groups.editAddress', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer server_id: - * - string url: - * - string title: - * - string secret_key: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function editCallbackServer(string $access_token, array $params = array()) { - return $this->request->post('groups.editCallbackServer', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * - @var integer server_id + * - @var string url + * - @var string title + * - @var string secret_key + * @throws VKClientException + * @throws VKApiException + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function editCallbackServer($access_token, array $params = []) { + return $this->request->post('groups.editCallbackServer', $access_token, $params); + } - /** - * Allows to edit a link in the community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer link_id: Link ID. - * - string text: New description text for the link. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function editLink(string $access_token, array $params = array()) { - return $this->request->post('groups.editLink', $access_token, $params); - } + /** + * Allows to edit a link in the community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer link_id: Link ID. + * - @var string text: New description text for the link. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function editLink($access_token, array $params = []) { + return $this->request->post('groups.editLink', $access_token, $params); + } - /** - * Allows to add, remove or edit the community manager. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer user_id: User ID. - * - string role: Manager role. Possible values: *'moderator',, *'editor',, *'administrator',, - * *'advertiser'. - * - boolean is_contact: '1' — to show the manager in Contacts block of the community. - * - string contact_position: Position to show in Contacts block. - * - string contact_phone: Contact phone. - * - string contact_email: Contact e-mail. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function editManager(string $access_token, array $params = array()) { - return $this->request->post('groups.editManager', $access_token, $params); - } + /** + * Allows to add, remove or edit the community manager. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer user_id: User ID. + * - @var GroupRole role: Manager role. Possible values: *'moderator',, *'editor',, *'administrator'. + * - @var boolean is_contact: '1' — to show the manager in Contacts block of the community. + * - @var string contact_position: Position to show in Contacts block. + * - @var string contact_phone: Contact phone. + * - @var string contact_email: Contact e-mail. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiGroupChangeCreatorException Cannot edit creator role + * @throws VKApiGroupNotInClubException User should be in club + * @throws VKApiGroupTooManyOfficersException Too many officers in club + * @throws VKApiGroupNeed2faException You need to enable 2FA for this action + * @throws VKApiGroupHostNeed2faException User needs to enable 2FA for this action + * @return mixed + */ + public function editManager($access_token, array $params = []) { + return $this->request->post('groups.editManager', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function enableOnline(string $access_token, array $params = array()) { - return $this->request->post('groups.enableOnline', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function enableOnline($access_token, array $params = []) { + return $this->request->post('groups.enableOnline', $access_token, $params); + } - /** - * Returns a list of the communities to which a user belongs. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - boolean extended: '1' — to return complete information about a user's communities, '0' — to - * return a list of community IDs without any additional fields (default), - * - array filter: Types of communities to return: 'admin' — to return communities administered by the - * user , 'editor' — to return communities where the user is an administrator or editor, 'moder' — to - * return communities where the user is an administrator, editor, or moderator, 'groups' — to return only - * groups, 'publics' — to return only public pages, 'events' — to return only events - * - array fields: Profile fields to return. - * - integer offset: Offset needed to return a specific subset of communities. - * - integer count: Number of communities to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('groups.get', $access_token, $params); - } + /** + * Returns a list of the communities to which a user belongs. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var boolean extended: '1' — to return complete information about a user's communities, '0' — to return a list of community IDs without any additional fields (default), + * - @var array[GroupsFilter] filter: Types of communities to return: 'admin' — to return communities administered by the user , 'editor' — to return communities where the user is an administrator or editor, 'moder' — to return communities where the user is an administrator, editor, or moderator, 'groups' — to return only groups, 'publics' — to return only public pages, 'events' — to return only events + * - @var array[GroupsFields] fields: Profile fields to return. + * - @var integer offset: Offset needed to return a specific subset of communities. + * - @var integer count: Number of communities to return. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessGroupsException Access to the groups list is denied due to the user's privacy settings + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('groups.get', $access_token, $params); + } - /** - * Returns a list of community addresses. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID or screen name of the community. - * - array address_ids: - * - number latitude: Latitude of the user geo position. - * - number longitude: Longitude of the user geo position. - * - integer offset: Offset needed to return a specific subset of community addresses. - * - integer count: Number of community addresses to return. - * - array fields: Address fields - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function getAddresses(string $access_token, array $params = array()) { - return $this->request->post('groups.getAddresses', $access_token, $params); - } + /** + * Returns a list of community addresses. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID or screen name of the community. + * - @var array[integer] address_ids + * - @var number latitude: Latitude of the user geo position. + * - @var number longitude: Longitude of the user geo position. + * - @var integer offset: Offset needed to return a specific subset of community addresses. + * - @var integer count: Number of community addresses to return. + * - @var array[GroupsFields] fields: Address fields + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamGroupIdException Invalid group id + * @return mixed + */ + public function getAddresses($access_token, array $params = []) { + return $this->request->post('groups.getAddresses', $access_token, $params); + } - /** - * Returns a list of users on a community blacklist. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer offset: Offset needed to return a specific subset of users. - * - integer count: Number of users to return. - * - array fields: - * - integer owner_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getBanned(string $access_token, array $params = array()) { - return $this->request->post('groups.getBanned', $access_token, $params); - } + /** + * Returns a list of users on a community blacklist. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer offset: Offset needed to return a specific subset of users. + * - @var integer count: Number of users to return. + * - @var array[GroupsFields] fields + * - @var integer owner_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function getBanned($access_token, array $params = []) { + return $this->request->post('groups.getBanned', $access_token, $params); + } - /** - * Returns information about communities by their IDs. - * - * @param $access_token string - * @param $params array - * - array group_ids: IDs or screen names of communities. - * - string group_id: ID or screen name of the community. - * - array fields: Group fields to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('groups.getById', $access_token, $params); - } + /** + * Returns information about communities by their IDs. + * + * @param string $access_token + * @param array $params + * - @var array[string] group_ids: IDs or screen names of communities. + * - @var string group_id: ID or screen name of the community. + * - @var array[GroupsFields] fields: Group fields to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('groups.getById', $access_token, $params); + } - /** - * Returns Callback API confirmation code for the community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCallbackConfirmationCode(string $access_token, array $params = array()) { - return $this->request->post('groups.getCallbackConfirmationCode', $access_token, $params); - } + /** + * Returns Callback API confirmation code for the community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCallbackConfirmationCode($access_token, array $params = []) { + return $this->request->post('groups.getCallbackConfirmationCode', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - array server_ids: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCallbackServers(string $access_token, array $params = array()) { - return $this->request->post('groups.getCallbackServers', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * - @var array[integer] server_ids + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCallbackServers($access_token, array $params = []) { + return $this->request->post('groups.getCallbackServers', $access_token, $params); + } - /** - * Returns [vk.com/dev/callback_api|Callback API] notifications settings. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer server_id: Server ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getCallbackSettings(string $access_token, array $params = array()) { - return $this->request->post('groups.getCallbackSettings', $access_token, $params); - } + /** + * Returns [vk.com/dev/callback_api|Callback API] notifications settings. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer server_id: Server ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function getCallbackSettings($access_token, array $params = []) { + return $this->request->post('groups.getCallbackSettings', $access_token, $params); + } - /** - * Returns communities list for a catalog category. - * - * @param $access_token string - * @param $params array - * - integer category_id: Category id received from - * [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. - * - integer subcategory_id: Subcategory id received from - * [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function getCatalog(string $access_token, array $params = array()) { - return $this->request->post('groups.getCatalog', $access_token, $params); - } + /** + * Returns communities list for a catalog category. + * + * @param string $access_token + * @param array $params + * - @var integer category_id: Category id received from [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. + * - @var integer subcategory_id: Subcategory id received from [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiCommunitiesCatalogDisabledException Catalog is not available for this user + * @throws VKApiCommunitiesCategoriesDisabledException Catalog categories are not available for this user + * @return mixed + */ + public function getCatalog($access_token, array $params = []) { + return $this->request->post('groups.getCatalog', $access_token, $params); + } - /** - * Returns categories list for communities catalog - * - * @param $access_token string - * @param $params array - * - boolean extended: 1 - to return communities count and three communities for preview. By default: 0. - * - boolean subcategories: 1 - to return subcategories info. By default: 0. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCatalogInfo(string $access_token, array $params = array()) { - return $this->request->post('groups.getCatalogInfo', $access_token, $params); - } + /** + * Returns categories list for communities catalog + * + * @param string $access_token + * @param array $params + * - @var boolean extended: 1 – to return communities count and three communities for preview. By default: 0. + * - @var boolean subcategories: 1 – to return subcategories info. By default: 0. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCatalogInfo($access_token, array $params = []) { + return $this->request->post('groups.getCatalogInfo', $access_token, $params); + } - /** - * Returns invited users list of a community - * - * @param $access_token string - * @param $params array - * - integer group_id: Group ID to return invited users for. - * - integer offset: Offset needed to return a specific subset of results. - * - integer count: Number of results to return. - * - array fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, - * photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, - * online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, - * can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, - * relation, relatives, counters'. - * - GroupsGetInvitedUsersNameCase name_case: Case for declension of user name and surname. Possible - * values: *'nom' — nominative (default),, *'gen' — genitive,, *'dat' — dative,, *'acc' — accusative, , - * *'ins' — instrumental,, *'abl' — prepositional. - * @see GroupsGetInvitedUsersNameCase - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getInvitedUsers(string $access_token, array $params = array()) { - return $this->request->post('groups.getInvitedUsers', $access_token, $params); - } + /** + * Returns invited users list of a community + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Group ID to return invited users for. + * - @var integer offset: Offset needed to return a specific subset of results. + * - @var integer count: Number of results to return. + * - @var array[GroupsFields] fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. + * - @var GroupsNameCase name_case: Case for declension of user name and surname. Possible values: *'nom' — nominative (default),, *'gen' — genitive,, *'dat' — dative,, *'acc' — accusative, , *'ins' — instrumental,, *'abl' — prepositional. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getInvitedUsers($access_token, array $params = []) { + return $this->request->post('groups.getInvitedUsers', $access_token, $params); + } - /** - * Returns a list of invitations to join communities and events. - * - * @param $access_token string - * @param $params array - * - integer offset: Offset needed to return a specific subset of invitations. - * - integer count: Number of invitations to return. - * - boolean extended: '1' — to return additional [vk.com/dev/fields_groups|fields] for communities.. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getInvites(string $access_token, array $params = array()) { - return $this->request->post('groups.getInvites', $access_token, $params); - } + /** + * Returns a list of invitations to join communities and events. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of invitations. + * - @var integer count: Number of invitations to return. + * - @var boolean extended: '1' — to return additional [vk.com/dev/fields_groups|fields] for communities.. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getInvites($access_token, array $params = []) { + return $this->request->post('groups.getInvites', $access_token, $params); + } - /** - * Returns the data needed to query a Long Poll server for events - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getLongPollServer(string $access_token, array $params = array()) { - return $this->request->post('groups.getLongPollServer', $access_token, $params); - } + /** + * Returns the data needed to query a Long Poll server for events + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getLongPollServer($access_token, array $params = []) { + return $this->request->post('groups.getLongPollServer', $access_token, $params); + } - /** - * Returns Long Poll notification settings - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getLongPollSettings(string $access_token, array $params = array()) { - return $this->request->post('groups.getLongPollSettings', $access_token, $params); - } + /** + * Returns Long Poll notification settings + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getLongPollSettings($access_token, array $params = []) { + return $this->request->post('groups.getLongPollSettings', $access_token, $params); + } - /** - * Returns a list of community members. - * - * @param $access_token string - * @param $params array - * - string group_id: ID or screen name of the community. - * - GroupsGetMembersSort sort: Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', - * 'time_desc'. 'time_asc' and 'time_desc' are availavle only if the method is called by the group's - * 'moderator'. - * @see GroupsGetMembersSort - * - integer offset: Offset needed to return a specific subset of community members. - * - integer count: Number of community members to return. - * - array fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, - * photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, - * online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, - * can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, - * relation, relatives, counters'. - * - GroupsGetMembersFilter filter: *'friends' - only friends in this community will be returned,, - * *'unsure' - only those who pressed 'I may attend' will be returned (if it's an event). - * @see GroupsGetMembersFilter - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getMembers(string $access_token, array $params = array()) { - return $this->request->post('groups.getMembers', $access_token, $params); - } + /** + * Returns a list of community members. + * + * @param string $access_token + * @param array $params + * - @var string group_id: ID or screen name of the community. + * - @var GroupsSort sort: Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', 'time_desc'. 'time_asc' and 'time_desc' are availavle only if the method is called by the group's 'moderator'. + * - @var integer offset: Offset needed to return a specific subset of community members. + * - @var integer count: Number of community members to return. + * - @var array[GroupsFields] fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. + * - @var GroupsFilter filter: *'friends' – only friends in this community will be returned,, *'unsure' – only those who pressed 'I may attend' will be returned (if it's an event). + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamGroupIdException Invalid group id + * @return mixed + */ + public function getMembers($access_token, array $params = []) { + return $this->request->post('groups.getMembers', $access_token, $params); + } - /** - * Returns a list of requests to the community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer offset: Offset needed to return a specific subset of results. - * - integer count: Number of results to return. - * - array fields: Profile fields to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getRequests(string $access_token, array $params = array()) { - return $this->request->post('groups.getRequests', $access_token, $params); - } + /** + * Returns online status of community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamGroupIdException Invalid group id + * @return mixed + */ + public function getOnlineStatus($access_token, array $params = []) { + return $this->request->post('groups.getOnlineStatus', $access_token, $params); + } - /** - * Returns community settings. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSettings(string $access_token, array $params = array()) { - return $this->request->post('groups.getSettings', $access_token, $params); - } + /** + * Returns a list of requests to the community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer offset: Offset needed to return a specific subset of results. + * - @var integer count: Number of results to return. + * - @var array[GroupsFields] fields: Profile fields to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getRequests($access_token, array $params = []) { + return $this->request->post('groups.getRequests', $access_token, $params); + } - /** - * List of group's tags - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getTagList(string $access_token, array $params = array()) { - return $this->request->post('groups.getTagList', $access_token, $params); - } + /** + * Returns community settings. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getSettings($access_token, array $params = []) { + return $this->request->post('groups.getSettings', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getTokenPermissions(string $access_token, array $params = array()) { - return $this->request->post('groups.getTokenPermissions', $access_token, $params); - } + /** + * Returns list of community tags. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getTagList($access_token, array $params = []) { + return $this->request->post('groups.getTagList', $access_token, $params); + } - /** - * Allows to invite friends to the community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer user_id: User ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function invite(string $access_token, array $params = array()) { - return $this->request->post('groups.invite', $access_token, $params); - } + /** + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getTokenPermissions($access_token) { + return $this->request->post('groups.getTokenPermissions', $access_token); + } - /** - * Returns information specifying whether a user is a member of a community. - * - * @param $access_token string - * @param $params array - * - string group_id: ID or screen name of the community. - * - integer user_id: User ID. - * - array user_ids: User IDs. - * - boolean extended: '1' — to return an extended response with additional fields. By default: '0'. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function isMember(string $access_token, array $params = array()) { - return $this->request->post('groups.isMember', $access_token, $params); - } + /** + * Allows to invite friends to the community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer user_id: User ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @return mixed + */ + public function invite($access_token, array $params = []) { + return $this->request->post('groups.invite', $access_token, $params); + } - /** - * With this method you can join the group or public page, and also confirm your participation in an event. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID or screen name of the community. - * - string not_sure: Optional parameter which is taken into account when 'gid' belongs to the event: '1' - * — Perhaps I will attend, '0' — I will be there for sure (default), , - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function join(string $access_token, array $params = array()) { - return $this->request->post('groups.join', $access_token, $params); - } + /** + * Returns information specifying whether a user is a member of a community. + * + * @param string $access_token + * @param array $params + * - @var string group_id: ID or screen name of the community. + * - @var integer user_id: User ID. + * - @var array[integer] user_ids: User IDs. + * - @var boolean extended: '1' — to return an extended response with additional fields. By default: '0'. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function isMember($access_token, array $params = []) { + return $this->request->post('groups.isMember', $access_token, $params); + } - /** - * With this method you can leave a group, public page, or event. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID or screen name of the community. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function leave(string $access_token, array $params = array()) { - return $this->request->post('groups.leave', $access_token, $params); - } + /** + * With this method you can join the group or public page, and also confirm your participation in an event. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID or screen name of the community. + * - @var string not_sure: Optional parameter which is taken into account when 'gid' belongs to the event: '1' — Perhaps I will attend, '0' — I will be there for sure (default), , + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @return mixed + */ + public function join($access_token, array $params = []) { + return $this->request->post('groups.join', $access_token, $params); + } - /** - * Removes a user from the community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer user_id: User ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function removeUser(string $access_token, array $params = array()) { - return $this->request->post('groups.removeUser', $access_token, $params); - } + /** + * With this method you can leave a group, public page, or event. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID or screen name of the community. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function leave($access_token, array $params = []) { + return $this->request->post('groups.leave', $access_token, $params); + } - /** - * Allows to reorder links in the community. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer link_id: Link ID. - * - integer after: ID of the link after which to place the link with 'link_id'. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function reorderLink(string $access_token, array $params = array()) { - return $this->request->post('groups.reorderLink', $access_token, $params); - } + /** + * Removes a user from the community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer user_id: User ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function removeUser($access_token, array $params = []) { + return $this->request->post('groups.removeUser', $access_token, $params); + } - /** - * Returns a list of communities matching the search criteria. - * - * @param $access_token string - * @param $params array - * - string q: Search query string. - * - GroupsSearchType type: Community type. Possible values: 'group, page, event.' - * @see GroupsSearchType - * - integer country_id: Country ID. - * - integer city_id: City ID. If this parameter is transmitted, country_id is ignored. - * - boolean future: '1' — to return only upcoming events. Works with the 'type' = 'event' only. - * - boolean market: '1' — to return communities with enabled market only. - * - GroupsSearchSort sort: Sort order. Possible values: *'0' — default sorting (similar the full - * version of the site),, *'1' — by growth speed,, *'2'— by the "day attendance/members number" ratio,, - * *'3' — by the "Likes number/members number" ratio,, *'4' — by the "comments number/members number" - * ratio,, *'5' — by the "boards entries number/members number" ratio. - * @see GroupsSearchSort - * - integer offset: Offset needed to return a specific subset of results. - * - integer count: Number of communities to return. "Note that you can not receive more than first - * thousand of results, regardless of 'count' and 'offset' values." - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('groups.search', $access_token, $params); - } + /** + * Allows to reorder links in the community. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer link_id: Link ID. + * - @var integer after: ID of the link after which to place the link with 'link_id'. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function reorderLink($access_token, array $params = []) { + return $this->request->post('groups.reorderLink', $access_token, $params); + } - /** - * Allow to set notifications settings for group. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer server_id: Server ID. - * - string api_version: - * - boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). - * - boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). - * - boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). - * - boolean message_edit: - * - boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). - * - boolean message_typing_state: - * - boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). - * - boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). - * - boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). - * - boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). - * - boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). - * - boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). - * - boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). - * - boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). - * - boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). - * - boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). - * - boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). - * - boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). - * - boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). - * - boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). - * - boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). - * - boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). - * - boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). - * - boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). - * - boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). - * - boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). - * - boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). - * - boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — - * enabled). - * - boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). - * - boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). - * - boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — - * enabled). - * - boolean market_order_new: - * - boolean market_order_edit: - * - boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). - * - boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). - * - boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). - * - boolean group_change_settings: - * - boolean group_change_photo: - * - boolean group_officers_edit: - * - boolean user_block: User added to community blacklist - * - boolean user_unblock: User removed from community blacklist - * - boolean lead_forms_new: New form in lead forms - * - boolean like_add: - * - boolean like_remove: - * - boolean message_event: - * - boolean donut_subscription_create: - * - boolean donut_subscription_prolonged: - * - boolean donut_subscription_cancelled: - * - boolean donut_subscription_price_changed: - * - boolean donut_subscription_expired: - * - boolean donut_money_withdraw: - * - boolean donut_money_withdraw_error: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function setCallbackSettings(string $access_token, array $params = array()) { - return $this->request->post('groups.setCallbackSettings', $access_token, $params); - } + /** + * Returns a list of communities matching the search criteria. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query string. + * - @var GroupsType type: Community type. Possible values: 'group, page, event.' + * - @var integer country_id: Country ID. + * - @var integer city_id: City ID. If this parameter is transmitted, country_id is ignored. + * - @var boolean future: '1' — to return only upcoming events. Works with the 'type' = 'event' only. + * - @var boolean market: '1' — to return communities with enabled market only. + * - @var GroupsSort sort: Sort order. Possible values: *'0' — default sorting (similar the full version of the site),, *'1' — by growth speed,, *'2'— by the "day attendance/members number" ratio,, *'3' — by the "Likes number/members number" ratio,, *'4' — by the "comments number/members number" ratio,, *'5' — by the "boards entries number/members number" ratio. + * - @var integer offset: Offset needed to return a specific subset of results. + * - @var integer count: Number of communities to return. "Note that you can not receive more than first thousand of results, regardless of 'count' and 'offset' values." + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('groups.search', $access_token, $params); + } - /** - * Sets Long Poll notification settings - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - boolean enabled: Sets whether Long Poll is enabled ('0' — disabled, '1' — enabled). - * - string api_version: - * - boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). - * - boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). - * - boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). - * - boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). - * - boolean message_edit: A message has been edited ('0' — disabled, '1' — enabled). - * - boolean message_typing_state: - * - boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). - * - boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). - * - boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). - * - boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). - * - boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). - * - boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). - * - boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). - * - boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). - * - boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). - * - boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). - * - boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). - * - boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). - * - boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). - * - boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). - * - boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). - * - boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). - * - boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). - * - boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). - * - boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). - * - boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). - * - boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). - * - boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — - * enabled). - * - boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). - * - boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). - * - boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — - * enabled). - * - boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). - * - boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). - * - boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). - * - boolean group_change_settings: - * - boolean group_change_photo: - * - boolean group_officers_edit: - * - boolean user_block: User added to community blacklist - * - boolean user_unblock: User removed from community blacklist - * - boolean like_add: - * - boolean like_remove: - * - boolean message_event: - * - boolean donut_subscription_create: - * - boolean donut_subscription_prolonged: - * - boolean donut_subscription_cancelled: - * - boolean donut_subscription_price_changed: - * - boolean donut_subscription_expired: - * - boolean donut_money_withdraw: - * - boolean donut_money_withdraw_error: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function setLongPollSettings(string $access_token, array $params = array()) { - return $this->request->post('groups.setLongPollSettings', $access_token, $params); - } + /** + * Allow to set notifications settings for group. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer server_id: Server ID. + * - @var string api_version + * - @var boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). + * - @var boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). + * - @var boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). + * - @var boolean message_edit + * - @var boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). + * - @var boolean message_typing_state + * - @var boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). + * - @var boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). + * - @var boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). + * - @var boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). + * - @var boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). + * - @var boolean group_change_settings + * - @var boolean group_change_photo + * - @var boolean group_officers_edit + * - @var boolean user_block: User added to community blacklist + * - @var boolean user_unblock: User removed from community blacklist + * - @var boolean lead_forms_new: New form in lead forms + * @throws VKClientException + * @throws VKApiException + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function setCallbackSettings($access_token, array $params = []) { + return $this->request->post('groups.setCallbackSettings', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - boolean messages: - * - boolean bots_capabilities: - * - boolean bots_start_button: - * - boolean bots_add_to_chat: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function setSettings(string $access_token, array $params = array()) { - return $this->request->post('groups.setSettings', $access_token, $params); - } + /** + * Sets Long Poll notification settings + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var boolean enabled: Sets whether Long Poll is enabled ('0' — disabled, '1' — enabled). + * - @var string api_version + * - @var boolean message_new: A new incoming message has been received ('0' — disabled, '1' — enabled). + * - @var boolean message_reply: A new outcoming message has been received ('0' — disabled, '1' — enabled). + * - @var boolean message_allow: Allowed messages notifications ('0' — disabled, '1' — enabled). + * - @var boolean message_deny: Denied messages notifications ('0' — disabled, '1' — enabled). + * - @var boolean message_edit: A message has been edited ('0' — disabled, '1' — enabled). + * - @var boolean message_typing_state + * - @var boolean photo_new: New photos notifications ('0' — disabled, '1' — enabled). + * - @var boolean audio_new: New audios notifications ('0' — disabled, '1' — enabled). + * - @var boolean video_new: New videos notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_new: New wall replies notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_edit: Wall replies edited notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_delete: A wall comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean wall_reply_restore: A wall comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean wall_post_new: New wall posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean wall_repost: New wall posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_new: New board posts notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_edit: Board posts edited notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_restore: Board posts restored notifications ('0' — disabled, '1' — enabled). + * - @var boolean board_post_delete: Board posts deleted notifications ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_new: New comment to photo notifications ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_edit: A photo comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_delete: A photo comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean photo_comment_restore: A photo comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_new: New comment to video notifications ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_edit: A video comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_delete: A video comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean video_comment_restore: A video comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_new: New comment to market item notifications ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_edit: A market comment has been edited ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_delete: A market comment has been deleted ('0' — disabled, '1' — enabled). + * - @var boolean market_comment_restore: A market comment has been restored ('0' — disabled, '1' — enabled). + * - @var boolean poll_vote_new: A vote in a public poll has been added ('0' — disabled, '1' — enabled). + * - @var boolean group_join: Joined community notifications ('0' — disabled, '1' — enabled). + * - @var boolean group_leave: Left community notifications ('0' — disabled, '1' — enabled). + * - @var boolean group_change_settings + * - @var boolean group_change_photo + * - @var boolean group_officers_edit + * - @var boolean user_block: User added to community blacklist + * - @var boolean user_unblock: User removed from community blacklist + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setLongPollSettings($access_token, array $params = []) { + return $this->request->post('groups.setLongPollSettings', $access_token, $params); + } - /** - * In order to save note about group participant - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer user_id: - * - string note: Note body - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function setUserNote(string $access_token, array $params = array()) { - return $this->request->post('groups.setUserNote', $access_token, $params); - } + /** + * Sets community settings + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var boolean messages: Sets whether messages is enabled ('0' — disabled, '1' — enabled). + * - @var boolean bots_capabilities: Sets whether bots capabilities is enabled ('0' — disabled, '1' — enabled). + * - @var boolean bots_start_button: Start button ('0' — disabled, '1' — enabled). + * - @var boolean bots_add_to_chat: Users can add bots to conversations ('0' — disabled, '1' — enabled). + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setSettings($access_token, array $params = []) { + return $this->request->post('groups.setSettings', $access_token, $params); + } - /** - * Add new group's tag - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - string tag_name: - * - GroupsTagAddTagColor tag_color: - * @see GroupsTagAddTagColor - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function tagAdd(string $access_token, array $params = array()) { - return $this->request->post('groups.tagAdd', $access_token, $params); - } + /** + * Set or update user note + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer user_id: User ID. + * - @var string note: Note text. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setUserNote($access_token, array $params = []) { + return $this->request->post('groups.setUserNote', $access_token, $params); + } - /** - * Bind or unbind group's tag to user - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer tag_id: - * - integer user_id: - * - GroupsTagBindAct act: Describe the action - * @see GroupsTagBindAct - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function tagBind(string $access_token, array $params = array()) { - return $this->request->post('groups.tagBind', $access_token, $params); - } + /** + * Add new tag to community + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var string tag_name: Name of tag. + * - @var string tag_color: Color of tag. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function tagAdd($access_token, array $params = []) { + return $this->request->post('groups.tagAdd', $access_token, $params); + } - /** - * Delete group's tag - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer tag_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function tagDelete(string $access_token, array $params = array()) { - return $this->request->post('groups.tagDelete', $access_token, $params); - } + /** + * Bind and unbind community's tags to conversations. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer tag_id: Tag ID. + * - @var integer user_id: User ID. + * - @var string act: Tag Action. Values: *'bind',, *'unbind' + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function tagBind($access_token, array $params = []) { + return $this->request->post('groups.tagBind', $access_token, $params); + } - /** - * Update group's tag - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer tag_id: - * - string tag_name: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function tagUpdate(string $access_token, array $params = array()) { - return $this->request->post('groups.tagUpdate', $access_token, $params); - } + /** + * Delete tag of community + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer tag_id: Tag ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function tagDelete($access_token, array $params = []) { + return $this->request->post('groups.tagDelete', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - GroupsToggleMarketState state: - * @see GroupsToggleMarketState - * - string ref: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function toggleMarket(string $access_token, array $params = array()) { - return $this->request->post('groups.toggleMarket', $access_token, $params); - } + /** + * Update tag of community + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer tag_id: Tag ID. + * - @var string tag_name: Tag Name. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function tagUpdate($access_token, array $params = []) { + return $this->request->post('groups.tagUpdate', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer owner_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function unban(string $access_token, array $params = array()) { - return $this->request->post('groups.unban', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer group_id + * - @var integer owner_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function unban($access_token, array $params = []) { + return $this->request->post('groups.unban', $access_token, $params); + } } diff --git a/src/VK/Actions/Leads.php b/src/VK/Actions/Leads.php new file mode 100644 index 0000000..6d9ab2e --- /dev/null +++ b/src/VK/Actions/Leads.php @@ -0,0 +1,137 @@ +request = $request; + } + + /** + * Checks if the user can start the lead. + * + * @param string $access_token + * @param array $params + * - @var integer lead_id: Lead ID. + * - @var integer test_result: Value to be return in 'result' field when test mode is used. + * - @var boolean test_mode + * - @var boolean auto_start + * - @var integer age: User age. + * - @var string country: User country code. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiActionFailedException Unable to process action + * @return mixed + */ + public function checkUser($access_token, array $params = []) { + return $this->request->post('leads.checkUser', $access_token, $params); + } + + /** + * Completes the lead started by user. + * + * @param string $access_token + * @param array $params + * - @var string vk_sid: Session obtained as GET parameter when session started. + * - @var string secret: Secret key from the lead testing interface. + * - @var string comment: Comment text. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @throws VKApiVotesException Not enough votes + * @return mixed + */ + public function complete($access_token, array $params = []) { + return $this->request->post('leads.complete', $access_token, $params); + } + + /** + * Returns lead stats data. + * + * @param string $access_token + * @param array $params + * - @var integer lead_id: Lead ID. + * - @var string secret: Secret key obtained from the lead testing interface. + * - @var string date_start: Day to start stats from (YYYY_MM_DD, e.g.2011-09-17). + * - @var string date_end: Day to finish stats (YYYY_MM_DD, e.g.2011-09-17). + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getStats($access_token, array $params = []) { + return $this->request->post('leads.getStats', $access_token, $params); + } + + /** + * Returns a list of last user actions for the offer. + * + * @param string $access_token + * @param array $params + * - @var integer offer_id: Offer ID. + * - @var string secret: Secret key obtained in the lead testing interface. + * - @var integer offset: Offset needed to return a specific subset of results. + * - @var integer count: Number of results to return. + * - @var LeadsStatus status: Action type. Possible values: *'0' — start,, *'1' — finish,, *'2' — blocking users,, *'3' — start in a test mode,, *'4' — finish in a test mode. + * - @var boolean reverse: Sort order. Possible values: *'1' — chronological,, *'0' — reverse chronological. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getUsers($access_token, array $params = []) { + return $this->request->post('leads.getUsers', $access_token, $params); + } + + /** + * Counts the metric event. + * + * @param string $access_token + * @param array $params + * - @var string data: Metric data obtained in the lead interface. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function metricHit($access_token, array $params = []) { + return $this->request->post('leads.metricHit', $access_token, $params); + } + + /** + * Creates new session for the user passing the offer. + * + * @param string $access_token + * @param array $params + * - @var integer lead_id: Lead ID. + * - @var string secret: Secret key from the lead testing interface. + * - @var integer uid + * - @var integer aid + * - @var boolean test_mode + * - @var boolean force + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @return mixed + */ + public function start($access_token, array $params = []) { + return $this->request->post('leads.start', $access_token, $params); + } +} diff --git a/src/VK/Actions/Likes.php b/src/VK/Actions/Likes.php index edbd3b2..5f80230 100644 --- a/src/VK/Actions/Likes.php +++ b/src/VK/Actions/Likes.php @@ -1,134 +1,101 @@ request = $request; - } + /** + * Likes constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Adds the specified object to the 'Likes' list of the current user. - * - * @param $access_token string - * @param $params array - * - string type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall - * post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment - * on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, - * 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed - * - integer owner_id: ID of the user or community that owns the object. - * - integer item_id: Object ID. - * - string access_key: Access key required for an object owned by a private entity. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function add(string $access_token, array $params = array()) { - return $this->request->post('likes.add', $access_token, $params); - } + /** + * Adds the specified object to the 'Likes' list of the current user. + * + * @param string $access_token + * @param array $params + * - @var LikesType type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed + * - @var integer owner_id: ID of the user or community that owns the object. + * - @var integer item_id: Object ID. + * - @var string access_key: Access key required for an object owned by a private entity. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function add($access_token, array $params = []) { + return $this->request->post('likes.add', $access_token, $params); + } - /** - * Deletes the specified object from the 'Likes' list of the current user. - * - * @param $access_token string - * @param $params array - * - string type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall - * post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment - * on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, - * 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed - * - integer owner_id: ID of the user or community that owns the object. - * - integer item_id: Object ID. - * - string access_key: Access key required for an object owned by a private entity. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('likes.delete', $access_token, $params); - } + /** + * Deletes the specified object from the 'Likes' list of the current user. + * + * @param string $access_token + * @param array $params + * - @var LikesType type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed + * - @var integer owner_id: ID of the user or community that owns the object. + * - @var integer item_id: Object ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('likes.delete', $access_token, $params); + } - /** - * Returns a list of IDs of users who added the specified object to their 'Likes' list. - * - * @param $access_token string - * @param $params array - * - string type: , Object type: 'post' — post on user or community wall, 'comment' — comment on a - * wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — - * comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the - * discussion, 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed - * - integer owner_id: ID of the user, community, or application that owns the object. If the 'type' - * parameter is set as 'sitepage', the application ID is passed as 'owner_id'. Use negative value for a - * community id. If the 'type' parameter is not set, the 'owner_id' is assumed to be either the current user or - * the same application ID as if the 'type' parameter was set to 'sitepage'. - * - integer item_id: Object ID. If 'type' is set as 'sitepage', 'item_id' can include the 'page_id' - * parameter value used during initialization of the [vk.com/dev/Like|Like widget]. - * - string page_url: URL of the page where the [vk.com/dev/Like|Like widget] is installed. Used instead - * of the 'item_id' parameter. - * - LikesGetListFilter filter: Filters to apply: 'likes' — returns information about all users who - * liked the object (default), 'copies' — returns information only about users who told their friends about - * the object - * @see LikesGetListFilter - * - LikesGetListFriendsOnly friends_only: Specifies which users are returned: '1' — to return only the - * current user's friends, '0' — to return all users (default) - * @see LikesGetListFriendsOnly - * - boolean extended: Specifies whether extended information will be returned. '1' — to return extended - * information about users and communities from the 'Likes' list, '0' — to return no additional information - * (default) - * - integer offset: Offset needed to select a specific subset of users. - * - integer count: Number of user IDs to return (maximum '1000'). Default is '100' if 'friends_only' is - * set to '0', otherwise, the default is '10' if 'friends_only' is set to '1'. - * - boolean skip_own: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getList(string $access_token, array $params = array()) { - return $this->request->post('likes.getList', $access_token, $params); - } + /** + * Returns a list of IDs of users who added the specified object to their 'Likes' list. + * + * @param string $access_token + * @param array $params + * - @var LikesType type: , Object type: 'post' — post on user or community wall, 'comment' — comment on a wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion, 'sitepage' — page of the site where the [vk.com/dev/Like|Like widget] is installed + * - @var integer owner_id: ID of the user, community, or application that owns the object. If the 'type' parameter is set as 'sitepage', the application ID is passed as 'owner_id'. Use negative value for a community id. If the 'type' parameter is not set, the 'owner_id' is assumed to be either the current user or the same application ID as if the 'type' parameter was set to 'sitepage'. + * - @var integer item_id: Object ID. If 'type' is set as 'sitepage', 'item_id' can include the 'page_id' parameter value used during initialization of the [vk.com/dev/Like|Like widget]. + * - @var string page_url: URL of the page where the [vk.com/dev/Like|Like widget] is installed. Used instead of the 'item_id' parameter. + * - @var LikesFilter filter: Filters to apply: 'likes' — returns information about all users who liked the object (default), 'copies' — returns information only about users who told their friends about the object + * - @var LikesFriendsOnly friends_only: Specifies which users are returned: '1' — to return only the current user's friends, '0' — to return all users (default) + * - @var boolean extended: Specifies whether extended information will be returned. '1' — to return extended information about users and communities from the 'Likes' list, '0' — to return no additional information (default) + * - @var integer offset: Offset needed to select a specific subset of users. + * - @var integer count: Number of user IDs to return (maximum '1000'). Default is '100' if 'friends_only' is set to '0', otherwise, the default is '10' if 'friends_only' is set to '1'. + * - @var boolean skip_own + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getList($access_token, array $params = []) { + return $this->request->post('likes.getList', $access_token, $params); + } - /** - * Checks for the object in the 'Likes' list of the specified user. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - string type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall - * post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment - * on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion - * - integer owner_id: ID of the user or community that owns the object. - * - integer item_id: Object ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function isLiked(string $access_token, array $params = array()) { - return $this->request->post('likes.isLiked', $access_token, $params); - } + /** + * Checks for the object in the 'Likes' list of the specified user. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var LikesType type: Object type: 'post' — post on user or community wall, 'comment' — comment on a wall post, 'photo' — photo, 'audio' — audio, 'video' — video, 'note' — note, 'photo_comment' — comment on the photo, 'video_comment' — comment on the video, 'topic_comment' — comment in the discussion + * - @var integer owner_id: ID of the user or community that owns the object. + * - @var integer item_id: Object ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function isLiked($access_token, array $params = []) { + return $this->request->post('likes.isLiked', $access_token, $params); + } } diff --git a/src/VK/Actions/Market.php b/src/VK/Actions/Market.php index 9191699..b3f403c 100644 --- a/src/VK/Actions/Market.php +++ b/src/VK/Actions/Market.php @@ -1,684 +1,482 @@ request = $request; - } - - /** - * Ads a new item to the market. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - string name: Item name. - * - string description: Item description. - * - integer category_id: Item category ID. - * - number price: Item price. - * - number old_price: - * - boolean deleted: Item status ('1' — deleted, '0' — not deleted). - * - integer main_photo_id: Cover photo ID. - * - array photo_ids: IDs of additional photos. - * - string url: Url for button in market item. - * - integer dimension_width: - * - integer dimension_height: - * - integer dimension_length: - * - integer weight: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function add(string $access_token, array $params = array()) { - return $this->request->post('market.add', $access_token, $params); - } - - /** - * Creates new collection of items - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - string title: Collection title. - * - integer photo_id: Cover photo ID. - * - boolean main_album: Set as main ('1' - set, '0' - no). - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function addAlbum(string $access_token, array $params = array()) { - return $this->request->post('market.addAlbum', $access_token, $params); - } - - /** - * Adds an item to one or multiple collections. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer item_id: Item ID. - * - array album_ids: Collections IDs to add item to. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function addToAlbum(string $access_token, array $params = array()) { - return $this->request->post('market.addToAlbum', $access_token, $params); - } - - /** - * Creates a new comment for an item. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer item_id: Item ID. - * - string message: Comment text (required if 'attachments' parameter is not specified) - * - array attachments: Comma-separated list of objects attached to a comment. The field is submitted the - * following way: , "'_,_'", , '' - media attachment type: "'photo' - - * photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - - * media attachment id, , For example: "photo100172_166443618,photo66748_265827614", - * - boolean from_group: '1' - comment will be published on behalf of a community, '0' - on behalf of a - * user (by default). - * - integer reply_to_comment: ID of a comment to reply with current comment to. - * - integer sticker_id: Sticker ID. - * - string guid: Random value to avoid resending one comment. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function createComment(string $access_token, array $params = array()) { - return $this->request->post('market.createComment', $access_token, $params); - } - - /** - * Deletes an item. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer item_id: Item ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('market.delete', $access_token, $params); - } - - /** - * Deletes a collection of items. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an collection owner community. - * - integer album_id: Collection ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function deleteAlbum(string $access_token, array $params = array()) { - return $this->request->post('market.deleteAlbum', $access_token, $params); - } - - /** - * Deletes an item's comment - * - * @param $access_token string - * @param $params array - * - integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' - * parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community - * " - * - integer comment_id: comment id - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteComment(string $access_token, array $params = array()) { - return $this->request->post('market.deleteComment', $access_token, $params); - } - - /** - * Edits an item. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer item_id: Item ID. - * - string name: Item name. - * - string description: Item description. - * - integer category_id: Item category ID. - * - number price: Item price. - * - boolean deleted: Item status ('1' — deleted, '0' — not deleted). - * - integer main_photo_id: Cover photo ID. - * - array photo_ids: IDs of additional photos. - * - string url: Url for button in market item. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('market.edit', $access_token, $params); - } - - /** - * Edits a collection of items - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an collection owner community. - * - integer album_id: Collection ID. - * - string title: Collection title. - * - integer photo_id: Cover photo id - * - boolean main_album: Set as main ('1' - set, '0' - no). - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function editAlbum(string $access_token, array $params = array()) { - return $this->request->post('market.editAlbum', $access_token, $params); - } - - /** - * Chages item comment's text - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer comment_id: Comment ID. - * - string message: New comment text (required if 'attachments' are not specified), , 2048 symbols - * maximum. - * - array attachments: Comma-separated list of objects attached to a comment. The field is submitted the - * following way: , "'_,_'", , '' - media attachment type: "'photo' - - * photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - - * media attachment id, , For example: "photo100172_166443618,photo66748_265827614", - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function editComment(string $access_token, array $params = array()) { - return $this->request->post('market.editComment', $access_token, $params); - } - - /** - * Edit order - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer order_id: - * - string merchant_comment: - * - integer status: - * - string track_number: - * - MarketEditOrderPaymentStatus payment_status: - * @see MarketEditOrderPaymentStatus - * - integer delivery_price: - * - integer width: - * - integer length: - * - integer height: - * - integer weight: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function editOrder(string $access_token, array $params = array()) { - return $this->request->post('market.editOrder', $access_token, $params); - } - - /** - * Returns items list for a community. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community, "Note that community id in the 'owner_id' parameter - * should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " - * - integer album_id: - * - integer count: Number of items to return. - * - integer offset: Offset needed to return a specific subset of results. - * - boolean extended: '1' - method will return additional fields: 'likes, can_comment, car_repost, - * photos'. These parameters are not returned by default. - * - string date_from: Items update date from (format: yyyy-mm-dd) - * - string date_to: Items update date to (format: yyyy-mm-dd) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('market.get', $access_token, $params); - } - - /** - * Returns items album's data - * - * @param $access_token string - * @param $params array - * - integer owner_id: identifier of an album owner community, "Note that community id in the 'owner_id' - * parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community - * " - * - array album_ids: collections identifiers to obtain data from - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAlbumById(string $access_token, array $params = array()) { - return $this->request->post('market.getAlbumById', $access_token, $params); - } - - /** - * Returns community's market collections list. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an items owner community. - * - integer offset: Offset needed to return a specific subset of results. - * - integer count: Number of items to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAlbums(string $access_token, array $params = array()) { - return $this->request->post('market.getAlbums', $access_token, $params); - } - - /** - * Returns information about market items by their ids. - * - * @param $access_token string - * @param $params array - * - array item_ids: Comma-separated ids list: {user id}_{item id}. If an item belongs to a community - * -{community id} is used. " 'Videos' value example: , '-4363_136089719,13245770_137352259'" - * - boolean extended: '1' - to return additional fields: 'likes, can_comment, car_repost, photos'. By - * default: '0'. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('market.getById', $access_token, $params); - } - - /** - * Returns a list of market categories. - * - * @param $access_token string - * @param $params array - * - integer count: Number of results to return. - * - integer offset: Offset needed to return a specific subset of results. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getCategories(string $access_token, array $params = array()) { - return $this->request->post('market.getCategories', $access_token, $params); - } - - /** - * Returns comments list for an item. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community - * - integer item_id: Item ID. - * - boolean need_likes: '1' — to return likes info. - * - integer start_comment_id: ID of a comment to start a list from (details below). - * - integer offset: - * - integer count: Number of results to return. - * - MarketGetCommentsSort sort: Sort order ('asc' — from old to new, 'desc' — from new to old) - * @see MarketGetCommentsSort - * - boolean extended: '1' — comments will be returned as numbered objects, in addition lists of - * 'profiles' and 'groups' objects will be returned. - * - array fields: List of additional profile fields to return. See the [vk.com/dev/fields|details] - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getComments(string $access_token, array $params = array()) { - return $this->request->post('market.getComments', $access_token, $params); - } - - /** - * Get market orders - * - * @param $access_token string - * @param $params array - * - integer group_id: - * - integer offset: - * - integer count: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getGroupOrders(string $access_token, array $params = array()) { - return $this->request->post('market.getGroupOrders', $access_token, $params); - } - - /** - * Get order - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer order_id: - * - boolean extended: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getOrderById(string $access_token, array $params = array()) { - return $this->request->post('market.getOrderById', $access_token, $params); - } - - /** - * Get market items in the order - * - * @param $access_token string - * @param $params array - * - integer order_id: - * - integer offset: - * - integer count: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getOrderItems(string $access_token, array $params = array()) { - return $this->request->post('market.getOrderItems', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer offset: - * - integer count: - * - boolean extended: - * - string date_from: Orders status updated date from (format: yyyy-mm-dd) - * - string date_to: Orders status updated date to (format: yyyy-mm-dd) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getOrders(string $access_token, array $params = array()) { - return $this->request->post('market.getOrders', $access_token, $params); - } - - /** - * Removes an item from one or multiple collections. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer item_id: Item ID. - * - array album_ids: Collections IDs to remove item from. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function removeFromAlbum(string $access_token, array $params = array()) { - return $this->request->post('market.removeFromAlbum', $access_token, $params); - } - - /** - * Reorders the collections list. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer album_id: Collection ID. - * - integer before: ID of a collection to place current collection before it. - * - integer after: ID of a collection to place current collection after it. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function reorderAlbums(string $access_token, array $params = array()) { - return $this->request->post('market.reorderAlbums', $access_token, $params); - } - - /** - * Changes item place in a collection. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer album_id: ID of a collection to reorder items in. Set 0 to reorder full items list. - * - integer item_id: Item ID. - * - integer before: ID of an item to place current item before it. - * - integer after: ID of an item to place current item after it. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function reorderItems(string $access_token, array $params = array()) { - return $this->request->post('market.reorderItems', $access_token, $params); - } - - /** - * Sends a complaint to the item. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer item_id: Item ID. - * - MarketReportReason reason: Complaint reason. Possible values: *'0' — spam,, *'1' — child porn,, - * *'2' — extremism,, *'3' — violence,, *'4' — drugs propaganda,, *'5' — adult materials,, *'6' — - * insult. - * @see MarketReportReason - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function report(string $access_token, array $params = array()) { - return $this->request->post('market.report', $access_token, $params); - } - - /** - * Sends a complaint to the item's comment. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer comment_id: Comment ID. - * - MarketReportCommentReason reason: Complaint reason. Possible values: *'0' — spam,, *'1' — child - * porn,, *'2' — extremism,, *'3' — violence,, *'4' — drugs propaganda,, *'5' — adult materials,, *'6' - * — insult. - * @see MarketReportCommentReason - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function reportComment(string $access_token, array $params = array()) { - return $this->request->post('market.reportComment', $access_token, $params); - } - - /** - * Restores recently deleted item - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an item owner community. - * - integer item_id: Deleted item ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function restore(string $access_token, array $params = array()) { - return $this->request->post('market.restore', $access_token, $params); - } - - /** - * Restores a recently deleted comment - * - * @param $access_token string - * @param $params array - * - integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' - * parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community - * " - * - integer comment_id: deleted comment id - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function restoreComment(string $access_token, array $params = array()) { - return $this->request->post('market.restoreComment', $access_token, $params); - } - - /** - * Searches market items in a community's catalog - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of an items owner community. - * - integer album_id: - * - string q: Search query, for example "pink slippers". - * - integer price_from: Minimum item price value. - * - integer price_to: Maximum item price value. - * - MarketSearchSort sort: - * @see MarketSearchSort - * - MarketSearchRev rev: '0' — do not use reverse order, '1' — use reverse order - * @see MarketSearchRev - * - integer offset: Offset needed to return a specific subset of results. - * - integer count: Number of items to return. - * - boolean extended: '1' - to return additional fields: 'likes, can_comment, car_repost, photos'. By - * default: '0'. - * - MarketSearchStatus status: - * @see MarketSearchStatus - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('market.search', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Market constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Ads a new item to the market. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var string name: Item name. + * - @var string description: Item description. + * - @var integer category_id: Item category ID. + * - @var number price: Item price. + * - @var number old_price + * - @var boolean deleted: Item status ('1' — deleted, '0' — not deleted). + * - @var integer main_photo_id: Cover photo ID. + * - @var array[integer] photo_ids: IDs of additional photos. + * - @var string url: Url for button in market item. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessMarketException Access denied + * @throws VKApiMarketTooManyItemsException Too many items + * @throws VKApiMarketItemHasBadLinksException Item has bad links in description + * @return mixed + */ + public function add($access_token, array $params = []) { + return $this->request->post('market.add', $access_token, $params); + } + + /** + * Creates new collection of items + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var string title: Collection title. + * - @var integer photo_id: Cover photo ID. + * - @var boolean main_album: Set as main ('1' – set, '0' – no). + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMarketTooManyAlbumsException Too many albums + * @return mixed + */ + public function addAlbum($access_token, array $params = []) { + return $this->request->post('market.addAlbum', $access_token, $params); + } + + /** + * Adds an item to one or multiple collections. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer item_id: Item ID. + * - @var array[integer] album_ids: Collections IDs to add item to. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMarketAlbumNotFoundException Album not found + * @throws VKApiMarketItemNotFoundException Item not found + * @throws VKApiMarketTooManyItemsInAlbumException Too many items in album + * @throws VKApiMarketItemAlreadyAddedException Item already added to album + * @return mixed + */ + public function addToAlbum($access_token, array $params = []) { + return $this->request->post('market.addToAlbum', $access_token, $params); + } + + /** + * Creates a new comment for an item. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer item_id: Item ID. + * - @var string message: Comment text (required if 'attachments' parameter is not specified) + * - @var array[string] attachments: Comma-separated list of objects attached to a comment. The field is submitted the following way: , "'_,_'", , '' - media attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - media attachment id, , For example: "photo100172_166443618,photo66748_265827614", + * - @var boolean from_group: '1' - comment will be published on behalf of a community, '0' - on behalf of a user (by default). + * - @var integer reply_to_comment: ID of a comment to reply with current comment to. + * - @var integer sticker_id: Sticker ID. + * - @var string guid: Random value to avoid resending one comment. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function createComment($access_token, array $params = []) { + return $this->request->post('market.createComment', $access_token, $params); + } + + /** + * Deletes an item. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer item_id: Item ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessMarketException Access denied + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('market.delete', $access_token, $params); + } + + /** + * Deletes a collection of items. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an collection owner community. + * - @var integer album_id: Collection ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMarketAlbumNotFoundException Album not found + * @return mixed + */ + public function deleteAlbum($access_token, array $params = []) { + return $this->request->post('market.deleteAlbum', $access_token, $params); + } + + /** + * Deletes an item's comment + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " + * - @var integer comment_id: comment id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteComment($access_token, array $params = []) { + return $this->request->post('market.deleteComment', $access_token, $params); + } + + /** + * Edits an item. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer item_id: Item ID. + * - @var string name: Item name. + * - @var string description: Item description. + * - @var integer category_id: Item category ID. + * - @var number price: Item price. + * - @var boolean deleted: Item status ('1' — deleted, '0' — not deleted). + * - @var integer main_photo_id: Cover photo ID. + * - @var array[integer] photo_ids: IDs of additional photos. + * - @var string url: Url for button in market item. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessMarketException Access denied + * @throws VKApiMarketItemNotFoundException Item not found + * @throws VKApiMarketItemHasBadLinksException Item has bad links in description + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('market.edit', $access_token, $params); + } + + /** + * Edits a collection of items + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an collection owner community. + * - @var integer album_id: Collection ID. + * - @var string title: Collection title. + * - @var integer photo_id: Cover photo id + * - @var boolean main_album: Set as main ('1' – set, '0' – no). + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMarketAlbumNotFoundException Album not found + * @return mixed + */ + public function editAlbum($access_token, array $params = []) { + return $this->request->post('market.editAlbum', $access_token, $params); + } + + /** + * Chages item comment's text + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer comment_id: Comment ID. + * - @var string message: New comment text (required if 'attachments' are not specified), , 2048 symbols maximum. + * - @var array[string] attachments: Comma-separated list of objects attached to a comment. The field is submitted the following way: , "'_,_'", , '' - media attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , '' - media owner id, '' - media attachment id, , For example: "photo100172_166443618,photo66748_265827614", + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function editComment($access_token, array $params = []) { + return $this->request->post('market.editComment', $access_token, $params); + } + + /** + * Returns items list for a community. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " + * - @var integer album_id + * - @var integer count: Number of items to return. + * - @var integer offset: Offset needed to return a specific subset of results. + * - @var boolean extended: '1' – method will return additional fields: 'likes, can_comment, car_repost, photos'. These parameters are not returned by default. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('market.get', $access_token, $params); + } + + /** + * Returns items album's data + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: identifier of an album owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " + * - @var array[integer] album_ids: collections identifiers to obtain data from + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getAlbumById($access_token, array $params = []) { + return $this->request->post('market.getAlbumById', $access_token, $params); + } + + /** + * Returns community's collections list. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an items owner community. + * - @var integer offset: Offset needed to return a specific subset of results. + * - @var integer count: Number of items to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getAlbums($access_token, array $params = []) { + return $this->request->post('market.getAlbums', $access_token, $params); + } + + /** + * Returns information about market items by their ids. + * + * @param string $access_token + * @param array $params + * - @var array[string] item_ids: Comma-separated ids list: {user id}_{item id}. If an item belongs to a community -{community id} is used. " 'Videos' value example: , '-4363_136089719,13245770_137352259'" + * - @var boolean extended: '1' – to return additional fields: 'likes, can_comment, car_repost, photos'. By default: '0'. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('market.getById', $access_token, $params); + } + + /** + * Returns a list of market categories. + * + * @param string $access_token + * @param array $params + * - @var integer count: Number of results to return. + * - @var integer offset: Offset needed to return a specific subset of results. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getCategories($access_token, array $params = []) { + return $this->request->post('market.getCategories', $access_token, $params); + } + + /** + * Returns comments list for an item. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community + * - @var integer item_id: Item ID. + * - @var boolean need_likes: '1' — to return likes info. + * - @var integer start_comment_id: ID of a comment to start a list from (details below). + * - @var integer offset + * - @var integer count: Number of results to return. + * - @var MarketSort sort: Sort order ('asc' — from old to new, 'desc' — from new to old) + * - @var boolean extended: '1' — comments will be returned as numbered objects, in addition lists of 'profiles' and 'groups' objects will be returned. + * - @var array[MarketFields] fields: List of additional profile fields to return. See the [vk.com/dev/fields|details] + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMarketCommentsClosedException Comments for this market are closed + * @return mixed + */ + public function getComments($access_token, array $params = []) { + return $this->request->post('market.getComments', $access_token, $params); + } + + /** + * Removes an item from one or multiple collections. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer item_id: Item ID. + * - @var array[integer] album_ids: Collections IDs to remove item from. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMarketAlbumNotFoundException Album not found + * @throws VKApiMarketItemNotFoundException Item not found + * @return mixed + */ + public function removeFromAlbum($access_token, array $params = []) { + return $this->request->post('market.removeFromAlbum', $access_token, $params); + } + + /** + * Reorders the collections list. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer album_id: Collection ID. + * - @var integer before: ID of a collection to place current collection before it. + * - @var integer after: ID of a collection to place current collection after it. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessMarketException Access denied + * @throws VKApiMarketAlbumNotFoundException Album not found + * @return mixed + */ + public function reorderAlbums($access_token, array $params = []) { + return $this->request->post('market.reorderAlbums', $access_token, $params); + } + + /** + * Changes item place in a collection. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer album_id: ID of a collection to reorder items in. Set 0 to reorder full items list. + * - @var integer item_id: Item ID. + * - @var integer before: ID of an item to place current item before it. + * - @var integer after: ID of an item to place current item after it. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessMarketException Access denied + * @throws VKApiMarketAlbumNotFoundException Album not found + * @throws VKApiMarketItemNotFoundException Item not found + * @return mixed + */ + public function reorderItems($access_token, array $params = []) { + return $this->request->post('market.reorderItems', $access_token, $params); + } + + /** + * Sends a complaint to the item. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer item_id: Item ID. + * - @var MarketReason reason: Complaint reason. Possible values: *'0' — spam,, *'1' — child porn,, *'2' — extremism,, *'3' — violence,, *'4' — drugs propaganda,, *'5' — adult materials,, *'6' — insult. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function report($access_token, array $params = []) { + return $this->request->post('market.report', $access_token, $params); + } + + /** + * Sends a complaint to the item's comment. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer comment_id: Comment ID. + * - @var MarketReason reason: Complaint reason. Possible values: *'0' — spam,, *'1' — child porn,, *'2' — extremism,, *'3' — violence,, *'4' — drugs propaganda,, *'5' — adult materials,, *'6' — insult. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function reportComment($access_token, array $params = []) { + return $this->request->post('market.reportComment', $access_token, $params); + } + + /** + * Restores recently deleted item + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an item owner community. + * - @var integer item_id: Deleted item ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessMarketException Access denied + * @throws VKApiMarketRestoreTooLateException Too late for restore + * @return mixed + */ + public function restore($access_token, array $params = []) { + return $this->request->post('market.restore', $access_token, $params); + } + + /** + * Restores a recently deleted comment + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: identifier of an item owner community, "Note that community id in the 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK API] community " + * - @var integer comment_id: deleted comment id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function restoreComment($access_token, array $params = []) { + return $this->request->post('market.restoreComment', $access_token, $params); + } + + /** + * Searches market items in a community's catalog + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of an items owner community. + * - @var integer album_id + * - @var string q: Search query, for example "pink slippers". + * - @var integer price_from: Minimum item price value. + * - @var integer price_to: Maximum item price value. + * - @var array[integer] tags: Comma-separated tag IDs list. + * - @var MarketSort sort + * - @var MarketRev rev: '0' — do not use reverse order, '1' — use reverse order + * - @var integer offset: Offset needed to return a specific subset of results. + * - @var integer count: Number of items to return. + * - @var boolean extended: '1' – to return additional fields: 'likes, can_comment, car_repost, photos'. By default: '0'. + * - @var MarketStatus status + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('market.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Messages.php b/src/VK/Actions/Messages.php index fad8f81..4c6279d 100644 --- a/src/VK/Actions/Messages.php +++ b/src/VK/Actions/Messages.php @@ -1,920 +1,761 @@ request = $request; - } - - /** - * Adds a new user to a chat. - * - * @param $access_token string - * @param $params array - * - integer chat_id: Chat ID. - * - integer user_id: ID of the user to be added to the chat. - * - integer visible_messages_count: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function addChatUser(string $access_token, array $params = array()) { - return $this->request->post('messages.addChatUser', $access_token, $params); - } - - /** - * Allows sending messages from community to the current user. - * - * @param $access_token string - * @param $params array - * - integer group_id: Group ID. - * - string key: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function allowMessagesFromGroup(string $access_token, array $params = array()) { - return $this->request->post('messages.allowMessagesFromGroup', $access_token, $params); - } - - /** - * Creates a chat with several participants. - * - * @param $access_token string - * @param $params array - * - array user_ids: IDs of the users to be added to the chat. - * - string title: Chat title. - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function createChat(string $access_token, array $params = array()) { - return $this->request->post('messages.createChat', $access_token, $params); - } - - /** - * Deletes one or more messages. - * - * @param $access_token string - * @param $params array - * - array message_ids: Message IDs. - * - boolean spam: '1' — to mark message as spam. - * - integer group_id: Group ID (for group messages with user access token) - * - boolean delete_for_all: '1' — delete message for for all. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('messages.delete', $access_token, $params); - } - - /** - * Deletes a chat's cover picture. - * - * @param $access_token string - * @param $params array - * - integer chat_id: Chat ID. - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function deleteChatPhoto(string $access_token, array $params = array()) { - return $this->request->post('messages.deleteChatPhoto', $access_token, $params); - } - - /** - * Deletes all private messages in a conversation. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. To clear a chat history use 'chat_id' - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - integer group_id: Group ID (for group messages with user access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function deleteConversation(string $access_token, array $params = array()) { - return $this->request->post('messages.deleteConversation', $access_token, $params); - } - - /** - * Denies sending message from community to the current user. - * - * @param $access_token string - * @param $params array - * - integer group_id: Group ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function denyMessagesFromGroup(string $access_token, array $params = array()) { - return $this->request->post('messages.denyMessagesFromGroup', $access_token, $params); - } - - /** - * Edits the message. - * - * @param $access_token string - * @param $params array - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - string message: (Required if 'attachments' is not set.) Text of the message. - * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - string attachment: (Required if 'message' is not set.) List of objects attached to the message, - * separated by commas, in the following format: "_", '' — Type of media attachment: - * 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'wall' — wall post, - * '' — ID of the media attachment owner. '' — media attachment ID. Example: - * "photo100172_166443618" - * - boolean keep_forward_messages: '1' — to keep forwarded, messages. - * - boolean keep_snippets: '1' — to keep attached snippets. - * - integer group_id: Group ID (for group messages with user access token) - * - boolean dont_parse_links: - * - integer message_id: - * - integer conversation_message_id: - * - string template: - * - string keyboard: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('messages.edit', $access_token, $params); - } - - /** - * Edits the title of a chat. - * - * @param $access_token string - * @param $params array - * - integer chat_id: Chat ID. - * - string title: New title of the chat. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function editChat(string $access_token, array $params = array()) { - return $this->request->post('messages.editChat', $access_token, $params); - } - - /** - * Returns messages by their IDs within the conversation. - * - * @param $access_token string - * @param $params array - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - array conversation_message_ids: Conversation message IDs. - * - boolean extended: Information whether the response should be extended - * - array fields: Profile fields to return. - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getByConversationMessageId(string $access_token, array $params = array()) { - return $this->request->post('messages.getByConversationMessageId', $access_token, $params); - } - - /** - * Returns messages by their IDs. - * - * @param $access_token string - * @param $params array - * - array message_ids: Message IDs. - * - integer preview_length: Number of characters after which to truncate a previewed message. To preview - * the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by - * words." - * - boolean extended: Information whether the response should be extended - * - array fields: Profile fields to return. - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('messages.getById', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer peer_id: - * - string link: Invitation link. - * - array fields: Profile fields to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getChatPreview(string $access_token, array $params = array()) { - return $this->request->post('messages.getChatPreview', $access_token, $params); - } - - /** - * Returns a list of IDs of users participating in a chat. - * - * @param $access_token string - * @param $params array - * - integer peer_id: Peer ID. - * - array fields: Profile fields to return. - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getConversationMembers(string $access_token, array $params = array()) { - return $this->request->post('messages.getConversationMembers', $access_token, $params); - } - - /** - * Returns a list of the current user's conversations. - * - * @param $access_token string - * @param $params array - * - integer offset: Offset needed to return a specific subset of conversations. - * - integer count: Number of conversations to return. - * - MessagesGetConversationsFilter filter: Filter to apply: 'all' — all conversations, 'unread' — - * conversations with unread messages, 'important' — conversations, marked as important (only for community - * messages), 'unanswered' — conversations, marked as unanswered (only for community messages) - * @see MessagesGetConversationsFilter - * - boolean extended: '1' — return extra information about users and communities - * - integer start_message_id: ID of the message from what to return dialogs. - * - array fields: Profile and communities fields to return. - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function getConversations(string $access_token, array $params = array()) { - return $this->request->post('messages.getConversations', $access_token, $params); - } - - /** - * Returns conversations by their IDs - * - * @param $access_token string - * @param $params array - * - array peer_ids: Destination IDs. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - boolean extended: Return extended properties - * - array fields: Profile and communities fields to return. - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function getConversationsById(string $access_token, array $params = array()) { - return $this->request->post('messages.getConversationsById', $access_token, $params); - } - - /** - * Returns message history for the specified user or group chat. - * - * @param $access_token string - * @param $params array - * - integer offset: Offset needed to return a specific subset of messages. - * - integer count: Number of messages to return. - * - integer user_id: ID of the user whose message history you want to return. - * - integer peer_id: - * - integer start_message_id: Starting message ID from which to return history. - * - MessagesGetHistoryRev rev: Sort order: '1' — return messages in chronological order. '0' — return - * messages in reverse chronological order. - * @see MessagesGetHistoryRev - * - boolean extended: Information whether the response should be extended - * - array fields: Profile fields to return. - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getHistory(string $access_token, array $params = array()) { - return $this->request->post('messages.getHistory', $access_token, $params); - } - - /** - * Returns media files from the dialog or group chat. - * - * @param $access_token string - * @param $params array - * - integer peer_id: Peer ID. ", For group chat: '2000000000 + chat ID' , , For community: '-community - * ID'" - * - MessagesGetHistoryAttachmentsMediaType media_type: Type of media files to return: *'photo',, - * *'video',, *'audio',, *'doc',, *'link'.,*'market'.,*'wall'.,*'share' - * @see MessagesGetHistoryAttachmentsMediaType - * - string start_from: Message ID to start return results from. - * - integer count: Number of objects to return. - * - boolean photo_sizes: '1' — to return photo sizes in a - * - array fields: Additional profile [vk.com/dev/fields|fields] to return. - * - integer group_id: Group ID (for group messages with group access token) - * - boolean preserve_order: - * - integer max_forwards_level: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getHistoryAttachments(string $access_token, array $params = array()) { - return $this->request->post('messages.getHistoryAttachments', $access_token, $params); - } - - /** - * Returns a list of user's important messages. - * - * @param $access_token string - * @param $params array - * - integer count: Amount of needed important messages. - * - integer offset: - * - integer start_message_id: - * - integer preview_length: Maximum length of messages body. - * - array fields: Actors fields to return. - * - boolean extended: Return extended properties - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getImportantMessages(string $access_token, array $params = array()) { + /** + * @var VKApiRequest + */ + private $request; + + /** + * Messages constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Adds a new user to a chat. + * + * @param string $access_token + * @param array $params + * - @var integer chat_id: Chat ID. + * - @var integer user_id: ID of the user to be added to the chat. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @throws VKApiMessagesChatNotAdminException You are not admin of this chat + * @throws VKApiMessagesMessageRequestAlreadySentException Message request already sent + * @throws VKApiMessagesContactNotFoundException Contact not found + * @return mixed + */ + public function addChatUser($access_token, array $params = []) { + return $this->request->post('messages.addChatUser', $access_token, $params); + } + + /** + * Allows sending messages from community to the current user. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Group ID. + * - @var string key + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function allowMessagesFromGroup($access_token, array $params = []) { + return $this->request->post('messages.allowMessagesFromGroup', $access_token, $params); + } + + /** + * Creates a chat with several participants. + * + * @param string $access_token + * @param array $params + * - @var array[integer] user_ids: IDs of the users to be added to the chat. + * - @var string title: Chat title. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesContactNotFoundException Contact not found + * @return mixed + */ + public function createChat($access_token, array $params = []) { + return $this->request->post('messages.createChat', $access_token, $params); + } + + /** + * Deletes one or more messages. + * + * @param string $access_token + * @param array $params + * - @var array[integer] message_ids: Message IDs. + * - @var boolean spam: '1' — to mark message as spam. + * - @var integer group_id: Group ID (for group messages with user access token) + * - @var boolean delete_for_all: '1' — delete message for for all. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesCantDeleteForAllException Can't delete this message for everybody + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('messages.delete', $access_token, $params); + } + + /** + * Deletes a chat's cover picture. + * + * @param string $access_token + * @param array $params + * - @var integer chat_id: Chat ID. + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesChatNotAdminException You are not admin of this chat + * @return mixed + */ + public function deleteChatPhoto($access_token, array $params = []) { + return $this->request->post('messages.deleteChatPhoto', $access_token, $params); + } + + /** + * Deletes all private messages in a conversation. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. To clear a chat history use 'chat_id' + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var integer group_id: Group ID (for group messages with user access token) + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesContactNotFoundException Contact not found + * @return mixed + */ + public function deleteConversation($access_token, array $params = []) { + return $this->request->post('messages.deleteConversation', $access_token, $params); + } + + /** + * Denies sending message from community to the current user. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Group ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function denyMessagesFromGroup($access_token, array $params = []) { + return $this->request->post('messages.denyMessagesFromGroup', $access_token, $params); + } + + /** + * Edits the message. + * + * @param string $access_token + * @param array $params + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var string message: (Required if 'attachments' is not set.) Text of the message. + * - @var integer message_id + * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - @var string attachment: (Required if 'message' is not set.) List of objects attached to the message, separated by commas, in the following format: "_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'wall' — wall post, '' — ID of the media attachment owner. '' — media attachment ID. Example: "photo100172_166443618" + * - @var boolean keep_forward_messages: '1' — to keep forwarded, messages. + * - @var boolean keep_snippets: '1' — to keep attached snippets. + * - @var integer group_id: Group ID (for group messages with user access token) + * - @var boolean dont_parse_links + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesDenySendException Can't send messages for users without permission + * @throws VKApiMessagesEditExpiredException Can't edit this message, because it's too old + * @throws VKApiMessagesTooBigException Can't sent this message, because it's too big + * @throws VKApiMessagesEditKindDisallowedException Can't edit this kind of message + * @throws VKApiMessagesTooLongMessageException Message is too long + * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat + * @throws VKApiMessagesKeyboardInvalidException Keyboard format is invalid + * @throws VKApiMessagesTooManyPostsException Too many posts in messages + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('messages.edit', $access_token, $params); + } + + /** + * Edits the title of a chat. + * + * @param string $access_token + * @param array $params + * - @var integer chat_id: Chat ID. + * - @var string title: New title of the chat. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesChatNotAdminException You are not admin of this chat + * @return mixed + */ + public function editChat($access_token, array $params = []) { + return $this->request->post('messages.editChat', $access_token, $params); + } + + /** + * Returns messages by their IDs within the conversation. + * + * @param string $access_token + * @param array $params + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var array[integer] conversation_message_ids: Conversation message IDs. + * - @var boolean extended: Information whether the response should be extended + * - @var array[MessagesFields] fields: Profile fields to return. + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getByConversationMessageId($access_token, array $params = []) { + return $this->request->post('messages.getByConversationMessageId', $access_token, $params); + } + + /** + * Returns messages by their IDs. + * + * @param string $access_token + * @param array $params + * - @var array[integer] message_ids: Message IDs. + * - @var integer preview_length: Number of characters after which to truncate a previewed message. To preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by words." + * - @var boolean extended: Information whether the response should be extended + * - @var array[MessagesFields] fields: Profile fields to return. + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('messages.getById', $access_token, $params); + } + + /** + * @param string $access_token + * @param array $params + * - @var integer peer_id + * - @var string link: Invitation link. + * - @var array[MessagesFields] fields: Profile fields to return. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat + * @return mixed + */ + public function getChatPreview($access_token, array $params = []) { + return $this->request->post('messages.getChatPreview', $access_token, $params); + } + + /** + * Returns a list of IDs of users participating in a chat. + * + * @param string $access_token + * @param array $params + * - @var integer peer_id: Peer ID. + * - @var array[MessagesFields] fields: Profile fields to return. + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat + * @return mixed + */ + public function getConversationMembers($access_token, array $params = []) { + return $this->request->post('messages.getConversationMembers', $access_token, $params); + } + + /** + * Returns a list of the current user's conversations. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of conversations. + * - @var integer count: Number of conversations to return. + * - @var MessagesFilter filter: Filter to apply: 'all' — all conversations, 'unread' — conversations with unread messages, 'important' — conversations, marked as important (only for community messages), 'unanswered' — conversations, marked as unanswered (only for community messages) + * - @var boolean extended: '1' — return extra information about users and communities + * - @var integer start_message_id: ID of the message from what to return dialogs. + * - @var array[MessagesFields] fields: Profile and communities fields to return. + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesContactNotFoundException Contact not found + * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat + * @return mixed + */ + public function getConversations($access_token, array $params = []) { + return $this->request->post('messages.getConversations', $access_token, $params); + } + + /** + * Returns conversations by their IDs + * + * @param string $access_token + * @param array $params + * - @var array[integer] peer_ids: Destination IDs. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var boolean extended: Return extended properties + * - @var array[MessagesFields] fields: Profile and communities fields to return. + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesChatNotExistException Chat does not exist + * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat + * @throws VKApiMessagesContactNotFoundException Contact not found + * @return mixed + */ + public function getConversationsById($access_token, array $params = []) { + return $this->request->post('messages.getConversationsById', $access_token, $params); + } + + /** + * Returns message history for the specified user or group chat. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of messages. + * - @var integer count: Number of messages to return. + * - @var integer user_id: ID of the user whose message history you want to return. + * - @var integer peer_id + * - @var integer start_message_id: Starting message ID from which to return history. + * - @var MessagesRev rev: Sort order: '1' — return messages in chronological order. '0' — return messages in reverse chronological order. + * - @var boolean extended: Information whether the response should be extended + * - @var array[MessagesFields] fields: Profile fields to return. + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesContactNotFoundException Contact not found + * @return mixed + */ + public function getHistory($access_token, array $params = []) { + return $this->request->post('messages.getHistory', $access_token, $params); + } + + /** + * Returns media files from the dialog or group chat. + * + * @param string $access_token + * @param array $params + * - @var integer peer_id: Peer ID. ", For group chat: '2000000000 + chat ID' , , For community: '-community ID'" + * - @var MessagesMediaType media_type: Type of media files to return: *'photo',, *'video',, *'audio',, *'doc',, *'link'.,*'market'.,*'wall'.,*'share' + * - @var string start_from: Message ID to start return results from. + * - @var integer count: Number of objects to return. + * - @var boolean photo_sizes: '1' — to return photo sizes in a + * - @var array[MessagesFields] fields: Additional profile [vk.com/dev/fields|fields] to return. + * - @var integer group_id: Group ID (for group messages with group access token) + * - @var boolean preserve_order + * - @var integer max_forwards_level + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getHistoryAttachments($access_token, array $params = []) { + return $this->request->post('messages.getHistoryAttachments', $access_token, $params); + } + + /** + * Returns important messages from the dialog or group chat. + * + * @param string $access_token + * @param array $params + * - @var integer count: Number of objects to return. + * - @var integer offset: Offset needed to return a specific subset of messages. + * - @var string start_message_id: Message ID to start return results from. + * - @var integer preview_length + * - @var array[MessagesFields] fields: Additional profile [vk.com/dev/fields|fields] to return. + * - @var boolean extended: '1' — return extra information about users and communities + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getImportantMessages($access_token, array $params = []) { return $this->request->post('messages.getImportantMessages', $access_token, $params); } - /** - * - * - * @param $access_token string - * @param $params array - * - MessagesGetIntentUsersIntent intent: - * @see MessagesGetIntentUsersIntent - * - integer subscribe_id: - * - integer offset: - * - integer count: - * - boolean extended: - * - array name_case: - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getIntentUsers(string $access_token, array $params = array()) { - return $this->request->post('messages.getIntentUsers', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer peer_id: Destination ID. - * - boolean reset: 1 — to generate new link (revoke previous), 0 — to return previous link. - * - integer group_id: Group ID - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function getInviteLink(string $access_token, array $params = array()) { - return $this->request->post('messages.getInviteLink', $access_token, $params); - } - - /** - * Returns a user's current status and date of last activity. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getLastActivity(string $access_token, array $params = array()) { - return $this->request->post('messages.getLastActivity', $access_token, $params); - } - - /** - * Returns updates in user's private messages. - * - * @param $access_token string - * @param $params array - * - integer ts: Last value of the 'ts' parameter returned from the Long Poll server or by using - * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. - * - integer pts: Lsat value of 'pts' parameter returned from the Long Poll server or by using - * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. - * - integer preview_length: Number of characters after which to truncate a previewed message. To preview - * the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by - * words." - * - boolean onlines: '1' — to return history with online users only. - * - array fields: Additional profile [vk.com/dev/fields|fields] to return. - * - integer events_limit: Maximum number of events to return. - * - integer msgs_limit: Maximum number of messages to return. - * - integer max_msg_id: Maximum ID of the message among existing ones in the local copy. Both messages - * received with API methods (for example, , ), and data received from a Long Poll server (events with code 4) - * are taken into account. - * - integer group_id: Group ID (for group messages with user access token) - * - integer lp_version: - * - integer last_n: - * - boolean credentials: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function getLongPollHistory(string $access_token, array $params = array()) { - return $this->request->post('messages.getLongPollHistory', $access_token, $params); - } - - /** - * Returns data required for connection to a Long Poll server. - * - * @param $access_token string - * @param $params array - * - boolean need_pts: '1' — to return the 'pts' field, needed for the - * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. - * - integer group_id: Group ID (for group messages with user access token) - * - integer lp_version: Long poll version - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getLongPollServer(string $access_token, array $params = array()) { - return $this->request->post('messages.getLongPollServer', $access_token, $params); - } - - /** - * Returns information whether sending messages from the community to current user is allowed. - * - * @param $access_token string - * @param $params array - * - integer group_id: Group ID. - * - integer user_id: User ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function isMessagesFromGroupAllowed(string $access_token, array $params = array()) { - return $this->request->post('messages.isMessagesFromGroupAllowed', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - string link: Invitation link. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function joinChatByInviteLink(string $access_token, array $params = array()) { - return $this->request->post('messages.joinChatByInviteLink', $access_token, $params); - } - - /** - * Marks and unmarks conversations as unanswered. - * - * @param $access_token string - * @param $params array - * - integer peer_id: ID of conversation to mark as important. - * - boolean answered: '1' — to mark as answered, '0' — to remove the mark - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function markAsAnsweredConversation(string $access_token, array $params = array()) { - return $this->request->post('messages.markAsAnsweredConversation', $access_token, $params); - } - - /** - * Marks and unmarks messages as important (starred). - * - * @param $access_token string - * @param $params array - * - array message_ids: IDs of messages to mark as important. - * - integer important: '1' — to add a star (mark as important), '0' — to remove the star - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function markAsImportant(string $access_token, array $params = array()) { - return $this->request->post('messages.markAsImportant', $access_token, $params); - } - - /** - * Marks and unmarks conversations as important. - * - * @param $access_token string - * @param $params array - * - integer peer_id: ID of conversation to mark as important. - * - boolean important: '1' — to add a star (mark as important), '0' — to remove the star - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function markAsImportantConversation(string $access_token, array $params = array()) { - return $this->request->post('messages.markAsImportantConversation', $access_token, $params); - } - - /** - * Marks messages as read. - * - * @param $access_token string - * @param $params array - * - array message_ids: IDs of messages to mark as read. - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - integer start_message_id: Message ID to start from. - * - integer group_id: Group ID (for group messages with user access token) - * - boolean mark_conversation_as_read: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function markAsRead(string $access_token, array $params = array()) { - return $this->request->post('messages.markAsRead', $access_token, $params); - } - - /** - * Pin a message. - * - * @param $access_token string - * @param $params array - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat - * ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " - * - integer message_id: Message ID - * - integer conversation_message_id: Conversation message ID - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function pin(string $access_token, array $params = array()) { - return $this->request->post('messages.pin', $access_token, $params); - } - - /** - * Allows the current user to leave a chat or, if the current user started the chat, allows the user to remove - * another user from the chat. - * - * @param $access_token string - * @param $params array - * - integer chat_id: Chat ID. - * - integer user_id: ID of the user to be removed from the chat. - * - integer member_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function removeChatUser(string $access_token, array $params = array()) { - return $this->request->post('messages.removeChatUser', $access_token, $params); - } - - /** - * Restores a deleted message. - * - * @param $access_token string - * @param $params array - * - integer message_id: ID of a previously-deleted message to restore. - * - integer group_id: Group ID (for group messages with user access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function restore(string $access_token, array $params = array()) { - return $this->request->post('messages.restore', $access_token, $params); - } - - /** - * Returns a list of the current user's private messages that match search criteria. - * - * @param $access_token string - * @param $params array - * - string q: Search query string. - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - integer date: Date to search message before in Unixtime. - * - integer preview_length: Number of characters after which to truncate a previewed message. To preview - * the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by - * words." - * - integer offset: Offset needed to return a specific subset of messages. - * - integer count: Number of messages to return. - * - boolean extended: - * - array fields: - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('messages.search', $access_token, $params); - } - - /** - * Returns a list of the current user's conversations that match search criteria. - * - * @param $access_token string - * @param $params array - * - string q: Search query string. - * - integer count: Maximum number of results. - * - boolean extended: '1' — return extra information about users and communities - * - array fields: Profile fields to return. - * - integer group_id: Group ID (for group messages with user access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function searchConversations(string $access_token, array $params = array()) { - return $this->request->post('messages.searchConversations', $access_token, $params); - } - - /** - * Sends a message. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID (by default — current user). - * - integer random_id: Unique identifier to avoid resending the message. - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - array peer_ids: IDs of message recipients. (See peer_id) - * - string domain: User's short address (for example, 'illarionov'). - * - integer chat_id: ID of conversation the message will relate to. - * - array user_ids: IDs of message recipients (if new conversation shall be started). - * - string message: (Required if 'attachments' is not set.) Text of the message. - * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - string attachment: (Required if 'message' is not set.) List of objects attached to the message, - * separated by commas, in the following format: "_", '' — Type of media attachment: - * 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'wall' — wall post, - * '' — ID of the media attachment owner. '' — media attachment ID. Example: - * "photo100172_166443618" - * - integer reply_to: - * - array forward_messages: ID of forwarded messages, separated with a comma. Listed messages of the - * sender will be shown in the message body at the recipient's. Example: "123,431,544" - * - string forward: JSON describing the forwarded message or reply - * - integer sticker_id: Sticker id. - * - integer group_id: Group ID (for group messages with group access token) - * - string keyboard: - * - string template: - * - string payload: - * - string content_source: JSON describing the content source in the message - * - boolean dont_parse_links: - * - boolean disable_mentions: - * - MessagesSendIntent intent: - * @see MessagesSendIntent - * - integer subscribe_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function send(string $access_token, array $params = array()) { - return $this->request->post('messages.send', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - string event_id: - * - integer user_id: - * - integer peer_id: - * - string event_data: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function sendMessageEventAnswer(string $access_token, array $params = array()) { + /** + * @param string $access_token + * @param array $params + * - @var integer peer_id: Destination ID. + * - @var boolean reset: 1 — to generate new link (revoke previous), 0 — to return previous link. + * - @var integer group_id: Group ID + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesCantSeeInviteLinkException You can't see invite link for this chat + * @throws VKApiMessagesCantChangeInviteLinkException You can't change invite link for this chat + * @return mixed + */ + public function getInviteLink($access_token, array $params = []) { + return $this->request->post('messages.getInviteLink', $access_token, $params); + } + + /** + * Returns a user's current status and date of last activity. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getLastActivity($access_token, array $params = []) { + return $this->request->post('messages.getLastActivity', $access_token, $params); + } + + /** + * Returns updates in user's private messages. + * + * @param string $access_token + * @param array $params + * - @var integer ts: Last value of the 'ts' parameter returned from the Long Poll server or by using [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. + * - @var integer pts: Lsat value of 'pts' parameter returned from the Long Poll server or by using [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. + * - @var integer preview_length: Number of characters after which to truncate a previewed message. To preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by words." + * - @var boolean onlines: '1' — to return history with online users only. + * - @var array[MessagesFields] fields: Additional profile [vk.com/dev/fields|fields] to return. + * - @var integer events_limit: Maximum number of events to return. + * - @var integer msgs_limit: Maximum number of messages to return. + * - @var integer max_msg_id: Maximum ID of the message among existing ones in the local copy. Both messages received with API methods (for example, , ), and data received from a Long Poll server (events with code 4) are taken into account. + * - @var integer group_id: Group ID (for group messages with user access token) + * - @var integer lp_version + * - @var integer last_n + * - @var boolean credentials + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesTooOldPtsException Value of ts or pts is too old + * @throws VKApiMessagesTooNewPtsException Value of ts or pts is too new + * @return mixed + */ + public function getLongPollHistory($access_token, array $params = []) { + return $this->request->post('messages.getLongPollHistory', $access_token, $params); + } + + /** + * Returns data required for connection to a Long Poll server. + * + * @param string $access_token + * @param array $params + * - @var boolean need_pts: '1' — to return the 'pts' field, needed for the [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. + * - @var integer group_id: Group ID (for group messages with user access token) + * - @var integer lp_version: Long poll version + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getLongPollServer($access_token, array $params = []) { + return $this->request->post('messages.getLongPollServer', $access_token, $params); + } + + /** + * Returns information whether sending messages from the community to current user is allowed. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Group ID. + * - @var integer user_id: User ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function isMessagesFromGroupAllowed($access_token, array $params = []) { + return $this->request->post('messages.isMessagesFromGroupAllowed', $access_token, $params); + } + + /** + * @param string $access_token + * @param array $params + * - @var string link: Invitation link. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat + * @throws VKApiLimitsException Out of limits + * @return mixed + */ + public function joinChatByInviteLink($access_token, array $params = []) { + return $this->request->post('messages.joinChatByInviteLink', $access_token, $params); + } + + /** + * Marks and unmarks conversations as unanswered. + * + * @param string $access_token + * @param array $params + * - @var integer peer_id: ID of conversation to mark as important. + * - @var boolean answered: '1' — to mark as answered, '0' — to remove the mark + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function markAsAnsweredConversation($access_token, array $params = []) { + return $this->request->post('messages.markAsAnsweredConversation', $access_token, $params); + } + + /** + * Marks and unmarks messages as important (starred). + * + * @param string $access_token + * @param array $params + * - @var array[integer] message_ids: IDs of messages to mark as important. + * - @var integer important: '1' — to add a star (mark as important), '0' — to remove the star + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function markAsImportant($access_token, array $params = []) { + return $this->request->post('messages.markAsImportant', $access_token, $params); + } + + /** + * Marks and unmarks conversations as important. + * + * @param string $access_token + * @param array $params + * - @var integer peer_id: ID of conversation to mark as important. + * - @var boolean important: '1' — to add a star (mark as important), '0' — to remove the star + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function markAsImportantConversation($access_token, array $params = []) { + return $this->request->post('messages.markAsImportantConversation', $access_token, $params); + } + + /** + * Marks messages as read. + * + * @param string $access_token + * @param array $params + * - @var array[integer] message_ids: IDs of messages to mark as read. + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var integer start_message_id: Message ID to start from. + * - @var integer group_id: Group ID (for group messages with user access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function markAsRead($access_token, array $params = []) { + return $this->request->post('messages.markAsRead', $access_token, $params); + } + + /** + * Pin a message. + * + * @param string $access_token + * @param array $params + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * - @var integer message_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesChatNotAdminException You are not admin of this chat + * @throws VKApiMessagesCantPinOneTimeStoryException Cannot pin one-time story + * @return mixed + */ + public function pin($access_token, array $params = []) { + return $this->request->post('messages.pin', $access_token, $params); + } + + /** + * Allows the current user to leave a chat or, if the current user started the chat, allows the user to remove another user from the chat. + * + * @param string $access_token + * @param array $params + * - @var integer chat_id: Chat ID. + * - @var integer user_id: ID of the user to be removed from the chat. + * - @var integer member_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesChatNotAdminException You are not admin of this chat + * @throws VKApiMessagesChatUserNotInChatException User not found in chat + * @throws VKApiMessagesContactNotFoundException Contact not found + * @return mixed + */ + public function removeChatUser($access_token, array $params = []) { + return $this->request->post('messages.removeChatUser', $access_token, $params); + } + + /** + * Restores a deleted message. + * + * @param string $access_token + * @param array $params + * - @var integer message_id: ID of a previously-deleted message to restore. + * - @var integer group_id: Group ID (for group messages with user access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function restore($access_token, array $params = []) { + return $this->request->post('messages.restore', $access_token, $params); + } + + /** + * Returns a list of the current user's private messages that match search criteria. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query string. + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var integer date: Date to search message before in Unixtime. + * - @var integer preview_length: Number of characters after which to truncate a previewed message. To preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages are truncated by words." + * - @var integer offset: Offset needed to return a specific subset of messages. + * - @var integer count: Number of messages to return. + * - @var boolean extended + * - @var array[string] fields + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('messages.search', $access_token, $params); + } + + /** + * Returns a list of the current user's conversations that match search criteria. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query string. + * - @var integer count: Maximum number of results. + * - @var boolean extended: '1' — return extra information about users and communities + * - @var array[MessagesFields] fields: Profile fields to return. + * - @var integer group_id: Group ID (for group messages with user access token) + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function searchConversations($access_token, array $params = []) { + return $this->request->post('messages.searchConversations', $access_token, $params); + } + + /** + * Sends a message. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID (by default — current user). + * - @var integer random_id: Unique identifier to avoid resending the message. + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var string domain: User's short address (for example, 'illarionov'). + * - @var integer chat_id: ID of conversation the message will relate to. + * - @var array[integer] user_ids: IDs of message recipients (if new conversation shall be started). + * - @var string message: (Required if 'attachments' is not set.) Text of the message. + * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - @var string attachment: (Required if 'message' is not set.) List of objects attached to the message, separated by commas, in the following format: "_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'wall' — wall post, '' — ID of the media attachment owner. '' — media attachment ID. Example: "photo100172_166443618" + * - @var integer reply_to + * - @var array[integer] forward_messages: ID of forwarded messages, separated with a comma. Listed messages of the sender will be shown in the message body at the recipient's. Example: "123,431,544" + * - @var string forward + * - @var integer sticker_id: Sticker id. + * - @var integer group_id: Group ID (for group messages with group access token) + * - @var string keyboard + * - @var string payload + * - @var boolean dont_parse_links + * - @var boolean disable_mentions + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist + * @throws VKApiMessagesDenySendException Can't send messages for users without permission + * @throws VKApiMessagesPrivacyException Can't send messages to this user due to their privacy settings + * @throws VKApiMessagesTooLongMessageException Message is too long + * @throws VKApiMessagesTooLongForwardsException Too many forwarded messages + * @throws VKApiMessagesCantFwdException Can't forward these messages + * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat + * @throws VKApiMessagesKeyboardInvalidException Keyboard format is invalid + * @throws VKApiMessagesChatBotFeatureException This is a chat bot feature, change this status in settings + * @throws VKApiMessagesContactNotFoundException Contact not found + * @throws VKApiMessagesTooManyPostsException Too many posts in messages + * @return mixed + */ + public function send($access_token, array $params = []) { + return $this->request->post('messages.send', $access_token, $params); + } + + /** + * Sends a message event answer. + * + * @param string $access_token + * @param array $params + * - @var integer event_id: Event ID. + * - @var integer user_id: User ID (by default — current user). + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var string event_data + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function sendMessageEventAnswer($access_token, array $params = []) { return $this->request->post('messages.sendMessageEventAnswer', $access_token, $params); } - /** - * Changes the status of a user as typing in a conversation. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - MessagesSetActivityType type: 'typing' — user has started to type. - * @see MessagesSetActivityType - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " - * - integer group_id: Group ID (for group messages with group access token) - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function setActivity(string $access_token, array $params = array()) { - return $this->request->post('messages.setActivity', $access_token, $params); - } - - /** - * Sets a previously-uploaded picture as the cover picture of a chat. - * - * @param $access_token string - * @param $params array - * - string file: Upload URL from the 'response' field returned by the - * [vk.com/dev/photos.getChatUploadServer|photos.getChatUploadServer] method upon successfully uploading an - * image. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function setChatPhoto(string $access_token, array $params = array()) { - return $this->request->post('messages.setChatPhoto', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - integer peer_id: - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function unpin(string $access_token, array $params = array()) { - return $this->request->post('messages.unpin', $access_token, $params); - } + /** + * Changes the status of a user as typing in a conversation. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var string type: 'typing' — user has started to type. + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * - @var integer group_id: Group ID (for group messages with group access token) + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesGroupPeerAccessException Your community can't interact with this peer + * @throws VKApiMessagesChatUserNoAccessException You don't have access to this chat + * @throws VKApiMessagesContactNotFoundException Contact not found + * @return mixed + */ + public function setActivity($access_token, array $params = []) { + return $this->request->post('messages.setActivity', $access_token, $params); + } + + /** + * Sets a previously-uploaded picture as the cover picture of a chat. + * + * @param string $access_token + * @param array $params + * - @var string file: Upload URL from the 'response' field returned by the [vk.com/dev/photos.getChatUploadServer|photos.getChatUploadServer] method upon successfully uploading an image. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiUploadException Upload error + * @throws VKApiPhotoChangedException Original photo was changed + * @throws VKApiMessagesChatNotAdminException You are not admin of this chat + * @return mixed + */ + public function setChatPhoto($access_token, array $params = []) { + return $this->request->post('messages.setChatPhoto', $access_token, $params); + } + + /** + * @param string $access_token + * @param array $params + * - @var integer peer_id + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesChatNotAdminException You are not admin of this chat + * @return mixed + */ + public function unpin($access_token, array $params = []) { + return $this->request->post('messages.unpin', $access_token, $params); + } } diff --git a/src/VK/Actions/Newsfeed.php b/src/VK/Actions/Newsfeed.php index 66c1ee6..a5500ac 100644 --- a/src/VK/Actions/Newsfeed.php +++ b/src/VK/Actions/Newsfeed.php @@ -1,354 +1,288 @@ request = $request; - } + /** + * Newsfeed constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Prevents news from specified users and communities from appearing in the current user's newsfeed. - * - * @param $access_token string - * @param $params array - * - array user_ids: - * - array group_ids: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function addBan(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.addBan', $access_token, $params); - } + /** + * Prevents news from specified users and communities from appearing in the current user's newsfeed. + * + * @param string $access_token + * @param array $params + * - @var array[integer] user_ids + * - @var array[integer] group_ids + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function addBan($access_token, array $params = []) { + return $this->request->post('newsfeed.addBan', $access_token, $params); + } - /** - * Allows news from previously banned users and communities to be shown in the current user's newsfeed. - * - * @param $access_token string - * @param $params array - * - array user_ids: - * - array group_ids: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteBan(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.deleteBan', $access_token, $params); - } + /** + * Allows news from previously banned users and communities to be shown in the current user's newsfeed. + * + * @param string $access_token + * @param array $params + * - @var array[integer] user_ids + * - @var array[integer] group_ids + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteBan($access_token, array $params = []) { + return $this->request->post('newsfeed.deleteBan', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer list_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteList(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.deleteList', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer list_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteList($access_token, array $params = []) { + return $this->request->post('newsfeed.deleteList', $access_token, $params); + } - /** - * Returns data required to show newsfeed for the current user. - * - * @param $access_token string - * @param $params array - * - array filters: Filters to apply: 'post' — new wall posts, 'photo' — new photos, 'photo_tag' — - * new photo tags, 'wall_photo' — new wall photos, 'friend' — new friends - * - boolean return_banned: '1' — to return news items from banned sources - * - integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours - * ago. - * - integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current - * time. - * - integer max_photos: Maximum number of photos to return. By default, '5'. - * - string source_ids: Sources to obtain news from, separated by commas. User IDs can be specified in - * formats '' or 'u' , where '' is the user's friend ID. Community IDs can be specified in formats '-' or 'g' , - * where '' is the community ID. If the parameter is not set, all of the user's friends and communities are - * returned, except for banned sources, which can be obtained with the - * [vk.com/dev/newsfeed.getBanned|newsfeed.getBanned] method. - * - string start_from: identifier required to get the next page of results. Value for this parameter is - * returned in 'next_from' field in a reply. - * - integer count: Number of news items to return (default 50, maximum 100). For auto feed, you can use - * the 'new_offset' parameter returned by this method. - * - array fields: Additional fields of [vk.com/dev/fields|profiles] and - * [vk.com/dev/fields_groups|communities] to return. - * - string section: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.get', $access_token, $params); - } + /** + * Returns data required to show newsfeed for the current user. + * + * @param string $access_token + * @param array $params + * - @var array[NewsfeedFilters] filters: Filters to apply: 'post' — new wall posts, 'photo' — new photos, 'photo_tag' — new photo tags, 'wall_photo' — new wall photos, 'friend' — new friends, 'note' — new notes + * - @var boolean return_banned: '1' — to return news items from banned sources + * - @var integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago. + * - @var integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current time. + * - @var integer max_photos: Maximum number of photos to return. By default, '5'. + * - @var string source_ids: Sources to obtain news from, separated by commas. User IDs can be specified in formats '' or 'u' , where '' is the user's friend ID. Community IDs can be specified in formats '-' or 'g' , where '' is the community ID. If the parameter is not set, all of the user's friends and communities are returned, except for banned sources, which can be obtained with the [vk.com/dev/newsfeed.getBanned|newsfeed.getBanned] method. + * - @var string start_from: identifier required to get the next page of results. Value for this parameter is returned in 'next_from' field in a reply. + * - @var integer count: Number of news items to return (default 50, maximum 100). For auto feed, you can use the 'new_offset' parameter returned by this method. + * - @var array[NewsfeedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. + * - @var string section + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('newsfeed.get', $access_token, $params); + } - /** - * Returns a list of users and communities banned from the current user's newsfeed. - * - * @param $access_token string - * @param $params array - * - boolean extended: '1' — return extra information about users and communities - * - array fields: Profile fields to return. - * - NewsfeedGetBannedNameCase name_case: Case for declension of user name and surname: 'nom' — - * nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , - * 'abl' — prepositional - * @see NewsfeedGetBannedNameCase - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getBanned(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.getBanned', $access_token, $params); - } + /** + * Returns a list of users and communities banned from the current user's newsfeed. + * + * @param string $access_token + * @param array $params + * - @var boolean extended: '1' — return extra information about users and communities + * - @var array[NewsfeedFields] fields: Profile fields to return. + * - @var NewsfeedNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getBanned($access_token, array $params = []) { + return $this->request->post('newsfeed.getBanned', $access_token, $params); + } - /** - * Returns a list of comments in the current user's newsfeed. - * - * @param $access_token string - * @param $params array - * - integer count: Number of comments to return. For auto feed, you can use the 'new_offset' parameter - * returned by this method. - * - array filters: Filters to apply: 'post' — new comments on wall posts, 'photo' — new comments on - * photos, 'video' — new comments on videos, 'topic' — new comments on discussions, 'note' — new comments - * on notes, - * - string reposts: Object ID, comments on repost of which shall be returned, e.g. 'wall1_45486'. (If the - * parameter is set, the 'filters' parameter is optional.), - * - integer start_time: Earliest timestamp (in Unix time) of a comment to return. By default, 24 hours - * ago. - * - integer end_time: Latest timestamp (in Unix time) of a comment to return. By default, the current - * time. - * - integer last_comments_count: - * - string start_from: Identificator needed to return the next page with results. Value for this - * parameter returns in 'next_from' field. - * - array fields: Additional fields of [vk.com/dev/fields|profiles] and - * [vk.com/dev/fields_groups|communities] to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getComments(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.getComments', $access_token, $params); - } + /** + * Returns a list of comments in the current user's newsfeed. + * + * @param string $access_token + * @param array $params + * - @var integer count: Number of comments to return. For auto feed, you can use the 'new_offset' parameter returned by this method. + * - @var array[NewsfeedFilters] filters: Filters to apply: 'post' — new comments on wall posts, 'photo' — new comments on photos, 'video' — new comments on videos, 'topic' — new comments on discussions, 'note' — new comments on notes, + * - @var string reposts: Object ID, comments on repost of which shall be returned, e.g. 'wall1_45486'. (If the parameter is set, the 'filters' parameter is optional.), + * - @var integer start_time: Earliest timestamp (in Unix time) of a comment to return. By default, 24 hours ago. + * - @var integer end_time: Latest timestamp (in Unix time) of a comment to return. By default, the current time. + * - @var integer last_comments_count + * - @var string start_from: Identificator needed to return the next page with results. Value for this parameter returns in 'next_from' field. + * - @var array[NewsfeedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getComments($access_token, array $params = []) { + return $this->request->post('newsfeed.getComments', $access_token, $params); + } - /** - * Returns a list of newsfeeds followed by the current user. - * - * @param $access_token string - * @param $params array - * - array list_ids: numeric list identifiers. - * - boolean extended: Return additional list info - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getLists(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.getLists', $access_token, $params); - } + /** + * Returns a list of newsfeeds followed by the current user. + * + * @param string $access_token + * @param array $params + * - @var array[integer] list_ids: numeric list identifiers. + * - @var boolean extended: Return additional list info + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getLists($access_token, array $params = []) { + return $this->request->post('newsfeed.getLists', $access_token, $params); + } - /** - * Returns a list of posts on user walls in which the current user is mentioned. - * - * @param $access_token string - * @param $params array - * - integer owner_id: Owner ID. - * - integer start_time: Earliest timestamp (in Unix time) of a post to return. By default, 24 hours ago. - * - integer end_time: Latest timestamp (in Unix time) of a post to return. By default, the current time. - * - integer offset: Offset needed to return a specific subset of posts. - * - integer count: Number of posts to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getMentions(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.getMentions', $access_token, $params); - } + /** + * Returns a list of posts on user walls in which the current user is mentioned. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: Owner ID. + * - @var integer start_time: Earliest timestamp (in Unix time) of a post to return. By default, 24 hours ago. + * - @var integer end_time: Latest timestamp (in Unix time) of a post to return. By default, the current time. + * - @var integer offset: Offset needed to return a specific subset of posts. + * - @var integer count: Number of posts to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getMentions($access_token, array $params = []) { + return $this->request->post('newsfeed.getMentions', $access_token, $params); + } - /** - * , Returns a list of newsfeeds recommended to the current user. - * - * @param $access_token string - * @param $params array - * - integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours - * ago. - * - integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current - * time. - * - integer max_photos: Maximum number of photos to return. By default, '5'. - * - string start_from: 'new_from' value obtained in previous call. - * - integer count: Number of news items to return. - * - array fields: Additional fields of [vk.com/dev/fields|profiles] and - * [vk.com/dev/fields_groups|communities] to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getRecommended(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.getRecommended', $access_token, $params); - } + /** + * , Returns a list of newsfeeds recommended to the current user. + * + * @param string $access_token + * @param array $params + * - @var integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago. + * - @var integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current time. + * - @var integer max_photos: Maximum number of photos to return. By default, '5'. + * - @var string start_from: 'new_from' value obtained in previous call. + * - @var integer count: Number of news items to return. + * - @var array[NewsfeedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getRecommended($access_token, array $params = []) { + return $this->request->post('newsfeed.getRecommended', $access_token, $params); + } - /** - * Returns communities and users that current user is suggested to follow. - * - * @param $access_token string - * @param $params array - * - integer offset: offset required to choose a particular subset of communities or users. - * - integer count: amount of communities or users to return. - * - boolean shuffle: shuffle the returned list or not. - * - array fields: list of extra fields to be returned. See available fields for [vk.com/dev/fields|users] - * and [vk.com/dev/fields_groups|communities]. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSuggestedSources(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.getSuggestedSources', $access_token, $params); - } + /** + * Returns communities and users that current user is suggested to follow. + * + * @param string $access_token + * @param array $params + * - @var integer offset: offset required to choose a particular subset of communities or users. + * - @var integer count: amount of communities or users to return. + * - @var boolean shuffle: shuffle the returned list or not. + * - @var array[NewsfeedFields] fields: list of extra fields to be returned. See available fields for [vk.com/dev/fields|users] and [vk.com/dev/fields_groups|communities]. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getSuggestedSources($access_token, array $params = []) { + return $this->request->post('newsfeed.getSuggestedSources', $access_token, $params); + } - /** - * Hides an item from the newsfeed. - * - * @param $access_token string - * @param $params array - * - string type: Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a photo,, - * *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. - * - integer owner_id: Item owner's identifier (user or community), "Note that community id must be - * negative. 'owner_id=1' - user , 'owner_id=-1' - community " - * - integer item_id: Item identifier - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function ignoreItem(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.ignoreItem', $access_token, $params); - } + /** + * Hides an item from the newsfeed. + * + * @param string $access_token + * @param array $params + * - @var IgnoreItemType type: Item type. Possible values: *'wall' – post on the wall,, *'tag' – tag on a photo,, *'profilephoto' – profile photo,, *'video' – video,, *'audio' – audio. + * - @var integer owner_id: Item owner's identifier (user or community), "Note that community id must be negative. 'owner_id=1' – user , 'owner_id=-1' – community " + * - @var integer item_id: Item identifier + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function ignoreItem($access_token, array $params = []) { + return $this->request->post('newsfeed.ignoreItem', $access_token, $params); + } - /** - * Creates and edits user newsfeed lists - * - * @param $access_token string - * @param $params array - * - integer list_id: numeric list identifier (if not sent, will be set automatically). - * - string title: list name. - * - array source_ids: users and communities identifiers to be added to the list. Community identifiers - * must be negative numbers. - * - boolean no_reposts: reposts display on and off ('1' is for off). - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function saveList(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.saveList', $access_token, $params); - } + /** + * Creates and edits user newsfeed lists + * + * @param string $access_token + * @param array $params + * - @var integer list_id: numeric list identifier (if not sent, will be set automatically). + * - @var string title: list name. + * - @var array[integer] source_ids: users and communities identifiers to be added to the list. Community identifiers must be negative numbers. + * - @var boolean no_reposts: reposts display on and off ('1' is for off). + * @throws VKClientException + * @throws VKApiException + * @throws VKApiTooManyListsException Too many feed lists + * @return mixed + */ + public function saveList($access_token, array $params = []) { + return $this->request->post('newsfeed.saveList', $access_token, $params); + } - /** - * Returns search results by statuses. - * - * @param $access_token string - * @param $params array - * - string q: Search query string (e.g., 'New Year'). - * - boolean extended: '1' — to return additional information about the user or community that placed - * the post. - * - integer count: Number of posts to return. - * - number latitude: Geographical latitude point (in degrees, -90 to 90) within which to search. - * - number longitude: Geographical longitude point (in degrees, -180 to 180) within which to search. - * - integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours - * ago. - * - integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current - * time. - * - string start_from: - * - array fields: Additional fields of [vk.com/dev/fields|profiles] and - * [vk.com/dev/fields_groups|communities] to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.search', $access_token, $params); - } + /** + * Returns search results by statuses. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query string (e.g., 'New Year'). + * - @var boolean extended: '1' — to return additional information about the user or community that placed the post. + * - @var integer count: Number of posts to return. + * - @var number latitude: Geographical latitude point (in degrees, -90 to 90) within which to search. + * - @var number longitude: Geographical longitude point (in degrees, -180 to 180) within which to search. + * - @var integer start_time: Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago. + * - @var integer end_time: Latest timestamp (in Unix time) of a news item to return. By default, the current time. + * - @var string start_from + * - @var array[NewsfeedFields] fields: Additional fields of [vk.com/dev/fields|profiles] and [vk.com/dev/fields_groups|communities] to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('newsfeed.search', $access_token, $params); + } - /** - * Returns a hidden item to the newsfeed. - * - * @param $access_token string - * @param $params array - * - string type: Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a photo,, - * *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. - * - integer owner_id: Item owner's identifier (user or community), "Note that community id must be - * negative. 'owner_id=1' - user , 'owner_id=-1' - community " - * - integer item_id: Item identifier - * - string track_code: Track code of unignored item - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function unignoreItem(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.unignoreItem', $access_token, $params); - } + /** + * Returns a hidden item to the newsfeed. + * + * @param string $access_token + * @param array $params + * - @var IgnoreItemType type: Item type. Possible values: *'wall' – post on the wall,, *'tag' – tag on a photo,, *'profilephoto' – profile photo,, *'video' – video,, *'audio' – audio. + * - @var integer owner_id: Item owner's identifier (user or community), "Note that community id must be negative. 'owner_id=1' – user , 'owner_id=-1' – community " + * - @var integer item_id: Item identifier + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function unignoreItem($access_token, array $params = []) { + return $this->request->post('newsfeed.unignoreItem', $access_token, $params); + } - /** - * Unsubscribes the current user from specified newsfeeds. - * - * @param $access_token string - * @param $params array - * - NewsfeedUnsubscribeType type: Type of object from which to unsubscribe: 'note' — note, 'photo' — - * photo, 'post' — post on user wall or community wall, 'topic' — topic, 'video' — video - * @see NewsfeedUnsubscribeType - * - integer owner_id: Object owner ID. - * - integer item_id: Object ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function unsubscribe(string $access_token, array $params = array()) { - return $this->request->post('newsfeed.unsubscribe', $access_token, $params); - } + /** + * Unsubscribes the current user from specified newsfeeds. + * + * @param string $access_token + * @param array $params + * - @var NewsfeedType type: Type of object from which to unsubscribe: 'note' — note, 'photo' — photo, 'post' — post on user wall or community wall, 'topic' — topic, 'video' — video + * - @var integer owner_id: Object owner ID. + * - @var integer item_id: Object ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function unsubscribe($access_token, array $params = []) { + return $this->request->post('newsfeed.unsubscribe', $access_token, $params); + } } diff --git a/src/VK/Actions/Notes.php b/src/VK/Actions/Notes.php index e4cf751..f77f024 100644 --- a/src/VK/Actions/Notes.php +++ b/src/VK/Actions/Notes.php @@ -1,226 +1,207 @@ request = $request; - } + /** + * Notes constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Creates a new note for the current user. - * - * @param $access_token string - * @param $params array - * - string title: Note title. - * - string text: Note text. - * - array privacy_view: - * - array privacy_comment: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function add(string $access_token, array $params = array()) { - return $this->request->post('notes.add', $access_token, $params); - } + /** + * Creates a new note for the current user. + * + * @param string $access_token + * @param array $params + * - @var string title: Note title. + * - @var string text: Note text. + * - @var array[string] privacy_view + * - @var array[string] privacy_comment + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function add($access_token, array $params = []) { + return $this->request->post('notes.add', $access_token, $params); + } - /** - * Adds a new comment on a note. - * - * @param $access_token string - * @param $params array - * - integer note_id: Note ID. - * - integer owner_id: Note owner ID. - * - integer reply_to: ID of the user to whom the reply is addressed (if the comment is a reply to another - * comment). - * - string message: Comment text. - * - string guid: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function createComment(string $access_token, array $params = array()) { - return $this->request->post('notes.createComment', $access_token, $params); - } + /** + * Adds a new comment on a note. + * + * @param string $access_token + * @param array $params + * - @var integer note_id: Note ID. + * - @var integer owner_id: Note owner ID. + * - @var integer reply_to: ID of the user to whom the reply is addressed (if the comment is a reply to another comment). + * - @var string message: Comment text. + * - @var string guid + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessNoteException Access to note denied + * @throws VKApiAccessNoteCommentException You can't comment this note + * @return mixed + */ + public function createComment($access_token, array $params = []) { + return $this->request->post('notes.createComment', $access_token, $params); + } - /** - * Deletes a note of the current user. - * - * @param $access_token string - * @param $params array - * - integer note_id: Note ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('notes.delete', $access_token, $params); - } + /** + * Deletes a note of the current user. + * + * @param string $access_token + * @param array $params + * - @var integer note_id: Note ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamNoteIdException Note not found + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('notes.delete', $access_token, $params); + } - /** - * Deletes a comment on a note. - * - * @param $access_token string - * @param $params array - * - integer comment_id: Comment ID. - * - integer owner_id: Note owner ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function deleteComment(string $access_token, array $params = array()) { - return $this->request->post('notes.deleteComment', $access_token, $params); - } + /** + * Deletes a comment on a note. + * + * @param string $access_token + * @param array $params + * - @var integer comment_id: Comment ID. + * - @var integer owner_id: Note owner ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessNoteException Access to note denied + * @throws VKApiAccessCommentException Access to comment denied + * @return mixed + */ + public function deleteComment($access_token, array $params = []) { + return $this->request->post('notes.deleteComment', $access_token, $params); + } - /** - * Edits a note of the current user. - * - * @param $access_token string - * @param $params array - * - integer note_id: Note ID. - * - string title: Note title. - * - string text: Note text. - * - array privacy_view: - * - array privacy_comment: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('notes.edit', $access_token, $params); - } + /** + * Edits a note of the current user. + * + * @param string $access_token + * @param array $params + * - @var integer note_id: Note ID. + * - @var string title: Note title. + * - @var string text: Note text. + * - @var array[string] privacy_view + * - @var array[string] privacy_comment + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamNoteIdException Note not found + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('notes.edit', $access_token, $params); + } - /** - * Edits a comment on a note. - * - * @param $access_token string - * @param $params array - * - integer comment_id: Comment ID. - * - integer owner_id: Note owner ID. - * - string message: New comment text. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function editComment(string $access_token, array $params = array()) { - return $this->request->post('notes.editComment', $access_token, $params); - } + /** + * Edits a comment on a note. + * + * @param string $access_token + * @param array $params + * - @var integer comment_id: Comment ID. + * - @var integer owner_id: Note owner ID. + * - @var string message: New comment text. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessCommentException Access to comment denied + * @return mixed + */ + public function editComment($access_token, array $params = []) { + return $this->request->post('notes.editComment', $access_token, $params); + } - /** - * Returns a list of notes created by a user. - * - * @param $access_token string - * @param $params array - * - array note_ids: Note IDs. - * - integer user_id: Note owner ID. - * - integer offset: - * - integer count: Number of notes to return. - * - NotesGetSort sort: - * @see NotesGetSort - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('notes.get', $access_token, $params); - } + /** + * Returns a list of notes created by a user. + * + * @param string $access_token + * @param array $params + * - @var array[integer] note_ids: Note IDs. + * - @var integer user_id: Note owner ID. + * - @var integer offset + * - @var integer count: Number of notes to return. + * - @var NotesSort sort + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamNoteIdException Note not found + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('notes.get', $access_token, $params); + } - /** - * Returns a note by its ID. - * - * @param $access_token string - * @param $params array - * - integer note_id: Note ID. - * - integer owner_id: Note owner ID. - * - boolean need_wiki: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('notes.getById', $access_token, $params); - } + /** + * Returns a note by its ID. + * + * @param string $access_token + * @param array $params + * - @var integer note_id: Note ID. + * - @var integer owner_id: Note owner ID. + * - @var boolean need_wiki + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessNoteException Access to note denied + * @throws VKApiParamNoteIdException Note not found + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('notes.getById', $access_token, $params); + } - /** - * Returns a list of comments on a note. - * - * @param $access_token string - * @param $params array - * - integer note_id: Note ID. - * - integer owner_id: Note owner ID. - * - NotesGetCommentsSort sort: - * @see NotesGetCommentsSort - * - integer offset: - * - integer count: Number of comments to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getComments(string $access_token, array $params = array()) { - return $this->request->post('notes.getComments', $access_token, $params); - } + /** + * Returns a list of comments on a note. + * + * @param string $access_token + * @param array $params + * - @var integer note_id: Note ID. + * - @var integer owner_id: Note owner ID. + * - @var NotesSort sort + * - @var integer offset + * - @var integer count: Number of comments to return. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessNoteException Access to note denied + * @return mixed + */ + public function getComments($access_token, array $params = []) { + return $this->request->post('notes.getComments', $access_token, $params); + } - /** - * Restores a deleted comment on a note. - * - * @param $access_token string - * @param $params array - * - integer comment_id: Comment ID. - * - integer owner_id: Note owner ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function restoreComment(string $access_token, array $params = array()) { - return $this->request->post('notes.restoreComment', $access_token, $params); - } + /** + * Restores a deleted comment on a note. + * + * @param string $access_token + * @param array $params + * - @var integer comment_id: Comment ID. + * - @var integer owner_id: Note owner ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessCommentException Access to comment denied + * @return mixed + */ + public function restoreComment($access_token, array $params = []) { + return $this->request->post('notes.restoreComment', $access_token, $params); + } } diff --git a/src/VK/Actions/Notifications.php b/src/VK/Actions/Notifications.php index 322574d..48d0735 100644 --- a/src/VK/Actions/Notifications.php +++ b/src/VK/Actions/Notifications.php @@ -1,92 +1,72 @@ request = $request; - } + /** + * Notifications constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns a list of notifications about other users' feedback to the current user's wall posts. - * - * @param $access_token string - * @param $params array - * - integer count: Number of notifications to return. - * - string start_from: - * - array filters: Type of notifications to return: 'wall' — wall posts, 'mentions' — mentions in - * wall posts, comments, or topics, 'comments' — comments to wall posts, photos, and videos, 'likes' — - * likes, 'reposted' — wall posts that are copied from the current user's wall, 'followers' — new - * followers, 'friends' — accepted friend requests - * - integer start_time: Earliest timestamp (in Unix time) of a notification to return. By default, 24 - * hours ago. - * - integer end_time: Latest timestamp (in Unix time) of a notification to return. By default, the - * current time. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('notifications.get', $access_token, $params); - } + /** + * Returns a list of notifications about other users' feedback to the current user's wall posts. + * + * @param string $access_token + * @param array $params + * - @var integer count: Number of notifications to return. + * - @var string start_from + * - @var array[NotificationsFilters] filters: Type of notifications to return: 'wall' — wall posts, 'mentions' — mentions in wall posts, comments, or topics, 'comments' — comments to wall posts, photos, and videos, 'likes' — likes, 'reposted' — wall posts that are copied from the current user's wall, 'followers' — new followers, 'friends' — accepted friend requests + * - @var integer start_time: Earliest timestamp (in Unix time) of a notification to return. By default, 24 hours ago. + * - @var integer end_time: Latest timestamp (in Unix time) of a notification to return. By default, the current time. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('notifications.get', $access_token, $params); + } - /** - * Resets the counter of new notifications about other users' feedback to the current user's wall posts. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function markAsViewed(string $access_token, array $params = array()) { - return $this->request->post('notifications.markAsViewed', $access_token, $params); - } + /** + * Resets the counter of new notifications about other users' feedback to the current user's wall posts. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function markAsViewed($access_token) { + return $this->request->post('notifications.markAsViewed', $access_token); + } - /** - * - * - * @param $access_token string - * @param $params array - * - array user_ids: - * - string message: - * - string fragment: - * - integer group_id: - * - integer random_id: - * - NotificationsSendMessageSendingMode sending_mode: Type of sending (delivering) notifications: - * 'immediately' — push and bell notifications will be delivered as soon as possible, 'delayed' — push and - * bell notifications will be delivered in the most comfortable time for the user, 'delayed_push' — only push - * notifications will be delivered in the most comfortable time, while the bell notifications will be delivered - * as soon as possible - * @see NotificationsSendMessageSendingMode - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function sendMessage(string $access_token, array $params = array()) { - return $this->request->post('notifications.sendMessage', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var array[integer] user_ids + * - @var string message + * - @var string fragment + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiGroupAppIsNotInstalledInCommunityException Application is not installed in community + * @return mixed + */ + public function sendMessage($access_token, array $params = []) { + return $this->request->post('notifications.sendMessage', $access_token, $params); + } } diff --git a/src/VK/Actions/Orders.php b/src/VK/Actions/Orders.php index c787b34..c84fb5a 100644 --- a/src/VK/Actions/Orders.php +++ b/src/VK/Actions/Orders.php @@ -1,179 +1,152 @@ request = $request; - } + /** + * Orders constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer subscription_id: - * - boolean pending_cancel: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function cancelSubscription(string $access_token, array $params = array()) { - return $this->request->post('orders.cancelSubscription', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer user_id + * - @var integer subscription_id + * - @var boolean pending_cancel + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAppsSubscriptionNotFoundException Subscription not found + * @throws VKApiAppsSubscriptionInvalidStatusException Subscription is in invalid status + * @return mixed + */ + public function cancelSubscription($access_token, array $params = []) { + return $this->request->post('orders.cancelSubscription', $access_token, $params); + } - /** - * Changes order status. - * - * @param $access_token string - * @param $params array - * - integer order_id: order ID. - * - OrdersChangeStateAction action: action to be done with the order. Available actions: *cancel — to - * cancel unconfirmed order. *charge — to confirm unconfirmed order. Applies only if processing of - * [vk.com/dev/payments_status|order_change_state] notification failed. *refund — to cancel confirmed order. - * @see OrdersChangeStateAction - * - integer app_order_id: internal ID of the order in the application. - * - boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By - * default — 0. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function changeState(string $access_token, array $params = array()) { - return $this->request->post('orders.changeState', $access_token, $params); - } + /** + * Changes order status. + * + * @param string $access_token + * @param array $params + * - @var integer order_id: order ID. + * - @var OrdersAction action: action to be done with the order. Available actions: *cancel — to cancel unconfirmed order. *charge — to confirm unconfirmed order. Applies only if processing of [vk.com/dev/payments_status|order_change_state] notification failed. *refund — to cancel confirmed order. + * - @var integer app_order_id: internal ID of the order in the application. + * - @var boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By default — 0. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @throws VKApiActionFailedException Unable to process action + * @return mixed + */ + public function changeState($access_token, array $params = []) { + return $this->request->post('orders.changeState', $access_token, $params); + } - /** - * Returns a list of orders. - * - * @param $access_token string - * @param $params array - * - integer offset: - * - integer count: number of returned orders. - * - boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By - * default — 0. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('orders.get', $access_token, $params); - } + /** + * Returns a list of orders. + * + * @param string $access_token + * @param array $params + * - @var integer offset + * - @var integer count: number of returned orders. + * - @var boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By default — 0. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('orders.get', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - array votes: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAmount(string $access_token, array $params = array()) { - return $this->request->post('orders.getAmount', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer user_id + * - @var array[string] votes + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getAmount($access_token, array $params = []) { + return $this->request->post('orders.getAmount', $access_token, $params); + } - /** - * Returns information about orders by their IDs. - * - * @param $access_token string - * @param $params array - * - integer order_id: order ID. - * - array order_ids: order IDs (when information about several orders is requested). - * - boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By - * default — 0. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('orders.getById', $access_token, $params); - } + /** + * Returns information about orders by their IDs. + * + * @param string $access_token + * @param array $params + * - @var integer order_id: order ID. + * - @var array[integer] order_ids: order IDs (when information about several orders is requested). + * - @var boolean test_mode: if this parameter is set to 1, this method returns a list of test mode orders. By default — 0. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('orders.getById', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer subscription_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getUserSubscriptionById(string $access_token, array $params = array()) { - return $this->request->post('orders.getUserSubscriptionById', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer user_id + * - @var integer subscription_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAppsSubscriptionNotFoundException Subscription not found + * @return mixed + */ + public function getUserSubscriptionById($access_token, array $params = []) { + return $this->request->post('orders.getUserSubscriptionById', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getUserSubscriptions(string $access_token, array $params = array()) { - return $this->request->post('orders.getUserSubscriptions', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer user_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getUserSubscriptions($access_token, array $params = []) { + return $this->request->post('orders.getUserSubscriptions', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer subscription_id: - * - integer price: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function updateSubscription(string $access_token, array $params = array()) { - return $this->request->post('orders.updateSubscription', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer user_id + * - @var integer subscription_id + * - @var integer price + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAppsSubscriptionNotFoundException Subscription not found + * @throws VKApiAppsSubscriptionInvalidStatusException Subscription is in invalid status + * @return mixed + */ + public function updateSubscription($access_token, array $params = []) { + return $this->request->post('orders.updateSubscription', $access_token, $params); + } } diff --git a/src/VK/Actions/Pages.php b/src/VK/Actions/Pages.php index d3e0a30..fab4acf 100644 --- a/src/VK/Actions/Pages.php +++ b/src/VK/Actions/Pages.php @@ -1,187 +1,171 @@ request = $request; - } + /** + * Pages constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Allows to clear the cache of particular 'external' pages which may be attached to VK posts. - * - * @param $access_token string - * @param $params array - * - string url: Address of the page where you need to refesh the cached version - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function clearCache(string $access_token, array $params = array()) { - return $this->request->post('pages.clearCache', $access_token, $params); - } + /** + * Allows to clear the cache of particular 'external' pages which may be attached to VK posts. + * + * @param string $access_token + * @param array $params + * - @var string url: Address of the page where you need to refesh the cached version + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function clearCache($access_token, array $params = []) { + return $this->request->post('pages.clearCache', $access_token, $params); + } - /** - * Returns information about a wiki page. - * - * @param $access_token string - * @param $params array - * - integer owner_id: Page owner ID. - * - integer page_id: Wiki page ID. - * - boolean global: '1' — to return information about a global wiki page - * - boolean site_preview: '1' — resulting wiki page is a preview for the attached link - * - string title: Wiki page title. - * - boolean need_source: - * - boolean need_html: '1' — to return the page as HTML, - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('pages.get', $access_token, $params); - } + /** + * Returns information about a wiki page. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: Page owner ID. + * - @var integer page_id: Wiki page ID. + * - @var boolean global: '1' — to return information about a global wiki page + * - @var boolean site_preview: '1' — resulting wiki page is a preview for the attached link + * - @var string title: Wiki page title. + * - @var boolean need_source + * - @var boolean need_html: '1' — to return the page as HTML, + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('pages.get', $access_token, $params); + } - /** - * Returns a list of all previous versions of a wiki page. - * - * @param $access_token string - * @param $params array - * - integer page_id: Wiki page ID. - * - integer group_id: ID of the community that owns the wiki page. - * - integer user_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function getHistory(string $access_token, array $params = array()) { - return $this->request->post('pages.getHistory', $access_token, $params); - } + /** + * Returns a list of all previous versions of a wiki page. + * + * @param string $access_token + * @param array $params + * - @var integer page_id: Wiki page ID. + * - @var integer group_id: ID of the community that owns the wiki page. + * - @var integer user_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessPageException Access to page denied + * @throws VKApiParamPageIdException Page not found + * @return mixed + */ + public function getHistory($access_token, array $params = []) { + return $this->request->post('pages.getHistory', $access_token, $params); + } - /** - * Returns a list of wiki pages in a group. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of the community that owns the wiki page. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getTitles(string $access_token, array $params = array()) { - return $this->request->post('pages.getTitles', $access_token, $params); - } + /** + * Returns a list of wiki pages in a group. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of the community that owns the wiki page. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessPageException Access to page denied + * @return mixed + */ + public function getTitles($access_token, array $params = []) { + return $this->request->post('pages.getTitles', $access_token, $params); + } - /** - * Returns the text of one of the previous versions of a wiki page. - * - * @param $access_token string - * @param $params array - * - integer version_id: - * - integer group_id: ID of the community that owns the wiki page. - * - integer user_id: - * - boolean need_html: '1' — to return the page as HTML - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getVersion(string $access_token, array $params = array()) { - return $this->request->post('pages.getVersion', $access_token, $params); - } + /** + * Returns the text of one of the previous versions of a wiki page. + * + * @param string $access_token + * @param array $params + * - @var integer version_id + * - @var integer group_id: ID of the community that owns the wiki page. + * - @var integer user_id + * - @var boolean need_html: '1' — to return the page as HTML + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessPageException Access to page denied + * @return mixed + */ + public function getVersion($access_token, array $params = []) { + return $this->request->post('pages.getVersion', $access_token, $params); + } - /** - * Returns HTML representation of the wiki markup. - * - * @param $access_token string - * @param $params array - * - string text: Text of the wiki page. - * - integer group_id: ID of the group in the context of which this markup is interpreted. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function parseWiki(string $access_token, array $params = array()) { - return $this->request->post('pages.parseWiki', $access_token, $params); - } + /** + * Returns HTML representation of the wiki markup. + * + * @param string $access_token + * @param array $params + * - @var string text: Text of the wiki page. + * - @var integer group_id: ID of the group in the context of which this markup is interpreted. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function parseWiki($access_token, array $params = []) { + return $this->request->post('pages.parseWiki', $access_token, $params); + } - /** - * Saves the text of a wiki page. - * - * @param $access_token string - * @param $params array - * - string text: Text of the wiki page in wiki-format. - * - integer page_id: Wiki page ID. The 'title' parameter can be passed instead of 'pid'. - * - integer group_id: ID of the community that owns the wiki page. - * - integer user_id: User ID - * - string title: Wiki page title. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function save(string $access_token, array $params = array()) { - return $this->request->post('pages.save', $access_token, $params); - } + /** + * Saves the text of a wiki page. + * + * @param string $access_token + * @param array $params + * - @var string text: Text of the wiki page in wiki-format. + * - @var integer page_id: Wiki page ID. The 'title' parameter can be passed instead of 'pid'. + * - @var integer group_id: ID of the community that owns the wiki page. + * - @var integer user_id: User ID + * - @var string title: Wiki page title. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessPageException Access to page denied + * @throws VKApiParamPageIdException Page not found + * @throws VKApiParamTitleException Invalid title + * @return mixed + */ + public function save($access_token, array $params = []) { + return $this->request->post('pages.save', $access_token, $params); + } - /** - * Saves modified read and edit access settings for a wiki page. - * - * @param $access_token string - * @param $params array - * - integer page_id: Wiki page ID. - * - integer group_id: ID of the community that owns the wiki page. - * - integer user_id: - * - PagesSaveAccessView view: Who can view the wiki page: '1' — only community members, '2' — all - * users can view the page, '0' — only community managers - * @see PagesSaveAccessView - * - PagesSaveAccessEdit edit: Who can edit the wiki page: '1' — only community members, '2' — all - * users can edit the page, '0' — only community managers - * @see PagesSaveAccessEdit - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function saveAccess(string $access_token, array $params = array()) { - return $this->request->post('pages.saveAccess', $access_token, $params); - } + /** + * Saves modified read and edit access settings for a wiki page. + * + * @param string $access_token + * @param array $params + * - @var integer page_id: Wiki page ID. + * - @var integer group_id: ID of the community that owns the wiki page. + * - @var integer user_id + * - @var PagesView view: Who can view the wiki page: '1' — only community members, '2' — all users can view the page, '0' — only community managers + * - @var PagesEdit edit: Who can edit the wiki page: '1' — only community members, '2' — all users can edit the page, '0' — only community managers + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessPageException Access to page denied + * @throws VKApiParamPageIdException Page not found + * @return mixed + */ + public function saveAccess($access_token, array $params = []) { + return $this->request->post('pages.saveAccess', $access_token, $params); + } } diff --git a/src/VK/Actions/Photos.php b/src/VK/Actions/Photos.php index 9152ac8..f5f9096 100644 --- a/src/VK/Actions/Photos.php +++ b/src/VK/Actions/Photos.php @@ -1,978 +1,855 @@ request = $request; - } - - /** - * Confirms a tag on a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - string photo_id: Photo ID. - * - integer tag_id: Tag ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function confirmTag(string $access_token, array $params = array()) { - return $this->request->post('photos.confirmTag', $access_token, $params); - } - - /** - * Allows to copy a photo to the "Saved photos" album - * - * @param $access_token string - * @param $params array - * - integer owner_id: photo's owner ID - * - integer photo_id: photo ID - * - string access_key: for private photos - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function copy(string $access_token, array $params = array()) { - return $this->request->post('photos.copy', $access_token, $params); - } - - /** - * Creates an empty photo album. - * - * @param $access_token string - * @param $params array - * - string title: Album title. - * - integer group_id: ID of the community in which the album will be created. - * - string description: Album description. - * - array privacy_view: - * - array privacy_comment: - * - boolean upload_by_admins_only: - * - boolean comments_disabled: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function createAlbum(string $access_token, array $params = array()) { - return $this->request->post('photos.createAlbum', $access_token, $params); - } - - /** - * Adds a new comment on the photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - string message: Comment text. - * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the - * following format: "_,_", '' — Type of media attachment: 'photo' - * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — Media attachment owner - * ID. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" - * - boolean from_group: '1' — to post a comment from the community - * - integer reply_to_comment: - * - integer sticker_id: - * - string access_key: - * - string guid: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function createComment(string $access_token, array $params = array()) { - return $this->request->post('photos.createComment', $access_token, $params); - } - - /** - * Deletes a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('photos.delete', $access_token, $params); - } - - /** - * Deletes a photo album belonging to the current user. - * - * @param $access_token string - * @param $params array - * - integer album_id: Album ID. - * - integer group_id: ID of the community that owns the album. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function deleteAlbum(string $access_token, array $params = array()) { - return $this->request->post('photos.deleteAlbum', $access_token, $params); - } - - /** - * Deletes a comment on the photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer comment_id: Comment ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteComment(string $access_token, array $params = array()) { - return $this->request->post('photos.deleteComment', $access_token, $params); - } - - /** - * Edits the caption of a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - string caption: New caption for the photo. If this parameter is not set, it is considered to be equal - * to an empty string. - * - number latitude: - * - number longitude: - * - string place_str: - * - string foursquare_id: - * - boolean delete_place: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('photos.edit', $access_token, $params); - } - - /** - * Edits information about a photo album. - * - * @param $access_token string - * @param $params array - * - integer album_id: ID of the photo album to be edited. - * - string title: New album title. - * - string description: New album description. - * - integer owner_id: ID of the user or community that owns the album. - * - array privacy_view: - * - array privacy_comment: - * - boolean upload_by_admins_only: - * - boolean comments_disabled: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function editAlbum(string $access_token, array $params = array()) { - return $this->request->post('photos.editAlbum', $access_token, $params); - } - - /** - * Edits a comment on a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer comment_id: Comment ID. - * - string message: New text of the comment. - * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the - * following format: "_,_", '' — Type of media attachment: 'photo' - * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — Media attachment owner - * ID. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function editComment(string $access_token, array $params = array()) { - return $this->request->post('photos.editComment', $access_token, $params); - } - - /** - * Returns a list of a user's or community's photos. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photos. Use a negative value to designate - * a community ID. - * - string album_id: Photo album ID. To return information about photos from service albums, use the - * following string values: 'profile, wall, saved'. - * - array photo_ids: Photo IDs. - * - boolean rev: Sort order: '1' — reverse chronological, '0' — chronological - * - boolean extended: '1' — to return additional 'likes', 'comments', and 'tags' fields, '0' — - * (default) - * - string feed_type: Type of feed obtained in 'feed' field of the method. - * - integer feed: unixtime, that can be obtained with [vk.com/dev/newsfeed.get|newsfeed.get] method in - * date field to get all photos uploaded by the user on a specific day, or photos the user has been tagged on. - * Also, 'uid' parameter of the user the event happened with shall be specified. - * - boolean photo_sizes: '1' — to return photo sizes in a [vk.com/dev/photo_sizes|special format] - * - integer offset: - * - integer count: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('photos.get', $access_token, $params); - } - - /** - * Returns a list of a user's or community's photo albums. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the albums. - * - array album_ids: Album IDs. - * - integer offset: Offset needed to return a specific subset of albums. - * - integer count: Number of albums to return. - * - boolean need_system: '1' — to return system albums with negative IDs - * - boolean need_covers: '1' — to return an additional 'thumb_src' field, '0' — (default) - * - boolean photo_sizes: '1' — to return photo sizes in a - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAlbums(string $access_token, array $params = array()) { - return $this->request->post('photos.getAlbums', $access_token, $params); - } - - /** - * Returns the number of photo albums belonging to a user or community. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - integer group_id: Community ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAlbumsCount(string $access_token, array $params = array()) { - return $this->request->post('photos.getAlbumsCount', $access_token, $params); - } - - /** - * Returns a list of photos belonging to a user or community, in reverse chronological order. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of a user or community that owns the photos. Use a negative value to designate a - * community ID. - * - boolean extended: '1' — to return detailed information about photos - * - integer offset: Offset needed to return a specific subset of photos. By default, '0'. - * - integer count: Number of photos to return. - * - boolean photo_sizes: '1' - to return image sizes in [vk.com/dev/photo_sizes|special format]. - * - boolean 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) - * - boolean need_hidden: '1' - to show information about photos being hidden from the block above the - * wall. - * - boolean 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. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getAll(string $access_token, array $params = array()) { - return $this->request->post('photos.getAll', $access_token, $params); - } - - /** - * Returns a list of comments on a specific photo album or all albums of the user sorted in reverse chronological - * order. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the album(s). - * - integer album_id: Album ID. If the parameter is not set, comments on all of the user's albums will be - * returned. - * - boolean need_likes: '1' — to return an additional 'likes' field, '0' — (default) - * - integer offset: Offset needed to return a specific subset of comments. By default, '0'. - * - integer count: Number of comments to return. By default, '20'. Maximum value, '100'. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getAllComments(string $access_token, array $params = array()) { - return $this->request->post('photos.getAllComments', $access_token, $params); - } - - /** - * Returns information about photos by their IDs. - * - * @param $access_token string - * @param $params array - * - array photos: IDs separated with a comma, that are IDs of users who posted photos and IDs of photos - * themselves with an underscore character between such IDs. To get information about a photo in the group - * album, you shall specify group ID instead of user ID. Example: "1_129207899,6492_135055734, , - * -20629724_271945303" - * - boolean extended: '1' — to return additional fields, '0' — (default) - * - boolean photo_sizes: '1' — to return photo sizes in a - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('photos.getById', $access_token, $params); - } - - /** - * Returns an upload link for chat cover pictures. - * - * @param $access_token string - * @param $params array - * - integer chat_id: ID of the chat for which you want to upload a cover photo. - * - integer crop_x: - * - integer crop_y: - * - integer crop_width: Width (in pixels) of the photo after cropping. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getChatUploadServer(string $access_token, array $params = array()) { - return $this->request->post('photos.getChatUploadServer', $access_token, $params); - } - - /** - * Returns a list of comments on a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - boolean need_likes: '1' — to return an additional 'likes' field, '0' — (default) - * - integer start_comment_id: - * - integer offset: Offset needed to return a specific subset of comments. By default, '0'. - * - integer count: Number of comments to return. - * - PhotosGetCommentsSort sort: Sort order: 'asc' — old first, 'desc' — new first - * @see PhotosGetCommentsSort - * - string access_key: - * - boolean extended: - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getComments(string $access_token, array $params = array()) { - return $this->request->post('photos.getComments', $access_token, $params); - } - - /** - * Returns the server address for market album photo upload. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getMarketAlbumUploadServer(string $access_token, array $params = array()) { - return $this->request->post('photos.getMarketAlbumUploadServer', $access_token, $params); - } - - /** - * Returns the server address for market photo upload. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - boolean main_photo: '1' if you want to upload the main item photo. - * - integer crop_x: X coordinate of the crop left upper corner. - * - integer crop_y: Y coordinate of the crop left upper corner. - * - integer crop_width: Width of the cropped photo in px. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getMarketUploadServer(string $access_token, array $params = array()) { - return $this->request->post('photos.getMarketUploadServer', $access_token, $params); - } - - /** - * Returns the server address for photo upload in a private message for a user. - * - * @param $access_token string - * @param $params array - * - integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat - * ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getMessagesUploadServer(string $access_token, array $params = array()) { - return $this->request->post('photos.getMessagesUploadServer', $access_token, $params); - } - - /** - * Returns a list of photos with tags that have not been viewed. - * - * @param $access_token string - * @param $params array - * - integer offset: Offset needed to return a specific subset of photos. - * - integer count: Number of photos to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getNewTags(string $access_token, array $params = array()) { - return $this->request->post('photos.getNewTags', $access_token, $params); - } - - /** - * Returns the server address for owner cover upload. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of community that owns the album (if the photo will be uploaded to a community - * album). - * - integer crop_x: X coordinate of the left-upper corner - * - integer crop_y: Y coordinate of the left-upper corner - * - integer crop_x2: X coordinate of the right-bottom corner - * - integer crop_y2: Y coordinate of the right-bottom corner - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getOwnerCoverPhotoUploadServer(string $access_token, array $params = array()) { - return $this->request->post('photos.getOwnerCoverPhotoUploadServer', $access_token, $params); - } - - /** - * Returns an upload server address for a profile or community photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: identifier of a community or current user. "Note that community id must be - * negative. 'owner_id=1' - user, 'owner_id=-1' - community, " - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getOwnerPhotoUploadServer(string $access_token, array $params = array()) { - return $this->request->post('photos.getOwnerPhotoUploadServer', $access_token, $params); - } - - /** - * Returns a list of tags on a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - string access_key: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getTags(string $access_token, array $params = array()) { - return $this->request->post('photos.getTags', $access_token, $params); - } - - /** - * Returns the server address for photo upload. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of community that owns the album (if the photo will be uploaded to a community - * album). - * - integer album_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getUploadServer(string $access_token, array $params = array()) { - return $this->request->post('photos.getUploadServer', $access_token, $params); - } - - /** - * Returns a list of photos in which a user is tagged. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - integer offset: Offset needed to return a specific subset of photos. By default, '0'. - * - integer count: Number of photos to return. Maximum value is 1000. - * - boolean extended: '1' — to return an additional 'likes' field, '0' — (default) - * - string sort: Sort order: '1' — by date the tag was added in ascending order, '0' — by date the - * tag was added in descending order - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getUserPhotos(string $access_token, array $params = array()) { - return $this->request->post('photos.getUserPhotos', $access_token, $params); - } - - /** - * Returns the server address for photo upload onto a user's wall. - * - * @param $access_token string - * @param $params array - * - integer group_id: ID of community to whose wall the photo will be uploaded. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getWallUploadServer(string $access_token, array $params = array()) { - return $this->request->post('photos.getWallUploadServer', $access_token, $params); - } - - /** - * Makes a photo into an album cover. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - integer album_id: Album ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function makeCover(string $access_token, array $params = array()) { - return $this->request->post('photos.makeCover', $access_token, $params); - } - - /** - * Moves a photo from one album to another. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer target_album_id: ID of the album to which the photo will be moved. - * - integer photo_id: Photo ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function move(string $access_token, array $params = array()) { - return $this->request->post('photos.move', $access_token, $params); - } - - /** - * Adds a tag on the photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - integer user_id: ID of the user to be tagged. - * - number x: Upper left-corner coordinate of the tagged area (as a percentage of the photo's width). - * - number y: Upper left-corner coordinate of the tagged area (as a percentage of the photo's height). - * - number x2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's width). - * - number y2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's height). - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function putTag(string $access_token, array $params = array()) { - return $this->request->post('photos.putTag', $access_token, $params); - } - - /** - * Removes a tag from a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - integer tag_id: Tag ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function removeTag(string $access_token, array $params = array()) { - return $this->request->post('photos.removeTag', $access_token, $params); - } - - /** - * Reorders the album in the list of user albums. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the album. - * - integer album_id: Album ID. - * - integer before: ID of the album before which the album in question shall be placed. - * - integer after: ID of the album after which the album in question shall be placed. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function reorderAlbums(string $access_token, array $params = array()) { - return $this->request->post('photos.reorderAlbums', $access_token, $params); - } - - /** - * Reorders the photo in the list of photos of the user album. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - integer before: ID of the photo before which the photo in question shall be placed. - * - integer after: ID of the photo after which the photo in question shall be placed. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function reorderPhotos(string $access_token, array $params = array()) { - return $this->request->post('photos.reorderPhotos', $access_token, $params); - } - - /** - * Reports (submits a complaint about) a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - PhotosReportReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - - * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse - * @see PhotosReportReason - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function report(string $access_token, array $params = array()) { - return $this->request->post('photos.report', $access_token, $params); - } - - /** - * Reports (submits a complaint about) a comment on a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer comment_id: ID of the comment being reported. - * - PhotosReportCommentReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - * - extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse - * @see PhotosReportCommentReason - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function reportComment(string $access_token, array $params = array()) { - return $this->request->post('photos.reportComment', $access_token, $params); - } - - /** - * Restores a deleted photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer photo_id: Photo ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function restore(string $access_token, array $params = array()) { - return $this->request->post('photos.restore', $access_token, $params); - } - - /** - * Restores a deleted comment on a photo. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the photo. - * - integer comment_id: ID of the deleted comment. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function restoreComment(string $access_token, array $params = array()) { - return $this->request->post('photos.restoreComment', $access_token, $params); - } - - /** - * Saves photos after successful uploading. - * - * @param $access_token string - * @param $params array - * - integer album_id: ID of the album to save photos to. - * - integer group_id: ID of the community to save photos to. - * - integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - string photos_list: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - number latitude: Geographical latitude, in degrees (from '-90' to '90'). - * - number longitude: Geographical longitude, in degrees (from '-180' to '180'). - * - string caption: Text describing the photo. 2048 digits max. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function save(string $access_token, array $params = array()) { - return $this->request->post('photos.save', $access_token, $params); - } - - /** - * Saves market album photos after successful uploading. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function saveMarketAlbumPhoto(string $access_token, array $params = array()) { - return $this->request->post('photos.saveMarketAlbumPhoto', $access_token, $params); - } - - /** - * Saves market photos after successful uploading. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - string crop_data: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - string crop_hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function saveMarketPhoto(string $access_token, array $params = array()) { - return $this->request->post('photos.saveMarketPhoto', $access_token, $params); - } - - /** - * Saves a photo after being successfully uploaded. URL obtained with - * [vk.com/dev/photos.getMessagesUploadServer|photos.getMessagesUploadServer] method. - * - * @param $access_token string - * @param $params array - * - string photo: Parameter returned when the photo is [vk.com/dev/upload_files|uploaded to the server]. - * - integer server: - * - string hash: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function saveMessagesPhoto(string $access_token, array $params = array()) { - return $this->request->post('photos.saveMessagesPhoto', $access_token, $params); - } - - /** - * Saves cover photo after successful uploading. - * - * @param $access_token string - * @param $params array - * - string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function saveOwnerCoverPhoto(string $access_token, array $params = array()) { - return $this->request->post('photos.saveOwnerCoverPhoto', $access_token, $params); - } - - /** - * Saves a profile or community photo. Upload URL can be got with the - * [vk.com/dev/photos.getOwnerPhotoUploadServer|photos.getOwnerPhotoUploadServer] method. - * - * @param $access_token string - * @param $params array - * - string server: parameter returned after [vk.com/dev/upload_files|photo upload]. - * - string hash: parameter returned after [vk.com/dev/upload_files|photo upload]. - * - string photo: parameter returned after [vk.com/dev/upload_files|photo upload]. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function saveOwnerPhoto(string $access_token, array $params = array()) { - return $this->request->post('photos.saveOwnerPhoto', $access_token, $params); - } - - /** - * Saves a photo to a user's or community's wall after being uploaded. - * - * @param $access_token string - * @param $params array - * - integer user_id: ID of the user on whose wall the photo will be saved. - * - integer group_id: ID of community on whose wall the photo will be saved. - * - string photo: Parameter returned when the the photo is [vk.com/dev/upload_files|uploaded to the - * server]. - * - integer server: - * - string hash: - * - number latitude: Geographical latitude, in degrees (from '-90' to '90'). - * - number longitude: Geographical longitude, in degrees (from '-180' to '180'). - * - string caption: Text describing the photo. 2048 digits max. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function saveWallPhoto(string $access_token, array $params = array()) { - return $this->request->post('photos.saveWallPhoto', $access_token, $params); - } - - /** - * Returns a list of photos. - * - * @param $access_token string - * @param $params array - * - string q: Search query string. - * - number lat: Geographical latitude, in degrees (from '-90' to '90'). - * - number long: Geographical longitude, in degrees (from '-180' to '180'). - * - integer start_time: - * - integer end_time: - * - integer sort: Sort order: - * - integer offset: Offset needed to return a specific subset of photos. - * - integer count: Number of photos to return. - * - integer radius: Radius of search in meters (works very approximately). Available values: '10', '100', - * '800', '6000', '50000'. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('photos.search', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Photos constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Confirms a tag on a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var string photo_id: Photo ID. + * - @var integer tag_id: Tag ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function confirmTag($access_token, array $params = []) { + return $this->request->post('photos.confirmTag', $access_token, $params); + } + + /** + * Allows to copy a photo to the "Saved photos" album + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: photo's owner ID + * - @var integer photo_id: photo ID + * - @var string access_key: for private photos + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function copy($access_token, array $params = []) { + return $this->request->post('photos.copy', $access_token, $params); + } + + /** + * Creates an empty photo album. + * + * @param string $access_token + * @param array $params + * - @var string title: Album title. + * - @var integer group_id: ID of the community in which the album will be created. + * - @var string description: Album description. + * - @var array[string] privacy_view + * - @var array[string] privacy_comment + * - @var boolean upload_by_admins_only + * - @var boolean comments_disabled + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAlbumsLimitException Albums number limit is reached + * @return mixed + */ + public function createAlbum($access_token, array $params = []) { + return $this->request->post('photos.createAlbum', $access_token, $params); + } + + /** + * Adds a new comment on the photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * - @var string message: Comment text. + * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — Media attachment owner ID. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * - @var boolean from_group: '1' — to post a comment from the community + * - @var integer reply_to_comment + * - @var integer sticker_id + * - @var string access_key + * - @var string guid + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function createComment($access_token, array $params = []) { + return $this->request->post('photos.createComment', $access_token, $params); + } + + /** + * Deletes a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('photos.delete', $access_token, $params); + } + + /** + * Deletes a photo album belonging to the current user. + * + * @param string $access_token + * @param array $params + * - @var integer album_id: Album ID. + * - @var integer group_id: ID of the community that owns the album. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamAlbumIdException Invalid album id + * @return mixed + */ + public function deleteAlbum($access_token, array $params = []) { + return $this->request->post('photos.deleteAlbum', $access_token, $params); + } + + /** + * Deletes a comment on the photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer comment_id: Comment ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteComment($access_token, array $params = []) { + return $this->request->post('photos.deleteComment', $access_token, $params); + } + + /** + * Edits the caption of a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * - @var string caption: New caption for the photo. If this parameter is not set, it is considered to be equal to an empty string. + * - @var number latitude + * - @var number longitude + * - @var string place_str + * - @var string foursquare_id + * - @var boolean delete_place + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('photos.edit', $access_token, $params); + } + + /** + * Edits information about a photo album. + * + * @param string $access_token + * @param array $params + * - @var integer album_id: ID of the photo album to be edited. + * - @var string title: New album title. + * - @var string description: New album description. + * - @var integer owner_id: ID of the user or community that owns the album. + * - @var array[string] privacy_view + * - @var array[string] privacy_comment + * - @var boolean upload_by_admins_only + * - @var boolean comments_disabled + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamAlbumIdException Invalid album id + * @return mixed + */ + public function editAlbum($access_token, array $params = []) { + return $this->request->post('photos.editAlbum', $access_token, $params); + } + + /** + * Edits a comment on a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer comment_id: Comment ID. + * - @var string message: New text of the comment. + * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — Media attachment owner ID. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function editComment($access_token, array $params = []) { + return $this->request->post('photos.editComment', $access_token, $params); + } + + /** + * Returns a list of a user's or community's photos. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photos. Use a negative value to designate a community ID. + * - @var string album_id: Photo album ID. To return information about photos from service albums, use the following string values: 'profile, wall, saved'. + * - @var array[string] photo_ids: Photo IDs. + * - @var boolean rev: Sort order: '1' — reverse chronological, '0' — chronological + * - @var boolean extended: '1' — to return additional 'likes', 'comments', and 'tags' fields, '0' — (default) + * - @var string feed_type: Type of feed obtained in 'feed' field of the method. + * - @var integer feed: unixtime, that can be obtained with [vk.com/dev/newsfeed.get|newsfeed.get] method in date field to get all photos uploaded by the user on a specific day, or photos the user has been tagged on. Also, 'uid' parameter of the user the event happened with shall be specified. + * - @var boolean photo_sizes: '1' — to return photo sizes in a [vk.com/dev/photo_sizes|special format] + * - @var integer offset + * - @var integer count + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('photos.get', $access_token, $params); + } + + /** + * Returns a list of a user's or community's photo albums. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the albums. + * - @var array[integer] album_ids: Album IDs. + * - @var integer offset: Offset needed to return a specific subset of albums. + * - @var integer count: Number of albums to return. + * - @var boolean need_system: '1' — to return system albums with negative IDs + * - @var boolean need_covers: '1' — to return an additional 'thumb_src' field, '0' — (default) + * - @var boolean photo_sizes: '1' — to return photo sizes in a + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getAlbums($access_token, array $params = []) { + return $this->request->post('photos.getAlbums', $access_token, $params); + } + + /** + * Returns the number of photo albums belonging to a user or community. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var integer group_id: Community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getAlbumsCount($access_token, array $params = []) { + return $this->request->post('photos.getAlbumsCount', $access_token, $params); + } + + /** + * Returns a list of photos belonging to a user or community, in reverse chronological order. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of a user or community that owns the photos. Use a negative value to designate a community ID. + * - @var boolean extended: '1' — to return detailed information about photos + * - @var integer offset: Offset needed to return a specific subset of photos. By default, '0'. + * - @var integer count: Number of photos to return. + * - @var boolean photo_sizes: '1' – to return image sizes in [vk.com/dev/photo_sizes|special format]. + * - @var boolean 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) + * - @var boolean need_hidden: '1' – to show information about photos being hidden from the block above the wall. + * - @var boolean 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. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiBlockedException Content blocked + * @return mixed + */ + public function getAll($access_token, array $params = []) { + return $this->request->post('photos.getAll', $access_token, $params); + } + + /** + * Returns a list of comments on a specific photo album or all albums of the user sorted in reverse chronological order. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the album(s). + * - @var integer album_id: Album ID. If the parameter is not set, comments on all of the user's albums will be returned. + * - @var boolean need_likes: '1' — to return an additional 'likes' field, '0' — (default) + * - @var integer offset: Offset needed to return a specific subset of comments. By default, '0'. + * - @var integer count: Number of comments to return. By default, '20'. Maximum value, '100'. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamAlbumIdException Invalid album id + * @return mixed + */ + public function getAllComments($access_token, array $params = []) { + return $this->request->post('photos.getAllComments', $access_token, $params); + } + + /** + * Returns information about photos by their IDs. + * + * @param string $access_token + * @param array $params + * - @var array[string] photos: IDs separated with a comma, that are IDs of users who posted photos and IDs of photos themselves with an underscore character between such IDs. To get information about a photo in the group album, you shall specify group ID instead of user ID. Example: "1_129207899,6492_135055734, , -20629724_271945303" + * - @var boolean extended: '1' — to return additional fields, '0' — (default) + * - @var boolean photo_sizes: '1' — to return photo sizes in a + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('photos.getById', $access_token, $params); + } + + /** + * Returns an upload link for chat cover pictures. + * + * @param string $access_token + * @param array $params + * - @var integer chat_id: ID of the chat for which you want to upload a cover photo. + * - @var integer crop_x + * - @var integer crop_y + * - @var integer crop_width: Width (in pixels) of the photo after cropping. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getChatUploadServer($access_token, array $params = []) { + return $this->request->post('photos.getChatUploadServer', $access_token, $params); + } + + /** + * Returns a list of comments on a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * - @var boolean need_likes: '1' — to return an additional 'likes' field, '0' — (default) + * - @var integer start_comment_id + * - @var integer offset: Offset needed to return a specific subset of comments. By default, '0'. + * - @var integer count: Number of comments to return. + * - @var PhotosSort sort: Sort order: 'asc' — old first, 'desc' — new first + * - @var string access_key + * - @var boolean extended + * - @var array[PhotosFields] fields + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getComments($access_token, array $params = []) { + return $this->request->post('photos.getComments', $access_token, $params); + } + + /** + * Returns the server address for market album photo upload. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getMarketAlbumUploadServer($access_token, array $params = []) { + return $this->request->post('photos.getMarketAlbumUploadServer', $access_token, $params); + } + + /** + * Returns the server address for market photo upload. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var boolean main_photo: '1' if you want to upload the main item photo. + * - @var integer crop_x: X coordinate of the crop left upper corner. + * - @var integer crop_y: Y coordinate of the crop left upper corner. + * - @var integer crop_width: Width of the cropped photo in px. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getMarketUploadServer($access_token, array $params = []) { + return $this->request->post('photos.getMarketUploadServer', $access_token, $params); + } + + /** + * Returns the server address for photo upload in a private message for a user. + * + * @param string $access_token + * @param array $params + * - @var integer peer_id: Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesDenySendException Can't send messages for users without permission + * @return mixed + */ + public function getMessagesUploadServer($access_token, array $params = []) { + return $this->request->post('photos.getMessagesUploadServer', $access_token, $params); + } + + /** + * Returns a list of photos with tags that have not been viewed. + * + * @param string $access_token + * @param array $params + * - @var integer offset: Offset needed to return a specific subset of photos. + * - @var integer count: Number of photos to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getNewTags($access_token, array $params = []) { + return $this->request->post('photos.getNewTags', $access_token, $params); + } + + /** + * Returns the server address for owner cover upload. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of community that owns the album (if the photo will be uploaded to a community album). + * - @var integer crop_x: X coordinate of the left-upper corner + * - @var integer crop_y: Y coordinate of the left-upper corner + * - @var integer crop_x2: X coordinate of the right-bottom corner + * - @var integer crop_y2: Y coordinate of the right-bottom corner + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getOwnerCoverPhotoUploadServer($access_token, array $params = []) { + return $this->request->post('photos.getOwnerCoverPhotoUploadServer', $access_token, $params); + } + + /** + * Returns an upload server address for a profile or community photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: identifier of a community or current user. "Note that community id must be negative. 'owner_id=1' – user, 'owner_id=-1' – community, " + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getOwnerPhotoUploadServer($access_token, array $params = []) { + return $this->request->post('photos.getOwnerPhotoUploadServer', $access_token, $params); + } + + /** + * Returns a list of tags on a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * - @var string access_key + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getTags($access_token, array $params = []) { + return $this->request->post('photos.getTags', $access_token, $params); + } + + /** + * Returns the server address for photo upload. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of community that owns the album (if the photo will be uploaded to a community album). + * - @var integer album_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getUploadServer($access_token, array $params = []) { + return $this->request->post('photos.getUploadServer', $access_token, $params); + } + + /** + * Returns a list of photos in which a user is tagged. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var integer offset: Offset needed to return a specific subset of photos. By default, '0'. + * - @var integer count: Number of photos to return. Maximum value is 1000. + * - @var boolean extended: '1' — to return an additional 'likes' field, '0' — (default) + * - @var string sort: Sort order: '1' — by date the tag was added in ascending order, '0' — by date the tag was added in descending order + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getUserPhotos($access_token, array $params = []) { + return $this->request->post('photos.getUserPhotos', $access_token, $params); + } + + /** + * Returns the server address for photo upload onto a user's wall. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: ID of community to whose wall the photo will be uploaded. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getWallUploadServer($access_token, array $params = []) { + return $this->request->post('photos.getWallUploadServer', $access_token, $params); + } + + /** + * Makes a photo into an album cover. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * - @var integer album_id: Album ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function makeCover($access_token, array $params = []) { + return $this->request->post('photos.makeCover', $access_token, $params); + } + + /** + * Moves a photo from one album to another. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer target_album_id: ID of the album to which the photo will be moved. + * - @var integer photo_id: Photo ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function move($access_token, array $params = []) { + return $this->request->post('photos.move', $access_token, $params); + } + + /** + * Adds a tag on the photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * - @var integer user_id: ID of the user to be tagged. + * - @var number x: Upper left-corner coordinate of the tagged area (as a percentage of the photo's width). + * - @var number y: Upper left-corner coordinate of the tagged area (as a percentage of the photo's height). + * - @var number x2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's width). + * - @var number y2: Lower right-corner coordinate of the tagged area (as a percentage of the photo's height). + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function putTag($access_token, array $params = []) { + return $this->request->post('photos.putTag', $access_token, $params); + } + + /** + * Removes a tag from a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * - @var integer tag_id: Tag ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function removeTag($access_token, array $params = []) { + return $this->request->post('photos.removeTag', $access_token, $params); + } + + /** + * Reorders the album in the list of user albums. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the album. + * - @var integer album_id: Album ID. + * - @var integer before: ID of the album before which the album in question shall be placed. + * - @var integer after: ID of the album after which the album in question shall be placed. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function reorderAlbums($access_token, array $params = []) { + return $this->request->post('photos.reorderAlbums', $access_token, $params); + } + + /** + * Reorders the photo in the list of photos of the user album. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * - @var integer before: ID of the photo before which the photo in question shall be placed. + * - @var integer after: ID of the photo after which the photo in question shall be placed. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamPhotosException Invalid photos + * @return mixed + */ + public function reorderPhotos($access_token, array $params = []) { + return $this->request->post('photos.reorderPhotos', $access_token, $params); + } + + /** + * Reports (submits a complaint about) a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * - @var PhotosReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function report($access_token, array $params = []) { + return $this->request->post('photos.report', $access_token, $params); + } + + /** + * Reports (submits a complaint about) a comment on a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer comment_id: ID of the comment being reported. + * - @var PhotosReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function reportComment($access_token, array $params = []) { + return $this->request->post('photos.reportComment', $access_token, $params); + } + + /** + * Restores a deleted photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer photo_id: Photo ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function restore($access_token, array $params = []) { + return $this->request->post('photos.restore', $access_token, $params); + } + + /** + * Restores a deleted comment on a photo. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the photo. + * - @var integer comment_id: ID of the deleted comment. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function restoreComment($access_token, array $params = []) { + return $this->request->post('photos.restoreComment', $access_token, $params); + } + + /** + * Saves photos after successful uploading. + * + * @param string $access_token + * @param array $params + * - @var integer album_id: ID of the album to save photos to. + * - @var integer group_id: ID of the community to save photos to. + * - @var integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string photos_list: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var number latitude: Geographical latitude, in degrees (from '-90' to '90'). + * - @var number longitude: Geographical longitude, in degrees (from '-180' to '180'). + * - @var string caption: Text describing the photo. 2048 digits max. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamAlbumIdException Invalid album id + * @throws VKApiParamServerException Invalid server + * @throws VKApiParamHashException Invalid hash + * @return mixed + */ + public function save($access_token, array $params = []) { + return $this->request->post('photos.save', $access_token, $params); + } + + /** + * Saves market album photos after successful uploading. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamHashException Invalid hash + * @throws VKApiParamPhotoException Invalid photo + * @return mixed + */ + public function saveMarketAlbumPhoto($access_token, array $params = []) { + return $this->request->post('photos.saveMarketAlbumPhoto', $access_token, $params); + } + + /** + * Saves market photos after successful uploading. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var integer server: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string crop_data: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string crop_hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamHashException Invalid hash + * @throws VKApiParamPhotoException Invalid photo + * @return mixed + */ + public function saveMarketPhoto($access_token, array $params = []) { + return $this->request->post('photos.saveMarketPhoto', $access_token, $params); + } + + /** + * Saves a photo after being successfully uploaded. URL obtained with [vk.com/dev/photos.getMessagesUploadServer|photos.getMessagesUploadServer] method. + * + * @param string $access_token + * @param array $params + * - @var string photo: Parameter returned when the photo is [vk.com/dev/upload_files|uploaded to the server]. + * - @var integer server + * - @var string hash + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamAlbumIdException Invalid album id + * @throws VKApiParamServerException Invalid server + * @throws VKApiParamHashException Invalid hash + * @return mixed + */ + public function saveMessagesPhoto($access_token, array $params = []) { + return $this->request->post('photos.saveMessagesPhoto', $access_token, $params); + } + + /** + * Saves cover photo after successful uploading. + * + * @param string $access_token + * @param array $params + * - @var string hash: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * - @var string photo: Parameter returned when photos are [vk.com/dev/upload_files|uploaded to server]. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamPhotoException Invalid photo + * @return mixed + */ + public function saveOwnerCoverPhoto($access_token, array $params = []) { + return $this->request->post('photos.saveOwnerCoverPhoto', $access_token, $params); + } + + /** + * Saves a profile or community photo. Upload URL can be got with the [vk.com/dev/photos.getOwnerPhotoUploadServer|photos.getOwnerPhotoUploadServer] method. + * + * @param string $access_token + * @param array $params + * - @var string server: parameter returned after [vk.com/dev/upload_files|photo upload]. + * - @var string hash: parameter returned after [vk.com/dev/upload_files|photo upload]. + * - @var string photo: parameter returned after [vk.com/dev/upload_files|photo upload]. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamPhotoException Invalid photo + * @return mixed + */ + public function saveOwnerPhoto($access_token, array $params = []) { + return $this->request->post('photos.saveOwnerPhoto', $access_token, $params); + } + + /** + * Saves a photo to a user's or community's wall after being uploaded. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: ID of the user on whose wall the photo will be saved. + * - @var integer group_id: ID of community on whose wall the photo will be saved. + * - @var string photo: Parameter returned when the the photo is [vk.com/dev/upload_files|uploaded to the server]. + * - @var integer server + * - @var string hash + * - @var number latitude: Geographical latitude, in degrees (from '-90' to '90'). + * - @var number longitude: Geographical longitude, in degrees (from '-180' to '180'). + * - @var string caption: Text describing the photo. 2048 digits max. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiParamAlbumIdException Invalid album id + * @throws VKApiParamServerException Invalid server + * @throws VKApiParamHashException Invalid hash + * @return mixed + */ + public function saveWallPhoto($access_token, array $params = []) { + return $this->request->post('photos.saveWallPhoto', $access_token, $params); + } + + /** + * Returns a list of photos. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query string. + * - @var number lat: Geographical latitude, in degrees (from '-90' to '90'). + * - @var number long: Geographical longitude, in degrees (from '-180' to '180'). + * - @var integer start_time + * - @var integer end_time + * - @var integer sort: Sort order: + * - @var integer offset: Offset needed to return a specific subset of photos. + * - @var integer count: Number of photos to return. + * - @var integer radius: Radius of search in meters (works very approximately). Available values: '10', '100', '800', '6000', '50000'. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('photos.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Podcasts.php b/src/VK/Actions/Podcasts.php deleted file mode 100644 index 0e50329..0000000 --- a/src/VK/Actions/Podcasts.php +++ /dev/null @@ -1,41 +0,0 @@ -request = $request; - } - - /** - * - * - * @param $access_token string - * @param $params array - * - string search_string: - * - integer offset: - * - integer count: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function searchPodcast(string $access_token, array $params = array()) { - return $this->request->post('podcasts.searchPodcast', $access_token, $params); - } -} diff --git a/src/VK/Actions/Polls.php b/src/VK/Actions/Polls.php index 4488a42..e0c45be 100644 --- a/src/VK/Actions/Polls.php +++ b/src/VK/Actions/Polls.php @@ -1,239 +1,161 @@ request = $request; - } - - /** - * Adds the current user's vote to the selected answer in the poll. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a - * community ID. - * - integer poll_id: Poll ID. - * - array answer_ids: - * - boolean is_board: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function addVote(string $access_token, array $params = array()) { - return $this->request->post('polls.addVote', $access_token, $params); - } - - /** - * Creates polls that can be attached to the users' or communities' posts. - * - * @param $access_token string - * @param $params array - * - string question: question text - * - boolean is_anonymous: '1' - anonymous poll, participants list is hidden,, '0' - public poll, - * participants list is available,, Default value is '0'. - * - boolean is_multiple: - * - integer end_date: - * - integer owner_id: If a poll will be added to a communty it is required to send a negative group - * identifier. Current user by default. - * - integer app_id: - * - string add_answers: available answers list, for example: " ["yes","no","maybe"]", There can be from 1 - * to 10 answers. - * - integer photo_id: - * - PollsCreateBackgroundId background_id: - * @see PollsCreateBackgroundId - * - boolean disable_unvote: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function create(string $access_token, array $params = array()) { - return $this->request->post('polls.create', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; - /** - * Deletes the current user's vote from the selected answer in the poll. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a - * community ID. - * - integer poll_id: Poll ID. - * - integer answer_id: Answer ID. - * - boolean is_board: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function deleteVote(string $access_token, array $params = array()) { - return $this->request->post('polls.deleteVote', $access_token, $params); - } + /** + * Polls constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Edits created polls - * - * @param $access_token string - * @param $params array - * - integer owner_id: poll owner id - * - integer poll_id: edited poll's id - * - string question: new question text - * - string add_answers: answers list, for example: , "["yes","no","maybe"]" - * - string edit_answers: object containing answers that need to be edited,, key - answer id, value - new - * answer text. Example: {"382967099":"option1", "382967103":"option2"}" - * - string delete_answers: list of answer ids to be deleted. For example: "[382967099, 382967103]" - * - integer end_date: - * - integer photo_id: - * - PollsEditBackgroundId background_id: - * @see PollsEditBackgroundId - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('polls.edit', $access_token, $params); - } + /** + * Adds the current user's vote to the selected answer in the poll. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. + * - @var integer poll_id: Poll ID. + * - @var array[integer] answer_ids + * - @var boolean is_board + * @throws VKClientException + * @throws VKApiException + * @throws VKApiPollsAccessException Access to poll denied + * @throws VKApiPollsAnswerIdException Invalid answer id + * @throws VKApiPollsPollIdException Invalid poll id + * @return mixed + */ + public function addVote($access_token, array $params = []) { + return $this->request->post('polls.addVote', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getBackgrounds(string $access_token, array $params = array()) { - return $this->request->post('polls.getBackgrounds', $access_token, $params); - } + /** + * Creates polls that can be attached to the users' or communities' posts. + * + * @param string $access_token + * @param array $params + * - @var string question: question text + * - @var boolean is_anonymous: '1' – anonymous poll, participants list is hidden,, '0' – public poll, participants list is available,, Default value is '0'. + * - @var boolean is_multiple + * - @var integer end_date + * - @var integer owner_id: If a poll will be added to a communty it is required to send a negative group identifier. Current user by default. + * - @var string add_answers: available answers list, for example: " ["yes","no","maybe"]", There can be from 1 to 10 answers. + * - @var integer photo_id + * - @var PollsBackgroundId background_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function create($access_token, array $params = []) { + return $this->request->post('polls.create', $access_token, $params); + } - /** - * Returns detailed information about a poll by its ID. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a - * community ID. - * - boolean is_board: '1' - poll is in a board, '0' - poll is on a wall. '0' by default. - * - integer poll_id: Poll ID. - * - boolean extended: - * - integer friends_count: - * - array fields: - * - PollsGetByIdNameCase name_case: - * @see PollsGetByIdNameCase - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('polls.getById', $access_token, $params); - } + /** + * Deletes the current user's vote from the selected answer in the poll. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. + * - @var integer poll_id: Poll ID. + * - @var integer answer_id: Answer ID. + * - @var boolean is_board + * @throws VKClientException + * @throws VKApiException + * @throws VKApiPollsAccessException Access to poll denied + * @throws VKApiPollsAnswerIdException Invalid answer id + * @throws VKApiPollsPollIdException Invalid poll id + * @return mixed + */ + public function deleteVote($access_token, array $params = []) { + return $this->request->post('polls.deleteVote', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getPhotoUploadServer(string $access_token, array $params = array()) { - return $this->request->post('polls.getPhotoUploadServer', $access_token, $params); - } + /** + * Edits created polls + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: poll owner id + * - @var integer poll_id: edited poll's id + * - @var string question: new question text + * - @var string add_answers: answers list, for example: , "["yes","no","maybe"]" + * - @var string edit_answers: object containing answers that need to be edited,, key – answer id, value – new answer text. Example: {"382967099":"option1", "382967103":"option2"}" + * - @var string delete_answers: list of answer ids to be deleted. For example: "[382967099, 382967103]" + * - @var integer end_date + * - @var integer photo_id + * - @var PollsBackgroundId background_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('polls.edit', $access_token, $params); + } - /** - * Returns a list of IDs of users who selected specific answers in the poll. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a - * community ID. - * - integer poll_id: Poll ID. - * - array answer_ids: Answer IDs. - * - boolean is_board: - * - boolean friends_only: '1' — to return only current user's friends, '0' — to return all users - * (default), - * - integer offset: Offset needed to return a specific subset of voters. '0' — (default) - * - integer count: Number of user IDs to return (if the 'friends_only' parameter is not set, maximum - * '1000', otherwise '10'). '100' — (default) - * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate - * (birthdate)', 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', - * 'contacts', 'education', 'online', 'counters'. - * - PollsGetVotersNameCase name_case: Case for declension of user name and surname: , 'nom' — - * nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental - * , 'abl' — prepositional - * @see PollsGetVotersNameCase - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function getVoters(string $access_token, array $params = array()) { - return $this->request->post('polls.getVoters', $access_token, $params); - } + /** + * Returns detailed information about a poll by its ID. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. + * - @var boolean is_board: '1' – poll is in a board, '0' – poll is on a wall. '0' by default. + * - @var integer poll_id: Poll ID. + * - @var boolean extended + * - @var integer friends_count + * - @var array[string] fields + * - @var PollsNameCase name_case + * @throws VKClientException + * @throws VKApiException + * @throws VKApiPollsAccessException Access to poll denied + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('polls.getById', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - string photo: - * - string hash: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function savePhoto(string $access_token, array $params = array()) { - return $this->request->post('polls.savePhoto', $access_token, $params); - } + /** + * Returns a list of IDs of users who selected specific answers in the poll. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the poll. Use a negative value to designate a community ID. + * - @var integer poll_id: Poll ID. + * - @var array[integer] answer_ids: Answer IDs. + * - @var boolean is_board + * - @var boolean friends_only: '1' — to return only current user's friends, '0' — to return all users (default), + * - @var integer offset: Offset needed to return a specific subset of voters. '0' — (default) + * - @var integer count: Number of user IDs to return (if the 'friends_only' parameter is not set, maximum '1000', otherwise '10'). '100' — (default) + * - @var array[PollsFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate (birthdate)', 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'. + * - @var PollsNameCase name_case: Case for declension of user name and surname: , 'nom' — nominative (default) , 'gen' — genitive , 'dat' — dative , 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional + * @throws VKClientException + * @throws VKApiException + * @throws VKApiPollsAccessException Access to poll denied + * @throws VKApiPollsAnswerIdException Invalid answer id + * @throws VKApiPollsPollIdException Invalid poll id + * @throws VKApiPollsAccessWithoutVoteException Access denied, please vote first + * @return mixed + */ + public function getVoters($access_token, array $params = []) { + return $this->request->post('polls.getVoters', $access_token, $params); + } } diff --git a/src/VK/Actions/PrettyCards.php b/src/VK/Actions/PrettyCards.php index ab57221..0ad67b9 100644 --- a/src/VK/Actions/PrettyCards.php +++ b/src/VK/Actions/PrettyCards.php @@ -1,140 +1,119 @@ request = $request; - } + /** + * PrettyCards constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - string photo: - * - string title: - * - string link: - * - string price: - * - string price_old: - * - string button: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function create(string $access_token, array $params = array()) { - return $this->request->post('prettyCards.create', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var string photo + * - @var string title + * - @var string link + * - @var string price + * - @var string price_old + * - @var string button + * @throws VKClientException + * @throws VKApiException + * @throws VKApiPrettyCardsTooManyCardsException Too many cards + * @return mixed + */ + public function create($access_token, array $params = []) { + return $this->request->post('prettyCards.create', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer card_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('prettyCards.delete', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer card_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiPrettyCardsCardNotFoundException Card not found + * @throws VKApiPrettyCardsCardIsConnectedToPostException Card is connected to post + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('prettyCards.delete', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer card_id: - * - string photo: - * - string title: - * - string link: - * - string price: - * - string price_old: - * - string button: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('prettyCards.edit', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer card_id + * - @var string photo + * - @var string title + * - @var string link + * - @var string price + * - @var string price_old + * - @var string button + * @throws VKClientException + * @throws VKApiException + * @throws VKApiPrettyCardsCardNotFoundException Card not found + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('prettyCards.edit', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer offset: - * - integer count: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('prettyCards.get', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer offset + * - @var integer count + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('prettyCards.get', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - array card_ids: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('prettyCards.getById', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var array[integer] card_ids + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('prettyCards.getById', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getUploadURL(string $access_token, array $params = array()) { - return $this->request->post('prettyCards.getUploadURL', $access_token, $params); - } + /** + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getUploadURL($access_token) { + return $this->request->post('prettyCards.getUploadURL', $access_token); + } } diff --git a/src/VK/Actions/Search.php b/src/VK/Actions/Search.php index 1701cc0..c7ecdb3 100644 --- a/src/VK/Actions/Search.php +++ b/src/VK/Actions/Search.php @@ -1,44 +1,44 @@ request = $request; - } + /** + * Search constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Allows the programmer to do a quick search for any substring. - * - * @param $access_token string - * @param $params array - * - string q: Search query string. - * - integer offset: Offset for querying specific result subset - * - integer limit: Maximum number of results to return. - * - array filters: - * - array fields: - * - boolean search_global: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getHints(string $access_token, array $params = array()) { - return $this->request->post('search.getHints', $access_token, $params); - } + /** + * Allows the programmer to do a quick search for any substring. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query string. + * - @var integer offset: Offset for querying specific result subset + * - @var integer limit: Maximum number of results to return. + * - @var array[string] filters + * - @var array[string] fields + * - @var boolean search_global + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getHints($access_token, array $params = []) { + return $this->request->post('search.getHints', $access_token, $params); + } } diff --git a/src/VK/Actions/Secure.php b/src/VK/Actions/Secure.php index 1eb28fe..72dbeed 100644 --- a/src/VK/Actions/Secure.php +++ b/src/VK/Actions/Secure.php @@ -1,212 +1,189 @@ request = $request; - } + /** + * Secure constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Adds user activity information to an application - * - * @param $access_token string - * @param $params array - * - integer user_id: ID of a user to save the data - * - integer activity_id: there are 2 default activities: , * 1 - level. Works similar to ,, * 2 - points, - * saves points amount, Any other value is for saving completed missions - * - integer value: depends on activity_id: * 1 - number, current level number,, * 2 - number, current - * user's points amount, , Any other value is ignored - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function addAppEvent(string $access_token, array $params = array()) { - return $this->request->post('secure.addAppEvent', $access_token, $params); - } + /** + * Adds user activity information to an application + * + * @param string $access_token + * @param array $params + * - @var integer user_id: ID of a user to save the data + * - @var integer activity_id: there are 2 default activities: , * 1 – level. Works similar to ,, * 2 – points, saves points amount, Any other value is for saving completed missions + * - @var integer value: depends on activity_id: * 1 – number, current level number,, * 2 – number, current user's points amount, , Any other value is ignored + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAppsAlreadyUnlockedException This achievement is already unlocked + * @return mixed + */ + public function addAppEvent($access_token, array $params = []) { + return $this->request->post('secure.addAppEvent', $access_token, $params); + } - /** - * Checks the user authentication in 'IFrame' and 'Flash' apps using the 'access_token' parameter. - * - * @param $access_token string - * @param $params array - * - string token: client 'access_token' - * - string ip: user 'ip address'. Note that user may access using the 'ipv6' address, in this case it is - * required to transmit the 'ipv6' address. If not transmitted, the address will not be checked. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function checkToken(string $access_token, array $params = array()) { - return $this->request->post('secure.checkToken', $access_token, $params); - } + /** + * Checks the user authentication in 'IFrame' and 'Flash' apps using the 'access_token' parameter. + * + * @param string $access_token + * @param array $params + * - @var string token: client 'access_token' + * - @var string ip: user 'ip address'. Note that user may access using the 'ipv6' address, in this case it is required to transmit the 'ipv6' address. If not transmitted, the address will not be checked. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function checkToken($access_token, array $params = []) { + return $this->request->post('secure.checkToken', $access_token, $params); + } - /** - * Returns payment balance of the application in hundredth of a vote. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getAppBalance(string $access_token, array $params = array()) { - return $this->request->post('secure.getAppBalance', $access_token, $params); - } + /** + * Returns payment balance of the application in hundredth of a vote. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getAppBalance($access_token) { + return $this->request->post('secure.getAppBalance', $access_token); + } - /** - * Shows a list of SMS notifications sent by the application using - * [vk.com/dev/secure.sendSMSNotification|secure.sendSMSNotification] method. - * - * @param $access_token string - * @param $params array - * - integer user_id: - * - integer date_from: filter by start date. It is set as UNIX-time. - * - integer date_to: filter by end date. It is set as UNIX-time. - * - integer limit: number of returned posts. By default — 1000. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSMSHistory(string $access_token, array $params = array()) { - return $this->request->post('secure.getSMSHistory', $access_token, $params); - } + /** + * Shows a list of SMS notifications sent by the application using [vk.com/dev/secure.sendSMSNotification|secure.sendSMSNotification] method. + * + * @param string $access_token + * @param array $params + * - @var integer user_id + * - @var integer date_from: filter by start date. It is set as UNIX-time. + * - @var integer date_to: filter by end date. It is set as UNIX-time. + * - @var integer limit: number of returned posts. By default — 1000. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getSMSHistory($access_token, array $params = []) { + return $this->request->post('secure.getSMSHistory', $access_token, $params); + } - /** - * Shows history of votes transaction between users and the application. - * - * @param $access_token string - * @param $params array - * - integer type: - * - integer uid_from: - * - integer uid_to: - * - integer date_from: - * - integer date_to: - * - integer limit: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getTransactionsHistory(string $access_token, array $params = array()) { - return $this->request->post('secure.getTransactionsHistory', $access_token, $params); - } + /** + * Shows history of votes transaction between users and the application. + * + * @param string $access_token + * @param array $params + * - @var integer type + * - @var integer uid_from + * - @var integer uid_to + * - @var integer date_from + * - @var integer date_to + * - @var integer limit + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getTransactionsHistory($access_token, array $params = []) { + return $this->request->post('secure.getTransactionsHistory', $access_token, $params); + } - /** - * Returns one of the previously set game levels of one or more users in the application. - * - * @param $access_token string - * @param $params array - * - array user_ids: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getUserLevel(string $access_token, array $params = array()) { - return $this->request->post('secure.getUserLevel', $access_token, $params); - } + /** + * Returns one of the previously set game levels of one or more users in the application. + * + * @param string $access_token + * @param array $params + * - @var array[integer] user_ids + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getUserLevel($access_token, array $params = []) { + return $this->request->post('secure.getUserLevel', $access_token, $params); + } - /** - * Opens the game achievement and gives the user a sticker - * - * @param $access_token string - * @param $params array - * - array user_ids: - * - integer achievement_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function giveEventSticker(string $access_token, array $params = array()) { - return $this->request->post('secure.giveEventSticker', $access_token, $params); - } + /** + * Opens the game achievement and gives the user a sticker + * + * @param string $access_token + * @param array $params + * - @var array[integer] user_ids + * - @var integer achievement_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function giveEventSticker($access_token, array $params = []) { + return $this->request->post('secure.giveEventSticker', $access_token, $params); + } - /** - * Sends notification to the user. - * - * @param $access_token string - * @param $params array - * - array user_ids: - * - integer user_id: - * - string message: notification text which should be sent in 'UTF-8' encoding ('254' characters - * maximum). - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function sendNotification(string $access_token, array $params = array()) { - return $this->request->post('secure.sendNotification', $access_token, $params); - } + /** + * Sends notification to the user. + * + * @param string $access_token + * @param array $params + * - @var array[integer] user_ids + * - @var integer user_id + * - @var string message: notification text which should be sent in 'UTF-8' encoding ('254' characters maximum). + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function sendNotification($access_token, array $params = []) { + return $this->request->post('secure.sendNotification', $access_token, $params); + } - /** - * Sends 'SMS' notification to a user's mobile device. - * - * @param $access_token string - * @param $params array - * - integer user_id: ID of the user to whom SMS notification is sent. The user shall allow the - * application to send him/her notifications (, +1). - * - string message: 'SMS' text to be sent in 'UTF-8' encoding. Only Latin letters and numbers are - * allowed. Maximum size is '160' characters. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function sendSMSNotification(string $access_token, array $params = array()) { - return $this->request->post('secure.sendSMSNotification', $access_token, $params); - } + /** + * Sends 'SMS' notification to a user's mobile device. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: ID of the user to whom SMS notification is sent. The user shall allow the application to send him/her notifications (, +1). + * - @var string message: 'SMS' text to be sent in 'UTF-8' encoding. Only Latin letters and numbers are allowed. Maximum size is '160' characters. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiInsufficientFundsException Application has insufficient funds + * @throws VKApiMobileNotActivatedException The mobile number of the user is unknown + * @return mixed + */ + public function sendSMSNotification($access_token, array $params = []) { + return $this->request->post('secure.sendSMSNotification', $access_token, $params); + } - /** - * Sets a counter which is shown to the user in bold in the left menu. - * - * @param $access_token string - * @param $params array - * - array counters: - * - integer user_id: - * - integer counter: counter value. - * - boolean increment: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function setCounter(string $access_token, array $params = array()) { - return $this->request->post('secure.setCounter', $access_token, $params); - } + /** + * Sets a counter which is shown to the user in bold in the left menu. + * + * @param string $access_token + * @param array $params + * - @var array[string] counters + * - @var integer user_id + * - @var integer counter: counter value. + * - @var boolean increment + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessMenuException Access to the menu of the user denied + * @return mixed + */ + public function setCounter($access_token, array $params = []) { + return $this->request->post('secure.setCounter', $access_token, $params); + } } diff --git a/src/VK/Actions/Stats.php b/src/VK/Actions/Stats.php index 630c058..8480a17 100644 --- a/src/VK/Actions/Stats.php +++ b/src/VK/Actions/Stats.php @@ -1,84 +1,76 @@ request = $request; - } + /** + * Stats constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns statistics of a community or an application. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID. - * - integer app_id: Application ID. - * - integer timestamp_from: - * - integer timestamp_to: - * - StatsGetInterval interval: - * @see StatsGetInterval - * - integer intervals_count: - * - array filters: - * - array stats_groups: - * - boolean extended: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('stats.get', $access_token, $params); - } + /** + * Returns statistics of a community or an application. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID. + * - @var integer app_id: Application ID. + * - @var integer timestamp_from + * - @var integer timestamp_to + * - @var string interval + * - @var integer intervals_count + * - @var array[string] filters + * - @var array[string] stats_groups + * - @var boolean extended + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('stats.get', $access_token, $params); + } - /** - * Returns stats for a wall post. - * - * @param $access_token string - * @param $params array - * - string owner_id: post owner community id. Specify with "-" sign. - * - array post_ids: wall posts id - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getPostReach(string $access_token, array $params = array()) { - return $this->request->post('stats.getPostReach', $access_token, $params); - } + /** + * Returns stats for a wall post. + * + * @param string $access_token + * @param array $params + * - @var string owner_id: post owner community id. Specify with "-" sign. + * - @var integer post_id: wall post id. Note that stats are available only for '300' last (newest) posts on a community wall. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAccessPostException Access to wall's post denied + * @return mixed + */ + public function getPostReach($access_token, array $params = []) { + return $this->request->post('stats.getPostReach', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - string id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function trackVisitor(string $access_token, array $params = array()) { - return $this->request->post('stats.trackVisitor', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var string id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function trackVisitor($access_token, array $params = []) { + return $this->request->post('stats.trackVisitor', $access_token, $params); + } } diff --git a/src/VK/Actions/Status.php b/src/VK/Actions/Status.php index d6930f4..8171f61 100644 --- a/src/VK/Actions/Status.php +++ b/src/VK/Actions/Status.php @@ -1,60 +1,57 @@ request = $request; - } + /** + * Status constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns data required to show the status of a user or community. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('status.get', $access_token, $params); - } + /** + * Returns data required to show the status of a user or community. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('status.get', $access_token, $params); + } - /** - * Sets a new status for the current user. - * - * @param $access_token string - * @param $params array - * - string text: Text of the new status. - * - integer group_id: Identifier of a community to set a status in. If left blank the status is set to - * current user. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function set(string $access_token, array $params = array()) { - return $this->request->post('status.set', $access_token, $params); - } + /** + * Sets a new status for the current user. + * + * @param string $access_token + * @param array $params + * - @var string text: Text of the new status. + * - @var integer group_id: Identifier of a community to set a status in. If left blank the status is set to current user. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiStatusNoAudioException User disabled track name broadcast + * @return mixed + */ + public function set($access_token, array $params = []) { + return $this->request->post('status.set', $access_token, $params); + } } diff --git a/src/VK/Actions/Storage.php b/src/VK/Actions/Storage.php index 26b5a71..43dcd18 100644 --- a/src/VK/Actions/Storage.php +++ b/src/VK/Actions/Storage.php @@ -1,80 +1,78 @@ request = $request; - } + /** + * Storage constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Returns a value of variable with the name set by key parameter. - * - * @param $access_token string - * @param $params array - * - string key: - * - array keys: - * - integer user_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('storage.get', $access_token, $params); - } + /** + * Returns a value of variable with the name set by key parameter. + * + * @param string $access_token + * @param array $params + * - @var string key + * - @var array[string] keys + * - @var integer user_id + * - @var boolean global + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('storage.get', $access_token, $params); + } - /** - * Returns the names of all variables. - * - * @param $access_token string - * @param $params array - * - integer user_id: user id, whose variables names are returned if they were requested with a server - * method. - * - integer offset: - * - integer count: amount of variable names the info needs to be collected from. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getKeys(string $access_token, array $params = array()) { - return $this->request->post('storage.getKeys', $access_token, $params); - } + /** + * Returns the names of all variables. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: user id, whose variables names are returned if they were requested with a server method. + * - @var boolean global + * - @var integer offset + * - @var integer count: amount of variable names the info needs to be collected from. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getKeys($access_token, array $params = []) { + return $this->request->post('storage.getKeys', $access_token, $params); + } - /** - * Saves a value of variable with the name set by 'key' parameter. - * - * @param $access_token string - * @param $params array - * - string key: - * - string value: - * - integer user_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function set(string $access_token, array $params = array()) { - return $this->request->post('storage.set', $access_token, $params); - } + /** + * Saves a value of variable with the name set by 'key' parameter. + * + * @param string $access_token + * @param array $params + * - @var string key + * - @var string value + * - @var integer user_id + * - @var boolean global + * @throws VKClientException + * @throws VKApiException + * @throws VKApiLimitsException Out of limits + * @return mixed + */ + public function set($access_token, array $params = []) { + return $this->request->post('storage.set', $access_token, $params); + } } diff --git a/src/VK/Actions/Store.php b/src/VK/Actions/Store.php deleted file mode 100644 index 57b5689..0000000 --- a/src/VK/Actions/Store.php +++ /dev/null @@ -1,115 +0,0 @@ -request = $request; - } - - /** - * Adds given sticker IDs to the list of user's favorite stickers - * - * @param $access_token string - * @param $params array - * - array sticker_ids: Sticker IDs to be added - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function addStickersToFavorite(string $access_token, array $params = array()) { - return $this->request->post('store.addStickersToFavorite', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getFavoriteStickers(string $access_token, array $params = array()) { - return $this->request->post('store.getFavoriteStickers', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - string type: - * - string merchant: - * - string section: - * - array product_ids: - * - array filters: - * - boolean extended: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getProducts(string $access_token, array $params = array()) { - return $this->request->post('store.getProducts', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - array stickers_ids: - * - array products_ids: - * - boolean aliases: - * - boolean all_products: - * - boolean need_stickers: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getStickersKeywords(string $access_token, array $params = array()) { - return $this->request->post('store.getStickersKeywords', $access_token, $params); - } - - /** - * Removes given sticker IDs from the list of user's favorite stickers - * - * @param $access_token string - * @param $params array - * - array sticker_ids: Sticker IDs to be removed - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function removeStickersFromFavorite(string $access_token, array $params = array()) { - return $this->request->post('store.removeStickersFromFavorite', $access_token, $params); - } -} diff --git a/src/VK/Actions/Stories.php b/src/VK/Actions/Stories.php index 19a2f80..394889f 100644 --- a/src/VK/Actions/Stories.php +++ b/src/VK/Actions/Stories.php @@ -1,335 +1,246 @@ request = $request; - } - - /** - * Allows to hide stories from chosen sources from current user's feed. - * - * @param $access_token string - * @param $params array - * - array owners_ids: List of sources IDs - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function banOwner(string $access_token, array $params = array()) { - return $this->request->post('stories.banOwner', $access_token, $params); - } - - /** - * Allows to delete story. - * - * @param $access_token string - * @param $params array - * - integer owner_id: Story owner's ID. Current user id is used by default. - * - integer story_id: Story ID. - * - array stories: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('stories.delete', $access_token, $params); - } - - /** - * Returns stories available for current user. - * - * @param $access_token string - * @param $params array - * - integer owner_id: Owner ID. - * - boolean extended: '1' — to return additional fields for users and communities. Default value is 0. - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('stories.get', $access_token, $params); - } - - /** - * Returns list of sources hidden from current user's feed. - * - * @param $access_token string - * @param $params array - * - boolean extended: '1' — to return additional fields for users and communities. Default value is 0. - * - array fields: Additional fields to return - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getBanned(string $access_token, array $params = array()) { - return $this->request->post('stories.getBanned', $access_token, $params); - } - - /** - * Returns story by its ID. - * - * @param $access_token string - * @param $params array - * - array stories: Stories IDs separated by commas. Use format {owner_id}+'_'+{story_id}, for example, - * 12345_54331. - * - boolean extended: '1' — to return additional fields for users and communities. Default value is 0. - * - array fields: Additional fields to return - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('stories.getById', $access_token, $params); - } - - /** - * Returns URL for uploading a story with photo. - * - * @param $access_token string - * @param $params array - * - boolean add_to_news: 1 — to add the story to friend's feed. - * - array user_ids: List of users IDs who can see the story. - * - string reply_to_story: ID of the story to reply with the current. - * - string link_text: Link text (for community's stories only). - * - string link_url: Link URL. Internal links on https://vk.com only. - * - integer group_id: ID of the community to upload the story (should be verified or with the "fire" - * icon). - * - string clickable_stickers: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function getPhotoUploadServer(string $access_token, array $params = array()) { - return $this->request->post('stories.getPhotoUploadServer', $access_token, $params); - } - - /** - * Returns replies to the story. - * - * @param $access_token string - * @param $params array - * - integer owner_id: Story owner ID. - * - integer story_id: Story ID. - * - string access_key: Access key for the private object. - * - boolean extended: '1' — to return additional fields for users and communities. Default value is 0. - * - array fields: Additional fields to return - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getReplies(string $access_token, array $params = array()) { - return $this->request->post('stories.getReplies', $access_token, $params); - } - - /** - * Returns stories available for current user. - * - * @param $access_token string - * @param $params array - * - integer owner_id: Story owner ID. - * - integer story_id: Story ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getStats(string $access_token, array $params = array()) { - return $this->request->post('stories.getStats', $access_token, $params); - } - - /** - * Allows to receive URL for uploading story with video. - * - * @param $access_token string - * @param $params array - * - boolean add_to_news: 1 — to add the story to friend's feed. - * - array user_ids: List of users IDs who can see the story. - * - string reply_to_story: ID of the story to reply with the current. - * - string link_text: Link text (for community's stories only). - * - string link_url: Link URL. Internal links on https://vk.com only. - * - integer group_id: ID of the community to upload the story (should be verified or with the "fire" - * icon). - * - string clickable_stickers: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function getVideoUploadServer(string $access_token, array $params = array()) { - return $this->request->post('stories.getVideoUploadServer', $access_token, $params); - } - - /** - * Returns a list of story viewers. - * - * @param $access_token string - * @param $params array - * - integer owner_id: Story owner ID. - * - integer story_id: Story ID. - * - integer count: Maximum number of results. - * - integer offset: Offset needed to return a specific subset of results. - * - boolean extended: '1' — to return detailed information about photos - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getViewers(string $access_token, array $params = array()) { - return $this->request->post('stories.getViewers', $access_token, $params); - } - - /** - * Hides all replies in the last 24 hours from the user to current user's stories. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user whose replies should be hidden. - * - integer group_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function hideAllReplies(string $access_token, array $params = array()) { - return $this->request->post('stories.hideAllReplies', $access_token, $params); - } - - /** - * Hides the reply to the current user's story. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user whose replies should be hidden. - * - integer story_id: Story ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function hideReply(string $access_token, array $params = array()) { - return $this->request->post('stories.hideReply', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - array upload_results: - * - boolean extended: - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function save(string $access_token, array $params = array()) { - return $this->request->post('stories.save', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - string q: - * - integer place_id: - * - number latitude: - * - number longitude: - * - integer radius: - * - integer mentioned_id: - * - integer count: - * - boolean extended: - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('stories.search', $access_token, $params); - } - - /** - * - * - * @param $access_token string - * @param $params array - * - string access_key: - * - string message: - * - boolean is_broadcast: - * - boolean is_anonymous: - * - boolean unseen_marker: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function sendInteraction(string $access_token, array $params = array()) { - return $this->request->post('stories.sendInteraction', $access_token, $params); - } - - /** - * Allows to show stories from hidden sources in current user's feed. - * - * @param $access_token string - * @param $params array - * - array owners_ids: List of hidden sources to show stories from. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function unbanOwner(string $access_token, array $params = array()) { - return $this->request->post('stories.unbanOwner', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; + + /** + * Stories constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } + + /** + * Allows to hide stories from chosen sources from current user's feed. + * + * @param string $access_token + * @param array $params + * - @var array[integer] owners_ids: List of sources IDs + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function banOwner($access_token, array $params = []) { + return $this->request->post('stories.banOwner', $access_token, $params); + } + + /** + * Allows to delete story. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: Story owner's ID. Current user id is used by default. + * - @var integer story_id: Story ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('stories.delete', $access_token, $params); + } + + /** + * Returns stories available for current user. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: Owner ID. + * - @var boolean extended: '1' — to return additional fields for users and communities. Default value is 0. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('stories.get', $access_token, $params); + } + + /** + * Returns list of sources hidden from current user's feed. + * + * @param string $access_token + * @param array $params + * - @var boolean extended: '1' — to return additional fields for users and communities. Default value is 0. + * - @var array[StoriesFields] fields: Additional fields to return + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getBanned($access_token, array $params = []) { + return $this->request->post('stories.getBanned', $access_token, $params); + } + + /** + * Returns story by its ID. + * + * @param string $access_token + * @param array $params + * - @var array[string] stories: Stories IDs separated by commas. Use format {owner_id}+'_'+{story_id}, for example, 12345_54331. + * - @var boolean extended: '1' — to return additional fields for users and communities. Default value is 0. + * - @var array[StoriesFields] fields: Additional fields to return + * @throws VKClientException + * @throws VKApiException + * @throws VKApiStoryExpiredException Story has already expired + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('stories.getById', $access_token, $params); + } + + /** + * Returns URL for uploading a story with photo. + * + * @param string $access_token + * @param array $params + * - @var boolean add_to_news: 1 — to add the story to friend's feed. + * - @var array[integer] user_ids: List of users IDs who can see the story. + * - @var string reply_to_story: ID of the story to reply with the current. + * - @var UploadLinkText link_text: Link text (for community's stories only). + * - @var string link_url: Link URL. Internal links on https://vk.com only. + * - @var integer group_id: ID of the community to upload the story (should be verified or with the "fire" icon). + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist + * @throws VKApiStoryIncorrectReplyPrivacyException Incorrect reply privacy + * @throws VKApiBlockedException Content blocked + * @return mixed + */ + public function getPhotoUploadServer($access_token, array $params = []) { + return $this->request->post('stories.getPhotoUploadServer', $access_token, $params); + } + + /** + * Returns replies to the story. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: Story owner ID. + * - @var integer story_id: Story ID. + * - @var string access_key: Access key for the private object. + * - @var boolean extended: '1' — to return additional fields for users and communities. Default value is 0. + * - @var array[StoriesFields] fields: Additional fields to return + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getReplies($access_token, array $params = []) { + return $this->request->post('stories.getReplies', $access_token, $params); + } + + /** + * Returns stories available for current user. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: Story owner ID. + * - @var integer story_id: Story ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getStats($access_token, array $params = []) { + return $this->request->post('stories.getStats', $access_token, $params); + } + + /** + * Allows to receive URL for uploading story with video. + * + * @param string $access_token + * @param array $params + * - @var boolean add_to_news: 1 — to add the story to friend's feed. + * - @var array[integer] user_ids: List of users IDs who can see the story. + * - @var string reply_to_story: ID of the story to reply with the current. + * - @var UploadLinkText link_text: Link text (for community's stories only). + * - @var string link_url: Link URL. Internal links on https://vk.com only. + * - @var integer group_id: ID of the community to upload the story (should be verified or with the "fire" icon). + * @throws VKClientException + * @throws VKApiException + * @throws VKApiMessagesUserBlockedException Can't send messages for users from blacklist + * @throws VKApiStoryIncorrectReplyPrivacyException Incorrect reply privacy + * @throws VKApiBlockedException Content blocked + * @return mixed + */ + public function getVideoUploadServer($access_token, array $params = []) { + return $this->request->post('stories.getVideoUploadServer', $access_token, $params); + } + + /** + * Returns a list of story viewers. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: Story owner ID. + * - @var integer story_id: Story ID. + * - @var integer count: Maximum number of results. + * - @var integer offset: Offset needed to return a specific subset of results. + * - @var boolean extended: '1' — to return detailed information about photos + * @throws VKClientException + * @throws VKApiException + * @throws VKApiStoryExpiredException Story has already expired + * @return mixed + */ + public function getViewers($access_token, array $params = []) { + return $this->request->post('stories.getViewers', $access_token, $params); + } + + /** + * Hides all replies in the last 24 hours from the user to current user's stories. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user whose replies should be hidden. + * - @var integer group_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function hideAllReplies($access_token, array $params = []) { + return $this->request->post('stories.hideAllReplies', $access_token, $params); + } + + /** + * Hides the reply to the current user's story. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user whose replies should be hidden. + * - @var integer story_id: Story ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function hideReply($access_token, array $params = []) { + return $this->request->post('stories.hideReply', $access_token, $params); + } + + /** + * Allows to show stories from hidden sources in current user's feed. + * + * @param string $access_token + * @param array $params + * - @var array[integer] owners_ids: List of hidden sources to show stories from. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function unbanOwner($access_token, array $params = []) { + return $this->request->post('stories.unbanOwner', $access_token, $params); + } } diff --git a/src/VK/Actions/Streaming.php b/src/VK/Actions/Streaming.php index fa8d4e3..c840b53 100644 --- a/src/VK/Actions/Streaming.php +++ b/src/VK/Actions/Streaming.php @@ -1,56 +1,50 @@ request = $request; - } + /** + * Streaming constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Allows to receive data for the connection to Streaming API. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getServerUrl(string $access_token, array $params = array()) { - return $this->request->post('streaming.getServerUrl', $access_token, $params); - } + /** + * Allows to receive data for the connection to Streaming API. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getServerUrl($access_token) { + return $this->request->post('streaming.getServerUrl', $access_token); + } - /** - * - * - * @param $access_token string - * @param $params array - * - StreamingSetSettingsMonthlyTier monthly_tier: - * @see StreamingSetSettingsMonthlyTier - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function setSettings(string $access_token, array $params = array()) { - return $this->request->post('streaming.setSettings', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var StreamingMonthlyTier monthly_tier + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function setSettings($access_token, array $params = []) { + return $this->request->post('streaming.setSettings', $access_token, $params); + } } diff --git a/src/VK/Actions/Users.php b/src/VK/Actions/Users.php index 3370ccb..2eefe70 100644 --- a/src/VK/Actions/Users.php +++ b/src/VK/Actions/Users.php @@ -1,172 +1,158 @@ request = $request; + } - /** - * Users constructor. - * @param VKApiRequest $request - */ - public function __construct(VKApiRequest $request) { - $this->request = $request; - } + /** + * Returns detailed information on users. + * + * @param string $access_token + * @param array $params + * - @var array[string] user_ids: User IDs or screen names ('screen_name'). By default, current user ID. + * - @var array[UsersFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities', + * - @var UsersNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('users.get', $access_token, $params); + } - /** - * Returns detailed information on users. - * - * @param $access_token string - * @param $params array - * - array user_ids: User IDs or screen names ('screen_name'). By default, current user ID. - * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' - * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', - * 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', - * 'can_see_all_posts', 'can_post', 'universities', 'can_invite_to_chats' - * - UsersGetNameCase name_case: Case for declension of user name and surname: 'nom' — nominative - * (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — - * prepositional - * @see UsersGetNameCase - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('users.get', $access_token, $params); - } + /** + * Returns a list of IDs of followers of the user in question, sorted by date added, most recent first. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var integer offset: Offset needed to return a specific subset of followers. + * - @var integer count: Number of followers to return. + * - @var array[UsersFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online'. + * - @var UsersNameCase name_case: Case for declension of user name and surname: 'nom' — nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getFollowers($access_token, array $params = []) { + return $this->request->post('users.getFollowers', $access_token, $params); + } - /** - * Returns a list of IDs of followers of the user in question, sorted by date added, most recent first. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - integer offset: Offset needed to return a specific subset of followers. - * - integer count: Number of followers to return. - * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' - * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', - * 'contacts', 'education', 'online'. - * - UsersGetFollowersNameCase name_case: Case for declension of user name and surname: 'nom' — - * nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , - * 'abl' — prepositional - * @see UsersGetFollowersNameCase - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getFollowers(string $access_token, array $params = array()) { - return $this->request->post('users.getFollowers', $access_token, $params); - } + /** + * Returns a list of IDs of users and communities followed by the user. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: User ID. + * - @var boolean extended: '1' — to return a combined list of users and communities, '0' — to return separate lists of users and communities (default) + * - @var integer offset: Offset needed to return a specific subset of subscriptions. + * - @var integer count: Number of users and communities to return. + * - @var array[UsersFields] fields + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getSubscriptions($access_token, array $params = []) { + return $this->request->post('users.getSubscriptions', $access_token, $params); + } - /** - * Returns a list of IDs of users and communities followed by the user. - * - * @param $access_token string - * @param $params array - * - integer user_id: User ID. - * - boolean extended: '1' — to return a combined list of users and communities, '0' — to return - * separate lists of users and communities (default) - * - integer offset: Offset needed to return a specific subset of subscriptions. - * - integer count: Number of users and communities to return. - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getSubscriptions(string $access_token, array $params = array()) { - return $this->request->post('users.getSubscriptions', $access_token, $params); - } + /** + * Returns information whether a user installed the application. + * + * @param string $access_token + * @param array $params + * - @var integer user_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function isAppUser($access_token, array $params = []) { + return $this->request->post('users.isAppUser', $access_token, $params); + } - /** - * Reports (submits a complain about) a user. - * - * @param $access_token string - * @param $params array - * - integer user_id: ID of the user about whom a complaint is being made. - * - UsersReportType type: Type of complaint: 'porn' - pornography, 'spam' - spamming, 'insult' - abusive - * behavior, 'advertisement' - disruptive advertisements - * @see UsersReportType - * - string comment: Comment describing the complaint. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function report(string $access_token, array $params = array()) { - return $this->request->post('users.report', $access_token, $params); - } + /** + * Reports (submits a complain about) a user. + * + * @param string $access_token + * @param array $params + * - @var integer user_id: ID of the user about whom a complaint is being made. + * - @var UsersType type: Type of complaint: 'porn' – pornography, 'spam' – spamming, 'insult' – abusive behavior, 'advertisement' – disruptive advertisements + * - @var string comment: Comment describing the complaint. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function report($access_token, array $params = []) { + return $this->request->post('users.report', $access_token, $params); + } - /** - * Returns a list of users matching the search criteria. - * - * @param $access_token string - * @param $params array - * - string q: Search query string (e.g., 'Vasya Babich'). - * - UsersSearchSort sort: Sort order: '1' — by date registered, '0' — by rating - * @see UsersSearchSort - * - integer offset: Offset needed to return a specific subset of users. - * - integer count: Number of users to return. - * - array fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' - * (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', - * 'contacts', 'education', 'online', - * - integer city: City ID. - * - integer country: Country ID. - * - string hometown: City name in a string. - * - integer university_country: ID of the country where the user graduated. - * - integer university: ID of the institution of higher education. - * - integer university_year: Year of graduation from an institution of higher education. - * - integer university_faculty: Faculty ID. - * - integer university_chair: Chair ID. - * - UsersSearchSex sex: '1' — female, '2' — male, '0' — any (default) - * @see UsersSearchSex - * - UsersSearchStatus status: Relationship status: '1' — Not married, '2' — In a relationship, '3' - * — Engaged, '4' — Married, '5' — It's complicated, '6' — Actively searching, '7' — In love - * @see UsersSearchStatus - * - integer age_from: Minimum age. - * - integer age_to: Maximum age. - * - integer birth_day: Day of birth. - * - integer birth_month: Month of birth. - * - integer birth_year: Year of birth. - * - boolean online: '1' — online only, '0' — all users - * - boolean has_photo: '1' — with photo only, '0' — all users - * - integer school_country: ID of the country where users finished school. - * - integer school_city: ID of the city where users finished school. - * - integer school_class: - * - integer school: ID of the school. - * - integer school_year: School graduation year. - * - string religion: Users' religious affiliation. - * - string company: Name of the company where users work. - * - string position: Job position. - * - integer group_id: ID of a community to search in communities. - * - array from_list: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('users.search', $access_token, $params); - } + /** + * Returns a list of users matching the search criteria. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query string (e.g., 'Vasya Babich'). + * - @var UsersSort sort: Sort order: '1' — by date registered, '0' — by rating + * - @var integer offset: Offset needed to return a specific subset of users. + * - @var integer count: Number of users to return. + * - @var array[UsersFields] fields: Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'rate', 'contacts', 'education', 'online', + * - @var integer city: City ID. + * - @var integer country: Country ID. + * - @var string hometown: City name in a string. + * - @var integer university_country: ID of the country where the user graduated. + * - @var integer university: ID of the institution of higher education. + * - @var integer university_year: Year of graduation from an institution of higher education. + * - @var integer university_faculty: Faculty ID. + * - @var integer university_chair: Chair ID. + * - @var UsersSex sex: '1' — female, '2' — male, '0' — any (default) + * - @var UsersStatus status: Relationship status: '1' — Not married, '2' — In a relationship, '3' — Engaged, '4' — Married, '5' — It's complicated, '6' — Actively searching, '7' — In love + * - @var integer age_from: Minimum age. + * - @var integer age_to: Maximum age. + * - @var integer birth_day: Day of birth. + * - @var integer birth_month: Month of birth. + * - @var integer birth_year: Year of birth. + * - @var boolean online: '1' — online only, '0' — all users + * - @var boolean has_photo: '1' — with photo only, '0' — all users + * - @var integer school_country: ID of the country where users finished school. + * - @var integer school_city: ID of the city where users finished school. + * - @var integer school_class + * - @var integer school: ID of the school. + * - @var integer school_year: School graduation year. + * - @var string religion: Users' religious affiliation. + * - @var string interests: Users' interests. + * - @var string company: Name of the company where users work. + * - @var string position: Job position. + * - @var integer group_id: ID of a community to search in communities. + * - @var array[string] from_list + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('users.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Utils.php b/src/VK/Actions/Utils.php index 2bdf89c..7c6d478 100644 --- a/src/VK/Actions/Utils.php +++ b/src/VK/Actions/Utils.php @@ -1,149 +1,132 @@ request = $request; - } + /** + * Utils constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Checks whether a link is blocked in VK. - * - * @param $access_token string - * @param $params array - * - string url: Link to check (e.g., 'http://google.com'). - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function checkLink(string $access_token, array $params = array()) { - return $this->request->post('utils.checkLink', $access_token, $params); - } + /** + * Checks whether a link is blocked in VK. + * + * @param string $access_token + * @param array $params + * - @var string url: Link to check (e.g., 'http://google.com'). + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function checkLink($access_token, array $params = []) { + return $this->request->post('utils.checkLink', $access_token, $params); + } - /** - * Deletes shortened link from user's list. - * - * @param $access_token string - * @param $params array - * - string key: Link key (characters after vk.cc/). - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteFromLastShortened(string $access_token, array $params = array()) { - return $this->request->post('utils.deleteFromLastShortened', $access_token, $params); - } + /** + * Deletes shortened link from user's list. + * + * @param string $access_token + * @param array $params + * - @var string key: Link key (characters after vk.cc/). + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteFromLastShortened($access_token, array $params = []) { + return $this->request->post('utils.deleteFromLastShortened', $access_token, $params); + } - /** - * Returns a list of user's shortened links. - * - * @param $access_token string - * @param $params array - * - integer count: Number of links to return. - * - integer offset: Offset needed to return a specific subset of links. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getLastShortenedLinks(string $access_token, array $params = array()) { - return $this->request->post('utils.getLastShortenedLinks', $access_token, $params); - } + /** + * Returns a list of user's shortened links. + * + * @param string $access_token + * @param array $params + * - @var integer count: Number of links to return. + * - @var integer offset: Offset needed to return a specific subset of links. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getLastShortenedLinks($access_token, array $params = []) { + return $this->request->post('utils.getLastShortenedLinks', $access_token, $params); + } - /** - * Returns stats data for shortened link. - * - * @param $access_token string - * @param $params array - * - string key: Link key (characters after vk.cc/). - * - UtilsGetLinkStatsSource source: Source of scope - * @see UtilsGetLinkStatsSource - * - string access_key: Access key for private link stats. - * - UtilsGetLinkStatsInterval interval: Interval. - * @see UtilsGetLinkStatsInterval - * - integer intervals_count: Number of intervals to return. - * - boolean extended: 1 — to return extended stats data (sex, age, geo). 0 — to return views number - * only. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getLinkStats(string $access_token, array $params = array()) { - return $this->request->post('utils.getLinkStats', $access_token, $params); - } + /** + * Returns stats data for shortened link. + * + * @param string $access_token + * @param array $params + * - @var string key: Link key (characters after vk.cc/). + * - @var UtilsSource source: Source of scope + * - @var string access_key: Access key for private link stats. + * - @var UtilsInterval interval: Interval. + * - @var integer intervals_count: Number of intervals to return. + * - @var boolean extended: 1 — to return extended stats data (sex, age, geo). 0 — to return views number only. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function getLinkStats($access_token, array $params = []) { + return $this->request->post('utils.getLinkStats', $access_token, $params); + } - /** - * Returns the current time of the VK server. - * - * @param $access_token string - * @param $params array - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getServerTime(string $access_token, array $params = array()) { - return $this->request->post('utils.getServerTime', $access_token, $params); - } + /** + * Returns the current time of the VK server. + * + * @param string $access_token + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getServerTime($access_token) { + return $this->request->post('utils.getServerTime', $access_token); + } - /** - * Allows to receive a link shortened via vk.cc. - * - * @param $access_token string - * @param $params array - * - string url: URL to be shortened. - * - boolean private: 1 — private stats, 0 — public stats. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getShortLink(string $access_token, array $params = array()) { - return $this->request->post('utils.getShortLink', $access_token, $params); - } + /** + * Allows to receive a link shortened via vk.cc. + * + * @param string $access_token + * @param array $params + * - @var string url: URL to be shortened. + * - @var boolean private: 1 — private stats, 0 — public stats. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getShortLink($access_token, array $params = []) { + return $this->request->post('utils.getShortLink', $access_token, $params); + } - /** - * Detects a type of object (e.g., user, community, application) and its ID by screen name. - * - * @param $access_token string - * @param $params array - * - string screen_name: Screen name of the user, community (e.g., 'apiclub,' 'andrew', or - * 'rules_of_war'), or application. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function resolveScreenName(string $access_token, array $params = array()) { - return $this->request->post('utils.resolveScreenName', $access_token, $params); - } + /** + * Detects a type of object (e.g., user, community, application) and its ID by screen name. + * + * @param string $access_token + * @param array $params + * - @var string screen_name: Screen name of the user, community (e.g., 'apiclub,' 'andrew', or 'rules_of_war'), or application. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function resolveScreenName($access_token, array $params = []) { + return $this->request->post('utils.resolveScreenName', $access_token, $params); + } } diff --git a/src/VK/Actions/Video.php b/src/VK/Actions/Video.php index cdcb4a9..e6bec87 100644 --- a/src/VK/Actions/Video.php +++ b/src/VK/Actions/Video.php @@ -1,560 +1,481 @@ request = $request; - } + /** + * Video constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Adds a video to a user or community page. - * - * @param $access_token string - * @param $params array - * - integer target_id: identifier of a user or community to add a video to. Use a negative value to - * designate a community ID. - * - integer video_id: Video ID. - * - integer owner_id: ID of the user or community that owns the video. Use a negative value to designate - * a community ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function add(string $access_token, array $params = array()) { - return $this->request->post('video.add', $access_token, $params); - } + /** + * Adds a video to a user or community page. + * + * @param string $access_token + * @param array $params + * - @var integer target_id: identifier of a user or community to add a video to. Use a negative value to designate a community ID. + * - @var integer video_id: Video ID. + * - @var integer owner_id: ID of the user or community that owns the video. Use a negative value to designate a community ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @throws VKApiVideoAlreadyAddedException This video is already added + * @return mixed + */ + public function add($access_token, array $params = []) { + return $this->request->post('video.add', $access_token, $params); + } - /** - * Creates an empty album for videos. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID (if the album will be created in a community). - * - string title: Album title. - * - array privacy: new access permissions for the album. Possible values: , *'0' - all users,, *'1' - - * friends only,, *'2' - friends and friends of friends,, *'3' - "only me". - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function addAlbum(string $access_token, array $params = array()) { - return $this->request->post('video.addAlbum', $access_token, $params); - } + /** + * Creates an empty album for videos. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID (if the album will be created in a community). + * - @var string title: Album title. + * - @var array[VideoPrivacy] privacy: new access permissions for the album. Possible values: , *'0' – all users,, *'1' – friends only,, *'2' – friends and friends of friends,, *'3' – "only me". + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @throws VKApiAlbumsLimitException Albums number limit is reached + * @return mixed + */ + public function addAlbum($access_token, array $params = []) { + return $this->request->post('video.addAlbum', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer target_id: - * - integer album_id: - * - array album_ids: - * - integer owner_id: - * - integer video_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function addToAlbum(string $access_token, array $params = array()) { - return $this->request->post('video.addToAlbum', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer target_id + * - @var integer album_id + * - @var array[integer] album_ids + * - @var integer owner_id + * - @var integer video_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @throws VKApiVideoAlreadyAddedException This video is already added + * @return mixed + */ + public function addToAlbum($access_token, array $params = []) { + return $this->request->post('video.addToAlbum', $access_token, $params); + } - /** - * Adds a new comment on a video. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video. - * - integer video_id: Video ID. - * - string message: New comment text. - * - array attachments: List of objects attached to the comment, in the following format: - * "_,_", '' — Type of media attachment: 'photo' — photo, 'video' - * — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. - * '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" - * - boolean from_group: '1' — to post the comment from a community name (only if 'owner_id'<0) - * - integer reply_to_comment: - * - integer sticker_id: - * - string guid: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function createComment(string $access_token, array $params = array()) { - return $this->request->post('video.createComment', $access_token, $params); - } + /** + * Adds a new comment on a video. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer video_id: Video ID. + * - @var string message: New comment text. + * - @var array[string] attachments: List of objects attached to the comment, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * - @var boolean from_group: '1' — to post the comment from a community name (only if 'owner_id'<0) + * - @var integer reply_to_comment + * - @var integer sticker_id + * - @var string guid + * @throws VKClientException + * @throws VKApiException + * @throws VKApiVideoCommentsClosedException Comments for this video are closed + * @return mixed + */ + public function createComment($access_token, array $params = []) { + return $this->request->post('video.createComment', $access_token, $params); + } - /** - * Deletes a video from a user or community page. - * - * @param $access_token string - * @param $params array - * - integer video_id: Video ID. - * - integer owner_id: ID of the user or community that owns the video. - * - integer target_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('video.delete', $access_token, $params); - } + /** + * Deletes a video from a user or community page. + * + * @param string $access_token + * @param array $params + * - @var integer video_id: Video ID. + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer target_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('video.delete', $access_token, $params); + } - /** - * Deletes a video album. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID (if the album is owned by a community). - * - integer album_id: Album ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function deleteAlbum(string $access_token, array $params = array()) { - return $this->request->post('video.deleteAlbum', $access_token, $params); - } + /** + * Deletes a video album. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID (if the album is owned by a community). + * - @var integer album_id: Album ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @return mixed + */ + public function deleteAlbum($access_token, array $params = []) { + return $this->request->post('video.deleteAlbum', $access_token, $params); + } - /** - * Deletes a comment on a video. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video. - * - integer comment_id: ID of the comment to be deleted. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function deleteComment(string $access_token, array $params = array()) { - return $this->request->post('video.deleteComment', $access_token, $params); - } + /** + * Deletes a comment on a video. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer comment_id: ID of the comment to be deleted. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function deleteComment($access_token, array $params = []) { + return $this->request->post('video.deleteComment', $access_token, $params); + } - /** - * Edits information about a video on a user or community page. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video. - * - integer video_id: Video ID. - * - string name: New video title. - * - string desc: New video description. - * - array privacy_view: Privacy settings in a [vk.com/dev/privacy_setting|special format]. Privacy - * setting is available for videos uploaded to own profile by user. - * - array privacy_comment: Privacy settings for comments in a [vk.com/dev/privacy_setting|special - * format]. - * - boolean no_comments: Disable comments for the group video. - * - boolean repeat: '1' — to repeat the playback of the video, '0' — to play the video once, - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('video.edit', $access_token, $params); - } + /** + * Edits information about a video on a user or community page. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer video_id: Video ID. + * - @var string name: New video title. + * - @var string desc: New video description. + * - @var array[string] privacy_view: Privacy settings in a [vk.com/dev/privacy_setting|special format]. Privacy setting is available for videos uploaded to own profile by user. + * - @var array[string] privacy_comment: Privacy settings for comments in a [vk.com/dev/privacy_setting|special format]. + * - @var boolean no_comments: Disable comments for the group video. + * - @var boolean repeat: '1' — to repeat the playback of the video, '0' — to play the video once, + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('video.edit', $access_token, $params); + } - /** - * Edits the title of a video album. - * - * @param $access_token string - * @param $params array - * - integer group_id: Community ID (if the album edited is owned by a community). - * - integer album_id: Album ID. - * - string title: New album title. - * - array privacy: new access permissions for the album. Possible values: , *'0' - all users,, *'1' - - * friends only,, *'2' - friends and friends of friends,, *'3' - "only me". - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function editAlbum(string $access_token, array $params = array()) { - return $this->request->post('video.editAlbum', $access_token, $params); - } + /** + * Edits the title of a video album. + * + * @param string $access_token + * @param array $params + * - @var integer group_id: Community ID (if the album edited is owned by a community). + * - @var integer album_id: Album ID. + * - @var string title: New album title. + * - @var array[VideoPrivacy] privacy: new access permissions for the album. Possible values: , *'0' – all users,, *'1' – friends only,, *'2' – friends and friends of friends,, *'3' – "only me". + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @return mixed + */ + public function editAlbum($access_token, array $params = []) { + return $this->request->post('video.editAlbum', $access_token, $params); + } - /** - * Edits the text of a comment on a video. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video. - * - integer comment_id: Comment ID. - * - string message: New comment text. - * - array attachments: List of objects attached to the comment, in the following format: - * "_,_", '' — Type of media attachment: 'photo' — photo, 'video' - * — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. - * '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function editComment(string $access_token, array $params = array()) { - return $this->request->post('video.editComment', $access_token, $params); - } + /** + * Edits the text of a comment on a video. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer comment_id: Comment ID. + * - @var string message: New comment text. + * - @var array[string] attachments: List of objects attached to the comment, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. '' — Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function editComment($access_token, array $params = []) { + return $this->request->post('video.editComment', $access_token, $params); + } - /** - * Returns detailed information about videos. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video(s). - * - array videos: Video IDs, in the following format: "_,_", Use - * a negative value to designate a community ID. Example: "-4363_136089719,13245770_137352259" - * - integer album_id: ID of the album containing the video(s). - * - integer count: Number of videos to return. - * - integer offset: Offset needed to return a specific subset of videos. - * - boolean extended: '1' — to return an extended response with additional fields - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('video.get', $access_token, $params); - } + /** + * Returns detailed information about videos. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video(s). + * - @var array[string] videos: Video IDs, in the following format: "_,_", Use a negative value to designate a community ID. Example: "-4363_136089719,13245770_137352259" + * - @var integer album_id: ID of the album containing the video(s). + * - @var integer count: Number of videos to return. + * - @var integer offset: Offset needed to return a specific subset of videos. + * - @var boolean extended: '1' — to return an extended response with additional fields + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('video.get', $access_token, $params); + } - /** - * Returns video album info - * - * @param $access_token string - * @param $params array - * - integer owner_id: identifier of a user or community to add a video to. Use a negative value to - * designate a community ID. - * - integer album_id: Album ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getAlbumById(string $access_token, array $params = array()) { - return $this->request->post('video.getAlbumById', $access_token, $params); - } + /** + * Returns video album info + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: identifier of a user or community to add a video to. Use a negative value to designate a community ID. + * - @var integer album_id: Album ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @return mixed + */ + public function getAlbumById($access_token, array $params = []) { + return $this->request->post('video.getAlbumById', $access_token, $params); + } - /** - * Returns a list of video albums owned by a user or community. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video album(s). - * - integer offset: Offset needed to return a specific subset of video albums. - * - integer count: Number of video albums to return. - * - boolean extended: '1' — to return additional information about album privacy settings for the - * current user - * - boolean need_system: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getAlbums(string $access_token, array $params = array()) { - return $this->request->post('video.getAlbums', $access_token, $params); - } + /** + * Returns a list of video albums owned by a user or community. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video album(s). + * - @var integer offset: Offset needed to return a specific subset of video albums. + * - @var integer count: Number of video albums to return. + * - @var boolean extended: '1' — to return additional information about album privacy settings for the current user + * - @var boolean need_system + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @return mixed + */ + public function getAlbums($access_token, array $params = []) { + return $this->request->post('video.getAlbums', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer target_id: - * - integer owner_id: - * - integer video_id: - * - boolean extended: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getAlbumsByVideo(string $access_token, array $params = array()) { - return $this->request->post('video.getAlbumsByVideo', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer target_id + * - @var integer owner_id + * - @var integer video_id + * - @var boolean extended + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @return mixed + */ + public function getAlbumsByVideo($access_token, array $params = []) { + return $this->request->post('video.getAlbumsByVideo', $access_token, $params); + } - /** - * Returns a list of comments on a video. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video. - * - integer video_id: Video ID. - * - boolean need_likes: '1' — to return an additional 'likes' field - * - integer start_comment_id: - * - integer offset: Offset needed to return a specific subset of comments. - * - integer count: Number of comments to return. - * - VideoGetCommentsSort sort: Sort order: 'asc' — oldest comment first, 'desc' — newest comment - * first - * @see VideoGetCommentsSort - * - boolean extended: - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getComments(string $access_token, array $params = array()) { - return $this->request->post('video.getComments', $access_token, $params); - } + /** + * Returns a list of comments on a video. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer video_id: Video ID. + * - @var boolean need_likes: '1' — to return an additional 'likes' field + * - @var integer start_comment_id + * - @var integer offset: Offset needed to return a specific subset of comments. + * - @var integer count: Number of comments to return. + * - @var VideoSort sort: Sort order: 'asc' — oldest comment first, 'desc' — newest comment first + * - @var boolean extended + * - @var array[string] fields + * @throws VKClientException + * @throws VKApiException + * @throws VKApiVideoCommentsClosedException Comments for this video are closed + * @return mixed + */ + public function getComments($access_token, array $params = []) { + return $this->request->post('video.getComments', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer target_id: - * - integer album_id: - * - array album_ids: - * - integer owner_id: - * - integer video_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function removeFromAlbum(string $access_token, array $params = array()) { - return $this->request->post('video.removeFromAlbum', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer target_id + * - @var integer album_id + * - @var array[integer] album_ids + * - @var integer owner_id + * - @var integer video_id + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @return mixed + */ + public function removeFromAlbum($access_token, array $params = []) { + return $this->request->post('video.removeFromAlbum', $access_token, $params); + } - /** - * Reorders the album in the list of user video albums. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the albums.. - * - integer album_id: Album ID. - * - integer before: ID of the album before which the album in question shall be placed. - * - integer after: ID of the album after which the album in question shall be placed. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function reorderAlbums(string $access_token, array $params = array()) { - return $this->request->post('video.reorderAlbums', $access_token, $params); - } + /** + * Reorders the album in the list of user video albums. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the albums.. + * - @var integer album_id: Album ID. + * - @var integer before: ID of the album before which the album in question shall be placed. + * - @var integer after: ID of the album after which the album in question shall be placed. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @throws VKApiNotFoundException Not found + * @return mixed + */ + public function reorderAlbums($access_token, array $params = []) { + return $this->request->post('video.reorderAlbums', $access_token, $params); + } - /** - * Reorders the video in the video album. - * - * @param $access_token string - * @param $params array - * - integer target_id: ID of the user or community that owns the album with videos. - * - integer album_id: ID of the video album. - * - integer owner_id: ID of the user or community that owns the video. - * - integer video_id: ID of the video. - * - integer before_owner_id: ID of the user or community that owns the video before which the video in - * question shall be placed. - * - integer before_video_id: ID of the video before which the video in question shall be placed. - * - integer after_owner_id: ID of the user or community that owns the video after which the photo in - * question shall be placed. - * - integer after_video_id: ID of the video after which the photo in question shall be placed. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function reorderVideos(string $access_token, array $params = array()) { - return $this->request->post('video.reorderVideos', $access_token, $params); - } + /** + * Reorders the video in the video album. + * + * @param string $access_token + * @param array $params + * - @var integer target_id: ID of the user or community that owns the album with videos. + * - @var integer album_id: ID of the video album. + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer video_id: ID of the video. + * - @var integer before_owner_id: ID of the user or community that owns the video before which the video in question shall be placed. + * - @var integer before_video_id: ID of the video before which the video in question shall be placed. + * - @var integer after_owner_id: ID of the user or community that owns the video after which the photo in question shall be placed. + * - @var integer after_video_id: ID of the video after which the photo in question shall be placed. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @return mixed + */ + public function reorderVideos($access_token, array $params = []) { + return $this->request->post('video.reorderVideos', $access_token, $params); + } - /** - * Reports (submits a complaint about) a video. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video. - * - integer video_id: Video ID. - * - VideoReportReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - - * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse - * @see VideoReportReason - * - string comment: Comment describing the complaint. - * - string search_query: (If the video was found in search results.) Search query string. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function report(string $access_token, array $params = array()) { - return $this->request->post('video.report', $access_token, $params); - } + /** + * Reports (submits a complaint about) a video. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer video_id: Video ID. + * - @var VideoReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse + * - @var string comment: Comment describing the complaint. + * - @var string search_query: (If the video was found in search results.) Search query string. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function report($access_token, array $params = []) { + return $this->request->post('video.report', $access_token, $params); + } - /** - * Reports (submits a complaint about) a comment on a video. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video. - * - integer comment_id: ID of the comment being reported. - * - VideoReportCommentReason reason: Reason for the complaint: , 0 - spam , 1 - child pornography , 2 - - * extremism , 3 - violence , 4 - drug propaganda , 5 - adult material , 6 - insult, abuse - * @see VideoReportCommentReason - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function reportComment(string $access_token, array $params = array()) { - return $this->request->post('video.reportComment', $access_token, $params); - } + /** + * Reports (submits a complaint about) a comment on a video. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer comment_id: ID of the comment being reported. + * - @var VideoReason reason: Reason for the complaint: , 0 – spam , 1 – child pornography , 2 – extremism , 3 – violence , 4 – drug propaganda , 5 – adult material , 6 – insult, abuse + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function reportComment($access_token, array $params = []) { + return $this->request->post('video.reportComment', $access_token, $params); + } - /** - * Restores a previously deleted video. - * - * @param $access_token string - * @param $params array - * - integer video_id: Video ID. - * - integer owner_id: ID of the user or community that owns the video. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function restore(string $access_token, array $params = array()) { - return $this->request->post('video.restore', $access_token, $params); - } + /** + * Restores a previously deleted video. + * + * @param string $access_token + * @param array $params + * - @var integer video_id: Video ID. + * - @var integer owner_id: ID of the user or community that owns the video. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function restore($access_token, array $params = []) { + return $this->request->post('video.restore', $access_token, $params); + } - /** - * Restores a previously deleted comment on a video. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the video. - * - integer comment_id: ID of the deleted comment. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function restoreComment(string $access_token, array $params = array()) { - return $this->request->post('video.restoreComment', $access_token, $params); - } + /** + * Restores a previously deleted comment on a video. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the video. + * - @var integer comment_id: ID of the deleted comment. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function restoreComment($access_token, array $params = []) { + return $this->request->post('video.restoreComment', $access_token, $params); + } - /** - * Returns a server address (required for upload) and video data. - * - * @param $access_token string - * @param $params array - * - string name: Name of the video. - * - string description: Description of the video. - * - boolean is_private: '1' — to designate the video as private (send it via a private message), the - * video will not appear on the user's video list and will not be available by ID for other users, '0' — not - * to designate the video as private - * - boolean wallpost: '1' — to post the saved video on a user's wall, '0' — not to post the saved - * video on a user's wall - * - string link: URL for embedding the video from an external website. - * - integer group_id: ID of the community in which the video will be saved. By default, the current - * user's page. - * - integer album_id: ID of the album to which the saved video will be added. - * - array privacy_view: - * - array privacy_comment: - * - boolean no_comments: - * - boolean repeat: '1' — to repeat the playback of the video, '0' — to play the video once, - * - boolean compression: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function save(string $access_token, array $params = array()) { - return $this->request->post('video.save', $access_token, $params); - } + /** + * Returns a server address (required for upload) and video data. + * + * @param string $access_token + * @param array $params + * - @var string name: Name of the video. + * - @var string description: Description of the video. + * - @var boolean is_private: '1' — to designate the video as private (send it via a private message), the video will not appear on the user's video list and will not be available by ID for other users, '0' — not to designate the video as private + * - @var boolean wallpost: '1' — to post the saved video on a user's wall, '0' — not to post the saved video on a user's wall + * - @var string link: URL for embedding the video from an external website. + * - @var integer group_id: ID of the community in which the video will be saved. By default, the current user's page. + * - @var integer album_id: ID of the album to which the saved video will be added. + * - @var array[string] privacy_view + * - @var array[string] privacy_comment + * - @var boolean no_comments + * - @var boolean repeat: '1' — to repeat the playback of the video, '0' — to play the video once, + * - @var boolean compression + * @throws VKClientException + * @throws VKApiException + * @throws VKApiAccessVideoException Access denied + * @throws VKApiWallAddPostException Access to adding post denied + * @throws VKApiWallAdsPublishedException Advertisement post was recently added + * @return mixed + */ + public function save($access_token, array $params = []) { + return $this->request->post('video.save', $access_token, $params); + } - /** - * Returns a list of videos under the set search criterion. - * - * @param $access_token string - * @param $params array - * - string q: Search query string (e.g., 'The Beatles'). - * - VideoSearchSort sort: Sort order: '1' — by duration, '2' — by relevance, '0' — by date added - * @see VideoSearchSort - * - integer hd: If not null, only searches for high-definition videos. - * - boolean adult: '1' — to disable the Safe Search filter, '0' — to enable the Safe Search filter - * - array filters: Filters to apply: 'youtube' — return YouTube videos only, 'vimeo' — return Vimeo - * videos only, 'short' — return short videos only, 'long' — return long videos only - * - boolean search_own: - * - integer offset: Offset needed to return a specific subset of videos. - * - integer longer: - * - integer shorter: - * - integer count: Number of videos to return. - * - boolean extended: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('video.search', $access_token, $params); - } + /** + * Returns a list of videos under the set search criterion. + * + * @param string $access_token + * @param array $params + * - @var string q: Search query string (e.g., 'The Beatles'). + * - @var VideoSort sort: Sort order: '1' — by duration, '2' — by relevance, '0' — by date added + * - @var integer hd: If not null, only searches for high-definition videos. + * - @var boolean adult: '1' — to disable the Safe Search filter, '0' — to enable the Safe Search filter + * - @var array[VideoFilters] filters: Filters to apply: 'youtube' — return YouTube videos only, 'vimeo' — return Vimeo videos only, 'short' — return short videos only, 'long' — return long videos only + * - @var boolean search_own + * - @var integer offset: Offset needed to return a specific subset of videos. + * - @var integer longer + * - @var integer shorter + * - @var integer count: Number of videos to return. + * - @var boolean extended + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('video.search', $access_token, $params); + } } diff --git a/src/VK/Actions/Wall.php b/src/VK/Actions/Wall.php index 9db8e92..6809c62 100644 --- a/src/VK/Actions/Wall.php +++ b/src/VK/Actions/Wall.php @@ -1,610 +1,477 @@ request = $request; - } - - /** - * - * - * @param $access_token string - * @param $params array - * - string link: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function checkCopyrightLink(string $access_token, array $params = array()) { - return $this->request->post('wall.checkCopyrightLink', $access_token, $params); - } + /** + * @var VKApiRequest + */ + private $request; - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer post_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function closeComments(string $access_token, array $params = array()) { - return $this->request->post('wall.closeComments', $access_token, $params); - } + /** + * Wall constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Adds a comment to a post on a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer post_id: Post ID. - * - integer from_group: Group ID. - * - string message: (Required if 'attachments' is not set.) Text of the comment. - * - integer reply_to_comment: ID of comment to reply. - * - array attachments: (Required if 'message' is not set.) List of media objects attached to the comment, - * in the following format: "_,_", '' — Type of media ojbect: 'photo' - * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. - * '' — Media ID. For example: "photo100172_166443618,photo66748_265827614" - * - integer sticker_id: Sticker ID. - * - string guid: Unique identifier to avoid repeated comments. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function createComment(string $access_token, array $params = array()) { - return $this->request->post('wall.createComment', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer post_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function closeComments($access_token, array $params = []) { + return $this->request->post('wall.closeComments', $access_token, $params); + } - /** - * Deletes a post from a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer post_id: ID of the post to be deleted. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function delete(string $access_token, array $params = array()) { - return $this->request->post('wall.delete', $access_token, $params); - } + /** + * Adds a comment to a post on a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer post_id: Post ID. + * - @var integer from_group: Group ID. + * - @var string message: (Required if 'attachments' is not set.) Text of the comment. + * - @var integer reply_to_comment: ID of comment to reply. + * - @var array[string] attachments: (Required if 'message' is not set.) List of media objects attached to the comment, in the following format: "_,_", '' — Type of media ojbect: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media owner. '' — Media ID. For example: "photo100172_166443618,photo66748_265827614" + * - @var integer sticker_id: Sticker ID. + * - @var string guid: Unique identifier to avoid repeated comments. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAccessAddReplyException Access to status replies denied + * @throws VKApiWallReplyOwnerFloodException Too many replies + * @throws VKApiWallLinksForbiddenException Hyperlinks are forbidden + * @throws VKApiWallAccessRepliesException Access to post comments denied + * @return mixed + */ + public function createComment($access_token, array $params = []) { + return $this->request->post('wall.createComment', $access_token, $params); + } - /** - * Deletes a comment on a post on a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer comment_id: Comment ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function deleteComment(string $access_token, array $params = array()) { - return $this->request->post('wall.deleteComment', $access_token, $params); - } + /** + * Deletes a post from a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer post_id: ID of the post to be deleted. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAccessPostException Access to wall's post denied + * @return mixed + */ + public function delete($access_token, array $params = []) { + return $this->request->post('wall.delete', $access_token, $params); + } - /** - * Edits a post on a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer post_id: - * - boolean friends_only: - * - string message: (Required if 'attachments' is not set.) Text of the post. - * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the - * following format: "_,_", '' — Type of media attachment: 'photo' - * — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media - * application owner. '' — Media application ID. Example: - * "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. - * Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an - * error is thrown." - * - string services: - * - boolean signed: - * - integer publish_date: - * - number lat: - * - number long: - * - integer place_id: - * - boolean mark_as_ads: - * - boolean close_comments: - * - integer donut_paid_duration: - * - integer poster_bkg_id: - * - integer poster_bkg_owner_id: - * - string poster_bkg_access_hash: - * - string copyright: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function edit(string $access_token, array $params = array()) { - return $this->request->post('wall.edit', $access_token, $params); - } + /** + * Deletes a comment on a post on a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer comment_id: Comment ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAccessCommentException Access to wall's comment denied + * @return mixed + */ + public function deleteComment($access_token, array $params = []) { + return $this->request->post('wall.deleteComment', $access_token, $params); + } - /** - * Allows to edit hidden post. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer post_id: Post ID. Used for publishing of scheduled and suggested posts. - * - string message: (Required if 'attachments' is not set.) Text of the post. - * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the - * following format: "_,_", '' — Type of media attachment: 'photo' - * — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, - * 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' - * — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an - * external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more - * than one link is being attached, an error will be thrown." - * - boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be - * signed with the name of the posting user, '0' — post will not be signed (default) - * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - integer place_id: ID of the location where the user was tagged. - * - string link_button: Link button ID - * - string link_title: Link title - * - string link_image: Link image url - * - string link_video: Link video ID in format "_" - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function editAdsStealth(string $access_token, array $params = array()) { - return $this->request->post('wall.editAdsStealth', $access_token, $params); - } + /** + * Edits a post on a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer post_id + * - @var boolean friends_only + * - @var string message: (Required if 'attachments' is not set.) Text of the post. + * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media application owner. '' — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error is thrown." + * - @var string services + * - @var boolean signed + * - @var integer publish_date + * - @var number lat + * - @var number long + * - @var integer place_id + * - @var boolean mark_as_ads + * - @var boolean close_comments + * - @var integer poster_bkg_id + * - @var integer poster_bkg_owner_id + * - @var string poster_bkg_access_hash + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAdsPostLimitReachedException Too many ads posts + * @return mixed + */ + public function edit($access_token, array $params = []) { + return $this->request->post('wall.edit', $access_token, $params); + } - /** - * Edits a comment on a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer comment_id: Comment ID. - * - string message: New comment text. - * - array attachments: List of objects attached to the comment, in the following format: , - * "_,_", '' — Type of media attachment: 'photo' — photo, 'video' - * — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. - * '' — Media attachment ID. For example: "photo100172_166443618,photo66748_265827614" - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function editComment(string $access_token, array $params = array()) { - return $this->request->post('wall.editComment', $access_token, $params); - } + /** + * Allows to edit hidden post. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer post_id: Post ID. Used for publishing of scheduled and suggested posts. + * - @var string message: (Required if 'attachments' is not set.) Text of the post. + * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error will be thrown." + * - @var boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be signed with the name of the posting user, '0' — post will not be signed (default) + * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - @var integer place_id: ID of the location where the user was tagged. + * - @var string link_button: Link button ID + * - @var string link_title: Link title + * - @var string link_image: Link image url + * - @var string link_video: Link video ID in format "_" + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAdsPostLimitReachedException Too many ads posts + * @return mixed + */ + public function editAdsStealth($access_token, array $params = []) { + return $this->request->post('wall.editAdsStealth', $access_token, $params); + } - /** - * Returns a list of posts on a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a - * negative value to designate a community ID. - * - string domain: User or community short address. - * - integer offset: Offset needed to return a specific subset of posts. - * - integer count: Number of posts to return (maximum 100). - * - string filter: - * - boolean extended: '1' — to return 'wall', 'profiles', and 'groups' fields, '0' — to return no - * additional fields (default) - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function get(string $access_token, array $params = array()) { - return $this->request->post('wall.get', $access_token, $params); - } + /** + * Edits a comment on a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer comment_id: Comment ID. + * - @var string message: New comment text. + * - @var array[string] attachments: List of objects attached to the comment, in the following format: , "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, '' — ID of the media attachment owner. '' — Media attachment ID. For example: "photo100172_166443618,photo66748_265827614" + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function editComment($access_token, array $params = []) { + return $this->request->post('wall.editComment', $access_token, $params); + } - /** - * Returns a list of posts from user or community walls by their IDs. - * - * @param $access_token string - * @param $params array - * - array posts: User or community IDs and post IDs, separated by underscores. Use a negative value to - * designate a community ID. Example: "93388_21539,93388_20904,2943_4276,-1_1" - * - boolean extended: '1' — to return user and community objects needed to display posts, '0' — no - * additional fields are returned (default) - * - integer copy_history_depth: Sets the number of parent elements to include in the array 'copy_history' - * that is returned if the post is a repost from another wall. - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getById(string $access_token, array $params = array()) { - return $this->request->post('wall.getById', $access_token, $params); - } + /** + * Returns a list of posts on a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. + * - @var string domain: User or community short address. + * - @var integer offset: Offset needed to return a specific subset of posts. + * - @var integer count: Number of posts to return (maximum 100). + * - @var WallFilter filter: Filter to apply: 'owner' — posts by the wall owner, 'others' — posts by someone else, 'all' — posts by the wall owner and others (default), 'postponed' — timed posts (only available for calls with an 'access_token'), 'suggests' — suggested posts on a community wall + * - @var boolean extended: '1' — to return 'wall', 'profiles', and 'groups' fields, '0' — to return no additional fields (default) + * - @var array[WallFields] fields + * @throws VKClientException + * @throws VKApiException + * @throws VKApiBlockedException Content blocked + * @return mixed + */ + public function get($access_token, array $params = []) { + return $this->request->post('wall.get', $access_token, $params); + } - /** - * Returns a comment on a post on a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer comment_id: Comment ID. - * - boolean extended: - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getComment(string $access_token, array $params = array()) { - return $this->request->post('wall.getComment', $access_token, $params); - } + /** + * Returns a list of posts from user or community walls by their IDs. + * + * @param string $access_token + * @param array $params + * - @var array[string] posts: User or community IDs and post IDs, separated by underscores. Use a negative value to designate a community ID. Example: "93388_21539,93388_20904,2943_4276,-1_1" + * - @var boolean extended: '1' — to return user and community objects needed to display posts, '0' — no additional fields are returned (default) + * - @var integer copy_history_depth: Sets the number of parent elements to include in the array 'copy_history' that is returned if the post is a repost from another wall. + * - @var array[WallFields] fields + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getById($access_token, array $params = []) { + return $this->request->post('wall.getById', $access_token, $params); + } - /** - * Returns a list of comments on a post on a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer post_id: Post ID. - * - boolean need_likes: '1' — to return the 'likes' field, '0' — not to return the 'likes' field - * (default) - * - integer start_comment_id: - * - integer offset: Offset needed to return a specific subset of comments. - * - integer count: Number of comments to return (maximum 100). - * - WallGetCommentsSort sort: Sort order: 'asc' — chronological, 'desc' — reverse chronological - * @see WallGetCommentsSort - * - integer preview_length: Number of characters at which to truncate comments when previewed. By - * default, '90'. Specify '0' if you do not want to truncate comments. - * - boolean extended: - * - array fields: - * - integer comment_id: Comment ID. - * - integer thread_items_count: Count items in threads. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function getComments(string $access_token, array $params = array()) { - return $this->request->post('wall.getComments', $access_token, $params); - } + /** + * Returns a list of comments on a post on a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer post_id: Post ID. + * - @var boolean need_likes: '1' — to return the 'likes' field, '0' — not to return the 'likes' field (default) + * - @var integer start_comment_id + * - @var integer offset: Offset needed to return a specific subset of comments. + * - @var integer count: Number of comments to return (maximum 100). + * - @var WallSort sort: Sort order: 'asc' — chronological, 'desc' — reverse chronological + * - @var integer preview_length: Number of characters at which to truncate comments when previewed. By default, '90'. Specify '0' if you do not want to truncate comments. + * - @var boolean extended + * - @var array[WallFields] fields + * - @var integer comment_id: Comment ID. + * - @var integer thread_items_count: Count items in threads. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAccessRepliesException Access to post comments denied + * @return mixed + */ + public function getComments($access_token, array $params = []) { + return $this->request->post('wall.getComments', $access_token, $params); + } - /** - * Returns information about reposts of a post on user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. By default, current user ID. Use a negative value to - * designate a community ID. - * - integer post_id: Post ID. - * - integer offset: Offset needed to return a specific subset of reposts. - * - integer count: Number of reposts to return. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getReposts(string $access_token, array $params = array()) { - return $this->request->post('wall.getReposts', $access_token, $params); - } + /** + * Returns information about reposts of a post on user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. By default, current user ID. Use a negative value to designate a community ID. + * - @var integer post_id: Post ID. + * - @var integer offset: Offset needed to return a specific subset of reposts. + * - @var integer count: Number of reposts to return. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getReposts($access_token, array $params = []) { + return $this->request->post('wall.getReposts', $access_token, $params); + } - /** - * - * - * @param $access_token string - * @param $params array - * - integer owner_id: - * - integer post_id: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function openComments(string $access_token, array $params = array()) { - return $this->request->post('wall.openComments', $access_token, $params); - } + /** + * @param string $access_token + * @param array $params + * - @var integer owner_id + * - @var integer post_id + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function openComments($access_token, array $params = []) { + return $this->request->post('wall.openComments', $access_token, $params); + } - /** - * Pins the post on wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a - * negative value to designate a community ID. - * - integer post_id: Post ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function pin(string $access_token, array $params = array()) { - return $this->request->post('wall.pin', $access_token, $params); - } + /** + * Pins the post on wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. + * - @var integer post_id: Post ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function pin($access_token, array $params = []) { + return $this->request->post('wall.pin', $access_token, $params); + } - /** - * Adds a new post on a user wall or community wall. Can also be used to publish suggested or scheduled posts. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - boolean friends_only: '1' — post will be available to friends only, '0' — post will be available - * to all users (default) - * - boolean from_group: For a community: '1' — post will be published by the community, '0' — post - * will be published by the user (default) - * - string message: (Required if 'attachments' is not set.) Text of the post. - * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the - * following format: "_,_", '' — Type of media attachment: 'photo' - * — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, - * 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' - * — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an - * external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more - * than one link is being attached, an error will be thrown." - * - string services: List of services or websites the update will be exported to, if the user has so - * requested. Sample values: 'twitter', 'facebook'. - * - boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be - * signed with the name of the posting user, '0' — post will not be signed (default) - * - integer publish_date: Publication date (in Unix time). If used, posting will be delayed until the set - * time. - * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - integer place_id: ID of the location where the user was tagged. - * - integer post_id: Post ID. Used for publishing of scheduled and suggested posts. - * - string guid: - * - boolean mark_as_ads: - * - boolean close_comments: - * - integer donut_paid_duration: - * - boolean mute_notifications: - * - string copyright: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function post(string $access_token, array $params = array()) { - return $this->request->post('wall.post', $access_token, $params); - } + /** + * Adds a new post on a user wall or community wall. Can also be used to publish suggested or scheduled posts. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var boolean friends_only: '1' — post will be available to friends only, '0' — post will be available to all users (default) + * - @var boolean from_group: For a community: '1' — post will be published by the community, '0' — post will be published by the user (default) + * - @var string message: (Required if 'attachments' is not set.) Text of the post. + * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error will be thrown." + * - @var string services: List of services or websites the update will be exported to, if the user has so requested. Sample values: 'twitter', 'facebook'. + * - @var boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be signed with the name of the posting user, '0' — post will not be signed (default) + * - @var integer publish_date: Publication date (in Unix time). If used, posting will be delayed until the set time. + * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - @var integer place_id: ID of the location where the user was tagged. + * - @var integer post_id: Post ID. Used for publishing of scheduled and suggested posts. + * - @var string guid + * - @var boolean mark_as_ads + * - @var boolean close_comments + * - @var boolean mute_notifications + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAdsPublishedException Advertisement post was recently added + * @throws VKApiWallAddPostException Access to adding post denied + * @throws VKApiWallTooManyRecipientsException Too many recipients + * @throws VKApiWallLinksForbiddenException Hyperlinks are forbidden + * @throws VKApiWallAdsPostLimitReachedException Too many ads posts + * @return mixed + */ + public function post($access_token, array $params = []) { + return $this->request->post('wall.post', $access_token, $params); + } - /** - * Allows to create hidden post which will not be shown on the community's wall and can be used for creating an ad - * with type "Community post". - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - string message: (Required if 'attachments' is not set.) Text of the post. - * - array attachments: (Required if 'message' is not set.) List of objects attached to the post, in the - * following format: "_,_", '' — Type of media attachment: 'photo' - * — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, - * 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' - * — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an - * external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more - * than one link is being attached, an error will be thrown." - * - boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be - * signed with the name of the posting user, '0' — post will not be signed (default) - * - number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). - * - number long: Geographical longitude of a check-in, in degrees (from -180 to 180). - * - integer place_id: ID of the location where the user was tagged. - * - string guid: Unique identifier to avoid duplication the same post. - * - string link_button: Link button ID - * - string link_title: Link title - * - string link_image: Link image url - * - string link_video: Link video ID in format "_" - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function postAdsStealth(string $access_token, array $params = array()) { - return $this->request->post('wall.postAdsStealth', $access_token, $params); - } + /** + * Allows to create hidden post which will not be shown on the community's wall and can be used for creating an ad with type "Community post". + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var string message: (Required if 'attachments' is not set.) Text of the post. + * - @var array[string] attachments: (Required if 'message' is not set.) List of objects attached to the post, in the following format: "_,_", '' — Type of media attachment: 'photo' — photo, 'video' — video, 'audio' — audio, 'doc' — document, 'page' — wiki-page, 'note' — note, 'poll' — poll, 'album' — photo album, '' — ID of the media application owner. '' — Media application ID. Example: "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link is being attached, an error will be thrown." + * - @var boolean signed: Only for posts in communities with 'from_group' set to '1': '1' — post will be signed with the name of the posting user, '0' — post will not be signed (default) + * - @var number lat: Geographical latitude of a check-in, in degrees (from -90 to 90). + * - @var number long: Geographical longitude of a check-in, in degrees (from -180 to 180). + * - @var integer place_id: ID of the location where the user was tagged. + * - @var string guid: Unique identifier to avoid duplication the same post. + * - @var string link_button: Link button ID + * - @var string link_title: Link title + * - @var string link_image: Link image url + * - @var string link_video: Link video ID in format "_" + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAdsPublishedException Advertisement post was recently added + * @throws VKApiWallAddPostException Access to adding post denied + * @throws VKApiWallTooManyRecipientsException Too many recipients + * @throws VKApiWallLinksForbiddenException Hyperlinks are forbidden + * @return mixed + */ + public function postAdsStealth($access_token, array $params = []) { + return $this->request->post('wall.postAdsStealth', $access_token, $params); + } - /** - * Reports (submits a complaint about) a comment on a post on a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the wall. - * - integer comment_id: Comment ID. - * - WallReportCommentReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - - * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse - * @see WallReportCommentReason - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function reportComment(string $access_token, array $params = array()) { - return $this->request->post('wall.reportComment', $access_token, $params); - } + /** + * Reports (submits a complaint about) a comment on a post on a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the wall. + * - @var integer comment_id: Comment ID. + * - @var WallReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function reportComment($access_token, array $params = []) { + return $this->request->post('wall.reportComment', $access_token, $params); + } - /** - * Reports (submits a complaint about) a post on a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the wall. - * - integer post_id: Post ID. - * - WallReportPostReason reason: Reason for the complaint: '0' - spam, '1' - child pornography, '2' - - * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse - * @see WallReportPostReason - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function reportPost(string $access_token, array $params = array()) { - return $this->request->post('wall.reportPost', $access_token, $params); - } + /** + * Reports (submits a complaint about) a post on a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the wall. + * - @var integer post_id: Post ID. + * - @var WallReason reason: Reason for the complaint: '0' – spam, '1' – child pornography, '2' – extremism, '3' – violence, '4' – drug propaganda, '5' – adult material, '6' – insult, abuse + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function reportPost($access_token, array $params = []) { + return $this->request->post('wall.reportPost', $access_token, $params); + } - /** - * Reposts (copies) an object to a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - string object: ID of the object to be reposted on the wall. Example: "wall66748_3675" - * - string message: Comment to be added along with the reposted object. - * - integer group_id: Target community ID when reposting to a community. - * - boolean mark_as_ads: - * - boolean mute_notifications: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * @throws undefined - * - */ - public function repost(string $access_token, array $params = array()) { - return $this->request->post('wall.repost', $access_token, $params); - } + /** + * Reposts (copies) an object to a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var string object: ID of the object to be reposted on the wall. Example: "wall66748_3675" + * - @var string message: Comment to be added along with the reposted object. + * - @var integer group_id: Target community ID when reposting to a community. + * - @var boolean mark_as_ads + * - @var boolean mute_notifications + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAdsPublishedException Advertisement post was recently added + * @throws VKApiWallAddPostException Access to adding post denied + * @throws VKApiWallAdsPostLimitReachedException Too many ads posts + * @return mixed + */ + public function repost($access_token, array $params = []) { + return $this->request->post('wall.repost', $access_token, $params); + } - /** - * Restores a post deleted from a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID from whose wall the post was deleted. Use a negative value - * to designate a community ID. - * - integer post_id: ID of the post to be restored. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * @throws undefined - * - */ - public function restore(string $access_token, array $params = array()) { - return $this->request->post('wall.restore', $access_token, $params); - } + /** + * Restores a post deleted from a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID from whose wall the post was deleted. Use a negative value to designate a community ID. + * - @var integer post_id: ID of the post to be restored. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAccessPostException Access to wall's post denied + * @throws VKApiWallAddPostException Access to adding post denied + * @return mixed + */ + public function restore($access_token, array $params = []) { + return $this->request->post('wall.restore', $access_token, $params); + } - /** - * Restores a comment deleted from a user wall or community wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: User ID or community ID. Use a negative value to designate a community ID. - * - integer comment_id: Comment ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function restoreComment(string $access_token, array $params = array()) { - return $this->request->post('wall.restoreComment', $access_token, $params); - } + /** + * Restores a comment deleted from a user wall or community wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: User ID or community ID. Use a negative value to designate a community ID. + * - @var integer comment_id: Comment ID. + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAccessCommentException Access to wall's comment denied + * @return mixed + */ + public function restoreComment($access_token, array $params = []) { + return $this->request->post('wall.restoreComment', $access_token, $params); + } - /** - * Allows to search posts on user or community walls. - * - * @param $access_token string - * @param $params array - * - integer owner_id: user or community id. "Remember that for a community 'owner_id' must be negative." - * - string domain: user or community screen name. - * - string query: search query string. - * - boolean owners_only: '1' - returns only page owner's posts. - * - integer count: count of posts to return. - * - integer offset: Offset needed to return a specific subset of posts. - * - boolean extended: show extended post info. - * - array fields: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * @throws undefined - * - */ - public function search(string $access_token, array $params = array()) { - return $this->request->post('wall.search', $access_token, $params); - } + /** + * Allows to search posts on user or community walls. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: user or community id. "Remember that for a community 'owner_id' must be negative." + * - @var string domain: user or community screen name. + * - @var string query: search query string. + * - @var boolean owners_only: '1' – returns only page owner's posts. + * - @var integer count: count of posts to return. + * - @var integer offset: Offset needed to return a specific subset of posts. + * - @var boolean extended: show extended post info. + * - @var array[WallFields] fields + * @throws VKClientException + * @throws VKApiException + * @throws VKApiWallAccessPostException Access to wall's post denied + * @return mixed + */ + public function search($access_token, array $params = []) { + return $this->request->post('wall.search', $access_token, $params); + } - /** - * Unpins the post on wall. - * - * @param $access_token string - * @param $params array - * - integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a - * negative value to designate a community ID. - * - integer post_id: Post ID. - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function unpin(string $access_token, array $params = array()) { - return $this->request->post('wall.unpin', $access_token, $params); - } + /** + * Unpins the post on wall. + * + * @param string $access_token + * @param array $params + * - @var integer owner_id: ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. + * - @var integer post_id: Post ID. + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function unpin($access_token, array $params = []) { + return $this->request->post('wall.unpin', $access_token, $params); + } } diff --git a/src/VK/Actions/Widgets.php b/src/VK/Actions/Widgets.php index ba2cc25..c8658a5 100644 --- a/src/VK/Actions/Widgets.php +++ b/src/VK/Actions/Widgets.php @@ -1,66 +1,63 @@ request = $request; - } + /** + * Widgets constructor. + * + * @param VKApiRequest $request + */ + public function __construct(VKApiRequest $request) { + $this->request = $request; + } - /** - * Gets a list of comments for the page added through the [vk.com/dev/Comments|Comments widget]. - * - * @param $access_token string - * @param $params array - * - integer widget_api_id: - * - string url: - * - string page_id: - * - string order: - * - array fields: - * - integer offset: - * - integer count: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getComments(string $access_token, array $params = array()) { - return $this->request->post('widgets.getComments', $access_token, $params); - } + /** + * Gets a list of comments for the page added through the [vk.com/dev/Comments|Comments widget]. + * + * @param string $access_token + * @param array $params + * - @var integer widget_api_id + * - @var string url + * - @var string page_id + * - @var string order + * - @var array[WidgetsFields] fields + * - @var integer offset + * - @var integer count + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getComments($access_token, array $params = []) { + return $this->request->post('widgets.getComments', $access_token, $params); + } - /** - * Gets a list of application/site pages where the [vk.com/dev/Comments|Comments widget] or [vk.com/dev/Like|Like - * widget] is installed. - * - * @param $access_token string - * @param $params array - * - integer widget_api_id: - * - string order: - * - string period: - * - integer offset: - * - integer count: - * - * @return mixed - * @throws VKClientException in case of network error - * @throws VKApiException in case of API error - * - */ - public function getPages(string $access_token, array $params = array()) { - return $this->request->post('widgets.getPages', $access_token, $params); - } + /** + * Gets a list of application/site pages where the [vk.com/dev/Comments|Comments widget] or [vk.com/dev/Like|Like widget] is installed. + * + * @param string $access_token + * @param array $params + * - @var integer widget_api_id + * - @var string order + * - @var string period + * - @var integer offset + * - @var integer count + * @throws VKClientException + * @throws VKApiException + * @return mixed + */ + public function getPages($access_token, array $params = []) { + return $this->request->post('widgets.getPages', $access_token, $params); + } } diff --git a/src/VK/Client/Enum/VKLanguage.php b/src/VK/Client/Enums/VKLanguage.php old mode 100644 new mode 100755 similarity index 89% rename from src/VK/Client/Enum/VKLanguage.php rename to src/VK/Client/Enums/VKLanguage.php index 610bb68..486ed38 --- a/src/VK/Client/Enum/VKLanguage.php +++ b/src/VK/Client/Enums/VKLanguage.php @@ -1,6 +1,6 @@ adsweb) { - $this->adsweb = new Adsweb($this->request); + public function apps(): Apps { + if (!$this->apps) { + $this->apps = new Apps($this->request); } - return $this->adsweb; + return $this->apps; } /** @@ -313,17 +287,6 @@ public function appWidgets(): AppWidgets { return $this->appWidgets; } - /** - * @return Apps - */ - public function apps(): Apps { - if (!$this->apps) { - $this->apps = new Apps($this->request); - } - - return $this->apps; - } - /** * @return Auth */ @@ -369,25 +332,18 @@ public function docs(): Docs { } /** - * @return Donut - */ - public function donut(): Donut { - if (!$this->donut) { - $this->donut = new Donut($this->request); - } - - return $this->donut; - } - - /** - * @return DownloadedGames + * @param string $access_token + * @param array $params + * - @var string code: VKScript code + * + * @return array */ - public function downloadedGames(): DownloadedGames { - if (!$this->downloadedGames) { - $this->downloadedGames = new DownloadedGames($this->request); + public function execute($access_token, $params = []): array { + if (!$this->execute) { + $this->execute = $this->request->post('execute', $access_token, $params); } - return $this->downloadedGames; + return $this->execute; } /** @@ -434,6 +390,17 @@ public function groups(): Groups { return $this->groups; } + /** + * @return Leads + */ + public function leads(): Leads { + if (!$this->leads) { + $this->leads = new Leads($this->request); + } + + return $this->leads; + } + /** * @return Likes */ @@ -533,17 +500,6 @@ public function photos(): Photos { return $this->photos; } - /** - * @return Podcasts - */ - public function podcasts(): Podcasts { - if (!$this->podcasts) { - $this->podcasts = new Podcasts($this->request); - } - - return $this->podcasts; - } - /** * @return Polls */ @@ -555,17 +511,6 @@ public function polls(): Polls { return $this->polls; } - /** - * @return PrettyCards - */ - public function prettyCards(): PrettyCards { - if (!$this->prettyCards) { - $this->prettyCards = new PrettyCards($this->request); - } - - return $this->prettyCards; - } - /** * @return Search */ @@ -621,17 +566,6 @@ public function storage(): Storage { return $this->storage; } - /** - * @return Store - */ - public function store(): Store { - if (!$this->store) { - $this->store = new Store($this->request); - } - - return $this->store; - } - /** * @return Stories */ diff --git a/src/VK/Exceptions/Api/ExceptionMapper.php b/src/VK/Exceptions/Api/ExceptionMapper.php index 36356ce..c8edc97 100644 --- a/src/VK/Exceptions/Api/ExceptionMapper.php +++ b/src/VK/Exceptions/Api/ExceptionMapper.php @@ -1,307 +1,92 @@ getErrorCode()) { - case 12: - return new VKApiUnableToCompileCodeException($error); - case 13: - return new VKApiRuntimeOccurredDuringCodeInvocationException($error); - case 19: - return new VKApiContentBlockedException($error); - case 22: - return new VKApiUploadException($error); - case 35: - return new VKApiClientUpdateNeededException($error); - case 36: - return new VKApiMethodExecutionWasInterruptedDueToTimeoutException($error); - case 103: - return new VKApiOutOfLimitsException($error); - case 104: - return new VKApiNotFoundException($error); - case 105: - return new VKApiCouldntSaveFileException($error); - case 106: - return new VKApiUnableToProcessActionException($error); - case 114: - return new VKApiInvalidAlbumIdException($error); - case 118: - return new VKApiInvalidServerException($error); - case 119: - return new VKApiInvalidTitleException($error); - case 121: - return new VKApiInvalidHashException($error); - case 122: - return new VKApiInvalidPhotosException($error); - case 125: - return new VKApiInvalidGroupIdException($error); - case 129: - return new VKApiInvalidPhotoException($error); - case 140: - return new VKApiPageNotFoundException($error); - case 141: - return new VKApiAccessToPageDeniedException($error); - case 146: - return new VKApiTheMobileNumberOfTheUserIsUnknownException($error); - case 147: - return new VKApiApplicationHasInsufficientFundsException($error); - case 148: - return new VKApiAccessToTheMenuOfTheUserDeniedException($error); - case 171: - return new VKApiInvalidListIdException($error); - case 173: - return new VKApiReachedTheMaximumNumberOfListsException($error); - case 174: - return new VKApiCannotAddUserHimselfAsFriendException($error); - case 175: - return new VKApiCannotAddThisUserToFriendsAsTheyHavePutYouOnTheirBlacklistException($error); - case 176: - return new VKApiCannotAddThisUserToFriendsAsYouPutHimOnBlacklistException($error); - case 177: - return new VKApiCannotAddThisUserToFriendsAsUserNotFoundException($error); - case 180: - return new VKApiNoteNotFoundException($error); - case 181: - return new VKApiAccessToNoteDeniedException($error); - case 182: - return new VKApiYouCantCommentThisNoteException($error); - case 183: - return new VKApiAccessToCommentDeniedException($error); - case 204: - return new VKApiAccessDeniedException($error); - case 205: - return new VKApiAccessDeniedException($error); - case 210: - return new VKApiAccessToWallsPostDeniedException($error); - case 211: - return new VKApiAccessToWallsCommentDeniedException($error); - case 212: - return new VKApiAccessToPostCommentsDeniedException($error); - case 213: - return new VKApiAccessToStatusRepliesDeniedException($error); - case 214: - return new VKApiAccessToAddingPostDeniedException($error); - case 219: - return new VKApiAdvertisementPostWasRecentlyAddedException($error); - case 220: - return new VKApiTooManyRecipientsException($error); - case 221: - return new VKApiUserDisabledTrackNameBroadcastException($error); - case 222: - return new VKApiHyperlinksAreForbiddenException($error); - case 223: - return new VKApiTooManyRepliesException($error); - case 224: - return new VKApiTooManyAdsPostsException($error); - case 225: - return new VKApiDonutIsDisabledException($error); - case 232: - return new VKApiReactionCanNotBeAppliedToTheObjectException($error); - case 250: - return new VKApiAccessToPollDeniedException($error); - case 251: - return new VKApiInvalidPollIdException($error); - case 252: - return new VKApiInvalidAnswerIdException($error); - case 253: - return new VKApiAccessDeniedPleaseVoteFirstException($error); - case 260: - return new VKApiAccessToTheGroupsListIsDeniedDueToTheUsersPrivacySettingsException($error); - case 302: - return new VKApiAlbumsNumberLimitIsReachedException($error); - case 601: - return new VKApiPermissionDenied.YouHaveRequestedTooManyActionsThisDay.TryLater.Exception($error); - case 602: - return new VKApiSomePartOfTheRequestHasNotBeenCompletedException($error); - case 629: - return new VKApiObjectDeletedException($error); - case 700: - return new VKApiCannotEditCreatorRoleException($error); - case 701: - return new VKApiUserShouldBeInClubException($error); - case 702: - return new VKApiTooManyOfficersInClubException($error); - case 703: - return new VKApiYouNeedToEnable2faForThisActionException($error); - case 704: - return new VKApiUserNeedsToEnable2faForThisActionException($error); - case 706: - return new VKApiTooManyAddressesInClubException($error); - case 711: - return new VKApiApplicationIsNotInstalledInCommunityException($error); - case 714: - return new VKApiInviteLinkIsInvalid-ExpiredDeletedOrNotExistsException($error); - case 800: - return new VKApiThisVideoIsAlreadyAddedException($error); - case 801: - return new VKApiCommentsForThisVideoAreClosedException($error); - case 900: - return new VKApiCantSendMessagesForUsersFromBlacklistException($error); - case 901: - return new VKApiCantSendMessagesForUsersWithoutPermissionException($error); - case 902: - return new VKApiCantSendMessagesToThisUserDueToTheirPrivacySettingsException($error); - case 907: - return new VKApiValueOfTsOrPtsIsTooOldException($error); - case 908: - return new VKApiValueOfTsOrPtsIsTooNewException($error); - case 909: - return new VKApiCantEditThisMessageBecauseItsTooOldException($error); - case 910: - return new VKApiCantSentThisMessageBecauseItsTooBigException($error); - case 911: - return new VKApiKeyboardFormatIsInvalidException($error); - case 912: - return new VKApiThisIsAChatBotFeatureChangeThisStatusInSettingsException($error); - case 913: - return new VKApiTooManyForwardedMessagesException($error); - case 914: - return new VKApiMessageIsTooLongException($error); - case 917: - return new VKApiYouDontHaveAccessToThisChatException($error); - case 919: - return new VKApiYouCantSeeInviteLinkForThisChatException($error); - case 920: - return new VKApiCantEditThisKindOfMessageException($error); - case 921: - return new VKApiCantForwardTheseMessagesException($error); - case 924: - return new VKApiCantDeleteThisMessageForEverybodyException($error); - case 925: - return new VKApiYouAreNotAdminOfThisChatException($error); - case 927: - return new VKApiChatDoesNotExistException($error); - case 931: - return new VKApiYouCantChangeInviteLinkForThisChatException($error); - case 932: - return new VKApiYourCommunityCantInteractWithThisPeerException($error); - case 935: - return new VKApiUserNotFoundInChatException($error); - case 936: - return new VKApiContactNotFoundException($error); - case 939: - return new VKApiMessageRequestAlreadySentException($error); - case 940: - return new VKApiTooManyPostsInMessagesException($error); - case 942: - return new VKApiCannotPinOne-timeStoryException($error); - case 943: - return new VKApiCannotUseThisIntentException($error); - case 944: - return new VKApiLimitsOverflowForThisIntentException($error); - case 945: - return new VKApiChatWasDisabledException($error); - case 946: - return new VKApiChatNotSupportedException($error); - case 947: - return new VKApiCantAddUserToChatBecauseUserHasNoAccessToGroupException($error); - case 949: - return new VKApiCantEditPinnedMessageYetException($error); - case 950: - return new VKApiCantSendMessageReplyTimedOutException($error); - case 1105: - return new VKApiTooManyAuthAttemptsTryAgainLaterException($error); - case 1150: - return new VKApiInvalidDocumentIdException($error); - case 1151: - return new VKApiAccessToDocumentDeletingIsDeniedException($error); - case 1152: - return new VKApiInvalidDocumentTitleException($error); - case 1153: - return new VKApiAccessToDocumentIsDeniedException($error); - case 1160: - return new VKApiOriginalPhotoWasChangedException($error); - case 1170: - return new VKApiTooManyFeedListsException($error); - case 1251: - return new VKApiThisAchievementIsAlreadyUnlockedException($error); - case 1256: - return new VKApiSubscriptionNotFoundException($error); - case 1257: - return new VKApiSubscriptionIsInInvalidStatusException($error); - case 1260: - return new VKApiInvalidScreenNameException($error); - case 1310: - return new VKApiCatalogIsNotAvailableForThisUserException($error); - case 1311: - return new VKApiCatalogCategoriesAreNotAvailableForThisUserException($error); - case 1400: - return new VKApiTooLateForRestoreException($error); - case 1401: - return new VKApiCommentsForThisMarketAreClosedException($error); - case 1402: - return new VKApiAlbumNotFoundException($error); - case 1403: - return new VKApiItemNotFoundException($error); - case 1404: - return new VKApiItemAlreadyAddedToAlbumException($error); - case 1405: - return new VKApiTooManyItemsException($error); - case 1406: - return new VKApiTooManyItemsInAlbumException($error); - case 1407: - return new VKApiTooManyAlbumsException($error); - case 1408: - return new VKApiItemHasBadLinksInDescriptionException($error); - case 1409: - return new VKApiExtendedMarketNotEnabledException($error); - case 1413: - return new VKApiGroupingAlreadyHasSuchVariantException($error); - case 1416: - return new VKApiVariantNotFoundException($error); - case 1417: - return new VKApiPropertyNotFoundException($error); - case 1425: - return new VKApiGroupingMustHaveTwoOrMoreItemsException($error); - case 1426: - return new VKApiItemMustHaveDistinctPropertiesException($error); - case 1427: - return new VKApiCartIsEmptyException($error); - case 1429: - return new VKApiSpecifyWidthLengthHeightAndWeightAllTogetherException($error); - case 1430: - return new VKApiVkPayStatusCanNotBeChangedException($error); - case 1431: - return new VKApiMarketWasAlreadyEnabledInThisGroupException($error); - case 1432: - return new VKApiMarketWasAlreadyDisabledInThisGroupException($error); - case 1433: - return new VKApiInvalidImageCropFormatException($error); - case 1434: - return new VKApiCropBottomRightCornerIsOutsideOfTheImageException($error); - case 1435: - return new VKApiCropSizeIsLessThanTheMinimumException($error); - case 1438: - return new VKApiMarketNotEnabledException($error); - case 1600: - return new VKApiStoryHasAlreadyExpiredException($error); - case 1602: - return new VKApiIncorrectReplyPrivacyException($error); - case 1900: - return new VKApiCardNotFoundException($error); - case 1901: - return new VKApiTooManyCardsException($error); - case 1902: - return new VKApiCardIsConnectedToPostException($error); - case 2000: - return new VKApiServersNumberLimitIsReachedException($error); - case 2100: - return new VKApiStickersAreNotPurchasedException($error); - case 2101: - return new VKApiTooManyFavoriteStickersException($error); - case 2102: - return new VKApiStickersAreNotFavoriteException($error); - case 3102: - return new VKApiSpecifiedLinkIsIncorrect(cantFindSource)Exception($error); - case 3800: - return new VKApiCantSetAliexpressTagToThisTypeOfObjectException($error); - default: - return new VKApiException($error->getErrorCode(), $error->getErrorMsg(), $error); - } - } + + /** + * @param VkApiError $error + * @return Exception + */ + public static function parse(VkApiError $error) { + switch ($error->getErrorCode()) { + case 1: + return new VKApiUnknownException($error); + case 2: + return new VKApiDisabledException($error); + case 3: + return new VKApiMethodException($error); + case 4: + return new VKApiSignatureException($error); + case 5: + return new VKApiAuthException($error); + case 6: + return new VKApiTooManyException($error); + case 7: + return new VKApiPermissionException($error); + case 8: + return new VKApiRequestException($error); + case 9: + return new VKApiFloodException($error); + case 10: + return new VKApiServerException($error); + case 11: + return new VKApiEnabledInTestException($error); + case 14: + return new VKApiCaptchaException($error); + case 15: + return new VKApiAccessException($error); + case 16: + return new VKApiAuthHttpsException($error); + case 17: + return new VKApiAuthValidationException($error); + case 18: + return new VKApiUserDeletedException($error); + case 20: + return new VKApiMethodPermissionException($error); + case 21: + return new VKApiMethodAdsException($error); + case 23: + return new VKApiMethodDisabledException($error); + case 24: + return new VKApiNeedConfirmationException($error); + case 25: + return new VKApiNeedTokenConfirmationException($error); + case 27: + return new VKApiGroupAuthException($error); + case 28: + return new VKApiAppAuthException($error); + case 29: + return new VKApiRateLimitException($error); + case 30: + return new VKApiPrivateProfileException($error); + case 100: + return new VKApiParamException($error); + case 101: + return new VKApiParamApiIdException($error); + case 113: + return new VKApiParamUserIdException($error); + case 150: + return new VKApiParamTimestampException($error); + case 200: + return new VKApiAccessAlbumException($error); + case 201: + return new VKApiAccessAudioException($error); + case 203: + return new VKApiAccessGroupException($error); + case 300: + return new VKApiAlbumFullException($error); + case 500: + return new VKApiVotesPermissionException($error); + case 600: + return new VKApiAdsPermissionException($error); + case 603: + return new VKApiAdsSpecificException($error); + default: + return new VKApiException($error->getErrorCode(), $error->getErrorMsg(), $error);} + } } diff --git a/src/VK/Exceptions/Api/VKApiAccessAlbumException.php b/src/VK/Exceptions/Api/VKApiAccessAlbumException.php new file mode 100644 index 0000000..e921632 --- /dev/null +++ b/src/VK/Exceptions/Api/VKApiAccessAlbumException.php @@ -0,0 +1,19 @@ +