Skip to content

Commit 07f2adf

Browse files
author
a.mochalov
committed
version 3.3.0
1 parent 6acc2d3 commit 07f2adf

File tree

219 files changed

+3894
-1208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+3894
-1208
lines changed

api/build.gradle

+11
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ android {
2525
versionName "$sdkVersions.name"
2626
}
2727

28+
packagingOptions {
29+
exclude("builddef.lst")
30+
exclude("**/com/**")
31+
exclude("META-INF/*.kotlin_module")
32+
exclude("META-INF/*.version")
33+
exclude("autoTest/**")
34+
exclude("META-INF/spring.*")
35+
exclude("META-INF/notice.txt")
36+
exclude("mockito-extensions/org.mockito.plugins.MockMaker")
37+
}
38+
2839
kotlinOptions {
2940
jvmTarget = '1.8'
3041
}

api/src/main/java/com/vk/sdk/api/GsonHolder.kt

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ package com.vk.sdk.api
3030
import com.google.gson.Gson
3131
import com.google.gson.GsonBuilder
3232
import com.vk.dto.common.id.UserId
33-
import com.vk.dto.common.id.UserId.GsonSerializer
3433
import com.vk.sdk.api.newsfeed.dto.NewsfeedNewsfeedItem
3534
import com.vk.sdk.api.users.dto.UsersSubscriptionsItem
3635

api/src/main/java/com/vk/sdk/api/account/AccountService.kt

+25-23
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@
2828
package com.vk.sdk.api.account
2929

