2828package com.vk.sdk.api.account
2929
3030import com.vk.api.sdk.requests.VKRequest
31+ import com.vk.dto.common.id.UserId
3132import com.vk.sdk.api.GsonHolder
3233import com.vk.sdk.api.NewApiRequest
3334import com.vk.sdk.api.account.dto.AccountAccountCounters
3435import com.vk.sdk.api.account.dto.AccountChangePasswordResponse
3536import com.vk.sdk.api.account.dto.AccountGetActiveOffersResponse
3637import 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
3740import com.vk.sdk.api.account.dto.AccountInfo
3841import 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
3944import com.vk.sdk.api.account.dto.AccountSaveProfileInfoResponse
45+ import com.vk.sdk.api.account.dto.AccountSaveProfileInfoSex
4046import 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
4647import com.vk.sdk.api.base.dto.BaseOkResponse
4748import kotlin.Boolean
4849import 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 }
0 commit comments