Skip to content

Commit

Permalink
version 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
a.mochalov committed Aug 11, 2021
1 parent 01374d0 commit 1932d5b
Show file tree
Hide file tree
Showing 903 changed files with 2,004 additions and 2,365 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion vk-sdk-api/README.md → api/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VK SDK generated api for Android
==========

Current generated version is 5.130
Current generated version is 5.131
4 changes: 2 additions & 2 deletions vk-sdk-api/build.gradle → api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ configurations {
}

dependencies {
implementation project(':libapi-sdk-core')

implementation project(':core')
implementation project(":id")
implementation sdkLibraries.kotlin
implementation sdkLibraries.gson
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ package com.vk.sdk.api

import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.vk.dto.common.id.UserId
import com.vk.dto.common.id.UserId.GsonSerializer
import com.vk.sdk.api.newsfeed.dto.NewsfeedNewsfeedItem
import com.vk.sdk.api.users.dto.UsersSubscriptionsItem

Expand All @@ -38,6 +40,7 @@ object GsonHolder {
.registerTypeAdapter(UsersSubscriptionsItem::class.java,
UsersSubscriptionsItem.Deserializer())
.registerTypeAdapter(NewsfeedNewsfeedItem::class.java, NewsfeedNewsfeedItem.Deserializer())
.registerTypeAdapter(UserId::class.java, UserId.GsonSerializer())
.create()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import kotlin.String
internal class NewApiRequest<T> internal constructor(
methodName: String,
parser: ApiResponseParser<T>
) : VKRequest<T>(methodName, requestApiVersion = "5.130"), ApiResponseParser<T> by parser {
) : VKRequest<T>(methodName, requestApiVersion = "5.131"), ApiResponseParser<T> by parser {
override fun parse(response: String): T {
val responseJson = JsonParser.parseString(response).asJsonObject.get("response")
return parseResponse(responseJson)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,19 @@ class AccountService {
* Returns non-null values of user counters.
*
* @param filter - Counters to be returned.
* @param userId - User ID
* @return [VKRequest] with [AccountAccountCounters]
*/
fun accountGetCounters(filter: List<FilterParam>? = null): VKRequest<AccountAccountCounters> =
NewApiRequest("account.getCounters") {
fun accountGetCounters(filter: List<FilterParam>? = null, userId: Int? = null):
VKRequest<AccountAccountCounters> = NewApiRequest("account.getCounters") {
GsonHolder.gson.fromJson(it, AccountAccountCounters::class.java)
}
.apply {
val filterJsonConverted = filter?.map {
it.value
}
filterJsonConverted?.let { addParam("filter", it) }
userId?.let { addParam("user_id", it) }
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ import kotlin.Int
* @param friendsRecommendations - New friends recommendations number
* @param gifts - New gifts number
* @param groups - New groups number
* @param menuDiscoverBadge -
* @param menuDiscoverBadge
* @param menuClipsBadge
* @param messages - New messages number
* @param memories - New memories number
* @param notes - New notes number
* @param notifications - New notifications number
* @param photos - New photo tags number
* @param sdk - New sdk number
* @param messagesUnreadUnmuted - Unread unmuted dialogs count
*/
data class AccountAccountCounters(
@SerializedName("app_requests")
Expand Down Expand Up @@ -81,7 +80,5 @@ data class AccountAccountCounters(
@SerializedName("photos")
val photos: Int? = null,
@SerializedName("sdk")
val sdk: Int? = null,
@SerializedName("messages_unread_unmuted")
val messagesUnreadUnmuted: Int? = null
val sdk: Int? = null
)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package com.vk.sdk.api.account.dto

import com.google.gson.annotations.SerializedName
import com.vk.sdk.api.groups.dto.GroupsGroup
import com.vk.sdk.api.users.dto.UsersUserMin
import com.vk.sdk.api.users.dto.UsersUserFull
import kotlin.Int
import kotlin.collections.List

Expand All @@ -45,7 +45,7 @@ data class AccountGetBannedResponse(
@SerializedName("items")
val items: List<Int>,
@SerializedName("profiles")
val profiles: List<UsersUserMin>? = null,
val profiles: List<UsersUserFull>? = null,
@SerializedName("groups")
val groups: List<GroupsGroup>? = null
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
package com.vk.sdk.api.account.dto

import com.google.gson.annotations.SerializedName
import com.vk.dto.common.id.UserId
import com.vk.sdk.api.audio.dto.AudioAudio
import com.vk.sdk.api.base.dto.BaseBoolInt
import com.vk.sdk.api.base.dto.BaseCity
Expand Down Expand Up @@ -85,7 +86,7 @@ data class AccountUserSettings(
@SerializedName("hidden")
val hidden: Int? = null,
@SerializedName("id")
val id: Int? = null,
val id: UserId? = null,
@SerializedName("last_name")
val lastName: String? = null,
@SerializedName("can_access_closed")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ enum class FilterParam(
@SerializedName("photos")
PHOTOS("photos"),

@SerializedName("videos")
VIDEOS("videos"),

@SerializedName("notes")
NOTES("notes"),

Expand All @@ -61,5 +58,14 @@ enum class FilterParam(
SDK("sdk"),

@SerializedName("friends_suggestions")
FRIENDS_SUGGESTIONS("friends_suggestions");
FRIENDS_SUGGESTIONS("friends_suggestions"),

@SerializedName("notifications")
NOTIFICATIONS("notifications"),

@SerializedName("app_requests")
APP_REQUESTS("app_requests"),

@SerializedName("friends_recommendations")
FRIENDS_RECOMMENDATIONS("friends_recommendations");
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ import com.vk.sdk.api.ads.dto.AdsTargStats
import com.vk.sdk.api.ads.dto.AdsTargSuggestions
import com.vk.sdk.api.ads.dto.AdsTargetGroup
import com.vk.sdk.api.ads.dto.AdsUpdateOfficeUsersResult
import com.vk.sdk.api.ads.dto.AdsUserSpecification
import com.vk.sdk.api.ads.dto.AdsUserSpecificationCutted
import com.vk.sdk.api.ads.dto.AdsUsers
import com.vk.sdk.api.ads.dto.FieldsParam
import com.vk.sdk.api.ads.dto.IdsTypeParam
Expand All @@ -78,16 +76,13 @@ class AdsService {
* 'user_specification' objects see below.
* @return [VKRequest] with [Boolean]
*/
fun adsAddOfficeUsers(accountId: Int, data: List<AdsUserSpecificationCutted>):
VKRequest<Boolean> = NewApiRequest("ads.addOfficeUsers") {
fun adsAddOfficeUsers(accountId: Int, data: String): VKRequest<Boolean> =
NewApiRequest("ads.addOfficeUsers") {
GsonHolder.gson.fromJson(it, Boolean::class.java)
}
.apply {
addParam("account_id", accountId)
val dataJsonConverted = data.map {
GsonHolder.gson.toJson(it)
}
addParam("data", dataJsonConverted)
addParam("data", data)
}

/**
Expand Down Expand Up @@ -393,24 +388,27 @@ class AdsService {
* Returns descriptions of ad layouts.
*
* @param accountId - Advertising account ID.
* @param adIds - Filter by ads. Serialized JSON array with ad IDs. If the parameter is null,
* all ads will be shown.
* @param campaignIds - Filter by advertising campaigns. Serialized JSON array with campaign
* IDs. If the parameter is null, ads of all campaigns will be shown.
* @param clientId - 'For advertising agencies.' ID of the client ads are retrieved from.
* @param includeDeleted - Flag that specifies whether archived ads shall be shown. *0 - show
* only active ads,, *1 - show all ads.
* @param onlyDeleted - Flag that specifies whether to show only archived ads: *0 - show all
* ads,, *1 - show only archived ads. Available when include_deleted flag is *1
* @param campaignIds - Filter by advertising campaigns. Serialized JSON array with campaign
* IDs. If the parameter is null, ads of all campaigns will be shown.
* @param adIds - Filter by ads. Serialized JSON array with ad IDs. If the parameter is null,
* all ads will be shown.
* @param limit - Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and
* 'campaign_ids' parameter contains ID of only one campaign.
* @param offset - Offset. Used in the same cases as 'limit' parameter.
* @return [VKRequest] with [Unit]
*/
fun adsGetAdsLayout(
accountId: Int,
adIds: String? = null,
campaignIds: String? = null,
clientId: Int? = null,
includeDeleted: Boolean? = null,
onlyDeleted: Boolean? = null,
campaignIds: String? = null,
adIds: String? = null,
limit: Int? = null,
offset: Int? = null
): VKRequest<List<AdsAdLayout>> = NewApiRequest("ads.getAdsLayout") {
Expand All @@ -419,10 +417,11 @@ class AdsService {
}
.apply {
addParam("account_id", accountId)
adIds?.let { addParam("ad_ids", it) }
campaignIds?.let { addParam("campaign_ids", it) }
clientId?.let { addParam("client_id", it) }
includeDeleted?.let { addParam("include_deleted", it) }
onlyDeleted?.let { addParam("only_deleted", it) }
campaignIds?.let { addParam("campaign_ids", it) }
adIds?.let { addParam("ad_ids", it) }
limit?.let { addParam("limit", it) }
offset?.let { addParam("offset", it) }
}
Expand Down Expand Up @@ -1075,17 +1074,14 @@ class AdsService {
* 'user_specification' objects see below.
* @return [VKRequest] with [Unit]
*/
fun adsUpdateOfficeUsers(accountId: Int, data: List<AdsUserSpecification>):
fun adsUpdateOfficeUsers(accountId: Int, data: String):
VKRequest<List<AdsUpdateOfficeUsersResult>> = NewApiRequest("ads.updateOfficeUsers") {
val typeToken = object: TypeToken<List<AdsUpdateOfficeUsersResult>>() {}.type
GsonHolder.gson.fromJson<List<AdsUpdateOfficeUsersResult>>(it, typeToken)
}
.apply {
addParam("account_id", accountId)
val dataJsonConverted = data.map {
GsonHolder.gson.toJson(it)
}
addParam("data", dataJsonConverted)
addParam("data", data)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
package com.vk.sdk.api.ads.dto

import com.google.gson.annotations.SerializedName
import kotlin.Boolean
import kotlin.Int
import kotlin.String

Expand All @@ -42,6 +43,9 @@ import kotlin.String
* @param type
* @param adsCount - Amount of active ads in campaign
* @param createTime - Campaign create time, as Unixtime
* @param goalType - Campaign goal type
* @param userGoalType - Campaign user goal type
* @param isCboEnabled - Shows if Campaign Budget Optimization is on
* @param updateTime - Campaign update time, as Unixtime
* @param viewsLimit - Limit of views per user per campaign
*/
Expand All @@ -66,6 +70,12 @@ data class AdsCampaign(
val adsCount: Int? = null,
@SerializedName("create_time")
val createTime: Int? = null,
@SerializedName("goal_type")
val goalType: Int? = null,
@SerializedName("user_goal_type")
val userGoalType: Int? = null,
@SerializedName("is_cbo_enabled")
val isCboEnabled: Boolean? = null,
@SerializedName("update_time")
val updateTime: Int? = null,
@SerializedName("views_limit")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import kotlin.String

/**
* @param clicks - Clicks number
* @param linkOwnerClicks - Group clicks number
* @param linkExternalClicks - External clicks number
* @param day - Day as YYYY-MM-DD
* @param impressions - Impressions number
Expand All @@ -50,8 +49,6 @@ import kotlin.String
data class AdsStatsFormat(
@SerializedName("clicks")
val clicks: Int? = null,
@SerializedName("link_owner_clicks")
val linkOwnerClicks: Int? = null,
@SerializedName("link_external_clicks")
val linkExternalClicks: Int? = null,
@SerializedName("day")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
package com.vk.sdk.api.ads.dto

import com.google.gson.annotations.SerializedName
import com.vk.dto.common.id.UserId
import com.vk.sdk.api.base.dto.BaseError
import kotlin.Boolean
import kotlin.Int

/**
* @param userId
Expand All @@ -39,7 +39,7 @@ import kotlin.Int
*/
data class AdsUpdateOfficeUsersResult(
@SerializedName("user_id")
val userId: Int,
val userId: UserId,
@SerializedName("is_success")
val isSuccess: Boolean,
@SerializedName("error")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
package com.vk.sdk.api.ads.dto

import com.google.gson.annotations.SerializedName
import kotlin.Int
import com.vk.dto.common.id.UserId
import kotlin.collections.List

/**
Expand All @@ -39,5 +39,5 @@ data class AdsUsers(
@SerializedName("accesses")
val accesses: List<AdsAccesses>,
@SerializedName("user_id")
val userId: Int
val userId: UserId
)
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,27 @@
// THIS FILE IS AUTO GENERATED!
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING.
// *********************************************************************
package com.vk.sdk.api.shortVideo.dto
package com.vk.sdk.api.aliexpress.dto

import com.google.gson.annotations.SerializedName
import com.vk.sdk.api.video.dto.VideoVideoFull
import kotlin.Int
import kotlin.String

/**
* @param title
* @param actionTitle
* @param totalCount
* @param url
* @param video
* @param title - Panel title
* @param subtitle - Panel text
* @param photo62 - URL of photo with 62 pixels in height
* @param photo124 - URL of photo with 124 pixels in height
* @param photo186 - URL of photo with 186 pixels in height
*/
data class ShortVideoChallengeFeedItem(
data class AliexpressBlockPanel(
@SerializedName("title")
val title: String,
@SerializedName("action_title")
val actionTitle: String,
@SerializedName("total_count")
val totalCount: Int,
@SerializedName("url")
val url: String,
@SerializedName("video")
val video: VideoVideoFull
@SerializedName("subtitle")
val subtitle: String? = null,
@SerializedName("photo_62")
val photo62: String? = null,
@SerializedName("photo_124")
val photo124: String? = null,
@SerializedName("photo_186")
val photo186: String? = null
)
Loading

0 comments on commit 1932d5b

Please sign in to comment.