3030
import com.vk.api.sdk.requests.VKRequest
31+
import com.vk.dto.common.id.UserId
3132
import com.vk.sdk.api.GsonHolder
3233
import com.vk.sdk.api.NewApiRequest
3334
import com.vk.sdk.api.account.dto.AccountAccountCounters
3435
import com.vk.sdk.api.account.dto.AccountChangePasswordResponse
3536
import com.vk.sdk.api.account.dto.AccountGetActiveOffersResponse
3637
import com.vk.sdk.api.account.dto.AccountGetBannedResponse
38+
import com.vk.sdk.api.account.dto.AccountGetCountersFilter
39+
import com.vk.sdk.api.account.dto.AccountGetInfoFields
3740
import com.vk.sdk.api.account.dto.AccountInfo
3841
import com.vk.sdk.api.account.dto.AccountPushSettings
42+
import com.vk.sdk.api.account.dto.AccountSaveProfileInfoBdateVisibility
43+
import com.vk.sdk.api.account.dto.AccountSaveProfileInfoRelation
3944
import com.vk.sdk.api.account.dto.AccountSaveProfileInfoResponse
45+
import com.vk.sdk.api.account.dto.AccountSaveProfileInfoSex
4046
import com.vk.sdk.api.account.dto.AccountUserSettings
41-
import com.vk.sdk.api.account.dto.BdateVisibilityParam
42-
import com.vk.sdk.api.account.dto.FieldsParam
43-
import com.vk.sdk.api.account.dto.FilterParam
44-
import com.vk.sdk.api.account.dto.RelationParam
45-
import com.vk.sdk.api.account.dto.SexParam
4647
import com.vk.sdk.api.base.dto.BaseOkResponse
4748
import kotlin.Boolean
4849
import kotlin.Int
@@ -54,7 +55,8 @@ class AccountService {
5455
* @param ownerId
5556
* @return [VKRequest] with [BaseOkResponse]
5657
*/
57-
fun accountBan(ownerId: Int? = null): VKRequest<BaseOkResponse> = NewApiRequest("account.ban") {
58+
fun accountBan(ownerId: UserId? = null): VKRequest<BaseOkResponse> =
59+
NewApiRequest("account.ban") {
5860
GsonHolder.gson.fromJson(it, BaseOkResponse::class.java)
5961
}
6062
.apply {
@@ -108,10 +110,10 @@ class AccountService {
108110
/**
109111
* Gets settings of the user in this application.
110112
*
111-
* @param userId - User ID whose settings information shall be got. By default: current user.
113+
* @param userId - User ID whose settings information shall be got. By default_ current user.
112114
* @return [VKRequest] with [Int]
113115
*/
114-
fun accountGetAppPermissions(userId: Int): VKRequest<Int> =
116+
fun accountGetAppPermissions(userId: UserId): VKRequest<Int> =
115117
NewApiRequest("account.getAppPermissions") {
116118
GsonHolder.gson.fromJson(it, Int::class.java)
117119
}
@@ -142,7 +144,7 @@ class AccountService {
142144
* @param userId - User ID
143145
* @return [VKRequest] with [AccountAccountCounters]
144146
*/
145-
fun accountGetCounters(filter: List<FilterParam>? = null, userId: Int? = null):
147+
fun accountGetCounters(filter: List<AccountGetCountersFilter>? = null, userId: UserId? = null):
146148
VKRequest<AccountAccountCounters> = NewApiRequest("account.getCounters") {
147149
GsonHolder.gson.fromJson(it, AccountAccountCounters::class.java)
148150
}
@@ -157,13 +159,13 @@ class AccountService {
157159
/**
158160
* Returns current account info.
159161
*
160-
* @param fields - Fields to return. Possible values: *'country' - user country,,
162+
* @param fields - Fields to return. Possible values_ *'country' - user country,,
161163
* *'https_required' - is "HTTPS only" option enabled,, *'own_posts_default' - is "Show my posts
162164
* only" option is enabled,, *'no_wall_replies' - are wall replies disabled or not,, *'intro' - is
163-
* intro passed by user or not,, *'lang' - user language. By default: all.
165+
* intro passed by user or not,, *'lang' - user language. By default_ all.
164166
* @return [VKRequest] with [AccountInfo]
165167
*/
166-
fun accountGetInfo(fields: List<FieldsParam>? = null): VKRequest<AccountInfo> =
168+
fun accountGetInfo(fields: List<AccountGetInfoFields>? = null): VKRequest<AccountInfo> =
167169
NewApiRequest("account.getInfo") {
168170
GsonHolder.gson.fromJson(it, AccountInfo::class.java)
169171
}
@@ -241,13 +243,13 @@ class AccountService {
241243
* @param screenName - User screen name.
242244
* @param cancelRequestId - ID of the name change request to be canceled. If this parameter is
243245
* sent, all the others are ignored.
244-
* @param sex - User sex. Possible values: , * '1' - female,, * '2' - male.
245-
* @param relation - User relationship status. Possible values: , * '1' - single,, * '2' - in a
246+
* @param sex - User sex. Possible values_ , * '1' - female,, * '2' - male.
247+
* @param relation - User relationship status. Possible values_ , * '1' - single,, * '2' - in a
246248
* relationship,, * '3' - engaged,, * '4' - married,, * '5' - it's complicated,, * '6' - actively
247249
* searching,, * '7' - in love,, * '0' - not specified.
248250
* @param relationPartnerId - ID of the relationship partner.
249-
* @param bdate - User birth date, format: DD.MM.YYYY.
250-
* @param bdateVisibility - Birth date visibility. Returned values: , * '1' - show birth date,,
251+
* @param bdate - User birth date, format_ DD.MM.YYYY.
252+
* @param bdateVisibility - Birth date visibility. Returned values_ , * '1' - show birth date,,
251253
* * '2' - show only month and day,, * '0' - hide birth date.
252254
* @param homeTown - User home town.
253255
* @param countryId - User country.
@@ -261,11 +263,11 @@ class AccountService {
261263
maidenName: String? = null,
262264
screenName: String? = null,
263265
cancelRequestId: Int? = null,
264-
sex: SexParam? = null,
265-
relation: RelationParam? = null,
266+
sex: AccountSaveProfileInfoSex? = null,
267+
relation: AccountSaveProfileInfoRelation? = null,
266268
relationPartnerId: Int? = null,
267269
bdate: String? = null,
268-
bdateVisibility: BdateVisibilityParam? = null,
270+
bdateVisibility: AccountSaveProfileInfoBdateVisibility? = null,
269271
homeTown: String? = null,
270272
countryId: Int? = null,
271273
cityId: Int? = null,
@@ -314,7 +316,7 @@ class AccountService {
314316
* @param name - Application screen name.
315317
* @return [VKRequest] with [BaseOkResponse]
316318
*/
317-
fun accountSetNameInMenu(userId: Int, name: String? = null): VKRequest<BaseOkResponse> =
319+
fun accountSetNameInMenu(userId: UserId, name: String? = null): VKRequest<BaseOkResponse> =
318320
NewApiRequest("account.setNameInMenu") {
319321
GsonHolder.gson.fromJson(it, BaseOkResponse::class.java)
320322
}
@@ -376,8 +378,8 @@ class AccountService {
376378
* @param deviceId - Unique device ID.
377379
* @param time - Time in seconds for what notifications should be disabled. '-1' to disable
378380
* forever.
379-
* @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' +
380-
* 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. "
381+
* @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' +
382+
* 'Chat ID', e.g. '2000000001'. For community_ '- Community ID', e.g. '-12345'. "
381383
* @param sound - '1' - to enable sound in this dialog, '0' - to disable sound. Only if
382384
* 'peer_id' contains user or community ID.
383385
* @return [VKRequest] with [BaseOkResponse]
@@ -401,7 +403,7 @@ class AccountService {
401403
* @param ownerId
402404
* @return [VKRequest] with [BaseOkResponse]
403405
*/
404-
fun accountUnban(ownerId: Int? = null): VKRequest<BaseOkResponse> =
406+
fun accountUnban(ownerId: UserId? = null): VKRequest<BaseOkResponse> =
405407
NewApiRequest("account.unban") {
406408
GsonHolder.gson.fromJson(it, BaseOkResponse::class.java)
407409
}

api/src/main/java/com/vk/sdk/api/account/dto/FilterParam.kt api/src/main/java/com/vk/sdk/api/account/dto/AccountGetCountersFilter.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto
3030
import com.google.gson.annotations.SerializedName
3131
import kotlin.String
3232

33-
enum class FilterParam(
33+
enum class AccountGetCountersFilter(
3434
val value: String
3535
) {
3636
@SerializedName("friends")

api/src/main/java/com/vk/sdk/api/account/dto/FieldsParam.kt api/src/main/java/com/vk/sdk/api/account/dto/AccountGetInfoFields.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto
3030
import com.google.gson.annotations.SerializedName
3131
import kotlin.String
3232

33-
enum class FieldsParam(
33+
enum class AccountGetInfoFields(
3434
val value: String
3535
) {
3636
@SerializedName("country")

api/src/main/java/com/vk/sdk/api/account/dto/BdateVisibilityParam.kt api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoBdateVisibility.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto
3030
import com.google.gson.annotations.SerializedName
3131
import kotlin.Int
3232

33-
enum class BdateVisibilityParam(
33+
enum class AccountSaveProfileInfoBdateVisibility(
3434
val value: Int
3535
) {
3636
@SerializedName("1")

api/src/main/java/com/vk/sdk/api/account/dto/RelationParam.kt api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoRelation.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto
3030
import com.google.gson.annotations.SerializedName
3131
import kotlin.Int
3232

33-
enum class RelationParam(
33+
enum class AccountSaveProfileInfoRelation(
3434
val value: Int
3535
) {
3636
@SerializedName("1")

api/src/main/java/com/vk/sdk/api/account/dto/SexParam.kt api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoSex.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto
3030
import com.google.gson.annotations.SerializedName
3131
import kotlin.Int
3232

33-
enum class SexParam(
33+
enum class AccountSaveProfileInfoSex(
3434
val value: Int
3535
) {
3636
@SerializedName("0")

0 commit comments

Comments
 (0)