Skip to content

Commit

Permalink
version 2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Smirnov committed Sep 22, 2020
1 parent 4c6f418 commit 2e628db
Show file tree
Hide file tree
Showing 564 changed files with 3,077 additions and 1,708 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VK SDK for Android

[![Maven Central](https://img.shields.io/maven-central/v/com.vk/androidsdk.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.vk%22%20AND%20a:%22androidsdk%22)

Library for working with VK API, authorization through VK app, using VK functions. Minimal version of Android is 4.1
Library for working with VK API, authorization through VK app, using VK functions. Minimal version of Android is 5.0

Prepare for Using VK SDK
----------
Expand Down Expand Up @@ -56,12 +56,12 @@ You can add next maven dependency in your project:

You may also need to add the following to your `project/build.gradle` file.

`implementation 'com.vk:androidsdk:2.2.3`
`implementation 'com.vk:androidsdk:2.4.0`

For example, your `app/build.gradle` script will contains such dependencies:
```
dependencies {
implementation 'com.vk:androidsdk:2.2.3
implementation 'com.vk:androidsdk:2.4.0
}
```

Expand Down
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ SOFTWARE.
*/

ext.sdkVersions = [
code : '18',
name : '2.3.0',
code : '19',
name : '2.4.0',

minSdk : 16,
targetSdk : 28,
minSdk : 21,
targetSdk : 29,
compileSdk : '29',
buildTools : '29.0.3',

Expand Down
2 changes: 1 addition & 1 deletion vk-sdk-api/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VK SDK api for Android
==========

To update it from current master please run tools/tasks/generator/generate_public_sdk_api.sh
Current version is 5.122

there are 3 packages now

Expand Down
39 changes: 39 additions & 0 deletions vk-sdk-api/src/main/java/com/vk/sdk/api/ApiRequestBase.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2019 vk.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// *********************************************************************
// THIS FILE IS AUTO GENERATED!
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING.
// *********************************************************************
package com.vk.sdk.api

import com.vk.api.sdk.requests.VKRequest
import kotlin.String

/**
* Base class for all Api requests
* @param methodName api method name
*/
open class ApiRequestBase<T>(
methodName: String
) : VKRequest<T>(method = methodName, requestApiVersion = Constants.API_VERSION)
34 changes: 34 additions & 0 deletions vk-sdk-api/src/main/java/com/vk/sdk/api/Constants.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2019 vk.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// *********************************************************************
// THIS FILE IS AUTO GENERATED!
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING.
// *********************************************************************
package com.vk.sdk.api

import kotlin.String

object Constants {
const val API_VERSION: String = "5.122"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.base.dto.BaseOkResponseDto
import com.vk.sdk.api.base.responses.BaseOkResponse
Expand All @@ -39,7 +39,7 @@ import org.json.JSONObject
*/
class AccountBan(
private val ownerId: Int? = null
) : VKRequest<BaseOkResponseDto>("account.ban") {
) : ApiRequestBase<BaseOkResponseDto>(methodName = "account.ban") {
init {
ownerId?.let { value ->
addParam("owner_id", value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.account.dto.AccountChangePasswordResponseDto
import com.vk.sdk.api.account.responses.AccountChangePasswordResponse
Expand All @@ -49,7 +49,7 @@ class AccountChangePassword(
private val restoreSid: String? = null,
private val changePasswordHash: String? = null,
private val oldPassword: String? = null
) : VKRequest<AccountChangePasswordResponseDto>("account.changePassword") {
) : ApiRequestBase<AccountChangePasswordResponseDto>(methodName = "account.changePassword") {
init {
addParam("new_password", newPassword)
restoreSid?.let { value ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.account.dto.AccountGetActiveOffersResponseDto
import com.vk.sdk.api.account.responses.AccountGetActiveOffersResponse
Expand All @@ -43,7 +43,7 @@ import org.json.JSONObject
class AccountGetActiveOffers(
private val offset: Int? = null,
private val count: Int? = null
) : VKRequest<AccountGetActiveOffersResponseDto>("account.getActiveOffers") {
) : ApiRequestBase<AccountGetActiveOffersResponseDto>(methodName = "account.getActiveOffers") {
init {
offset?.let { value ->
addParam("offset", value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.account.responses.AccountGetAppPermissionsResponse
import kotlin.Int
Expand All @@ -40,7 +40,7 @@ import org.json.JSONObject
*/
class AccountGetAppPermissions(
private val userId: Int
) : VKRequest<Int>("account.getAppPermissions") {
) : ApiRequestBase<Int>(methodName = "account.getAppPermissions") {
init {
addParam("user_id", userId)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.account.dto.AccountGetBannedResponseDto
import com.vk.sdk.api.account.responses.AccountGetBannedResponse
Expand All @@ -42,7 +42,7 @@ import org.json.JSONObject
class AccountGetBanned(
private val offset: Int? = null,
private val count: Int? = null
) : VKRequest<AccountGetBannedResponseDto>("account.getBanned") {
) : ApiRequestBase<AccountGetBannedResponseDto>(methodName = "account.getBanned") {
init {
offset?.let { value ->
addParam("offset", value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.account.dto.AccountAccountCounters
import com.vk.sdk.api.account.dto.AccountGetCountersFilter
Expand All @@ -41,7 +41,7 @@ import org.json.JSONObject
*/
class AccountGetCounters(
private val filter: List<AccountGetCountersFilter>? = null
) : VKRequest<AccountAccountCounters>("account.getCounters") {
) : ApiRequestBase<AccountAccountCounters>(methodName = "account.getCounters") {
init {
filter?.let { value ->
addParam("filter", value.map { it.value })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.account.dto.AccountGetInfoFields
import com.vk.sdk.api.account.dto.AccountInfo
Expand All @@ -37,14 +37,14 @@ import org.json.JSONObject

/**
* Returns current account info.
* @param 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.
* @param 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.
*/
class AccountGetInfo(
private val fields: List<AccountGetInfoFields>? = null
) : VKRequest<AccountInfo>("account.getInfo") {
) : ApiRequestBase<AccountInfo>(methodName = "account.getInfo") {
init {
fields?.let { value ->
addParam("fields", value.map { it.value })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.account.dto.AccountUserSettings
import com.vk.sdk.api.account.responses.AccountGetProfileInfoResponse
Expand All @@ -36,7 +36,8 @@ import org.json.JSONObject
/**
* Returns the current account info.
*/
class AccountGetProfileInfo : VKRequest<AccountUserSettings>("account.getProfileInfo") {
class AccountGetProfileInfo : ApiRequestBase<AccountUserSettings>(methodName =
"account.getProfileInfo") {
override fun parse(r: JSONObject): AccountUserSettings = GsonHolder.gson.fromJson(r.toString(),
AccountGetProfileInfoResponse::class.java).response
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.account.dto.AccountPushSettings
import com.vk.sdk.api.account.responses.AccountGetPushSettingsResponse
Expand All @@ -40,7 +40,7 @@ import org.json.JSONObject
*/
class AccountGetPushSettings(
private val deviceId: String? = null
) : VKRequest<AccountPushSettings>("account.getPushSettings") {
) : ApiRequestBase<AccountPushSettings>(methodName = "account.getPushSettings") {
init {
deviceId?.let { value ->
addParam("device_id", value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.base.dto.BaseOkResponseDto
import com.vk.sdk.api.base.responses.BaseOkResponse
Expand Down Expand Up @@ -55,7 +55,7 @@ class AccountRegisterDevice(
private val systemVersion: String? = null,
private val settings: String? = null,
private val sandbox: Boolean? = null
) : VKRequest<BaseOkResponseDto>("account.registerDevice") {
) : ApiRequestBase<BaseOkResponseDto>(methodName = "account.registerDevice") {
init {
addParam("token", token)
addParam("device_id", deviceId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.account.dto.AccountSaveProfileInfoBdateVisibility
import com.vk.sdk.api.account.dto.AccountSaveProfileInfoRelation
Expand All @@ -46,14 +46,14 @@ import org.json.JSONObject
* @param screenName User screen name.
* @param cancelRequestId ID of the name change request to be canceled. If this parameter is sent,
* all the others are ignored. minimum 0
* @param sex User sex. Possible values: , * '1' female,, * '2' male. minimum 0
* @param 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. minimum 0
* @param sex User sex. Possible values: , * '1' - female,, * '2' - male. minimum 0
* @param 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. minimum 0
* @param relationPartnerId ID of the relationship partner. minimum 0
* @param bdate User birth date, format: DD.MM.YYYY.
* @param bdateVisibility Birth date visibility. Returned values: , * '1' show birth date,, * '2'
* show only month and day,, * '0' hide birth date. minimum 0
* @param bdateVisibility Birth date visibility. Returned values: , * '1' - show birth date,, *
* '2' - show only month and day,, * '0' - hide birth date. minimum 0
* @param homeTown User home town.
* @param countryId User country. minimum 0
* @param cityId User city. minimum 0
Expand All @@ -74,7 +74,7 @@ class AccountSaveProfileInfo(
private val countryId: Int? = null,
private val cityId: Int? = null,
private val status: String? = null
) : VKRequest<AccountSaveProfileInfoResponseDto>("account.saveProfileInfo") {
) : ApiRequestBase<AccountSaveProfileInfoResponseDto>(methodName = "account.saveProfileInfo") {
init {
firstName?.let { value ->
addParam("first_name", value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.base.dto.BaseOkResponseDto
import com.vk.sdk.api.base.responses.BaseOkResponse
Expand All @@ -42,7 +42,7 @@ import org.json.JSONObject
class AccountSetInfo(
private val name: String? = null,
private val value: String? = null
) : VKRequest<BaseOkResponseDto>("account.setInfo") {
) : ApiRequestBase<BaseOkResponseDto>(methodName = "account.setInfo") {
init {
name?.let { value ->
addParam("name", value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// *********************************************************************
package com.vk.sdk.api.account.methods

import com.vk.api.sdk.requests.VKRequest
import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.base.dto.BaseOkResponseDto
import com.vk.sdk.api.base.responses.BaseOkResponse
Expand All @@ -44,7 +44,7 @@ import org.json.JSONObject
class AccountSetNameInMenu(
private val userId: Int,
private val name: String? = null
) : VKRequest<BaseOkResponseDto>("account.setNameInMenu") {
) : ApiRequestBase<BaseOkResponseDto>(methodName = "account.setNameInMenu") {
init {
addParam("user_id", userId)
name?.let { value ->
Expand Down
Loading

0 comments on commit 2e628db

Please sign in to comment.