28
28
package com.vk.sdk.api.account
29
29
30
30
import com.vk.api.sdk.requests.VKRequest
31
+ import com.vk.dto.common.id.UserId
31
32
import com.vk.sdk.api.GsonHolder
32
33
import com.vk.sdk.api.NewApiRequest
33
34
import com.vk.sdk.api.account.dto.AccountAccountCounters
34
35
import com.vk.sdk.api.account.dto.AccountChangePasswordResponse
35
36
import com.vk.sdk.api.account.dto.AccountGetActiveOffersResponse
36
37
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
37
40
import com.vk.sdk.api.account.dto.AccountInfo
38
41
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
39
44
import com.vk.sdk.api.account.dto.AccountSaveProfileInfoResponse
45
+ import com.vk.sdk.api.account.dto.AccountSaveProfileInfoSex
40
46
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
46
47
import com.vk.sdk.api.base.dto.BaseOkResponse
47
48
import kotlin.Boolean
48
49
import kotlin.Int
@@ -54,7 +55,8 @@ class AccountService {
54
55
* @param ownerId
55
56
* @return [VKRequest] with [BaseOkResponse]
56
57
*/
57
- fun accountBan (ownerId : Int? = null): VKRequest <BaseOkResponse > = NewApiRequest (" account.ban" ) {
58
+ fun accountBan (ownerId : UserId ? = null): VKRequest <BaseOkResponse > =
59
+ NewApiRequest (" account.ban" ) {
58
60
GsonHolder .gson.fromJson(it, BaseOkResponse ::class .java)
59
61
}
60
62
.apply {
@@ -108,10 +110,10 @@ class AccountService {
108
110
/* *
109
111
* Gets settings of the user in this application.
110
112
*
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.
112
114
* @return [VKRequest] with [Int]
113
115
*/
114
- fun accountGetAppPermissions (userId : Int ): VKRequest <Int > =
116
+ fun accountGetAppPermissions (userId : UserId ): VKRequest <Int > =
115
117
NewApiRequest (" account.getAppPermissions" ) {
116
118
GsonHolder .gson.fromJson(it, Int ::class .java)
117
119
}
@@ -142,7 +144,7 @@ class AccountService {
142
144
* @param userId - User ID
143
145
* @return [VKRequest] with [AccountAccountCounters]
144
146
*/
145
- fun accountGetCounters (filter : List <FilterParam >? = null, userId : Int ? = null):
147
+ fun accountGetCounters (filter : List <AccountGetCountersFilter >? = null, userId : UserId ? = null):
146
148
VKRequest <AccountAccountCounters > = NewApiRequest (" account.getCounters" ) {
147
149
GsonHolder .gson.fromJson(it, AccountAccountCounters ::class .java)
148
150
}
@@ -157,13 +159,13 @@ class AccountService {
157
159
/* *
158
160
* Returns current account info.
159
161
*
160
- * @param fields - Fields to return. Possible values: *'country' - user country,,
162
+ * @param fields - Fields to return. Possible values_ *'country' - user country,,
161
163
* *'https_required' - is "HTTPS only" option enabled,, *'own_posts_default' - is "Show my posts
162
164
* 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.
164
166
* @return [VKRequest] with [AccountInfo]
165
167
*/
166
- fun accountGetInfo (fields : List <FieldsParam >? = null): VKRequest <AccountInfo > =
168
+ fun accountGetInfo (fields : List <AccountGetInfoFields >? = null): VKRequest <AccountInfo > =
167
169
NewApiRequest (" account.getInfo" ) {
168
170
GsonHolder .gson.fromJson(it, AccountInfo ::class .java)
169
171
}
@@ -241,13 +243,13 @@ class AccountService {
241
243
* @param screenName - User screen name.
242
244
* @param cancelRequestId - ID of the name change request to be canceled. If this parameter is
243
245
* 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
246
248
* relationship,, * '3' - engaged,, * '4' - married,, * '5' - it's complicated,, * '6' - actively
247
249
* searching,, * '7' - in love,, * '0' - not specified.
248
250
* @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,,
251
253
* * '2' - show only month and day,, * '0' - hide birth date.
252
254
* @param homeTown - User home town.
253
255
* @param countryId - User country.
@@ -261,11 +263,11 @@ class AccountService {
261
263
maidenName : String? = null,
262
264
screenName : String? = null,
263
265
cancelRequestId : Int? = null,
264
- sex : SexParam ? = null,
265
- relation : RelationParam ? = null,
266
+ sex : AccountSaveProfileInfoSex ? = null,
267
+ relation : AccountSaveProfileInfoRelation ? = null,
266
268
relationPartnerId : Int? = null,
267
269
bdate : String? = null,
268
- bdateVisibility : BdateVisibilityParam ? = null,
270
+ bdateVisibility : AccountSaveProfileInfoBdateVisibility ? = null,
269
271
homeTown : String? = null,
270
272
countryId : Int? = null,
271
273
cityId : Int? = null,
@@ -314,7 +316,7 @@ class AccountService {
314
316
* @param name - Application screen name.
315
317
* @return [VKRequest] with [BaseOkResponse]
316
318
*/
317
- fun accountSetNameInMenu (userId : Int , name : String? = null): VKRequest <BaseOkResponse > =
319
+ fun accountSetNameInMenu (userId : UserId , name : String? = null): VKRequest <BaseOkResponse > =
318
320
NewApiRequest (" account.setNameInMenu" ) {
319
321
GsonHolder .gson.fromJson(it, BaseOkResponse ::class .java)
320
322
}
@@ -376,8 +378,8 @@ class AccountService {
376
378
* @param deviceId - Unique device ID.
377
379
* @param time - Time in seconds for what notifications should be disabled. '-1' to disable
378
380
* 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'. "
381
383
* @param sound - '1' - to enable sound in this dialog, '0' - to disable sound. Only if
382
384
* 'peer_id' contains user or community ID.
383
385
* @return [VKRequest] with [BaseOkResponse]
@@ -401,7 +403,7 @@ class AccountService {
401
403
* @param ownerId
402
404
* @return [VKRequest] with [BaseOkResponse]
403
405
*/
404
- fun accountUnban (ownerId : Int ? = null): VKRequest <BaseOkResponse > =
406
+ fun accountUnban (ownerId : UserId ? = null): VKRequest <BaseOkResponse > =
405
407
NewApiRequest (" account.unban" ) {
406
408
GsonHolder .gson.fromJson(it, BaseOkResponse ::class .java)
407
409
}
0 commit comments