Skip to content

Commit

Permalink
SDK v1.0.9 based on v5.130.67 API schema
Browse files Browse the repository at this point in the history
  • Loading branch information
vkcom committed Apr 21, 2021
1 parent 9cb301b commit 914c328
Show file tree
Hide file tree
Showing 352 changed files with 10,166 additions and 1,488 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build/
gradle/
gradlew
gradlew.bat
gradle.properties
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Java 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.126.
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.130.

## 1. Prerequisites

Expand Down Expand Up @@ -184,7 +184,7 @@ See [example](https://github.com/VKCOM/vk-java-sdk/tree/master/examples/user-oau
The difference from the previous flow is that you send the groupId parameter to obtain the community's access token. Please read [the full manual](https://vk.com/dev/authcode_flow_group).

```java
GroupAuthGroupResponse authResponse = vk.oAuth()
GroupAuthResponse authResponse = vk.oAuth()
.groupAuthorizationCodeFlow(APP_ID, CLIENT_SECRET, REDIRECT_URI, code)
.execute();

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ subprojects {
apply plugin: 'java'

group 'com.vk.api'
version '1.0.8'
version '1.0.9'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.vk.api.sdk.callback.objects.messages.CallbackMessage;
import com.vk.api.sdk.objects.callback.messages.CallbackMessage;
import com.vk.api.sdk.objects.callback.MessageType;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.vk.api.examples.youtrack;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.google.gson.JsonObject;
import com.vk.api.sdk.callback.objects.messages.CallbackMessage;
import com.vk.api.sdk.objects.callback.messages.CallbackMessage;
import com.vk.api.sdk.objects.callback.MessageType;
import org.testng.Assert;
import org.testng.annotations.Test;
Expand Down
52 changes: 38 additions & 14 deletions sdk/src/main/java/com/vk/api/sdk/actions/Ads.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
import com.vk.api.sdk.client.AbstractAction;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.ads.CheckLinkLinkType;
import com.vk.api.sdk.objects.ads.GetDemographicsIdsType;
import com.vk.api.sdk.objects.ads.GetDemographicsPeriod;
import com.vk.api.sdk.objects.ads.GetPostsReachIdsType;
import com.vk.api.sdk.objects.ads.GetStatisticsIdsType;
import com.vk.api.sdk.objects.ads.GetStatisticsPeriod;
import com.vk.api.sdk.objects.ads.GetSuggestionsSection;
import com.vk.api.sdk.objects.ads.UserSpecification;
import com.vk.api.sdk.objects.ads.UserSpecificationCutted;
import com.vk.api.sdk.objects.enums.AdsIdsType;
import com.vk.api.sdk.objects.enums.AdsLinkType;
import com.vk.api.sdk.objects.enums.AdsPeriod;
import com.vk.api.sdk.objects.enums.AdsSection;
import com.vk.api.sdk.queries.ads.AdsAddOfficeUsersQuery;
import com.vk.api.sdk.queries.ads.AdsCheckLinkQuery;
import com.vk.api.sdk.queries.ads.AdsCreateAdsQuery;
Expand All @@ -30,6 +33,7 @@
import com.vk.api.sdk.queries.ads.AdsGetDemographicsQuery;
import com.vk.api.sdk.queries.ads.AdsGetFloodStatsQuery;
import com.vk.api.sdk.queries.ads.AdsGetLookalikeRequestsQuery;
import com.vk.api.sdk.queries.ads.AdsGetMusiciansByIdsQuery;
import com.vk.api.sdk.queries.ads.AdsGetMusiciansQuery;
import com.vk.api.sdk.queries.ads.AdsGetOfficeUsersQuery;
import com.vk.api.sdk.queries.ads.AdsGetPostsReachQuery;
Expand Down Expand Up @@ -100,7 +104,7 @@ public AdsAddOfficeUsersQuery addOfficeUsers(UserActor actor, int accountId,
* @param linkUrl Object URL.
* @return query
*/
public AdsCheckLinkQuery checkLink(UserActor actor, int accountId, AdsLinkType linkType,
public AdsCheckLinkQuery checkLink(UserActor actor, int accountId, CheckLinkLinkType linkType,
String linkUrl) {
return new AdsCheckLinkQuery(getClient(), actor, accountId, linkType, linkUrl);
}
Expand Down Expand Up @@ -303,7 +307,8 @@ public AdsGetClientsQuery getClients(UserActor actor, int accountId) {
* @return query
*/
public AdsGetDemographicsQuery getDemographics(UserActor actor, int accountId,
AdsIdsType idsType, String ids, AdsPeriod period, String dateFrom, String dateTo) {
GetDemographicsIdsType idsType, String ids, GetDemographicsPeriod period,
String dateFrom, String dateTo) {
return new AdsGetDemographicsQuery(getClient(), actor, accountId, idsType, ids, period, dateFrom, dateTo);
}

Expand Down Expand Up @@ -336,6 +341,24 @@ public AdsGetMusiciansQuery getMusicians(UserActor actor, String artistName) {
return new AdsGetMusiciansQuery(getClient(), actor, artistName);
}

/**
* @param actor vk actor
* @param ids
* @return query
*/
public AdsGetMusiciansByIdsQuery getMusiciansByIds(UserActor actor, Integer... ids) {
return new AdsGetMusiciansByIdsQuery(getClient(), actor, ids);
}

/**
* @param actor vk actor
* @param ids
* @return query
*/
public AdsGetMusiciansByIdsQuery getMusiciansByIds(UserActor actor, List<Integer> ids) {
return new AdsGetMusiciansByIdsQuery(getClient(), actor, ids);
}

/**
* Returns a list of managers and supervisors of advertising account.
*
Expand All @@ -356,8 +379,8 @@ public AdsGetOfficeUsersQuery getOfficeUsers(UserActor actor, int accountId) {
* @param ids IDs requested ads or campaigns, separated with a comma, depending on the value set in 'ids_type'. Maximum 100 objects.
* @return query
*/
public AdsGetPostsReachQuery getPostsReach(UserActor actor, int accountId, AdsIdsType idsType,
String ids) {
public AdsGetPostsReachQuery getPostsReach(UserActor actor, int accountId,
GetPostsReachIdsType idsType, String ids) {
return new AdsGetPostsReachQuery(getClient(), actor, accountId, idsType, ids);
}

Expand Down Expand Up @@ -385,8 +408,9 @@ public AdsGetRejectionReasonQuery getRejectionReason(UserActor actor, int accoun
* @param dateTo 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 query
*/
public AdsGetStatisticsQuery getStatistics(UserActor actor, int accountId, AdsIdsType idsType,
String ids, AdsPeriod period, String dateFrom, String dateTo) {
public AdsGetStatisticsQuery getStatistics(UserActor actor, int accountId,
GetStatisticsIdsType idsType, String ids, GetStatisticsPeriod period, String dateFrom,
String dateTo) {
return new AdsGetStatisticsQuery(getClient(), actor, accountId, idsType, ids, period, dateFrom, dateTo);
}

Expand All @@ -397,7 +421,7 @@ public AdsGetStatisticsQuery getStatistics(UserActor actor, int accountId, AdsId
* @param 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.
* @return query
*/
public AdsGetSuggestionsQuery getSuggestions(UserActor actor, AdsSection section) {
public AdsGetSuggestionsQuery getSuggestions(UserActor actor, GetSuggestionsSection section) {
return new AdsGetSuggestionsQuery(getClient(), actor, section);
}

Expand All @@ -409,7 +433,7 @@ public AdsGetSuggestionsQuery getSuggestions(UserActor actor, AdsSection section
* @return query
*/
public AdsGetSuggestionsQueryWithRegions getSuggestionsRegions(UserActor actor,
AdsSection section) {
GetSuggestionsSection section) {
return new AdsGetSuggestionsQueryWithRegions(getClient(), actor, section);
}

Expand All @@ -421,7 +445,7 @@ public AdsGetSuggestionsQueryWithRegions getSuggestionsRegions(UserActor actor,
* @return query
*/
public AdsGetSuggestionsQueryWithSchools getSuggestionsSchools(UserActor actor,
AdsSection section) {
GetSuggestionsSection section) {
return new AdsGetSuggestionsQueryWithSchools(getClient(), actor, section);
}

Expand All @@ -434,7 +458,7 @@ public AdsGetSuggestionsQueryWithSchools getSuggestionsSchools(UserActor actor,
* @return query
*/
public AdsGetSuggestionsQueryWithCities getSuggestionsWithCities(UserActor actor,
AdsSection section, String cities) {
GetSuggestionsSection section, String cities) {
return new AdsGetSuggestionsQueryWithCities(getClient(), actor, section, cities);
}

Expand Down
11 changes: 6 additions & 5 deletions sdk/src/main/java/com/vk/api/sdk/actions/AppWidgets.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import com.vk.api.sdk.client.actors.GroupActor;
import com.vk.api.sdk.client.actors.ServiceActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.enums.AppWidgetsImageType;
import com.vk.api.sdk.objects.enums.AppWidgetsType;
import com.vk.api.sdk.objects.appwidgets.GetAppImageUploadServerImageType;
import com.vk.api.sdk.objects.appwidgets.GetGroupImageUploadServerImageType;
import com.vk.api.sdk.objects.appwidgets.UpdateType;
import com.vk.api.sdk.queries.appwidgets.AppWidgetsGetAppImageUploadServerQuery;
import com.vk.api.sdk.queries.appwidgets.AppWidgetsGetAppImagesQuery;
import com.vk.api.sdk.queries.appwidgets.AppWidgetsGetGroupImageUploadServerQuery;
Expand Down Expand Up @@ -38,7 +39,7 @@ public AppWidgets(VkApiClient client) {
* @return query
*/
public AppWidgetsGetAppImageUploadServerQuery getAppImageUploadServer(ServiceActor actor,
AppWidgetsImageType imageType) {
GetAppImageUploadServerImageType imageType) {
return new AppWidgetsGetAppImageUploadServerQuery(getClient(), actor, imageType);
}

Expand Down Expand Up @@ -80,7 +81,7 @@ public AppWidgetsGetAppImagesQuery getAppImages(ServiceActor actor) {
* @return query
*/
public AppWidgetsGetGroupImageUploadServerQuery getGroupImageUploadServer(GroupActor actor,
AppWidgetsImageType imageType) {
GetGroupImageUploadServerImageType imageType) {
return new AppWidgetsGetGroupImageUploadServerQuery(getClient(), actor, imageType);
}

Expand Down Expand Up @@ -193,7 +194,7 @@ public AppWidgetsSaveGroupImageQuery saveGroupImage(GroupActor actor, String has
* @param type
* @return query
*/
public AppWidgetsUpdateQuery update(GroupActor actor, String code, AppWidgetsType type) {
public AppWidgetsUpdateQuery update(GroupActor actor, String code, UpdateType type) {
return new AppWidgetsUpdateQuery(getClient(), actor, code, type);
}
}
18 changes: 15 additions & 3 deletions sdk/src/main/java/com/vk/api/sdk/actions/Apps.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.ServiceActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.enums.AppsType;
import com.vk.api.sdk.objects.apps.GetLeaderboardType;
import com.vk.api.sdk.queries.apps.AppsDeleteAppRequestsQuery;
import com.vk.api.sdk.queries.apps.AppsGetCatalogQuery;
import com.vk.api.sdk.queries.apps.AppsGetFriendsListQuery;
import com.vk.api.sdk.queries.apps.AppsGetLeaderboardQuery;
import com.vk.api.sdk.queries.apps.AppsGetLeaderboardQueryWithExtended;
import com.vk.api.sdk.queries.apps.AppsGetMiniAppPoliciesQuery;
import com.vk.api.sdk.queries.apps.AppsGetQuery;
import com.vk.api.sdk.queries.apps.AppsGetScopesQuery;
import com.vk.api.sdk.queries.apps.AppsGetScoreQuery;
Expand Down Expand Up @@ -99,7 +100,7 @@ public AppsGetFriendsListQuery getFriendsList(UserActor actor) {
* @param type Leaderboard type. Possible values: *'level' — by level,, *'points' — by mission points,, *'score' — by score ().
* @return query
*/
public AppsGetLeaderboardQuery getLeaderboard(UserActor actor, AppsType type) {
public AppsGetLeaderboardQuery getLeaderboard(UserActor actor, GetLeaderboardType type) {
return new AppsGetLeaderboardQuery(getClient(), actor, type);
}

Expand All @@ -111,10 +112,21 @@ public AppsGetLeaderboardQuery getLeaderboard(UserActor actor, AppsType type) {
* @return query
*/
public AppsGetLeaderboardQueryWithExtended getLeaderboardExtended(UserActor actor,
AppsType type) {
GetLeaderboardType type) {
return new AppsGetLeaderboardQueryWithExtended(getClient(), actor, type);
}

/**
* Returns policies and terms given to a mini app.
*
* @param actor vk actor
* @param appId Mini App ID
* @return query
*/
public AppsGetMiniAppPoliciesQuery getMiniAppPolicies(UserActor actor, int appId) {
return new AppsGetMiniAppPoliciesQuery(getClient(), actor, appId);
}

/**
* Returns scopes for auth
*
Expand Down
23 changes: 12 additions & 11 deletions sdk/src/main/java/com/vk/api/sdk/actions/Groups.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import com.vk.api.sdk.client.actors.GroupActor;
import com.vk.api.sdk.client.actors.ServiceActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.enums.GroupsAct;
import com.vk.api.sdk.objects.enums.GroupsFilter;
import com.vk.api.sdk.objects.enums.GroupsState;
import com.vk.api.sdk.objects.groups.GetMembersFilter;
import com.vk.api.sdk.objects.groups.TagBindAct;
import com.vk.api.sdk.objects.groups.ToggleMarketState;
import com.vk.api.sdk.objects.users.Fields;
import com.vk.api.sdk.queries.groups.GroupsAddAddressQuery;
import com.vk.api.sdk.queries.groups.GroupsAddCallbackServerQuery;
Expand Down Expand Up @@ -697,35 +697,35 @@ public GroupsGetMembersQueryWithFields getMembersWithFields(ServiceActor actor,
* Returns a list of community members.
*
* @param actor vk actor
* @param 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).
* @param 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).
* @return query
*/
public GroupsGetMembersQueryWithFilter getMembersWithFilter(UserActor actor,
GroupsFilter filter) {
GetMembersFilter filter) {
return new GroupsGetMembersQueryWithFilter(getClient(), actor, filter);
}

/**
* Returns a list of community members.
*
* @param actor vk actor
* @param 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).
* @param 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).
* @return query
*/
public GroupsGetMembersQueryWithFilter getMembersWithFilter(GroupActor actor,
GroupsFilter filter) {
GetMembersFilter filter) {
return new GroupsGetMembersQueryWithFilter(getClient(), actor, filter);
}

/**
* Returns a list of community members.
*
* @param actor vk actor
* @param 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).
* @param 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).
* @return query
*/
public GroupsGetMembersQueryWithFilter getMembersWithFilter(ServiceActor actor,
GroupsFilter filter) {
GetMembersFilter filter) {
return new GroupsGetMembersQueryWithFilter(getClient(), actor, filter);
}

Expand Down Expand Up @@ -1089,7 +1089,7 @@ public GroupsTagAddQuery tagAdd(UserActor actor, int groupId, String tagName) {
* @return query
*/
public GroupsTagBindQuery tagBind(UserActor actor, int groupId, int tagId, int userId,
GroupsAct act) {
TagBindAct act) {
return new GroupsTagBindQuery(getClient(), actor, groupId, tagId, userId, act);
}

Expand Down Expand Up @@ -1124,7 +1124,8 @@ public GroupsTagUpdateQuery tagUpdate(UserActor actor, int groupId, int tagId, S
* @param state
* @return query
*/
public GroupsToggleMarketQuery toggleMarket(UserActor actor, int groupId, GroupsState state) {
public GroupsToggleMarketQuery toggleMarket(UserActor actor, int groupId,
ToggleMarketState state) {
return new GroupsToggleMarketQuery(getClient(), actor, groupId, state);
}

Expand Down
3 changes: 0 additions & 3 deletions sdk/src/main/java/com/vk/api/sdk/actions/GroupsLongPoll.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.vk.api.sdk.actions;

import com.vk.api.sdk.client.AbstractAction;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.GroupActor;
import com.vk.api.sdk.client.actors.ServiceActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.users.Fields;
import com.vk.api.sdk.queries.groups.*;

/**
Expand Down
Loading

0 comments on commit 914c328

Please sign in to comment.