diff --git a/README.md b/README.md index 2415d4b03c..2c5a621017 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,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) +[![Maven Central](https://img.shields.io/maven-central/v/com.vk/android-sdk-core.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.vk%22%20AND%20a:%22android-sdk-core%22) Library for working with VK API, authorization through VK app, using VK functions. Minimal version of Android is 5.0 @@ -52,23 +52,27 @@ Connecting VK SDK to Your Android Application Connecting With Maven ---------- +[![Core Release](https://img.shields.io/maven-central/v/com.vk/android-sdk-core.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.vk%22%20AND%20a:%22android-sdk-core%22) + + You can add next maven dependency in your project: -You may also need to add the following to your `project/build.gradle` file. +The available library modules are listed below. + +* `android-sdk-core`: Core functionality (required). +* `android-sdk-api` : Api generated models and methods. -`implementation 'com.vk:androidsdk:2.4.0` +* `androidsdk`: deprecated copy version of the android-sdk-core(will be removed in future releases). +* `androidsdkapi` : deprecated copy version of the android-sdk-api(will be removed in future releases). For example, your `app/build.gradle` script will contains such dependencies: ``` dependencies { - implementation 'com.vk:androidsdk:2.4.0 + implementation 'com.vk:android-sdk-core:3.0.0 + implementation 'com.vk:android-sdk-api:3.0.0 // generated models and api methods } ``` -Older version ----------- -Older version of sdk can be found **[here](https://github.com/VKCOM/vk-android-sdk/releases/tag/1.6.7)** - Using SDK ========== @@ -136,18 +140,20 @@ class SampleApplication: Application() { API Requests ========== -Run request with VK.execute: - +Run request with VK.execute and auto generated methods(android-sdk-api dependency is required): ```kotlin -VK.execute(UsersGet(), object: VKApiCallback> { - override fun success(result: List) { - } - override fun fail(error: VKApiExecutionException) { - } -}) +VK.execute(FriendsService().friendsGet(fields = fields), object: VKApiCallback { + override fun success(result: FriendsGetFieldsResponse) { + // you stuff is here + } + override fun fail(error: Exception) { + Log.e(TAG, error.toString()) + } + }) ``` + If you are using RxJava in your project, you can do something like this: ```kotlin diff --git a/build.gradle b/build.gradle index 5417ed9c89..76147d508e 100644 --- a/build.gradle +++ b/build.gradle @@ -27,9 +27,14 @@ apply from: 'dependencies.gradle' subprojects { Project subproject -> buildscript { repositories { + jcenter { + content { + includeModule("com.jfrog.bintray.gradle", "gradle-bintray-plugin") + includeModule("org.codehaus.groovy.modules.http-builder", "http-builder") + } + } google() mavenCentral() - jcenter() maven { url 'https://maven.google.com' } } @@ -42,7 +47,7 @@ subprojects { Project subproject -> repositories { google() - jcenter() + mavenCentral() } } diff --git a/dependencies.gradle b/dependencies.gradle index 3b735b1be5..eac1e39e8d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -23,8 +23,8 @@ SOFTWARE. */ ext.sdkVersions = [ - code : '21', - name : '2.6.0', + code : '23', + name : '3.0.0', minSdk : 21, targetSdk : 29, @@ -68,17 +68,21 @@ ext.testLibraries = [ ext.sdkGradlePlugins = [ android : "com.android.tools.build:gradle:$sdkVersions.androidGradlePlugin", kotlinGradle : "org.jetbrains.kotlin:kotlin-gradle-plugin:$sdkVersions.kotlin", - bintryRelease : "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4", + bintryRelease : "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5", ] ext.sdkPublish = [ POM_NAME : "VK API library", - POM_ARTIFACT_ID : 'androidsdk', + POM_ARTIFACT_ID : 'android-sdk-core', POM_DESCRIPTION : 'Main VK Android API library', POM_URL : 'https://github.com/VKCOM/vk-android-sdk', POM_SCM_URL : 'https://github.com/VKCOM/vk-android-sdk', POM_SCM_CONNECTION : 'scm:git:git://github.com/VKCOM/vk-android-sdk.git', POM_SCM_DEV_CONNECTION : 'scm:git:git://github.com/VKCOM/vk-android-sdk.git', POM_LICENCE_URL : 'https://github.com/VKCOM/vk-android-sdk/raw/master/LICENSE', + + POM_API_NAME : 'VK API Models library', + POM_API_ARTIFACT_ID : 'android-sdk-api', + POM_API_DESCRIPTION : 'VK Android API generated library', ] diff --git a/publish.gradle b/publish.gradle index 633093891b..6e6e8bfabd 100644 --- a/publish.gradle +++ b/publish.gradle @@ -22,8 +22,6 @@ * SOFTWARE. ******************************************************************************/ -apply from: '../dependencies.gradle' - static def getRepoUrl() { return "https://oss.sonatype.org/service/local/staging/deploy/maven2/" } @@ -35,6 +33,11 @@ static def getRepoPassword() { return System.getenv('NEXUS_PASSWORD') } +def getArtifactId() { + def envArtifactId = System.getenv('POM_ARTIFACT_ID') + return envArtifactId != null ? envArtifactId : sdkPublish.POM_ARTIFACT_ID +} + if (System.getenv('SDK_UPDATE') == "1") { apply plugin: 'com.jfrog.bintray' apply plugin: 'maven-publish' @@ -50,7 +53,7 @@ if (System.getenv('SDK_UPDATE') == "1") { mavenDeployer { beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - pom.artifactId = sdkPublish.POM_ARTIFACT_ID + pom.artifactId = getArtifactId() repository(url: sonatypeRepositoryUrl) { authentication(userName: getRepoUsername(), password: getRepoPassword()) diff --git a/samples/app/.gitignore b/samples/app/.gitignore index 796b96d1c4..9df29b6bd2 100644 --- a/samples/app/.gitignore +++ b/samples/app/.gitignore @@ -1 +1,2 @@ /build +notTranslatedStrings/ diff --git a/samples/app/build.gradle b/samples/app/build.gradle index 65f75acc52..5c7c5bda1f 100644 --- a/samples/app/build.gradle +++ b/samples/app/build.gradle @@ -53,7 +53,6 @@ android { } dependencies { - implementation fileTree(dir: 'libs', include: '*.jar') implementation sdkLibraries.kotlin implementation sdkLibrariesSupport.recyclerView implementation sdkLibrariesSupport.appCompat @@ -62,5 +61,4 @@ dependencies { implementation project(':libapi-sdk-core') implementation project(':libapi-sdk-api') - //implementation 'com.vk:androidsdk:2.0.0' } diff --git a/samples/app/sdk/src/main/res/values/strings.xml b/samples/app/sdk/src/main/res/values/strings.xml index a09619d994..7298c9baa9 100644 --- a/samples/app/sdk/src/main/res/values/strings.xml +++ b/samples/app/sdk/src/main/res/values/strings.xml @@ -2,7 +2,7 @@ Войти Выйти - Post on wall + Отправить на стену Ваше сообщение Posted diff --git a/samples/app/src/main/java/com/vk/sdk/sample/SampleApplication.kt b/samples/app/src/main/java/com/vk/sdk/sample/SampleApplication.kt index 61301210ff..3d94fca843 100644 --- a/samples/app/src/main/java/com/vk/sdk/sample/SampleApplication.kt +++ b/samples/app/src/main/java/com/vk/sdk/sample/SampleApplication.kt @@ -26,6 +26,7 @@ package com.vk.sdk.sample import android.app.Application import com.vk.api.sdk.VK +import com.vk.api.sdk.VKApiConfig import com.vk.api.sdk.VKTokenExpiredHandler class SampleApplication: Application() { diff --git a/samples/app/src/main/java/com/vk/sdk/sample/UserActivity.kt b/samples/app/src/main/java/com/vk/sdk/sample/UserActivity.kt index d132bb57d6..f60acd27f9 100644 --- a/samples/app/src/main/java/com/vk/sdk/sample/UserActivity.kt +++ b/samples/app/src/main/java/com/vk/sdk/sample/UserActivity.kt @@ -39,8 +39,8 @@ import androidx.recyclerview.widget.RecyclerView import com.squareup.picasso.Picasso import com.vk.api.sdk.VK import com.vk.api.sdk.VKApiCallback -import com.vk.sdk.api.friends.dto.FriendsGetFieldsResponseDto -import com.vk.sdk.api.friends.methods.FriendsGetFields +import com.vk.sdk.api.friends.FriendsService +import com.vk.sdk.api.friends.dto.FriendsGetFieldsResponse import com.vk.sdk.api.users.dto.UsersFields import com.vk.sdk.sample.models.VKUser import com.vk.sdk.sample.requests.VKUsersCommand @@ -96,8 +96,8 @@ class UserActivity: Activity() { private fun requestFriends() { val fields = listOf(UsersFields.PHOTO_200) - VK.execute(FriendsGetFields(fields = fields), object: VKApiCallback { - override fun success(result: FriendsGetFieldsResponseDto) { + VK.execute(FriendsService().friendsGet(fields = fields), object: VKApiCallback { + override fun success(result: FriendsGetFieldsResponse) { val friends = result.items if (!isFinishing && friends.isNotEmpty()) { val vkUsers = friends.map { friend -> diff --git a/samples/app/src/main/res/values-es/strings.xml b/samples/app/src/main/res/values-es/strings.xml new file mode 100644 index 0000000000..3d25d4fda2 --- /dev/null +++ b/samples/app/src/main/res/values-es/strings.xml @@ -0,0 +1,8 @@ + + + Войти + Выйти + Отправить на стену + Ваше сообщение + Запись опубликована + diff --git a/samples/app/src/main/res/values-kk/strings.xml b/samples/app/src/main/res/values-kk/strings.xml new file mode 100644 index 0000000000..3d25d4fda2 --- /dev/null +++ b/samples/app/src/main/res/values-kk/strings.xml @@ -0,0 +1,8 @@ + + + Войти + Выйти + Отправить на стену + Ваше сообщение + Запись опубликована + diff --git a/samples/app/src/main/res/values-pt/strings.xml b/samples/app/src/main/res/values-pt/strings.xml new file mode 100644 index 0000000000..3d25d4fda2 --- /dev/null +++ b/samples/app/src/main/res/values-pt/strings.xml @@ -0,0 +1,8 @@ + + + Войти + Выйти + Отправить на стену + Ваше сообщение + Запись опубликована + diff --git a/samples/app/src/main/res/values-ru/strings.xml b/samples/app/src/main/res/values-ru/strings.xml index 3d25d4fda2..d4d2d695f0 100644 --- a/samples/app/src/main/res/values-ru/strings.xml +++ b/samples/app/src/main/res/values-ru/strings.xml @@ -5,4 +5,5 @@ Отправить на стену Ваше сообщение Запись опубликована + VK SDK sample diff --git a/samples/app/src/main/res/values-uk/strings.xml b/samples/app/src/main/res/values-uk/strings.xml new file mode 100644 index 0000000000..3d25d4fda2 --- /dev/null +++ b/samples/app/src/main/res/values-uk/strings.xml @@ -0,0 +1,8 @@ + + + Войти + Выйти + Отправить на стену + Ваше сообщение + Запись опубликована + diff --git a/samples/app/src/main/res/values/integers.xml b/samples/app/src/main/res/values/integers.xml new file mode 100644 index 0000000000..356f02fdd2 --- /dev/null +++ b/samples/app/src/main/res/values/integers.xml @@ -0,0 +1,4 @@ + + + 0 //put your app id here + \ No newline at end of file diff --git a/samples/app/src/main/res/values/strings.xml b/samples/app/src/main/res/values/strings.xml index 4a7ac7d9f5..3d25d4fda2 100644 --- a/samples/app/src/main/res/values/strings.xml +++ b/samples/app/src/main/res/values/strings.xml @@ -1,11 +1,8 @@ - VK SDK sample - Login - Logout - Send to my wall - Your message - Post has been published - - 6681226 + Войти + Выйти + Отправить на стену + Ваше сообщение + Запись опубликована diff --git a/vk-sdk-api/README.md b/vk-sdk-api/README.md index d74e99a23e..ea5a57a56e 100644 --- a/vk-sdk-api/README.md +++ b/vk-sdk-api/README.md @@ -1,12 +1,4 @@ -VK SDK api for Android +VK SDK generated api for Android ========== -Current version is 5.126 - -there are 3 packages now - -dto - all needed dto objects -responses - all possible responses object -methods - all methods except: newsfeed.get, newsfeed.getRecommended, newfeed.getComments, users.getSubscriptions, newsfeed.getSuggestedSources - -It will be handled in future releases \ No newline at end of file +Current generated version is 5.130 \ No newline at end of file diff --git a/vk-sdk-api/build.gradle b/vk-sdk-api/build.gradle index 5031180909..f7d7635b9f 100644 --- a/vk-sdk-api/build.gradle +++ b/vk-sdk-api/build.gradle @@ -3,6 +3,12 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply from: "../dependencies.gradle" +version = sdkVersions.name +group = 'com.vk' +sdkPublish.POM_ARTIFACT_ID = sdkPublish.POM_API_ARTIFACT_ID +sdkPublish.POM_NAME = sdkPublish.POM_API_NAME +sdkPublish.POM_DESCRIPTION = sdkPublish.POM_API_DESCRIPTION + android { compileSdkVersion "$sdkVersions.compileSdk".toInteger() buildToolsVersion "$sdkVersions.buildTools" @@ -24,9 +30,16 @@ android { } } +configurations { + // Used for correct javadoc generation + javadocDeps +} + dependencies { implementation project(':libapi-sdk-core') implementation sdkLibraries.kotlin implementation sdkLibraries.gson } + +apply from: "../publish.gradle" diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ApiResponseParser.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ApiResponseParser.kt new file mode 100644 index 0000000000..dca1fb3f3a --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ApiResponseParser.kt @@ -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 com.google.gson.JsonElement + +internal fun interface ApiResponseParser { + fun parseResponse(json: JsonElement): T +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/GsonHolder.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/GsonHolder.kt index 4e0ef5e0f2..35e6bcc0de 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/GsonHolder.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/GsonHolder.kt @@ -29,538 +29,16 @@ package com.vk.sdk.api import com.google.gson.Gson import com.google.gson.GsonBuilder +import com.vk.sdk.api.newsfeed.dto.NewsfeedNewsfeedItem +import com.vk.sdk.api.users.dto.UsersSubscriptionsItem object GsonHolder { - val gson: Gson by lazy { gsonBuilder.create() } - - val gsonBuilder: GsonBuilder by lazy { makeBuilder() } - - private fun makeBuilder(): GsonBuilder { - val builder = GsonBuilder() - builder.registerTypeAdapter(com.vk.sdk.api.calls.dto.CallsEndState::class.java, - com.vk.sdk.api.calls.dto.CallsEndState.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetStatisticsStatsFields::class.java, - com.vk.sdk.api.ads.dto.AdsGetStatisticsStatsFields.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetStatisticsPeriod::class.java, - com.vk.sdk.api.ads.dto.AdsGetStatisticsPeriod.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsAdStatus::class.java, - com.vk.sdk.api.ads.dto.AdsAdStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetUploadURLAdFormat::class.java, - com.vk.sdk.api.ads.dto.AdsGetUploadURLAdFormat.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetCampaignsFields::class.java, - com.vk.sdk.api.ads.dto.AdsGetCampaignsFields.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsAccessRolePublic::class.java, - com.vk.sdk.api.ads.dto.AdsAccessRolePublic.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetDemographicsIdsType::class.java, - com.vk.sdk.api.ads.dto.AdsGetDemographicsIdsType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsAdApproved::class.java, - com.vk.sdk.api.ads.dto.AdsAdApproved.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsLookalikeRequest.SourceType::class.java, - com.vk.sdk.api.ads.dto.AdsLookalikeRequest.SourceType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsLookalikeRequest.Status::class.java, - com.vk.sdk.api.ads.dto.AdsLookalikeRequest.Status.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetSuggestionsLang::class.java, - com.vk.sdk.api.ads.dto.AdsGetSuggestionsLang.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsCheckLinkLinkType::class.java, - com.vk.sdk.api.ads.dto.AdsCheckLinkLinkType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetTargetingStatsAdFormat::class.java, - com.vk.sdk.api.ads.dto.AdsGetTargetingStatsAdFormat.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsCriteriaSex::class.java, - com.vk.sdk.api.ads.dto.AdsCriteriaSex.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsObjectType::class.java, - com.vk.sdk.api.ads.dto.AdsObjectType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsTargSuggestionsSchoolsType::class.java, - com.vk.sdk.api.ads.dto.AdsTargSuggestionsSchoolsType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsCampaignStatus::class.java, - com.vk.sdk.api.ads.dto.AdsCampaignStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsStatsSexValue::class.java, - com.vk.sdk.api.ads.dto.AdsStatsSexValue.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetPostsReachIdsType::class.java, - com.vk.sdk.api.ads.dto.AdsGetPostsReachIdsType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetSuggestionsSection::class.java, - com.vk.sdk.api.ads.dto.AdsGetSuggestionsSection.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsAccessRole::class.java, - com.vk.sdk.api.ads.dto.AdsAccessRole.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsAccountType::class.java, - com.vk.sdk.api.ads.dto.AdsAccountType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsAdCostType::class.java, - com.vk.sdk.api.ads.dto.AdsAdCostType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetDemographicsPeriod::class.java, - com.vk.sdk.api.ads.dto.AdsGetDemographicsPeriod.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetStatisticsIdsType::class.java, - com.vk.sdk.api.ads.dto.AdsGetStatisticsIdsType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsCampaignType::class.java, - com.vk.sdk.api.ads.dto.AdsCampaignType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoSearchSort::class.java, - com.vk.sdk.api.video.dto.VideoSearchSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoSearchFilters::class.java, - com.vk.sdk.api.video.dto.VideoSearchFilters.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoEditAlbumPrivacy::class.java, - com.vk.sdk.api.video.dto.VideoEditAlbumPrivacy.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoVideo.Type::class.java, - com.vk.sdk.api.video.dto.VideoVideo.Type.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoVideo.LiveStatus::class.java, - com.vk.sdk.api.video.dto.VideoVideo.LiveStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoGetCommentsSort::class.java, - com.vk.sdk.api.video.dto.VideoGetCommentsSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoReportCommentReason::class.java, - com.vk.sdk.api.video.dto.VideoReportCommentReason.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoRestrictionButton.Action::class.java, - com.vk.sdk.api.video.dto.VideoRestrictionButton.Action.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoVideoFull.Type::class.java, - com.vk.sdk.api.video.dto.VideoVideoFull.Type.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoVideoFull.LiveStatus::class.java, - com.vk.sdk.api.video.dto.VideoVideoFull.LiveStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoReportReason::class.java, - com.vk.sdk.api.video.dto.VideoReportReason.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.video.dto.VideoAddAlbumPrivacy::class.java, - com.vk.sdk.api.video.dto.VideoAddAlbumPrivacy.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.wall.dto.WallGetCommentsSort::class.java, - com.vk.sdk.api.wall.dto.WallGetCommentsSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.wall.dto.WallWallpostAttachmentType::class.java, - com.vk.sdk.api.wall.dto.WallWallpostAttachmentType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.wall.dto.WallPostType::class.java, - com.vk.sdk.api.wall.dto.WallPostType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.wall.dto.WallCommentAttachmentType::class.java, - com.vk.sdk.api.wall.dto.WallCommentAttachmentType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.wall.dto.WallReportPostReason::class.java, - com.vk.sdk.api.wall.dto.WallReportPostReason.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.wall.dto.WallGetFilter::class.java, - com.vk.sdk.api.wall.dto.WallGetFilter.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.wall.dto.WallPostSourceType::class.java, - com.vk.sdk.api.wall.dto.WallPostSourceType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.wall.dto.WallWallpostDonut.EditMode::class.java, - com.vk.sdk.api.wall.dto.WallWallpostDonut.EditMode.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.wall.dto.WallReportCommentReason::class.java, - com.vk.sdk.api.wall.dto.WallReportCommentReason.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesGetHistoryAttachmentsMediaType::class.java, - com.vk.sdk.api.messages.dto.MessagesGetHistoryAttachmentsMediaType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangeInfo::class.java, - com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangeInfo.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.Call::class.java, - com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.Call.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.UseMassMentions::class.java, - com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.UseMassMentions.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangePin::class.java, - com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangePin.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangeAdmins::class.java, - com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangeAdmins.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.Invite::class.java, - com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.Invite.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.SeeInviteLink::class.java, - com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.SeeInviteLink.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesConversation.SpecialServiceType::class.java, - com.vk.sdk.api.messages.dto.MessagesConversation.SpecialServiceType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesConversationPeerType::class.java, - com.vk.sdk.api.messages.dto.MessagesConversationPeerType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesGetIntentUsersIntent::class.java, - com.vk.sdk.api.messages.dto.MessagesGetIntentUsersIntent.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesGetHistoryRev::class.java, - com.vk.sdk.api.messages.dto.MessagesGetHistoryRev.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesKeyboardButton.Color::class.java, - com.vk.sdk.api.messages.dto.MessagesKeyboardButton.Color.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsState::class.java, - com.vk.sdk.api.messages.dto.MessagesChatSettingsState.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesSendIntent::class.java, - com.vk.sdk.api.messages.dto.MessagesSendIntent.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesSetActivityType::class.java, - com.vk.sdk.api.messages.dto.MessagesSetActivityType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesTemplateActionTypeNames::class.java, - com.vk.sdk.api.messages.dto.MessagesTemplateActionTypeNames.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesGetConversationsFilter::class.java, - com.vk.sdk.api.messages.dto.MessagesGetConversationsFilter.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.owner.dto.OwnerState.State::class.java, - com.vk.sdk.api.owner.dto.OwnerState.State.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.donut.dto.DonutDonatorSubscriptionInfo.Status::class.java, - com.vk.sdk.api.donut.dto.DonutDonatorSubscriptionInfo.Status.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.board.dto.BoardDefaultOrder::class.java, - com.vk.sdk.api.board.dto.BoardDefaultOrder.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.board.dto.BoardGetTopicsOrder::class.java, - com.vk.sdk.api.board.dto.BoardGetTopicsOrder.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.board.dto.BoardGetTopicsPreview::class.java, - com.vk.sdk.api.board.dto.BoardGetTopicsPreview.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.board.dto.BoardGetCommentsSort::class.java, - com.vk.sdk.api.board.dto.BoardGetCommentsSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.likes.dto.LikesType::class.java, - com.vk.sdk.api.likes.dto.LikesType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.likes.dto.LikesGetListFilter::class.java, - com.vk.sdk.api.likes.dto.LikesGetListFilter.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.likes.dto.LikesGetListFriendsOnly::class.java, - com.vk.sdk.api.likes.dto.LikesGetListFriendsOnly.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.auth.dto.AuthRestoreResponseDto.Success::class.java, - com.vk.sdk.api.auth.dto.AuthRestoreResponseDto.Success.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.appWidgets.dto.AppWidgetsGetAppImageUploadServerImageType::class.java, - com.vk.sdk.api.appWidgets.dto.AppWidgetsGetAppImageUploadServerImageType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.appWidgets.dto.AppWidgetsGetAppImagesImageType::class.java, - com.vk.sdk.api.appWidgets.dto.AppWidgetsGetAppImagesImageType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.appWidgets.dto.AppWidgetsGetGroupImagesImageType::class.java, - com.vk.sdk.api.appWidgets.dto.AppWidgetsGetGroupImagesImageType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.appWidgets.dto.AppWidgetsUpdateType::class.java, - com.vk.sdk.api.appWidgets.dto.AppWidgetsUpdateType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.appWidgets.dto.AppWidgetsGetGroupImageUploadServerImageType::class.java, - com.vk.sdk.api.appWidgets.dto.AppWidgetsGetGroupImageUploadServerImageType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveGetPagesType::class.java, - com.vk.sdk.api.fave.dto.FaveGetPagesType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FavePageType::class.java, - com.vk.sdk.api.fave.dto.FavePageType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveAddTagPosition::class.java, - com.vk.sdk.api.fave.dto.FaveAddTagPosition.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveBookmarkType::class.java, - com.vk.sdk.api.fave.dto.FaveBookmarkType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveRemoveClassifiedItemSource::class.java, - com.vk.sdk.api.fave.dto.FaveRemoveClassifiedItemSource.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveSetTagsItemType::class.java, - com.vk.sdk.api.fave.dto.FaveSetTagsItemType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveGetItemType::class.java, - com.vk.sdk.api.fave.dto.FaveGetItemType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveAddClassifiedItemSource::class.java, - com.vk.sdk.api.fave.dto.FaveAddClassifiedItemSource.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.polls.dto.PollsGetByIdNameCase::class.java, - com.vk.sdk.api.polls.dto.PollsGetByIdNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.polls.dto.PollsBackground.Type::class.java, - com.vk.sdk.api.polls.dto.PollsBackground.Type.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.polls.dto.PollsCreateBackgroundId::class.java, - com.vk.sdk.api.polls.dto.PollsCreateBackgroundId.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.polls.dto.PollsEditBackgroundId::class.java, - com.vk.sdk.api.polls.dto.PollsEditBackgroundId.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.polls.dto.PollsGetVotersNameCase::class.java, - com.vk.sdk.api.polls.dto.PollsGetVotersNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.utils.dto.UtilsDomainResolvedType::class.java, - com.vk.sdk.api.utils.dto.UtilsDomainResolvedType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.utils.dto.UtilsGetLinkStatsInterval::class.java, - com.vk.sdk.api.utils.dto.UtilsGetLinkStatsInterval.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.utils.dto.UtilsLinkCheckedStatus::class.java, - com.vk.sdk.api.utils.dto.UtilsLinkCheckedStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.utils.dto.UtilsGetLinkStatsSource::class.java, - com.vk.sdk.api.utils.dto.UtilsGetLinkStatsSource.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsOwnerXtrBanInfoType::class.java, - com.vk.sdk.api.groups.dto.GroupsOwnerXtrBanInfoType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupSubject::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupSubject.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsRoleOptions::class.java, - com.vk.sdk.api.groups.dto.GroupsRoleOptions.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupAdminLevel::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupAdminLevel.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupAccess::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupAccess.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsMarketState::class.java, - com.vk.sdk.api.groups.dto.GroupsMarketState.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsBanInfoReason::class.java, - com.vk.sdk.api.groups.dto.GroupsBanInfoReason.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupMarketCurrency::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupMarketCurrency.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupFullMemberStatus::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupFullMemberStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsMemberRoleStatus::class.java, - com.vk.sdk.api.groups.dto.GroupsMemberRoleStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupPhotos::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupPhotos.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupVideo::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupVideo.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsSearchSort::class.java, - com.vk.sdk.api.groups.dto.GroupsSearchSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsSettingsTwitter.Status::class.java, - com.vk.sdk.api.groups.dto.GroupsSettingsTwitter.Status.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsFilter::class.java, - com.vk.sdk.api.groups.dto.GroupsFilter.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupFullAgeLimits::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupFullAgeLimits.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupDocs::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupDocs.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupAudio::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupAudio.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupType::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGetMembersFilter::class.java, - com.vk.sdk.api.groups.dto.GroupsGetMembersFilter.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsAddressWorkInfoStatus::class.java, - com.vk.sdk.api.groups.dto.GroupsAddressWorkInfoStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsUserXtrRole.WallDefault::class.java, - com.vk.sdk.api.groups.dto.GroupsUserXtrRole.WallDefault.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupWiki::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupWiki.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsTagAddTagColor::class.java, - com.vk.sdk.api.groups.dto.GroupsTagAddTagColor.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsFields::class.java, - com.vk.sdk.api.groups.dto.GroupsFields.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupFullMainSection::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupFullMainSection.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupIsClosed::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupIsClosed.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupFull.Wall::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupFull.Wall.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsCallbackServer.Status::class.java, - com.vk.sdk.api.groups.dto.GroupsCallbackServer.Status.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsMemberRolePermission::class.java, - com.vk.sdk.api.groups.dto.GroupsMemberRolePermission.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupRole::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupRole.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsCreateSubtype::class.java, - com.vk.sdk.api.groups.dto.GroupsCreateSubtype.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsCreateType::class.java, - com.vk.sdk.api.groups.dto.GroupsCreateType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsSearchType::class.java, - com.vk.sdk.api.groups.dto.GroupsSearchType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupTopics::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupTopics.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsToggleMarketState::class.java, - com.vk.sdk.api.groups.dto.GroupsToggleMarketState.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGetMembersSort::class.java, - com.vk.sdk.api.groups.dto.GroupsGetMembersSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsAddAddressWorkInfoStatus::class.java, - com.vk.sdk.api.groups.dto.GroupsAddAddressWorkInfoStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsTagBindAct::class.java, - com.vk.sdk.api.groups.dto.GroupsTagBindAct.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupTag.Color::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupTag.Color.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsEditAddressWorkInfoStatus::class.java, - com.vk.sdk.api.groups.dto.GroupsEditAddressWorkInfoStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsOnlineStatusType::class.java, - com.vk.sdk.api.groups.dto.GroupsOnlineStatusType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupWall::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupWall.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsEditAgeLimits::class.java, - com.vk.sdk.api.groups.dto.GroupsEditAgeLimits.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupSuggestedPrivacy::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupSuggestedPrivacy.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGetInvitedUsersNameCase::class.java, - com.vk.sdk.api.groups.dto.GroupsGetInvitedUsersNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.groups.dto.GroupsGroupAgeLimits::class.java, - com.vk.sdk.api.groups.dto.GroupsGroupAgeLimits.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.docs.dto.DocsGetType::class.java, - com.vk.sdk.api.docs.dto.DocsGetType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.docs.dto.DocsGetMessagesUploadServerType::class.java, - com.vk.sdk.api.docs.dto.DocsGetMessagesUploadServerType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.docs.dto.DocsDocAttachmentType::class.java, - com.vk.sdk.api.docs.dto.DocsDocAttachmentType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.streaming.dto.StreamingGetStatsInterval::class.java, - com.vk.sdk.api.streaming.dto.StreamingGetStatsInterval.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.streaming.dto.StreamingSetSettingsMonthlyTier::class.java, - com.vk.sdk.api.streaming.dto.StreamingSetSettingsMonthlyTier.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.streaming.dto.StreamingGetStatsType::class.java, - com.vk.sdk.api.streaming.dto.StreamingGetStatsType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.search.dto.SearchHintType::class.java, - com.vk.sdk.api.search.dto.SearchHintType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.stories.dto.StoriesClickableSticker.Subtype::class.java, - com.vk.sdk.api.stories.dto.StoriesClickableSticker.Subtype.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.stories.dto.StoriesClickableSticker.Style::class.java, - com.vk.sdk.api.stories.dto.StoriesClickableSticker.Style.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.stories.dto.StoriesClickableSticker.Type::class.java, - com.vk.sdk.api.stories.dto.StoriesClickableSticker.Type.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.stories.dto.StoriesFeedItem.Type::class.java, - com.vk.sdk.api.stories.dto.StoriesFeedItem.Type.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.stories.dto.StoriesUploadLinkText::class.java, - com.vk.sdk.api.stories.dto.StoriesUploadLinkText.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.stories.dto.StoriesStoryStatsState::class.java, - com.vk.sdk.api.stories.dto.StoriesStoryStatsState.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.stories.dto.StoriesStoryType::class.java, - com.vk.sdk.api.stories.dto.StoriesStoryType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.notes.dto.NotesGetCommentsSort::class.java, - com.vk.sdk.api.notes.dto.NotesGetCommentsSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.notes.dto.NotesGetSort::class.java, - com.vk.sdk.api.notes.dto.NotesGetSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.gifts.dto.GiftsGiftPrivacy::class.java, - com.vk.sdk.api.gifts.dto.GiftsGiftPrivacy.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.addresses.dto.AddressesFields::class.java, - com.vk.sdk.api.addresses.dto.AddressesFields.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersUserType::class.java, - com.vk.sdk.api.users.dto.UsersUserType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersSearchSex::class.java, - com.vk.sdk.api.users.dto.UsersSearchSex.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersOnlineInfo.Status::class.java, - com.vk.sdk.api.users.dto.UsersOnlineInfo.Status.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersSearchSort::class.java, - com.vk.sdk.api.users.dto.UsersSearchSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersUserRelation::class.java, - com.vk.sdk.api.users.dto.UsersUserRelation.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersUserXtrCounters.WallDefault::class.java, - com.vk.sdk.api.users.dto.UsersUserXtrCounters.WallDefault.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersRelative.Type::class.java, - com.vk.sdk.api.users.dto.UsersRelative.Type.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersGetNameCase::class.java, - com.vk.sdk.api.users.dto.UsersGetNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersGetFollowersNameCase::class.java, - com.vk.sdk.api.users.dto.UsersGetFollowersNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersReportType::class.java, - com.vk.sdk.api.users.dto.UsersReportType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersUserFull.WallDefault::class.java, - com.vk.sdk.api.users.dto.UsersUserFull.WallDefault.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersFields::class.java, - com.vk.sdk.api.users.dto.UsersFields.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.users.dto.UsersSearchStatus::class.java, - com.vk.sdk.api.users.dto.UsersSearchStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.market.dto.MarketSearchSort::class.java, - com.vk.sdk.api.market.dto.MarketSearchSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.market.dto.MarketSearchRev::class.java, - com.vk.sdk.api.market.dto.MarketSearchRev.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.market.dto.MarketMarketItemAvailability::class.java, - com.vk.sdk.api.market.dto.MarketMarketItemAvailability.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.market.dto.MarketSearchStatus::class.java, - com.vk.sdk.api.market.dto.MarketSearchStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.market.dto.MarketGetCommentsSort::class.java, - com.vk.sdk.api.market.dto.MarketGetCommentsSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.market.dto.MarketReportCommentReason::class.java, - com.vk.sdk.api.market.dto.MarketReportCommentReason.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.market.dto.MarketReportReason::class.java, - com.vk.sdk.api.market.dto.MarketReportReason.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.callback.dto.CallbackGroupOfficerRole::class.java, - com.vk.sdk.api.callback.dto.CallbackGroupOfficerRole.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.callback.dto.CallbackMessageType::class.java, - com.vk.sdk.api.callback.dto.CallbackMessageType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.callback.dto.CallbackLikeAddRemove.ObjectType::class.java, - com.vk.sdk.api.callback.dto.CallbackLikeAddRemove.ObjectType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.callback.dto.CallbackGroupMarket::class.java, - com.vk.sdk.api.callback.dto.CallbackGroupMarket.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.callback.dto.CallbackGroupJoinType::class.java, - com.vk.sdk.api.callback.dto.CallbackGroupJoinType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsUserXtrLists.WallDefault::class.java, - com.vk.sdk.api.friends.dto.FriendsUserXtrLists.WallDefault.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsSearchNameCase::class.java, - com.vk.sdk.api.friends.dto.FriendsSearchNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsGetSuggestionsNameCase::class.java, - com.vk.sdk.api.friends.dto.FriendsGetSuggestionsNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsGetRequestsSort::class.java, - com.vk.sdk.api.friends.dto.FriendsGetRequestsSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsUserXtrPhone.WallDefault::class.java, - com.vk.sdk.api.friends.dto.FriendsUserXtrPhone.WallDefault.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsGetOrder::class.java, - com.vk.sdk.api.friends.dto.FriendsGetOrder.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsGetNameCase::class.java, - com.vk.sdk.api.friends.dto.FriendsGetNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsGetSuggestionsFilter::class.java, - com.vk.sdk.api.friends.dto.FriendsGetSuggestionsFilter.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsAddResponseDto::class.java, - com.vk.sdk.api.friends.dto.FriendsAddResponseDto.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsDeleteResponseDto.FriendDeleted::class.java, - com.vk.sdk.api.friends.dto.FriendsDeleteResponseDto.FriendDeleted.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsDeleteResponseDto.InRequestDeleted::class.java, - com.vk.sdk.api.friends.dto.FriendsDeleteResponseDto.InRequestDeleted.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsDeleteResponseDto.SuggestionDeleted::class.java, - com.vk.sdk.api.friends.dto.FriendsDeleteResponseDto.SuggestionDeleted.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsDeleteResponseDto.OutRequestDeleted::class.java, - com.vk.sdk.api.friends.dto.FriendsDeleteResponseDto.OutRequestDeleted.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.friends.dto.FriendsFriendStatusStatus::class.java, - com.vk.sdk.api.friends.dto.FriendsFriendStatusStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.orders.dto.OrdersChangeStateAction::class.java, - com.vk.sdk.api.orders.dto.OrdersChangeStateAction.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountGetInfoFields::class.java, - com.vk.sdk.api.account.dto.AccountGetInfoFields.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountPushParamsMode::class.java, - com.vk.sdk.api.account.dto.AccountPushParamsMode.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountSaveProfileInfoSex::class.java, - com.vk.sdk.api.account.dto.AccountSaveProfileInfoSex.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountSaveProfileInfoRelation::class.java, - com.vk.sdk.api.account.dto.AccountSaveProfileInfoRelation.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountSaveProfileInfoBdateVisibility::class.java, - com.vk.sdk.api.account.dto.AccountSaveProfileInfoBdateVisibility.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountNameRequestStatus::class.java, - com.vk.sdk.api.account.dto.AccountNameRequestStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountOffer.LinkType::class.java, - com.vk.sdk.api.account.dto.AccountOffer.LinkType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountPushParamsSettings::class.java, - com.vk.sdk.api.account.dto.AccountPushParamsSettings.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountPushParamsOnoff::class.java, - com.vk.sdk.api.account.dto.AccountPushParamsOnoff.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.account.dto.AccountGetCountersFilter::class.java, - com.vk.sdk.api.account.dto.AccountGetCountersFilter.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.photos.dto.PhotosReportReason::class.java, - com.vk.sdk.api.photos.dto.PhotosReportReason.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.photos.dto.PhotosPhotoSizesType::class.java, - com.vk.sdk.api.photos.dto.PhotosPhotoSizesType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.photos.dto.PhotosGetCommentsSort::class.java, - com.vk.sdk.api.photos.dto.PhotosGetCommentsSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.photos.dto.PhotosTagsSuggestionItemButton.Action::class.java, - com.vk.sdk.api.photos.dto.PhotosTagsSuggestionItemButton.Action.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.photos.dto.PhotosTagsSuggestionItemButton.Style::class.java, - com.vk.sdk.api.photos.dto.PhotosTagsSuggestionItemButton.Style.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.photos.dto.PhotosReportCommentReason::class.java, - com.vk.sdk.api.photos.dto.PhotosReportCommentReason.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.photos.dto.PhotosImageType::class.java, - com.vk.sdk.api.photos.dto.PhotosImageType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.pages.dto.PagesPrivacySettings::class.java, - com.vk.sdk.api.pages.dto.PagesPrivacySettings.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.pages.dto.PagesSaveAccessView::class.java, - com.vk.sdk.api.pages.dto.PagesSaveAccessView.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.pages.dto.PagesSaveAccessEdit::class.java, - com.vk.sdk.api.pages.dto.PagesSaveAccessEdit.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsGetNameCase::class.java, - com.vk.sdk.api.apps.dto.AppsGetNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsSendRequestType::class.java, - com.vk.sdk.api.apps.dto.AppsSendRequestType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsGetLeaderboardType::class.java, - com.vk.sdk.api.apps.dto.AppsGetLeaderboardType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsAppLeaderboardType::class.java, - com.vk.sdk.api.apps.dto.AppsAppLeaderboardType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsScope.Name::class.java, - com.vk.sdk.api.apps.dto.AppsScope.Name.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsGetFriendsListType::class.java, - com.vk.sdk.api.apps.dto.AppsGetFriendsListType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsGetScopesType::class.java, - com.vk.sdk.api.apps.dto.AppsGetScopesType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsGetCatalogSort::class.java, - com.vk.sdk.api.apps.dto.AppsGetCatalogSort.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsGetPlatform::class.java, - com.vk.sdk.api.apps.dto.AppsGetPlatform.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.apps.dto.AppsGetCatalogFilter::class.java, - com.vk.sdk.api.apps.dto.AppsGetCatalogFilter.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.notifications.dto.NotificationsSendMessageError.Code::class.java, - com.vk.sdk.api.notifications.dto.NotificationsSendMessageError.Code.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.notifications.dto.NotificationsGetFilters::class.java, - com.vk.sdk.api.notifications.dto.NotificationsGetFilters.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.notifications.dto.NotificationsNotificationParent.Type::class.java, - com.vk.sdk.api.notifications.dto.NotificationsNotificationParent.Type.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.notifications.dto.NotificationsNotificationParent.LiveStatus::class.java, - com.vk.sdk.api.notifications.dto.NotificationsNotificationParent.LiveStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.base.dto.BaseOkResponseDto::class.java, - com.vk.sdk.api.base.dto.BaseOkResponseDto.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.base.dto.BaseUserGroupFields::class.java, - com.vk.sdk.api.base.dto.BaseUserGroupFields.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.base.dto.BaseLinkButtonStyle::class.java, - com.vk.sdk.api.base.dto.BaseLinkButtonStyle.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.base.dto.BaseSex::class.java, - com.vk.sdk.api.base.dto.BaseSex.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.base.dto.BasePropertyExists::class.java, - com.vk.sdk.api.base.dto.BasePropertyExists.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.base.dto.BaseStickerAnimation.Type::class.java, - com.vk.sdk.api.base.dto.BaseStickerAnimation.Type.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.base.dto.BaseBoolInt::class.java, - com.vk.sdk.api.base.dto.BaseBoolInt.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.base.dto.BaseLinkButtonActionType::class.java, - com.vk.sdk.api.base.dto.BaseLinkButtonActionType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.base.dto.BaseLinkProductStatus::class.java, - com.vk.sdk.api.base.dto.BaseLinkProductStatus.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.stats.dto.StatsGetInterval::class.java, - com.vk.sdk.api.stats.dto.StatsGetInterval.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.widgets.dto.WidgetsCommentMediaType::class.java, - com.vk.sdk.api.widgets.dto.WidgetsCommentMediaType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.store.dto.StoreProduct.Type::class.java, - com.vk.sdk.api.store.dto.StoreProduct.Type.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostFeedbackType::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostFeedbackType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigest.Template::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigest.Template.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedNewsfeedItemType::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedNewsfeedItemType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedUnsubscribeType::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedUnsubscribeType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedFilters::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedFilters.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestButton.Style::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestButton.Style.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestHeader.Style::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestHeader.Style.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostType::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostType.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFooter.Style::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFooter.Style.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedNameCase::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedNameCase.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedCommentsFilters::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedCommentsFilters.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFullItem.Style::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFullItem.Style.Serializer()) - builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedIgnoreItemType::class.java, - com.vk.sdk.api.newsfeed.dto.NewsfeedIgnoreItemType.Serializer()) - return builder + val gson: Gson by lazy { + GsonBuilder() + .registerTypeAdapter(UsersSubscriptionsItem::class.java, + UsersSubscriptionsItem.Deserializer()) + .registerTypeAdapter(NewsfeedNewsfeedItem::class.java, NewsfeedNewsfeedItem.Deserializer()) + .create() } + } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/NewApiRequest.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/NewApiRequest.kt new file mode 100644 index 0000000000..c38df01ebe --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/NewApiRequest.kt @@ -0,0 +1,42 @@ +/** + * 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.google.gson.JsonParser +import com.vk.api.sdk.requests.VKRequest +import kotlin.String + +internal class NewApiRequest internal constructor( + methodName: String, + parser: ApiResponseParser +) : VKRequest(methodName, requestApiVersion = "5.130"), ApiResponseParser by parser { + override fun parse(response: String): T { + val responseJson = JsonParser.parseString(response).asJsonObject.get("response") + return parseResponse(responseJson) + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/AccountService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/AccountService.kt new file mode 100644 index 0000000000..d5f72de3d1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/AccountService.kt @@ -0,0 +1,425 @@ +/** + * 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.account + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.account.dto.AccountAccountCounters +import com.vk.sdk.api.account.dto.AccountChangePasswordResponse +import com.vk.sdk.api.account.dto.AccountGetActiveOffersResponse +import com.vk.sdk.api.account.dto.AccountGetBannedResponse +import com.vk.sdk.api.account.dto.AccountInfo +import com.vk.sdk.api.account.dto.AccountPushSettings +import com.vk.sdk.api.account.dto.AccountSaveProfileInfoResponse +import com.vk.sdk.api.account.dto.AccountUserSettings +import com.vk.sdk.api.account.dto.BdateVisibilityParam +import com.vk.sdk.api.account.dto.FieldsParam +import com.vk.sdk.api.account.dto.FilterParam +import com.vk.sdk.api.account.dto.RelationParam +import com.vk.sdk.api.account.dto.SexParam +import com.vk.sdk.api.base.dto.BaseOkResponse +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class AccountService { + /** + * @param ownerId + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountBan(ownerId: Int? = null): VKRequest = NewApiRequest("account.ban") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + ownerId?.let { addParam("owner_id", it) } + } + + /** + * Changes a user password after access is successfully restored with the + * [vk.com/dev/auth.restore|auth.restore] method. + * + * @param newPassword - New password that will be set as a current + * @param restoreSid - Session id received after the [vk.com/dev/auth.restore|auth.restore] + * method is executed. (If the password is changed right after the access was restored) + * @param changePasswordHash - Hash received after a successful OAuth authorization with a code + * got by SMS. (If the password is changed right after the access was restored) + * @param oldPassword - Current user password. + * @return [VKRequest] with [AccountChangePasswordResponse] + */ + fun accountChangePassword( + newPassword: String, + restoreSid: String? = null, + changePasswordHash: String? = null, + oldPassword: String? = null + ): VKRequest = NewApiRequest("account.changePassword") { + GsonHolder.gson.fromJson(it, AccountChangePasswordResponse::class.java) + } + .apply { + addParam("new_password", newPassword) + restoreSid?.let { addParam("restore_sid", it) } + changePasswordHash?.let { addParam("change_password_hash", it) } + oldPassword?.let { addParam("old_password", it) } + } + + /** + * Returns a list of active ads (offers) which executed by the user will bring him/her + * respective number of votes to his balance in the application. + * + * @param offset + * @param count - Number of results to return. + * @return [VKRequest] with [AccountGetActiveOffersResponse] + */ + fun accountGetActiveOffers(offset: Int? = null, count: Int? = null): + VKRequest = NewApiRequest("account.getActiveOffers") { + GsonHolder.gson.fromJson(it, AccountGetActiveOffersResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Gets settings of the user in this application. + * + * @param userId - User ID whose settings information shall be got. By default: current user. + * @return [VKRequest] with [Int] + */ + fun accountGetAppPermissions(userId: Int): VKRequest = + NewApiRequest("account.getAppPermissions") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("user_id", userId) + } + + /** + * Returns a user's blacklist. + * + * @param offset - Offset needed to return a specific subset of results. + * @param count - Number of results to return. + * @return [VKRequest] with [AccountGetBannedResponse] + */ + fun accountGetBanned(offset: Int? = null, count: Int? = null): + VKRequest = NewApiRequest("account.getBanned") { + GsonHolder.gson.fromJson(it, AccountGetBannedResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns non-null values of user counters. + * + * @param filter - Counters to be returned. + * @return [VKRequest] with [AccountAccountCounters] + */ + fun accountGetCounters(filter: List? = null): VKRequest = + NewApiRequest("account.getCounters") { + GsonHolder.gson.fromJson(it, AccountAccountCounters::class.java) + } + .apply { + val filterJsonConverted = filter?.map { + it.value + } + filterJsonConverted?.let { addParam("filter", it) } + } + + /** + * 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. + * @return [VKRequest] with [AccountInfo] + */ + fun accountGetInfo(fields: List? = null): VKRequest = + NewApiRequest("account.getInfo") { + GsonHolder.gson.fromJson(it, AccountInfo::class.java) + } + .apply { + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns the current account info. + * + * @return [VKRequest] with [AccountUserSettings] + */ + fun accountGetProfileInfo(): VKRequest = + NewApiRequest("account.getProfileInfo") { + GsonHolder.gson.fromJson(it, AccountUserSettings::class.java) + } + + /** + * Gets settings of push notifications. + * + * @param deviceId - Unique device ID. + * @return [VKRequest] with [AccountPushSettings] + */ + fun accountGetPushSettings(deviceId: String? = null): VKRequest = + NewApiRequest("account.getPushSettings") { + GsonHolder.gson.fromJson(it, AccountPushSettings::class.java) + } + .apply { + deviceId?.let { addParam("device_id", it) } + } + + /** + * Subscribes an iOS/Android/Windows Phone-based device to receive push notifications + * + * @param token - Device token used to send notifications. (for mpns, the token shall be URL for + * sending of notifications) + * @param deviceId - Unique device ID. + * @param deviceModel - String name of device model. + * @param deviceYear - Device year. + * @param systemVersion - String version of device operating system. + * @param settings - Push settings in a [vk.com/dev/push_settings|special format]. + * @param sandbox + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountRegisterDevice( + token: String, + deviceId: String, + deviceModel: String? = null, + deviceYear: Int? = null, + systemVersion: String? = null, + settings: String? = null, + sandbox: Boolean? = null + ): VKRequest = NewApiRequest("account.registerDevice") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("token", token) + addParam("device_id", deviceId) + deviceModel?.let { addParam("device_model", it) } + deviceYear?.let { addParam("device_year", it) } + systemVersion?.let { addParam("system_version", it) } + settings?.let { addParam("settings", it) } + sandbox?.let { addParam("sandbox", it) } + } + + /** + * Edits current profile info. + * + * @param firstName - User first name. + * @param lastName - User last name. + * @param maidenName - User maiden name (female only) + * @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. + * @param sex - User sex. Possible values: , * '1' - female,, * '2' - male. + * @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. + * @param relationPartnerId - ID of the relationship partner. + * @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. + * @param homeTown - User home town. + * @param countryId - User country. + * @param cityId - User city. + * @param status - Status text. + * @return [VKRequest] with [AccountSaveProfileInfoResponse] + */ + fun accountSaveProfileInfo( + firstName: String? = null, + lastName: String? = null, + maidenName: String? = null, + screenName: String? = null, + cancelRequestId: Int? = null, + sex: SexParam? = null, + relation: RelationParam? = null, + relationPartnerId: Int? = null, + bdate: String? = null, + bdateVisibility: BdateVisibilityParam? = null, + homeTown: String? = null, + countryId: Int? = null, + cityId: Int? = null, + status: String? = null + ): VKRequest = NewApiRequest("account.saveProfileInfo") { + GsonHolder.gson.fromJson(it, AccountSaveProfileInfoResponse::class.java) + } + .apply { + firstName?.let { addParam("first_name", it) } + lastName?.let { addParam("last_name", it) } + maidenName?.let { addParam("maiden_name", it) } + screenName?.let { addParam("screen_name", it) } + cancelRequestId?.let { addParam("cancel_request_id", it) } + sex?.let { addParam("sex", it.value) } + relation?.let { addParam("relation", it.value) } + relationPartnerId?.let { addParam("relation_partner_id", it) } + bdate?.let { addParam("bdate", it) } + bdateVisibility?.let { addParam("bdate_visibility", it.value) } + homeTown?.let { addParam("home_town", it) } + countryId?.let { addParam("country_id", it) } + cityId?.let { addParam("city_id", it) } + status?.let { addParam("status", it) } + } + + /** + * Allows to edit the current account info. + * + * @param name - Setting name. + * @param value - Setting value. + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountSetInfo(name: String? = null, value: String? = null): VKRequest = + NewApiRequest("account.setInfo") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + name?.let { addParam("name", it) } + value?.let { addParam("value", it) } + } + + /** + * Sets an application screen name (up to 17 characters), that is shown to the user in the left + * menu. + * + * @param userId - User ID. + * @param name - Application screen name. + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountSetNameInMenu(userId: Int, name: String? = null): VKRequest = + NewApiRequest("account.setNameInMenu") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("user_id", userId) + name?.let { addParam("name", it) } + } + + /** + * Marks a current user as offline. + * + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountSetOffline(): VKRequest = NewApiRequest("account.setOffline") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + + /** + * Marks the current user as online for 15 minutes. + * + * @param voip - '1' if videocalls are available for current device. + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountSetOnline(voip: Boolean? = null): VKRequest = + NewApiRequest("account.setOnline") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + voip?.let { addParam("voip", it) } + } + + /** + * Change push settings. + * + * @param deviceId - Unique device ID. + * @param settings - Push settings in a [vk.com/dev/push_settings|special format]. + * @param key - Notification key. + * @param value - New value for the key in a [vk.com/dev/push_settings|special format]. + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountSetPushSettings( + deviceId: String, + settings: String? = null, + key: String? = null, + value: List? = null + ): VKRequest = NewApiRequest("account.setPushSettings") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("device_id", deviceId) + settings?.let { addParam("settings", it) } + key?.let { addParam("key", it) } + value?.let { addParam("value", it) } + } + + /** + * Mutes push notifications for the set period of time. + * + * @param deviceId - Unique device ID. + * @param time - Time in seconds for what notifications should be disabled. '-1' to disable + * forever. + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * @param sound - '1' - to enable sound in this dialog, '0' - to disable sound. Only if + * 'peer_id' contains user or community ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountSetSilenceMode( + deviceId: String? = null, + time: Int? = null, + peerId: Int? = null, + sound: Int? = null + ): VKRequest = NewApiRequest("account.setSilenceMode") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + deviceId?.let { addParam("device_id", it) } + time?.let { addParam("time", it) } + peerId?.let { addParam("peer_id", it) } + sound?.let { addParam("sound", it) } + } + + /** + * @param ownerId + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountUnban(ownerId: Int? = null): VKRequest = + NewApiRequest("account.unban") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + ownerId?.let { addParam("owner_id", it) } + } + + /** + * Unsubscribes a device from push notifications. + * + * @param deviceId - Unique device ID. + * @param sandbox + * @return [VKRequest] with [BaseOkResponse] + */ + fun accountUnregisterDevice(deviceId: String? = null, sandbox: Boolean? = null): + VKRequest = NewApiRequest("account.unregisterDevice") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + deviceId?.let { addParam("device_id", it) } + sandbox?.let { addParam("sandbox", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountAccountCounters.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountAccountCounters.kt index adb35d2bb4..d8e2f02725 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountAccountCounters.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountAccountCounters.kt @@ -31,54 +31,57 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param appRequests New app requests number - * @param events New events number - * @param faves New faves number - * @param friends New friends requests number - * @param friendsSuggestions New friends suggestions number - * @param friendsRecommendations New friends recommendations number - * @param gifts New gifts number - * @param groups New groups number - * @param menuDiscoverBadge - * @param menuClipsBadge no description - * @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 appRequests - New app requests number + * @param events - New events number + * @param faves - New faves number + * @param friends - New friends requests number + * @param friendsSuggestions - New friends suggestions number + * @param friendsRecommendations - New friends recommendations number + * @param gifts - New gifts number + * @param groups - New groups number + * @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(value="app_requests") + @SerializedName("app_requests") val appRequests: Int? = null, - @SerializedName(value="events") + @SerializedName("events") val events: Int? = null, - @SerializedName(value="faves") + @SerializedName("faves") val faves: Int? = null, - @SerializedName(value="friends") + @SerializedName("friends") val friends: Int? = null, - @SerializedName(value="friends_suggestions") + @SerializedName("friends_suggestions") val friendsSuggestions: Int? = null, - @SerializedName(value="friends_recommendations") + @SerializedName("friends_recommendations") val friendsRecommendations: Int? = null, - @SerializedName(value="gifts") + @SerializedName("gifts") val gifts: Int? = null, - @SerializedName(value="groups") + @SerializedName("groups") val groups: Int? = null, - @SerializedName(value="menu_discover_badge") + @SerializedName("menu_discover_badge") val menuDiscoverBadge: Int? = null, - @SerializedName(value="menu_clips_badge") + @SerializedName("menu_clips_badge") val menuClipsBadge: Int? = null, - @SerializedName(value="messages") + @SerializedName("messages") val messages: Int? = null, - @SerializedName(value="memories") + @SerializedName("memories") val memories: Int? = null, - @SerializedName(value="notes") + @SerializedName("notes") val notes: Int? = null, - @SerializedName(value="notifications") + @SerializedName("notifications") val notifications: Int? = null, - @SerializedName(value="photos") + @SerializedName("photos") val photos: Int? = null, - @SerializedName(value="sdk") - val sdk: Int? = null + @SerializedName("sdk") + val sdk: Int? = null, + @SerializedName("messages_unread_unmuted") + val messagesUnreadUnmuted: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountChangePasswordResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountChangePasswordResponse.kt new file mode 100644 index 0000000000..a4f14012a8 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountChangePasswordResponse.kt @@ -0,0 +1,42 @@ +/** + * 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.account.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param token - New token + * @param secret - New secret + */ +data class AccountChangePasswordResponse( + @SerializedName("token") + val token: String, + @SerializedName("secret") + val secret: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountGetActiveOffersResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountGetActiveOffersResponse.kt new file mode 100644 index 0000000000..b8132cca59 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountGetActiveOffersResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.account.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class AccountGetActiveOffersResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountGetBannedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountGetBannedResponse.kt new file mode 100644 index 0000000000..20a161430f --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountGetBannedResponse.kt @@ -0,0 +1,51 @@ +/** + * 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.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 kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param profiles + * @param groups + */ +data class AccountGetBannedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountInfo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountInfo.kt index 3a7eb9935d..5c9b42c203 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountInfo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountInfo.kt @@ -36,45 +36,45 @@ import kotlin.String import kotlin.collections.List /** - * @param wishlistsAePromoBannerShow no description - * @param twoFaRequired Two factor authentication is enabled - * @param country Country code - * @param httpsRequired Information whether HTTPS-only is enabled - * @param intro Information whether user has been processed intro - * @param showVkAppsIntro no description - * @param miniAppsAdsSlotId Ads slot id for MyTarget - * @param qrPromotion no description - * @param linkRedirects no description - * @param lang Language ID - * @param noWallReplies Information whether wall comments should be hidden - * @param ownPostsDefault Information whether only owners posts should be shown - * @param subscriptions no description + * @param wishlistsAePromoBannerShow + * @param 2faRequired - Two factor authentication is enabled + * @param country - Country code + * @param httpsRequired - Information whether HTTPS-only is enabled + * @param intro - Information whether user has been processed intro + * @param showVkAppsIntro + * @param miniAppsAdsSlotId - Ads slot id for MyTarget + * @param qrPromotion + * @param linkRedirects + * @param lang - Language ID + * @param noWallReplies - Information whether wall comments should be hidden + * @param ownPostsDefault - Information whether only owners posts should be shown + * @param subscriptions */ data class AccountInfo( - @SerializedName(value="wishlists_ae_promo_banner_show") + @SerializedName("wishlists_ae_promo_banner_show") val wishlistsAePromoBannerShow: BaseBoolInt? = null, - @SerializedName(value="2fa_required") - val twoFaRequired: BaseBoolInt? = null, - @SerializedName(value="country") + @SerializedName("2fa_required") + val `2faRequired`: BaseBoolInt? = null, + @SerializedName("country") val country: String? = null, - @SerializedName(value="https_required") + @SerializedName("https_required") val httpsRequired: BaseBoolInt? = null, - @SerializedName(value="intro") + @SerializedName("intro") val intro: BaseBoolInt? = null, - @SerializedName(value="show_vk_apps_intro") + @SerializedName("show_vk_apps_intro") val showVkAppsIntro: Boolean? = null, - @SerializedName(value="mini_apps_ads_slot_id") + @SerializedName("mini_apps_ads_slot_id") val miniAppsAdsSlotId: Int? = null, - @SerializedName(value="qr_promotion") + @SerializedName("qr_promotion") val qrPromotion: Int? = null, - @SerializedName(value="link_redirects") + @SerializedName("link_redirects") val linkRedirects: Any? = null, - @SerializedName(value="lang") + @SerializedName("lang") val lang: Int? = null, - @SerializedName(value="no_wall_replies") + @SerializedName("no_wall_replies") val noWallReplies: BaseBoolInt? = null, - @SerializedName(value="own_posts_default") + @SerializedName("own_posts_default") val ownPostsDefault: BaseBoolInt? = null, - @SerializedName(value="subscriptions") + @SerializedName("subscriptions") val subscriptions: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountNameRequest.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountNameRequest.kt index a9ba6269a6..69043e4625 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountNameRequest.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountNameRequest.kt @@ -32,27 +32,27 @@ import kotlin.Int import kotlin.String /** - * @param firstName First name in request - * @param id Request ID needed to cancel the request - * @param lastName Last name in request - * @param status no description - * @param lang Text to display to user - * @param linkHref href for link in lang field - * @param linkLabel label to display for link in lang field + * @param firstName - First name in request + * @param id - Request ID needed to cancel the request + * @param lastName - Last name in request + * @param status + * @param lang - Text to display to user + * @param linkHref - href for link in lang field + * @param linkLabel - label to display for link in lang field */ data class AccountNameRequest( - @SerializedName(value="first_name") + @SerializedName("first_name") val firstName: String? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="last_name") + @SerializedName("last_name") val lastName: String? = null, - @SerializedName(value="status") + @SerializedName("status") val status: AccountNameRequestStatus? = null, - @SerializedName(value="lang") + @SerializedName("lang") val lang: String? = null, - @SerializedName(value="link_href") + @SerializedName("link_href") val linkHref: String? = null, - @SerializedName(value="link_label") + @SerializedName("link_label") val linkLabel: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountNameRequestStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountNameRequestStatus.kt index ec4eb46af5..0c32c91727 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountNameRequestStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountNameRequestStatus.kt @@ -27,53 +27,33 @@ // ********************************************************************* package com.vk.sdk.api.account.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AccountNameRequestStatus( val value: String ) { + @SerializedName("success") SUCCESS("success"), + @SerializedName("processing") PROCESSING("processing"), + @SerializedName("declined") DECLINED("declined"), + @SerializedName("was_accepted") WAS_ACCEPTED("was_accepted"), + @SerializedName("was_declined") WAS_DECLINED("was_declined"), + @SerializedName("declined_with_link") DECLINED_WITH_LINK("declined_with_link"), + @SerializedName("response") RESPONSE("response"), + @SerializedName("response_with_link") RESPONSE_WITH_LINK("response_with_link"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: AccountNameRequestStatus?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AccountNameRequestStatus { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountOffer.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountOffer.kt index 0f79c60202..68bbca9d15 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountOffer.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountOffer.kt @@ -27,86 +27,61 @@ // ********************************************************************* package com.vk.sdk.api.account.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.Float import kotlin.Int import kotlin.String /** - * @param description Offer description - * @param id Offer ID - * @param img URL of the preview image - * @param instruction Instruction how to process the offer - * @param instructionHtml Instruction how to process the offer (HTML format) - * @param price Offer price - * @param shortDescription Offer short description - * @param tag Offer tag - * @param title Offer title - * @param currencyAmount Currency amount - * @param linkId Link id - * @param linkType Link type + * @param description - Offer description + * @param id - Offer ID + * @param img - URL of the preview image + * @param instruction - Instruction how to process the offer + * @param instructionHtml - Instruction how to process the offer (HTML format) + * @param price - Offer price + * @param shortDescription - Offer short description + * @param tag - Offer tag + * @param title - Offer title + * @param currencyAmount - Currency amount + * @param linkId - Link id + * @param linkType - Link type */ data class AccountOffer( - @SerializedName(value="description") + @SerializedName("description") val description: String? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="img") + @SerializedName("img") val img: String? = null, - @SerializedName(value="instruction") + @SerializedName("instruction") val instruction: String? = null, - @SerializedName(value="instruction_html") + @SerializedName("instruction_html") val instructionHtml: String? = null, - @SerializedName(value="price") + @SerializedName("price") val price: Int? = null, - @SerializedName(value="short_description") + @SerializedName("short_description") val shortDescription: String? = null, - @SerializedName(value="tag") + @SerializedName("tag") val tag: String? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="currency_amount") + @SerializedName("currency_amount") val currencyAmount: Float? = null, - @SerializedName(value="link_id") + @SerializedName("link_id") val linkId: Int? = null, - @SerializedName(value="link_type") - val linkType: LinkType? = null + @SerializedName("link_type") + val linkType: AccountOffer.LinkType? = null ) { enum class LinkType( val value: String ) { + @SerializedName("profile") PROFILE("profile"), + @SerializedName("group") GROUP("group"), + @SerializedName("app") APP("app"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: LinkType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): LinkType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushConversations.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushConversations.kt index 115a2a6a66..0b907c18d6 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushConversations.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushConversations.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param count Items count - * @param items no description + * @param count - Items count + * @param items */ data class AccountPushConversations( - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null, - @SerializedName(value="items") + @SerializedName("items") val items: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushConversationsItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushConversationsItem.kt index e8d884d6a7..fdf72a3fd4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushConversationsItem.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushConversationsItem.kt @@ -32,22 +32,22 @@ import com.vk.sdk.api.base.dto.BaseBoolInt import kotlin.Int /** - * @param disabledUntil Time until that notifications are disabled in seconds - * @param peerId Peer ID - * @param sound Information whether the sound are enabled - * @param disabledMentions Information whether the mentions are disabled - * @param disabledMassMentions Information whether the mass mentions (like '@all', '@online') are + * @param disabledUntil - Time until that notifications are disabled in seconds + * @param peerId - Peer ID + * @param sound - Information whether the sound are enabled + * @param disabledMentions - Information whether the mentions are disabled + * @param disabledMassMentions - Information whether the mass mentions (like '@all', '@online') are * disabled. Can be affected by 'disabled_mentions' */ data class AccountPushConversationsItem( - @SerializedName(value="disabled_until") + @SerializedName("disabled_until") val disabledUntil: Int, - @SerializedName(value="peer_id") + @SerializedName("peer_id") val peerId: Int, - @SerializedName(value="sound") + @SerializedName("sound") val sound: BaseBoolInt, - @SerializedName(value="disabled_mentions") + @SerializedName("disabled_mentions") val disabledMentions: BaseBoolInt? = null, - @SerializedName(value="disabled_mass_mentions") + @SerializedName("disabled_mass_mentions") val disabledMassMentions: BaseBoolInt? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParams.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParams.kt index ddb5989983..fb797ffb58 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParams.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParams.kt @@ -31,63 +31,63 @@ import com.google.gson.annotations.SerializedName import kotlin.collections.List /** - * @param msg no description - * @param chat no description - * @param like no description - * @param repost no description - * @param comment no description - * @param mention no description - * @param reply no description - * @param newPost no description - * @param wallPost no description - * @param wallPublish no description - * @param friend no description - * @param friendFound no description - * @param friendAccepted no description - * @param groupInvite no description - * @param groupAccepted no description - * @param birthday no description - * @param eventSoon no description - * @param appRequest no description - * @param sdkOpen no description + * @param msg + * @param chat + * @param like + * @param repost + * @param comment + * @param mention + * @param reply + * @param newPost + * @param wallPost + * @param wallPublish + * @param friend + * @param friendFound + * @param friendAccepted + * @param groupInvite + * @param groupAccepted + * @param birthday + * @param eventSoon + * @param appRequest + * @param sdkOpen */ data class AccountPushParams( - @SerializedName(value="msg") + @SerializedName("msg") val msg: List? = null, - @SerializedName(value="chat") + @SerializedName("chat") val chat: List? = null, - @SerializedName(value="like") + @SerializedName("like") val like: List? = null, - @SerializedName(value="repost") + @SerializedName("repost") val repost: List? = null, - @SerializedName(value="comment") + @SerializedName("comment") val comment: List? = null, - @SerializedName(value="mention") + @SerializedName("mention") val mention: List? = null, - @SerializedName(value="reply") + @SerializedName("reply") val reply: List? = null, - @SerializedName(value="new_post") + @SerializedName("new_post") val newPost: List? = null, - @SerializedName(value="wall_post") + @SerializedName("wall_post") val wallPost: List? = null, - @SerializedName(value="wall_publish") + @SerializedName("wall_publish") val wallPublish: List? = null, - @SerializedName(value="friend") + @SerializedName("friend") val friend: List? = null, - @SerializedName(value="friend_found") + @SerializedName("friend_found") val friendFound: List? = null, - @SerializedName(value="friend_accepted") + @SerializedName("friend_accepted") val friendAccepted: List? = null, - @SerializedName(value="group_invite") + @SerializedName("group_invite") val groupInvite: List? = null, - @SerializedName(value="group_accepted") + @SerializedName("group_accepted") val groupAccepted: List? = null, - @SerializedName(value="birthday") + @SerializedName("birthday") val birthday: List? = null, - @SerializedName(value="event_soon") + @SerializedName("event_soon") val eventSoon: List? = null, - @SerializedName(value="app_request") + @SerializedName("app_request") val appRequest: List? = null, - @SerializedName(value="sdk_open") + @SerializedName("sdk_open") val sdkOpen: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsMode.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsMode.kt index ad2470a6f5..6993ada551 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsMode.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsMode.kt @@ -27,45 +27,21 @@ // ********************************************************************* package com.vk.sdk.api.account.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AccountPushParamsMode( val value: String ) { + @SerializedName("on") ON("on"), + @SerializedName("off") OFF("off"), + @SerializedName("no_sound") NO_SOUND("no_sound"), + @SerializedName("no_text") NO_TEXT("no_text"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: AccountPushParamsMode?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AccountPushParamsMode { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsOnoff.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsOnoff.kt index bcf7ce8b30..29fe59c560 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsOnoff.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsOnoff.kt @@ -27,41 +27,15 @@ // ********************************************************************* package com.vk.sdk.api.account.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AccountPushParamsOnoff( val value: String ) { + @SerializedName("on") ON("on"), + @SerializedName("off") OFF("off"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: AccountPushParamsOnoff?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AccountPushParamsOnoff { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsSettings.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsSettings.kt index 0a9440475c..6dd045ee1f 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsSettings.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushParamsSettings.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.account.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AccountPushParamsSettings( val value: String ) { + @SerializedName("on") ON("on"), + @SerializedName("off") OFF("off"), + @SerializedName("fr_of_fr") FR_OF_FR("fr_of_fr"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: AccountPushParamsSettings?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AccountPushParamsSettings { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushSettings.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushSettings.kt index 982c9e3b07..81c4a31585 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushSettings.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountPushSettings.kt @@ -32,18 +32,18 @@ import com.vk.sdk.api.base.dto.BaseBoolInt import kotlin.Int /** - * @param disabled Information whether notifications are disabled - * @param disabledUntil Time until that notifications are disabled in Unixtime - * @param settings no description - * @param conversations no description + * @param disabled - Information whether notifications are disabled + * @param disabledUntil - Time until that notifications are disabled in Unixtime + * @param settings + * @param conversations */ data class AccountPushSettings( - @SerializedName(value="disabled") + @SerializedName("disabled") val disabled: BaseBoolInt? = null, - @SerializedName(value="disabled_until") + @SerializedName("disabled_until") val disabledUntil: Int? = null, - @SerializedName(value="settings") + @SerializedName("settings") val settings: AccountPushParams? = null, - @SerializedName(value="conversations") + @SerializedName("conversations") val conversations: AccountPushConversations? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoResponse.kt new file mode 100644 index 0000000000..8b534eca1c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoResponse.kt @@ -0,0 +1,42 @@ +/** + * 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.account.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseBoolInt + +/** + * @param changed - 1 if changes has been processed + * @param nameRequest + */ +data class AccountSaveProfileInfoResponse( + @SerializedName("changed") + val changed: BaseBoolInt? = null, + @SerializedName("name_request") + val nameRequest: AccountNameRequest? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettings.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettings.kt index 067eaf1a9f..a8606d13b8 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettings.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettings.kt @@ -43,93 +43,93 @@ import kotlin.String import kotlin.collections.List /** - * @param photo200 URL of square photo of the user with 200 pixels in width - * @param isServiceAccount flag about service account - * @param deactivated Returns if a profile is deleted or blocked - * @param firstName User first name - * @param hidden Returns if a profile is hidden. - * @param id User ID - * @param lastName User last name - * @param canAccessClosed no description - * @param isClosed no description - * @param connections no description - * @param bdate User's date of birth - * @param bdateVisibility Information whether user's birthdate are hidden - * @param city no description - * @param country no description - * @param homeTown User's hometown - * @param maidenName User maiden name - * @param nameRequest no description - * @param personal no description - * @param phone User phone number with some hidden digits - * @param relation User relationship status - * @param relationPartner no description - * @param relationPending Information whether relation status is pending - * @param relationRequests no description - * @param screenName Domain name of the user's page - * @param sex User sex - * @param status User status - * @param statusAudio no description - * @param interests no description - * @param languages no description + * @param photo200 - URL of square photo of the user with 200 pixels in width + * @param isServiceAccount - flag about service account + * @param deactivated - Returns if a profile is deleted or blocked + * @param firstName - User first name + * @param hidden - Returns if a profile is hidden. + * @param id - User ID + * @param lastName - User last name + * @param canAccessClosed + * @param isClosed + * @param connections + * @param bdate - User's date of birth + * @param bdateVisibility - Information whether user's birthdate are hidden + * @param city + * @param country + * @param homeTown - User's hometown + * @param maidenName - User maiden name + * @param nameRequest + * @param personal + * @param phone - User phone number with some hidden digits + * @param relation - User relationship status + * @param relationPartner + * @param relationPending - Information whether relation status is pending + * @param relationRequests + * @param screenName - Domain name of the user's page + * @param sex - User sex + * @param status - User status + * @param statusAudio + * @param interests + * @param languages */ data class AccountUserSettings( - @SerializedName(value="photo_200") + @SerializedName("photo_200") val photo200: String? = null, - @SerializedName(value="is_service_account") + @SerializedName("is_service_account") val isServiceAccount: Boolean? = null, - @SerializedName(value="deactivated") + @SerializedName("deactivated") val deactivated: String? = null, - @SerializedName(value="first_name") + @SerializedName("first_name") val firstName: String? = null, - @SerializedName(value="hidden") + @SerializedName("hidden") val hidden: Int? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="last_name") + @SerializedName("last_name") val lastName: String? = null, - @SerializedName(value="can_access_closed") + @SerializedName("can_access_closed") val canAccessClosed: Boolean? = null, - @SerializedName(value="is_closed") + @SerializedName("is_closed") val isClosed: Boolean? = null, - @SerializedName(value="connections") + @SerializedName("connections") val connections: UsersUserConnections? = null, - @SerializedName(value="bdate") + @SerializedName("bdate") val bdate: String? = null, - @SerializedName(value="bdate_visibility") + @SerializedName("bdate_visibility") val bdateVisibility: Int? = null, - @SerializedName(value="city") + @SerializedName("city") val city: BaseCity? = null, - @SerializedName(value="country") + @SerializedName("country") val country: BaseCountry? = null, - @SerializedName(value="home_town") + @SerializedName("home_town") val homeTown: String? = null, - @SerializedName(value="maiden_name") + @SerializedName("maiden_name") val maidenName: String? = null, - @SerializedName(value="name_request") + @SerializedName("name_request") val nameRequest: AccountNameRequest? = null, - @SerializedName(value="personal") + @SerializedName("personal") val personal: UsersPersonal? = null, - @SerializedName(value="phone") + @SerializedName("phone") val phone: String? = null, - @SerializedName(value="relation") + @SerializedName("relation") val relation: UsersUserRelation? = null, - @SerializedName(value="relation_partner") + @SerializedName("relation_partner") val relationPartner: UsersUserMin? = null, - @SerializedName(value="relation_pending") + @SerializedName("relation_pending") val relationPending: BaseBoolInt? = null, - @SerializedName(value="relation_requests") + @SerializedName("relation_requests") val relationRequests: List? = null, - @SerializedName(value="screen_name") + @SerializedName("screen_name") val screenName: String? = null, - @SerializedName(value="sex") + @SerializedName("sex") val sex: BaseSex? = null, - @SerializedName(value="status") + @SerializedName("status") val status: String? = null, - @SerializedName(value="status_audio") + @SerializedName("status_audio") val statusAudio: AudioAudio? = null, - @SerializedName(value="interests") + @SerializedName("interests") val interests: AccountUserSettingsInterests? = null, - @SerializedName(value="languages") + @SerializedName("languages") val languages: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettingsInterest.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettingsInterest.kt index e7bd41fe39..da4a2102bc 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettingsInterest.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettingsInterest.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param title no description - * @param value no description + * @param title + * @param value */ data class AccountUserSettingsInterest( - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="value") + @SerializedName("value") val value: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettingsInterests.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettingsInterests.kt index e76a294d0a..ad659fca8c 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettingsInterests.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettingsInterests.kt @@ -30,33 +30,33 @@ package com.vk.sdk.api.account.dto import com.google.gson.annotations.SerializedName /** - * @param activities no description - * @param interests no description - * @param music no description - * @param tv no description - * @param movies no description - * @param books no description - * @param games no description - * @param quotes no description - * @param about no description + * @param activities + * @param interests + * @param music + * @param tv + * @param movies + * @param books + * @param games + * @param quotes + * @param about */ data class AccountUserSettingsInterests( - @SerializedName(value="activities") + @SerializedName("activities") val activities: AccountUserSettingsInterest? = null, - @SerializedName(value="interests") + @SerializedName("interests") val interests: AccountUserSettingsInterest? = null, - @SerializedName(value="music") + @SerializedName("music") val music: AccountUserSettingsInterest? = null, - @SerializedName(value="tv") + @SerializedName("tv") val tv: AccountUserSettingsInterest? = null, - @SerializedName(value="movies") + @SerializedName("movies") val movies: AccountUserSettingsInterest? = null, - @SerializedName(value="books") + @SerializedName("books") val books: AccountUserSettingsInterest? = null, - @SerializedName(value="games") + @SerializedName("games") val games: AccountUserSettingsInterest? = null, - @SerializedName(value="quotes") + @SerializedName("quotes") val quotes: AccountUserSettingsInterest? = null, - @SerializedName(value="about") + @SerializedName("about") val about: AccountUserSettingsInterest? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/BdateVisibilityParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/BdateVisibilityParam.kt new file mode 100644 index 0000000000..6ad8370290 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/BdateVisibilityParam.kt @@ -0,0 +1,44 @@ +/** + * 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.account.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class BdateVisibilityParam( + val value: Int +) { + @SerializedName("1") + SHOW(1), + + @SerializedName("2") + HIDE_YEAR(2), + + @SerializedName("0") + HIDE(0); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/FieldsParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/FieldsParam.kt new file mode 100644 index 0000000000..f3f69266b8 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/FieldsParam.kt @@ -0,0 +1,53 @@ +/** + * 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.account.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FieldsParam( + val value: String +) { + @SerializedName("country") + COUNTRY("country"), + + @SerializedName("https_required") + HTTPS_REQUIRED("https_required"), + + @SerializedName("own_posts_default") + OWN_POSTS_DEFAULT("own_posts_default"), + + @SerializedName("no_wall_replies") + NO_WALL_REPLIES("no_wall_replies"), + + @SerializedName("intro") + INTRO("intro"), + + @SerializedName("lang") + LANG("lang"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/FilterParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/FilterParam.kt new file mode 100644 index 0000000000..488497c05e --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/FilterParam.kt @@ -0,0 +1,65 @@ +/** + * 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.account.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FilterParam( + val value: String +) { + @SerializedName("friends") + FRIENDS("friends"), + + @SerializedName("messages") + MESSAGES("messages"), + + @SerializedName("photos") + PHOTOS("photos"), + + @SerializedName("videos") + VIDEOS("videos"), + + @SerializedName("notes") + NOTES("notes"), + + @SerializedName("gifts") + GIFTS("gifts"), + + @SerializedName("events") + EVENTS("events"), + + @SerializedName("groups") + GROUPS("groups"), + + @SerializedName("sdk") + SDK("sdk"), + + @SerializedName("friends_suggestions") + FRIENDS_SUGGESTIONS("friends_suggestions"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/RelationParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/RelationParam.kt new file mode 100644 index 0000000000..65e8c4285b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/RelationParam.kt @@ -0,0 +1,59 @@ +/** + * 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.account.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class RelationParam( + val value: Int +) { + @SerializedName("1") + SINGLE(1), + + @SerializedName("2") + RELATIONSHIP(2), + + @SerializedName("3") + ENGAGED(3), + + @SerializedName("4") + MARRIED(4), + + @SerializedName("5") + COMPLICATED(5), + + @SerializedName("6") + ACTIVELY_SEARCHING(6), + + @SerializedName("7") + IN_LOVE(7), + + @SerializedName("0") + NOT_SPECIFIED(0); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/SexParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/SexParam.kt new file mode 100644 index 0000000000..0df9b7c3f0 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/account/dto/SexParam.kt @@ -0,0 +1,44 @@ +/** + * 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.account.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class SexParam( + val value: Int +) { + @SerializedName("0") + UNDEFINED(0), + + @SerializedName("1") + FEMALE(1), + + @SerializedName("2") + MALE(2); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/addresses/dto/AddressesFields.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/addresses/dto/AddressesFields.kt index d7c0ad42d3..ef33907b76 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/addresses/dto/AddressesFields.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/addresses/dto/AddressesFields.kt @@ -27,66 +27,54 @@ // ********************************************************************* package com.vk.sdk.api.addresses.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AddressesFields( val value: String ) { + @SerializedName("id") ID("id"), + @SerializedName("title") TITLE("title"), + @SerializedName("address") ADDRESS("address"), + @SerializedName("additional_address") ADDITIONAL_ADDRESS("additional_address"), + @SerializedName("country_id") COUNTRY_ID("country_id"), + @SerializedName("city_id") CITY_ID("city_id"), + @SerializedName("metro_station_id") METRO_STATION_ID("metro_station_id"), + @SerializedName("latitude") LATITUDE("latitude"), + @SerializedName("longitude") LONGITUDE("longitude"), + @SerializedName("distance") DISTANCE("distance"), + @SerializedName("work_info_status") WORK_INFO_STATUS("work_info_status"), + @SerializedName("timetable") TIMETABLE("timetable"), + @SerializedName("phone") PHONE("phone"), + @SerializedName("time_offset") TIME_OFFSET("time_offset"), + @SerializedName("has_vk_taxi") HAS_VK_TAXI("has_vk_taxi"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AddressesFields?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AddressesFields { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/AdsService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/AdsService.kt new file mode 100644 index 0000000000..ac2a7617cc --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/AdsService.kt @@ -0,0 +1,1156 @@ +/** + * 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.ads + +import com.google.gson.reflect.TypeToken +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.ads.dto.AdFormatParam +import com.vk.sdk.api.ads.dto.AdsAccount +import com.vk.sdk.api.ads.dto.AdsAd +import com.vk.sdk.api.ads.dto.AdsAdLayout +import com.vk.sdk.api.ads.dto.AdsCampaign +import com.vk.sdk.api.ads.dto.AdsClient +import com.vk.sdk.api.ads.dto.AdsCreateTargetGroupResponse +import com.vk.sdk.api.ads.dto.AdsDemoStats +import com.vk.sdk.api.ads.dto.AdsFloodStats +import com.vk.sdk.api.ads.dto.AdsGetCategoriesResponse +import com.vk.sdk.api.ads.dto.AdsGetLookalikeRequestsResponse +import com.vk.sdk.api.ads.dto.AdsGetMusiciansResponse +import com.vk.sdk.api.ads.dto.AdsLinkStatus +import com.vk.sdk.api.ads.dto.AdsPromotedPostReach +import com.vk.sdk.api.ads.dto.AdsRejectReason +import com.vk.sdk.api.ads.dto.AdsStats +import com.vk.sdk.api.ads.dto.AdsTargSettings +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 +import com.vk.sdk.api.ads.dto.LangParam +import com.vk.sdk.api.ads.dto.LinkTypeParam +import com.vk.sdk.api.ads.dto.PeriodParam +import com.vk.sdk.api.ads.dto.SectionParam +import com.vk.sdk.api.ads.dto.StatsFieldsParam +import com.vk.sdk.api.base.dto.BaseOkResponse +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.Unit +import kotlin.collections.List + +class AdsService { + /** + * Adds managers and/or supervisors to advertising account. + * + * @param accountId - Advertising account ID. + * @param data - Serialized JSON array of objects that describe added managers. Description of + * 'user_specification' objects see below. + * @return [VKRequest] with [Boolean] + */ + fun adsAddOfficeUsers(accountId: Int, data: List): + VKRequest = 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) + } + + /** + * Allows to check the ad link. + * + * @param accountId - Advertising account ID. + * @param linkType - Object type: *'community' - community,, *'post' - community post,, + * *'application' - VK application,, *'video' - video,, *'site' - external site. + * @param linkUrl - Object URL. + * @param campaignId - Campaign ID + * @return [VKRequest] with [AdsLinkStatus] + */ + fun adsCheckLink( + accountId: Int, + linkType: LinkTypeParam, + linkUrl: String, + campaignId: Int? = null + ): VKRequest = NewApiRequest("ads.checkLink") { + GsonHolder.gson.fromJson(it, AdsLinkStatus::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("link_type", linkType.value) + addParam("link_url", linkUrl) + campaignId?.let { addParam("campaign_id", it) } + } + + /** + * Creates ads. + * + * @param accountId - Advertising account ID. + * @param data - Serialized JSON array of objects that describe created ads. Description of + * 'ad_specification' objects see below. + * @return [VKRequest] with [Unit] + */ + fun adsCreateAds(accountId: Int, data: String): VKRequest> = + NewApiRequest("ads.createAds") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + addParam("data", data) + } + + /** + * Creates advertising campaigns. + * + * @param accountId - Advertising account ID. + * @param data - Serialized JSON array of objects that describe created campaigns. Description + * of 'campaign_specification' objects see below. + * @return [VKRequest] with [Unit] + */ + fun adsCreateCampaigns(accountId: Int, data: String): VKRequest> = + NewApiRequest("ads.createCampaigns") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + addParam("data", data) + } + + /** + * Creates clients of an advertising agency. + * + * @param accountId - Advertising account ID. + * @param data - Serialized JSON array of objects that describe created campaigns. Description + * of 'client_specification' objects see below. + * @return [VKRequest] with [Unit] + */ + fun adsCreateClients(accountId: Int, data: String): VKRequest> = + NewApiRequest("ads.createClients") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + addParam("data", data) + } + + /** + * @param accountId + * @param sourceType + * @param clientId + * @param retargetingGroupId + * @return [VKRequest] with [Unit] + */ + fun adsCreateLookalikeRequest( + accountId: Int, + sourceType: String, + clientId: Int? = null, + retargetingGroupId: String? = null + ): VKRequest = NewApiRequest("ads.createLookalikeRequest") { + } + .apply { + addParam("account_id", accountId) + addParam("source_type", sourceType) + clientId?.let { addParam("client_id", it) } + retargetingGroupId?.let { addParam("retargeting_group_id", it) } + } + + /** + * Creates a group to re-target ads for users who visited advertiser's site (viewed information + * about the product, registered, etc.). + * + * @param accountId - Advertising account ID. + * @param name - Name of the target group - a string up to 64 characters long. + * @param lifetime - 'For groups with auditory created with pixel code only.', , Number of days + * after that users will be automatically removed from the group. + * @param clientId - 'Only for advertising agencies.', ID of the client with the advertising + * account where the group will be created. + * @param targetPixelId + * @param targetPixelRules + * @return [VKRequest] with [AdsCreateTargetGroupResponse] + */ + fun adsCreateTargetGroup( + accountId: Int, + name: String, + lifetime: Int, + clientId: Int? = null, + targetPixelId: Int? = null, + targetPixelRules: String? = null + ): VKRequest = NewApiRequest("ads.createTargetGroup") { + GsonHolder.gson.fromJson(it, AdsCreateTargetGroupResponse::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("name", name) + addParam("lifetime", lifetime) + clientId?.let { addParam("client_id", it) } + targetPixelId?.let { addParam("target_pixel_id", it) } + targetPixelRules?.let { addParam("target_pixel_rules", it) } + } + + /** + * @param accountId + * @param name + * @param categoryId + * @param clientId + * @param domain + * @return [VKRequest] with [Unit] + */ + fun adsCreateTargetPixel( + accountId: Int, + name: String, + categoryId: Int, + clientId: Int? = null, + domain: String? = null + ): VKRequest = NewApiRequest("ads.createTargetPixel") { + } + .apply { + addParam("account_id", accountId) + addParam("name", name) + addParam("category_id", categoryId) + clientId?.let { addParam("client_id", it) } + domain?.let { addParam("domain", it) } + } + + /** + * Archives ads. + * + * @param accountId - Advertising account ID. + * @param ids - Serialized JSON array with ad IDs. + * @return [VKRequest] with [Unit] + */ + fun adsDeleteAds(accountId: Int, ids: String): VKRequest> = + NewApiRequest("ads.deleteAds") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + addParam("ids", ids) + } + + /** + * Archives advertising campaigns. + * + * @param accountId - Advertising account ID. + * @param ids - Serialized JSON array with IDs of deleted campaigns. + * @return [VKRequest] with [Int] + */ + fun adsDeleteCampaigns(accountId: Int, ids: String): VKRequest = + NewApiRequest("ads.deleteCampaigns") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("ids", ids) + } + + /** + * Archives clients of an advertising agency. + * + * @param accountId - Advertising account ID. + * @param ids - Serialized JSON array with IDs of deleted clients. + * @return [VKRequest] with [Int] + */ + fun adsDeleteClients(accountId: Int, ids: String): VKRequest = + NewApiRequest("ads.deleteClients") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("ids", ids) + } + + /** + * Deletes a retarget group. + * + * @param accountId - Advertising account ID. + * @param targetGroupId - Group ID. + * @param clientId - 'Only for advertising agencies.' , ID of the client with the advertising + * account where the group will be created. + * @return [VKRequest] with [BaseOkResponse] + */ + fun adsDeleteTargetGroup( + accountId: Int, + targetGroupId: Int, + clientId: Int? = null + ): VKRequest = NewApiRequest("ads.deleteTargetGroup") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("target_group_id", targetGroupId) + clientId?.let { addParam("client_id", it) } + } + + /** + * @param accountId + * @param targetPixelId + * @param clientId + * @return [VKRequest] with [Unit] + */ + fun adsDeleteTargetPixel( + accountId: Int, + targetPixelId: Int, + clientId: Int? = null + ): VKRequest = NewApiRequest("ads.deleteTargetPixel") { + } + .apply { + addParam("account_id", accountId) + addParam("target_pixel_id", targetPixelId) + clientId?.let { addParam("client_id", it) } + } + + /** + * Returns a list of advertising accounts. + * + * @return [VKRequest] with [Unit] + */ + fun adsGetAccounts(): VKRequest> = NewApiRequest("ads.getAccounts") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + + /** + * Returns number of ads. + * + * @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 - 'Available and required 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 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 adsGetAds( + accountId: Int, + adIds: String? = null, + campaignIds: String? = null, + clientId: Int? = null, + includeDeleted: Boolean? = null, + onlyDeleted: Boolean? = null, + limit: Int? = null, + offset: Int? = null + ): VKRequest> = NewApiRequest("ads.getAds") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .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) } + limit?.let { addParam("limit", it) } + offset?.let { addParam("offset", it) } + } + + /** + * 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 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, + limit: Int? = null, + offset: Int? = null + ): VKRequest> = NewApiRequest("ads.getAdsLayout") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .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) } + limit?.let { addParam("limit", it) } + offset?.let { addParam("offset", it) } + } + + /** + * Returns ad targeting parameters. + * + * @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 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 needed to return a specific subset of results. + * @return [VKRequest] with [Unit] + */ + fun adsGetAdsTargeting( + accountId: Int, + adIds: String? = null, + campaignIds: String? = null, + clientId: Int? = null, + includeDeleted: Boolean? = null, + limit: Int? = null, + offset: Int? = null + ): VKRequest> = NewApiRequest("ads.getAdsTargeting") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .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) } + limit?.let { addParam("limit", it) } + offset?.let { addParam("offset", it) } + } + + /** + * Returns current budget of the advertising account. + * + * @param accountId - Advertising account ID. + * @return [VKRequest] with [Int] + */ + fun adsGetBudget(accountId: Int): VKRequest = NewApiRequest("ads.getBudget") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("account_id", accountId) + } + + /** + * Returns a list of campaigns in an advertising account. + * + * @param accountId - Advertising account ID. + * @param clientId - 'For advertising agencies'. ID of the client advertising campaigns are + * retrieved from. + * @param includeDeleted - Flag that specifies whether archived ads shall be shown. *0 - show + * only active campaigns,, *1 - show all campaigns. + * @param campaignIds - Filter of advertising campaigns to show. Serialized JSON array with + * campaign IDs. Only campaigns that exist in 'campaign_ids' and belong to the specified + * advertising account will be shown. If the parameter is null, all campaigns will be shown. + * @param fields + * @return [VKRequest] with [Unit] + */ + fun adsGetCampaigns( + accountId: Int, + clientId: Int? = null, + includeDeleted: Boolean? = null, + campaignIds: String? = null, + fields: List? = null + ): VKRequest> = NewApiRequest("ads.getCampaigns") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + clientId?.let { addParam("client_id", it) } + includeDeleted?.let { addParam("include_deleted", it) } + campaignIds?.let { addParam("campaign_ids", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns a list of possible ad categories. + * + * @param lang - Language. The full list of supported languages is + * [vk.com/dev/api_requests|here]. + * @return [VKRequest] with [AdsGetCategoriesResponse] + */ + fun adsGetCategories(lang: String? = null): VKRequest = + NewApiRequest("ads.getCategories") { + GsonHolder.gson.fromJson(it, AdsGetCategoriesResponse::class.java) + } + .apply { + lang?.let { addParam("lang", it) } + } + + /** + * Returns a list of advertising agency's clients. + * + * @param accountId - Advertising account ID. + * @return [VKRequest] with [Unit] + */ + fun adsGetClients(accountId: Int): VKRequest> = + NewApiRequest("ads.getClients") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + } + + /** + * Returns demographics for ads or campaigns. + * + * @param accountId - Advertising account ID. + * @param idsType - Type of requested objects listed in 'ids' parameter: *ad - ads,, *campaign - + * campaigns. + * @param ids - IDs requested ads or campaigns, separated with a comma, depending on the value + * set in 'ids_type'. Maximum 2000 objects. + * @param period - Data grouping by dates: *day - statistics by days,, *month - statistics by + * months,, *overall - overall statistics. 'date_from' and 'date_to' parameters set temporary + * limits. + * @param dateFrom - Date to show statistics from. For different value of 'period' different + * date format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - day it + * was created on,, *month: YYYY-MM, example: 2011-09 - September 2011, **0 - month it was created + * in,, *overall: 0. + * @param dateTo - Date to show statistics to. For different value of 'period' different date + * format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - current day,, + * *month: YYYY-MM, example: 2011-09 - September 2011, **0 - current month,, *overall: 0. + * @return [VKRequest] with [Unit] + */ + fun adsGetDemographics( + accountId: Int, + idsType: IdsTypeParam, + ids: String, + period: PeriodParam, + dateFrom: String, + dateTo: String + ): VKRequest> = NewApiRequest("ads.getDemographics") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + addParam("ids_type", idsType.value) + addParam("ids", ids) + addParam("period", period.value) + addParam("date_from", dateFrom) + addParam("date_to", dateTo) + } + + /** + * Returns information about current state of a counter � number of remaining runs of methods + * and time to the next counter nulling in seconds. + * + * @param accountId - Advertising account ID. + * @return [VKRequest] with [AdsFloodStats] + */ + fun adsGetFloodStats(accountId: Int): VKRequest = + NewApiRequest("ads.getFloodStats") { + GsonHolder.gson.fromJson(it, AdsFloodStats::class.java) + } + .apply { + addParam("account_id", accountId) + } + + /** + * @param accountId + * @param clientId + * @param requestsIds + * @param offset + * @param limit + * @param sortBy + * @return [VKRequest] with [AdsGetLookalikeRequestsResponse] + */ + fun adsGetLookalikeRequests( + accountId: Int, + clientId: Int? = null, + requestsIds: String? = null, + offset: Int? = null, + limit: Int? = null, + sortBy: String? = null + ): VKRequest = NewApiRequest("ads.getLookalikeRequests") { + GsonHolder.gson.fromJson(it, AdsGetLookalikeRequestsResponse::class.java) + } + .apply { + addParam("account_id", accountId) + clientId?.let { addParam("client_id", it) } + requestsIds?.let { addParam("requests_ids", it) } + offset?.let { addParam("offset", it) } + limit?.let { addParam("limit", it) } + sortBy?.let { addParam("sort_by", it) } + } + + /** + * @param artistName + * @return [VKRequest] with [AdsGetMusiciansResponse] + */ + fun adsGetMusicians(artistName: String): VKRequest = + NewApiRequest("ads.getMusicians") { + GsonHolder.gson.fromJson(it, AdsGetMusiciansResponse::class.java) + } + .apply { + addParam("artist_name", artistName) + } + + /** + * @param ids + * @return [VKRequest] with [AdsGetMusiciansResponse] + */ + fun adsGetMusiciansByIds(ids: List): VKRequest = + NewApiRequest("ads.getMusiciansByIds") { + GsonHolder.gson.fromJson(it, AdsGetMusiciansResponse::class.java) + } + .apply { + addParam("ids", ids) + } + + /** + * Returns a list of managers and supervisors of advertising account. + * + * @param accountId - Advertising account ID. + * @return [VKRequest] with [Unit] + */ + fun adsGetOfficeUsers(accountId: Int): VKRequest> = + NewApiRequest("ads.getOfficeUsers") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + } + + /** + * Returns detailed statistics of promoted posts reach from campaigns and ads. + * + * @param accountId - Advertising account ID. + * @param idsType - Type of requested objects listed in 'ids' parameter: *ad - ads,, *campaign - + * campaigns. + * @param ids - IDs requested ads or campaigns, separated with a comma, depending on the value + * set in 'ids_type'. Maximum 100 objects. + * @return [VKRequest] with [Unit] + */ + fun adsGetPostsReach( + accountId: Int, + idsType: IdsTypeParam, + ids: String + ): VKRequest> = NewApiRequest("ads.getPostsReach") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + addParam("ids_type", idsType.value) + addParam("ids", ids) + } + + /** + * Returns a reason of ad rejection for pre-moderation. + * + * @param accountId - Advertising account ID. + * @param adId - Ad ID. + * @return [VKRequest] with [AdsRejectReason] + */ + fun adsGetRejectionReason(accountId: Int, adId: Int): VKRequest = + NewApiRequest("ads.getRejectionReason") { + GsonHolder.gson.fromJson(it, AdsRejectReason::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("ad_id", adId) + } + + /** + * Returns statistics of performance indicators for ads, campaigns, clients or the whole + * account. + * + * @param accountId - Advertising account ID. + * @param idsType - Type of requested objects listed in 'ids' parameter: *ad - ads,, *campaign - + * campaigns,, *client - clients,, *office - account. + * @param ids - IDs requested ads, campaigns, clients or account, separated with a comma, + * depending on the value set in 'ids_type'. Maximum 2000 objects. + * @param period - Data grouping by dates: *day - statistics by days,, *month - statistics by + * months,, *overall - overall statistics. 'date_from' and 'date_to' parameters set temporary + * limits. + * @param dateFrom - Date to show statistics from. For different value of 'period' different + * date format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - day it + * was created on,, *month: YYYY-MM, example: 2011-09 - September 2011, **0 - month it was created + * in,, *overall: 0. + * @param dateTo - Date to show statistics to. For different value of 'period' different date + * format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - current day,, + * *month: YYYY-MM, example: 2011-09 - September 2011, **0 - current month,, *overall: 0. + * @param statsFields - Additional fields to add to statistics + * @return [VKRequest] with [Unit] + */ + fun adsGetStatistics( + accountId: Int, + idsType: IdsTypeParam, + ids: String, + period: PeriodParam, + dateFrom: String, + dateTo: String, + statsFields: List? = null + ): VKRequest> = NewApiRequest("ads.getStatistics") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + addParam("ids_type", idsType.value) + addParam("ids", ids) + addParam("period", period.value) + addParam("date_from", dateFrom) + addParam("date_to", dateTo) + val statsFieldsJsonConverted = statsFields?.map { + it.value + } + statsFieldsJsonConverted?.let { addParam("stats_fields", it) } + } + + /** + * Returns a set of auto-suggestions for various targeting parameters. + * + * @param section - Section, suggestions are retrieved in. Available values: *countries - + * request of a list of countries. If q is not set or blank, a short list of countries is shown. + * Otherwise, a full list of countries is shown. *regions - requested list of regions. 'country' + * parameter is required. *cities - requested list of cities. 'country' parameter is required. + * *districts - requested list of districts. 'cities' parameter is required. *stations - requested + * list of subway stations. 'cities' parameter is required. *streets - requested list of streets. + * 'cities' parameter is required. *schools - requested list of educational organizations. 'cities' + * parameter is required. *interests - requested list of interests. *positions - requested list of + * positions (professions). *group_types - requested list of group types. *religions - requested + * list of religious commitments. *browsers - requested list of browsers and mobile devices. + * @param ids - Objects IDs separated by commas. If the parameter is passed, 'q, country, + * cities' should not be passed. + * @param q - Filter-line of the request (for countries, regions, cities, streets, schools, + * interests, positions). + * @param country - ID of the country objects are searched in. + * @param cities - IDs of cities where objects are searched in, separated with a comma. + * @param lang - Language of the returned string values. Supported languages: *ru - Russian,, + * *ua - Ukrainian,, *en - English. + * @return [VKRequest] with [Unit] + */ + fun adsGetSuggestions( + section: SectionParam, + ids: String? = null, + q: String? = null, + country: Int? = null, + cities: String? = null, + lang: LangParam? = null + ): VKRequest> = NewApiRequest("ads.getSuggestions") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("section", section.value) + ids?.let { addParam("ids", it) } + q?.let { addParam("q", it) } + country?.let { addParam("country", it) } + cities?.let { addParam("cities", it) } + lang?.let { addParam("lang", it.value) } + } + + /** + * Returns a list of target groups. + * + * @param accountId - Advertising account ID. + * @param clientId - 'Only for advertising agencies.', ID of the client with the advertising + * account where the group will be created. + * @return [VKRequest] with [Unit] + */ + fun adsGetTargetGroups(accountId: Int, clientId: Int? = null): VKRequest> = + NewApiRequest("ads.getTargetGroups") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + clientId?.let { addParam("client_id", it) } + } + + /** + * @param accountId + * @param clientId + * @return [VKRequest] with [Unit] + */ + fun adsGetTargetPixels(accountId: Int, clientId: Int? = null): VKRequest = + NewApiRequest("ads.getTargetPixels") { + } + .apply { + addParam("account_id", accountId) + clientId?.let { addParam("client_id", it) } + } + + /** + * Returns the size of targeting audience, and also recommended values for CPC and CPM. + * + * @param accountId - Advertising account ID. + * @param linkUrl - URL for the advertised object. + * @param clientId + * @param criteria - Serialized JSON object that describes targeting parameters. Description of + * 'criteria' object see below. + * @param adId - ID of an ad which targeting parameters shall be analyzed. + * @param adFormat - Ad format. Possible values: *'1' - image and text,, *'2' - big image,, + * *'3' - exclusive format,, *'4' - community, square image,, *'7' - special app format,, *'8' - + * special community format,, *'9' - post in community,, *'10' - app board. + * @param adPlatform - Platforms to use for ad showing. Possible values: (for 'ad_format' = + * '1'), *'0' - VK and partner sites,, *'1' - VK only. (for 'ad_format' = '9'), *'all' - all + * platforms,, *'desktop' - desktop version,, *'mobile' - mobile version and apps. + * @param adPlatformNoWall + * @param adPlatformNoAdNetwork + * @param publisherPlatforms + * @param linkDomain - Domain of the advertised object. + * @param needPrecise - Additionally return recommended cpc and cpm to reach 5,10..95 percents + * of audience. + * @param impressionsLimitPeriod - Impressions limit period in seconds, must be a multiple of + * 86400(day) + * @return [VKRequest] with [AdsTargStats] + */ + fun adsGetTargetingStats( + accountId: Int, + linkUrl: String, + clientId: Int? = null, + criteria: String? = null, + adId: Int? = null, + adFormat: AdFormatParam? = null, + adPlatform: String? = null, + adPlatformNoWall: String? = null, + adPlatformNoAdNetwork: String? = null, + publisherPlatforms: String? = null, + linkDomain: String? = null, + needPrecise: Boolean? = null, + impressionsLimitPeriod: Int? = null + ): VKRequest = NewApiRequest("ads.getTargetingStats") { + GsonHolder.gson.fromJson(it, AdsTargStats::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("link_url", linkUrl) + clientId?.let { addParam("client_id", it) } + criteria?.let { addParam("criteria", it) } + adId?.let { addParam("ad_id", it) } + adFormat?.let { addParam("ad_format", it.value) } + adPlatform?.let { addParam("ad_platform", it) } + adPlatformNoWall?.let { addParam("ad_platform_no_wall", it) } + adPlatformNoAdNetwork?.let { addParam("ad_platform_no_ad_network", it) } + publisherPlatforms?.let { addParam("publisher_platforms", it) } + linkDomain?.let { addParam("link_domain", it) } + needPrecise?.let { addParam("need_precise", it) } + impressionsLimitPeriod?.let { addParam("impressions_limit_period", it) } + } + + /** + * Returns URL to upload an ad photo to. + * + * @param adFormat - Ad format: *1 - image and text,, *2 - big image,, *3 - exclusive format,, + * *4 - community, square image,, *7 - special app format. + * @param icon + * @return [VKRequest] with [String] + */ + fun adsGetUploadURL(adFormat: AdFormatParam, icon: Int? = null): VKRequest = + NewApiRequest("ads.getUploadURL") { + GsonHolder.gson.fromJson(it, String::class.java) + } + .apply { + addParam("ad_format", adFormat.value) + icon?.let { addParam("icon", it) } + } + + /** + * Returns URL to upload an ad video to. + * + * @return [VKRequest] with [String] + */ + fun adsGetVideoUploadURL(): VKRequest = NewApiRequest("ads.getVideoUploadURL") { + GsonHolder.gson.fromJson(it, String::class.java) + } + + /** + * Imports a list of advertiser's contacts to count VK registered users against the target + * group. + * + * @param accountId - Advertising account ID. + * @param targetGroupId - Target group ID. + * @param contacts - List of phone numbers, emails or user IDs separated with a comma. + * @param clientId - 'Only for advertising agencies.' , ID of the client with the advertising + * account where the group will be created. + * @return [VKRequest] with [Int] + */ + fun adsImportTargetContacts( + accountId: Int, + targetGroupId: Int, + contacts: String, + clientId: Int? = null + ): VKRequest = NewApiRequest("ads.importTargetContacts") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("target_group_id", targetGroupId) + addParam("contacts", contacts) + clientId?.let { addParam("client_id", it) } + } + + /** + * Removes managers and/or supervisors from advertising account. + * + * @param accountId - Advertising account ID. + * @param ids - Serialized JSON array with IDs of deleted managers. + * @return [VKRequest] with [Boolean] + */ + fun adsRemoveOfficeUsers(accountId: Int, ids: String): VKRequest = + NewApiRequest("ads.removeOfficeUsers") { + GsonHolder.gson.fromJson(it, Boolean::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("ids", ids) + } + + /** + * @param accountId + * @param targetGroupId + * @param contacts + * @param clientId + * @return [VKRequest] with [Unit] + */ + fun adsRemoveTargetContacts( + accountId: Int, + targetGroupId: Int, + contacts: String, + clientId: Int? = null + ): VKRequest = NewApiRequest("ads.removeTargetContacts") { + } + .apply { + addParam("account_id", accountId) + addParam("target_group_id", targetGroupId) + addParam("contacts", contacts) + clientId?.let { addParam("client_id", it) } + } + + /** + * @param accountId + * @param requestId + * @param level + * @param clientId + * @return [VKRequest] with [Unit] + */ + fun adsSaveLookalikeRequestResult( + accountId: Int, + requestId: Int, + level: Int, + clientId: Int? = null + ): VKRequest = NewApiRequest("ads.saveLookalikeRequestResult") { + } + .apply { + addParam("account_id", accountId) + addParam("request_id", requestId) + addParam("level", level) + clientId?.let { addParam("client_id", it) } + } + + /** + * @param accountId + * @param targetGroupId + * @param clientId + * @param shareWithClientId + * @return [VKRequest] with [Unit] + */ + fun adsShareTargetGroup( + accountId: Int, + targetGroupId: Int, + clientId: Int? = null, + shareWithClientId: Int? = null + ): VKRequest = NewApiRequest("ads.shareTargetGroup") { + } + .apply { + addParam("account_id", accountId) + addParam("target_group_id", targetGroupId) + clientId?.let { addParam("client_id", it) } + shareWithClientId?.let { addParam("share_with_client_id", it) } + } + + /** + * Edits ads. + * + * @param accountId - Advertising account ID. + * @param data - Serialized JSON array of objects that describe changes in ads. Description of + * 'ad_edit_specification' objects see below. + * @return [VKRequest] with [Unit] + */ + fun adsUpdateAds(accountId: Int, data: String): VKRequest> = + NewApiRequest("ads.updateAds") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + addParam("data", data) + } + + /** + * Edits advertising campaigns. + * + * @param accountId - Advertising account ID. + * @param data - Serialized JSON array of objects that describe changes in campaigns. + * Description of 'campaign_mod' objects see below. + * @return [VKRequest] with [Int] + */ + fun adsUpdateCampaigns(accountId: Int, data: String): VKRequest = + NewApiRequest("ads.updateCampaigns") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("data", data) + } + + /** + * Edits clients of an advertising agency. + * + * @param accountId - Advertising account ID. + * @param data - Serialized JSON array of objects that describe changes in clients. Description + * of 'client_mod' objects see below. + * @return [VKRequest] with [Int] + */ + fun adsUpdateClients(accountId: Int, data: String): VKRequest = + NewApiRequest("ads.updateClients") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("data", data) + } + + /** + * Adds managers and/or supervisors to advertising account. + * + * @param accountId - Advertising account ID. + * @param data - Serialized JSON array of objects that describe added managers. Description of + * 'user_specification' objects see below. + * @return [VKRequest] with [Unit] + */ + fun adsUpdateOfficeUsers(accountId: Int, data: List): + VKRequest> = NewApiRequest("ads.updateOfficeUsers") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("account_id", accountId) + val dataJsonConverted = data.map { + GsonHolder.gson.toJson(it) + } + addParam("data", dataJsonConverted) + } + + /** + * Edits a retarget group. + * + * @param accountId - Advertising account ID. + * @param targetGroupId - Group ID. + * @param name - New name of the target group - a string up to 64 characters long. + * @param lifetime - 'Only for the groups that get audience from sites with user accounting + * code.', Time in days when users added to a retarget group will be automatically excluded from + * it. '0' - automatic exclusion is off. + * @param clientId - 'Only for advertising agencies.' , ID of the client with the advertising + * account where the group will be created. + * @param domain - Domain of the site where user accounting code will be placed. + * @param targetPixelId + * @param targetPixelRules + * @return [VKRequest] with [BaseOkResponse] + */ + fun adsUpdateTargetGroup( + accountId: Int, + targetGroupId: Int, + name: String, + lifetime: Int, + clientId: Int? = null, + domain: String? = null, + targetPixelId: Int? = null, + targetPixelRules: String? = null + ): VKRequest = NewApiRequest("ads.updateTargetGroup") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("account_id", accountId) + addParam("target_group_id", targetGroupId) + addParam("name", name) + addParam("lifetime", lifetime) + clientId?.let { addParam("client_id", it) } + domain?.let { addParam("domain", it) } + targetPixelId?.let { addParam("target_pixel_id", it) } + targetPixelRules?.let { addParam("target_pixel_rules", it) } + } + + /** + * @param accountId + * @param targetPixelId + * @param name + * @param categoryId + * @param clientId + * @param domain + * @return [VKRequest] with [Unit] + */ + fun adsUpdateTargetPixel( + accountId: Int, + targetPixelId: Int, + name: String, + categoryId: Int, + clientId: Int? = null, + domain: String? = null + ): VKRequest = NewApiRequest("ads.updateTargetPixel") { + } + .apply { + addParam("account_id", accountId) + addParam("target_pixel_id", targetPixelId) + addParam("name", name) + addParam("category_id", categoryId) + clientId?.let { addParam("client_id", it) } + domain?.let { addParam("domain", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdFormatParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdFormatParam.kt new file mode 100644 index 0000000000..f8fce34dce --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdFormatParam.kt @@ -0,0 +1,59 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class AdFormatParam( + val value: Int +) { + @SerializedName("1") + IMAGE_AND_TEXT(1), + + @SerializedName("2") + BIG_IMAGE(2), + + @SerializedName("3") + EXCLUSIVE_FORMAT(3), + + @SerializedName("4") + COMMUNITY_SQUARE_IMAGE(4), + + @SerializedName("7") + SPECIAL_APP_FORMAT(7), + + @SerializedName("8") + SPECIAL_COMMUNITY_FORMAT(8), + + @SerializedName("9") + POST_IN_COMMUNITY(9), + + @SerializedName("10") + APP_BOARD(10); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRole.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRole.kt index 3c06cc0a53..5e9c7c4ca9 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRole.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRole.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AdsAccessRole( val value: String ) { + @SerializedName("admin") ADMIN("admin"), + @SerializedName("manager") MANAGER("manager"), + @SerializedName("reports") REPORTS("reports"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsAccessRole?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsAccessRole { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRolePublic.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRolePublic.kt index 0f577f7416..415d47bcdb 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRolePublic.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRolePublic.kt @@ -27,40 +27,15 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AdsAccessRolePublic( val value: String ) { + @SerializedName("manager") MANAGER("manager"), + @SerializedName("reports") REPORTS("reports"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsAccessRolePublic?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsAccessRolePublic { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccesses.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccesses.kt index 01a37a7b00..ea42c9ac88 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccesses.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccesses.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param clientId Client ID - * @param role no description + * @param clientId - Client ID + * @param role */ data class AdsAccesses( - @SerializedName(value="client_id") + @SerializedName("client_id") val clientId: String? = null, - @SerializedName(value="role") + @SerializedName("role") val role: AdsAccessRole? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccount.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccount.kt index b4a2498688..9633744404 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccount.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccount.kt @@ -34,24 +34,24 @@ import kotlin.Int import kotlin.String /** - * @param accessRole no description - * @param accountId Account ID - * @param accountStatus Information whether account is active - * @param accountType no description - * @param accountName Account name - * @param canViewBudget Can user view account budget + * @param accessRole + * @param accountId - Account ID + * @param accountStatus - Information whether account is active + * @param accountType + * @param accountName - Account name + * @param canViewBudget - Can user view account budget */ data class AdsAccount( - @SerializedName(value="access_role") + @SerializedName("access_role") val accessRole: AdsAccessRole, - @SerializedName(value="account_id") + @SerializedName("account_id") val accountId: Int, - @SerializedName(value="account_status") + @SerializedName("account_status") val accountStatus: BaseBoolInt, - @SerializedName(value="account_type") + @SerializedName("account_type") val accountType: AdsAccountType, - @SerializedName(value="account_name") + @SerializedName("account_name") val accountName: String, - @SerializedName(value="can_view_budget") + @SerializedName("can_view_budget") val canViewBudget: Boolean ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccountType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccountType.kt index cb8d5f7125..dc9b87248a 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccountType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccountType.kt @@ -27,40 +27,15 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AdsAccountType( val value: String ) { + @SerializedName("general") GENERAL("general"), + @SerializedName("agency") AGENCY("agency"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsAccountType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsAccountType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAd.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAd.kt index 548bf8f666..9c5fb363e0 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAd.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAd.kt @@ -33,72 +33,72 @@ import kotlin.Int import kotlin.String /** - * @param adFormat Ad format - * @param allLimit Total limit - * @param approved no description - * @param campaignId Campaign ID - * @param costType no description - * @param id Ad ID - * @param name Ad title - * @param status no description - * @param adPlatform Ad platform - * @param category1Id Category ID - * @param category2Id Additional category ID - * @param cpc Cost of a click, kopecks - * @param cpm Cost of 1000 impressions, kopecks - * @param cpa Cost of an action, kopecks - * @param ocpm Cost of 1000 impressions optimized, kopecks - * @param autobiddingMaxCost Max cost of target actions for autobidding, kopecks - * @param disclaimerMedical Information whether disclaimer is enabled - * @param disclaimerSpecialist Information whether disclaimer is enabled - * @param disclaimerSupplements Information whether disclaimer is enabled - * @param impressionsLimit Impressions limit - * @param impressionsLimited Information whether impressions are limited - * @param video Information whether the ad is a video + * @param adFormat - Ad format + * @param allLimit - Total limit + * @param approved + * @param campaignId - Campaign ID + * @param costType + * @param id - Ad ID + * @param name - Ad title + * @param status + * @param adPlatform - Ad platform + * @param category1Id - Category ID + * @param category2Id - Additional category ID + * @param cpc - Cost of a click, kopecks + * @param cpm - Cost of 1000 impressions, kopecks + * @param cpa - Cost of an action, kopecks + * @param ocpm - Cost of 1000 impressions optimized, kopecks + * @param autobiddingMaxCost - Max cost of target actions for autobidding, kopecks + * @param disclaimerMedical - Information whether disclaimer is enabled + * @param disclaimerSpecialist - Information whether disclaimer is enabled + * @param disclaimerSupplements - Information whether disclaimer is enabled + * @param impressionsLimit - Impressions limit + * @param impressionsLimited - Information whether impressions are limited + * @param video - Information whether the ad is a video */ data class AdsAd( - @SerializedName(value="ad_format") + @SerializedName("ad_format") val adFormat: Int, - @SerializedName(value="all_limit") + @SerializedName("all_limit") val allLimit: Int, - @SerializedName(value="approved") + @SerializedName("approved") val approved: AdsAdApproved, - @SerializedName(value="campaign_id") + @SerializedName("campaign_id") val campaignId: Int, - @SerializedName(value="cost_type") + @SerializedName("cost_type") val costType: AdsAdCostType, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="status") + @SerializedName("status") val status: AdsAdStatus, - @SerializedName(value="ad_platform") + @SerializedName("ad_platform") val adPlatform: Int? = null, - @SerializedName(value="category1_id") + @SerializedName("category1_id") val category1Id: Int? = null, - @SerializedName(value="category2_id") + @SerializedName("category2_id") val category2Id: Int? = null, - @SerializedName(value="cpc") + @SerializedName("cpc") val cpc: Int? = null, - @SerializedName(value="cpm") + @SerializedName("cpm") val cpm: Int? = null, - @SerializedName(value="cpa") + @SerializedName("cpa") val cpa: Int? = null, - @SerializedName(value="ocpm") + @SerializedName("ocpm") val ocpm: Int? = null, - @SerializedName(value="autobidding_max_cost") + @SerializedName("autobidding_max_cost") val autobiddingMaxCost: Int? = null, - @SerializedName(value="disclaimer_medical") + @SerializedName("disclaimer_medical") val disclaimerMedical: BaseBoolInt? = null, - @SerializedName(value="disclaimer_specialist") + @SerializedName("disclaimer_specialist") val disclaimerSpecialist: BaseBoolInt? = null, - @SerializedName(value="disclaimer_supplements") + @SerializedName("disclaimer_supplements") val disclaimerSupplements: BaseBoolInt? = null, - @SerializedName(value="impressions_limit") + @SerializedName("impressions_limit") val impressionsLimit: Int? = null, - @SerializedName(value="impressions_limited") + @SerializedName("impressions_limited") val impressionsLimited: BaseBoolInt? = null, - @SerializedName(value="video") + @SerializedName("video") val video: BaseBoolInt? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdApproved.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdApproved.kt index 90d1d984b3..adb04ff6ac 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdApproved.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdApproved.kt @@ -27,44 +27,21 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class AdsAdApproved( val value: Int ) { + @SerializedName("0") NOT_MODERATED(0), + @SerializedName("1") PENDING_MODERATION(1), + @SerializedName("2") APPROVED(2), + @SerializedName("3") REJECTED(3); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsAdApproved?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsAdApproved { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdCostType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdCostType.kt index f4211780b6..4a7e14722b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdCostType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdCostType.kt @@ -27,44 +27,21 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class AdsAdCostType( val value: Int ) { + @SerializedName("0") PER_CLICKS(0), + @SerializedName("1") PER_IMPRESSIONS(1), + @SerializedName("2") PER_ACTIONS(2), + @SerializedName("3") PER_IMPRESSIONS_OPTIMIZED(3); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsAdCostType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsAdCostType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdLayout.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdLayout.kt index 3daeda7087..19ba946fda 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdLayout.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdLayout.kt @@ -33,42 +33,42 @@ import kotlin.Int import kotlin.String /** - * @param adFormat Ad format - * @param campaignId Campaign ID - * @param costType no description - * @param description Ad description - * @param id Ad ID - * @param imageSrc Image URL - * @param linkUrl URL of advertised object - * @param title Ad title - * @param imageSrc2x URL of the preview image in double size - * @param linkDomain Domain of advertised object - * @param previewLink link to preview an ad as it is shown on the website - * @param video Information whether the ad is a video + * @param adFormat - Ad format + * @param campaignId - Campaign ID + * @param costType + * @param description - Ad description + * @param id - Ad ID + * @param imageSrc - Image URL + * @param linkUrl - URL of advertised object + * @param title - Ad title + * @param imageSrc2x - URL of the preview image in double size + * @param linkDomain - Domain of advertised object + * @param previewLink - link to preview an ad as it is shown on the website + * @param video - Information whether the ad is a video */ data class AdsAdLayout( - @SerializedName(value="ad_format") + @SerializedName("ad_format") val adFormat: Int, - @SerializedName(value="campaign_id") + @SerializedName("campaign_id") val campaignId: Int, - @SerializedName(value="cost_type") + @SerializedName("cost_type") val costType: AdsAdCostType, - @SerializedName(value="description") + @SerializedName("description") val description: String, - @SerializedName(value="id") + @SerializedName("id") val id: String, - @SerializedName(value="image_src") + @SerializedName("image_src") val imageSrc: String, - @SerializedName(value="link_url") + @SerializedName("link_url") val linkUrl: String, - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="image_src_2x") + @SerializedName("image_src_2x") val imageSrc2x: String? = null, - @SerializedName(value="link_domain") + @SerializedName("link_domain") val linkDomain: String? = null, - @SerializedName(value="preview_link") + @SerializedName("preview_link") val previewLink: Int? = null, - @SerializedName(value="video") + @SerializedName("video") val video: BaseBoolInt? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdStatus.kt index 2a57d15249..88176a24c0 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdStatus.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class AdsAdStatus( val value: Int ) { + @SerializedName("0") STOPPED(0), + @SerializedName("1") STARTED(1), + @SerializedName("2") DELETED(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsAdStatus?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsAdStatus { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaign.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaign.kt index 78738baa81..e0d844f354 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaign.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaign.kt @@ -32,30 +32,42 @@ import kotlin.Int import kotlin.String /** - * @param allLimit Campaign's total limit, rubles - * @param dayLimit Campaign's day limit, rubles - * @param id Campaign ID - * @param name Campaign title - * @param startTime Campaign start time, as Unixtime - * @param status no description - * @param stopTime Campaign stop time, as Unixtime - * @param type no description + * @param allLimit - Campaign's total limit, rubles + * @param dayLimit - Campaign's day limit, rubles + * @param id - Campaign ID + * @param name - Campaign title + * @param startTime - Campaign start time, as Unixtime + * @param status + * @param stopTime - Campaign stop time, as Unixtime + * @param type + * @param adsCount - Amount of active ads in campaign + * @param createTime - Campaign create time, as Unixtime + * @param updateTime - Campaign update time, as Unixtime + * @param viewsLimit - Limit of views per user per campaign */ data class AdsCampaign( - @SerializedName(value="all_limit") + @SerializedName("all_limit") val allLimit: String, - @SerializedName(value="day_limit") + @SerializedName("day_limit") val dayLimit: String, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="start_time") + @SerializedName("start_time") val startTime: Int, - @SerializedName(value="status") + @SerializedName("status") val status: AdsCampaignStatus, - @SerializedName(value="stop_time") + @SerializedName("stop_time") val stopTime: Int, - @SerializedName(value="type") - val type: AdsCampaignType + @SerializedName("type") + val type: AdsCampaignType, + @SerializedName("ads_count") + val adsCount: Int? = null, + @SerializedName("create_time") + val createTime: Int? = null, + @SerializedName("update_time") + val updateTime: Int? = null, + @SerializedName("views_limit") + val viewsLimit: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaignStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaignStatus.kt index 174f2dfcc3..8bd75da29b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaignStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaignStatus.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class AdsCampaignStatus( val value: Int ) { + @SerializedName("0") STOPPED(0), + @SerializedName("1") STARTED(1), + @SerializedName("2") DELETED(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsCampaignStatus?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsCampaignStatus { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaignType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaignType.kt index c13243649c..c18fe3bfca 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaignType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCampaignType.kt @@ -27,44 +27,27 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AdsCampaignType( val value: String ) { + @SerializedName("normal") NORMAL("normal"), + @SerializedName("vk_apps_managed") VK_APPS_MANAGED("vk_apps_managed"), + @SerializedName("mobile_apps") MOBILE_APPS("mobile_apps"), - PROMOTED_POSTS("promoted_posts"); + @SerializedName("promoted_posts") + PROMOTED_POSTS("promoted_posts"), - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsCampaignType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE + @SerializedName("adaptive_ads") + ADAPTIVE_ADS("adaptive_ads"), - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsCampaignType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } + @SerializedName("stories") + STORIES("stories"); } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCategory.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCategory.kt index 070f822668..a7331b1be9 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCategory.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCategory.kt @@ -34,15 +34,15 @@ import kotlin.String import kotlin.collections.List /** - * @param id Category ID - * @param name Category name - * @param subcategories no description + * @param id - Category ID + * @param name - Category name + * @param subcategories */ data class AdsCategory( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="subcategories") + @SerializedName("subcategories") val subcategories: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsClient.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsClient.kt index 7c966dd911..a43d6d8837 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsClient.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsClient.kt @@ -32,18 +32,18 @@ import kotlin.Int import kotlin.String /** - * @param allLimit Client's total limit, rubles - * @param dayLimit Client's day limit, rubles - * @param id Client ID - * @param name Client name + * @param allLimit - Client's total limit, rubles + * @param dayLimit - Client's day limit, rubles + * @param id - Client ID + * @param name - Client name */ data class AdsClient( - @SerializedName(value="all_limit") + @SerializedName("all_limit") val allLimit: String, - @SerializedName(value="day_limit") + @SerializedName("day_limit") val dayLimit: String, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateTargetGroupResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateTargetGroupResponse.kt new file mode 100644 index 0000000000..35694b17de --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateTargetGroupResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param id - Group ID + * @param pixel - Pixel code + */ +data class AdsCreateTargetGroupResponse( + @SerializedName("id") + val id: Int? = null, + @SerializedName("pixel") + val pixel: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCriteriaSex.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCriteriaSex.kt index 6370591194..cef9061750 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCriteriaSex.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsCriteriaSex.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class AdsCriteriaSex( val value: Int ) { + @SerializedName("0") ANY(0), + @SerializedName("1") MALE(1), + @SerializedName("2") FEMALE(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsCriteriaSex?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsCriteriaSex { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsDemoStats.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsDemoStats.kt index dbe87653dc..964e9dd044 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsDemoStats.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsDemoStats.kt @@ -31,15 +31,15 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param id Object ID - * @param stats no description - * @param type no description + * @param id - Object ID + * @param stats + * @param type */ data class AdsDemoStats( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="stats") + @SerializedName("stats") val stats: AdsDemostatsFormat? = null, - @SerializedName(value="type") + @SerializedName("type") val type: AdsObjectType? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsDemostatsFormat.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsDemostatsFormat.kt index 5be90f5cf1..33efcecb32 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsDemostatsFormat.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsDemostatsFormat.kt @@ -33,27 +33,27 @@ import kotlin.String import kotlin.collections.List /** - * @param age no description - * @param cities no description - * @param day Day as YYYY-MM-DD - * @param month Month as YYYY-MM - * @param overall 1 if period=overall - * @param sex no description - * @param sexAge no description + * @param age + * @param cities + * @param day - Day as YYYY-MM-DD + * @param month - Month as YYYY-MM + * @param overall - 1 if period=overall + * @param sex + * @param sexAge */ data class AdsDemostatsFormat( - @SerializedName(value="age") + @SerializedName("age") val age: List? = null, - @SerializedName(value="cities") + @SerializedName("cities") val cities: List? = null, - @SerializedName(value="day") + @SerializedName("day") val day: String? = null, - @SerializedName(value="month") + @SerializedName("month") val month: String? = null, - @SerializedName(value="overall") + @SerializedName("overall") val overall: Int? = null, - @SerializedName(value="sex") + @SerializedName("sex") val sex: List? = null, - @SerializedName(value="sex_age") + @SerializedName("sex_age") val sexAge: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsFloodStats.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsFloodStats.kt index ec0438cfd7..698e71dfad 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsFloodStats.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsFloodStats.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param left Requests left - * @param refresh Time to refresh in seconds + * @param left - Requests left + * @param refresh - Time to refresh in seconds */ data class AdsFloodStats( - @SerializedName(value="left") + @SerializedName("left") val left: Int, - @SerializedName(value="refresh") + @SerializedName("refresh") val refresh: Int ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetCategoriesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetCategoriesResponse.kt new file mode 100644 index 0000000000..908af0d5e1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetCategoriesResponse.kt @@ -0,0 +1,42 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.collections.List + +/** + * @param v1 - Old categories + * @param v2 - Actual categories + */ +data class AdsGetCategoriesResponse( + @SerializedName("v1") + val v1: List? = null, + @SerializedName("v2") + val v2: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetLookalikeRequestsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetLookalikeRequestsResponse.kt new file mode 100644 index 0000000000..441669cc07 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetLookalikeRequestsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total count of found lookalike requests + * @param items - found lookalike requests + */ +data class AdsGetLookalikeRequestsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetMusiciansResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetMusiciansResponse.kt new file mode 100644 index 0000000000..5d4bb6bb6d --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetMusiciansResponse.kt @@ -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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.collections.List + +/** + * @param items - Musicians + */ +data class AdsGetMusiciansResponse( + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLinkStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLinkStatus.kt index 4be3e768b6..65d2dcb51b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLinkStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLinkStatus.kt @@ -31,15 +31,15 @@ import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param description Reject reason - * @param redirectUrl URL - * @param status Link status + * @param description - Reject reason + * @param redirectUrl - URL + * @param status - Link status */ data class AdsLinkStatus( - @SerializedName(value="description") + @SerializedName("description") val description: String, - @SerializedName(value="redirect_url") + @SerializedName("redirect_url") val redirectUrl: String, - @SerializedName(value="status") + @SerializedName("status") val status: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLookalikeRequest.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLookalikeRequest.kt index 3b2b4657a2..2c7d1a97f5 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLookalikeRequest.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLookalikeRequest.kt @@ -27,123 +27,89 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.Int import kotlin.String import kotlin.collections.List /** - * @param id Lookalike request ID - * @param createTime Lookalike request create time, as Unixtime - * @param updateTime Lookalike request update time, as Unixtime - * @param status Lookalike request status - * @param sourceType Lookalike request source type - * @param scheduledDeleteTime Time by which lookalike request would be deleted, as Unixtime - * @param sourceRetargetingGroupId Retargeting group id, which was used as lookalike seed - * @param sourceName Lookalike request seed name (retargeting group name) - * @param audienceCount Lookalike request seed audience size - * @param saveAudienceLevels no description + * @param id - Lookalike request ID + * @param createTime - Lookalike request create time, as Unixtime + * @param updateTime - Lookalike request update time, as Unixtime + * @param status - Lookalike request status + * @param sourceType - Lookalike request source type + * @param scheduledDeleteTime - Time by which lookalike request would be deleted, as Unixtime + * @param sourceRetargetingGroupId - Retargeting group id, which was used as lookalike seed + * @param sourceName - Lookalike request seed name (retargeting group name) + * @param audienceCount - Lookalike request seed audience size + * @param saveAudienceLevels */ data class AdsLookalikeRequest( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="create_time") + @SerializedName("create_time") val createTime: Int, - @SerializedName(value="update_time") + @SerializedName("update_time") val updateTime: Int, - @SerializedName(value="status") - val status: Status, - @SerializedName(value="source_type") - val sourceType: SourceType, - @SerializedName(value="scheduled_delete_time") + @SerializedName("status") + val status: AdsLookalikeRequest.Status, + @SerializedName("source_type") + val sourceType: AdsLookalikeRequest.SourceType, + @SerializedName("scheduled_delete_time") val scheduledDeleteTime: Int? = null, - @SerializedName(value="source_retargeting_group_id") + @SerializedName("source_retargeting_group_id") val sourceRetargetingGroupId: Int? = null, - @SerializedName(value="source_name") + @SerializedName("source_name") val sourceName: String? = null, - @SerializedName(value="audience_count") + @SerializedName("audience_count") val audienceCount: Int? = null, - @SerializedName(value="save_audience_levels") + @SerializedName("save_audience_levels") val saveAudienceLevels: List? = null ) { - enum class SourceType( - val value: String - ) { - UNKNOWN("unknown"), - - RETARGETING_GROUP("retargeting_group"), - - PROMOTED_POST("promoted_post"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: SourceType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): SourceType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } - } - enum class Status( val value: String ) { + @SerializedName("unknown") UNKNOWN("unknown"), + @SerializedName("new") NEW("new"), + @SerializedName("search_queued") SEARCH_QUEUED("search_queued"), + @SerializedName("search_in_progress") SEARCH_IN_PROGRESS("search_in_progress"), + @SerializedName("search_failed") SEARCH_FAILED("search_failed"), + @SerializedName("search_done") SEARCH_DONE("search_done"), + @SerializedName("save_in_progress") SAVE_IN_PROGRESS("save_in_progress"), + @SerializedName("save_failed") SAVE_FAILED("save_failed"), + @SerializedName("save_done") SAVE_DONE("save_done"), + @SerializedName("canceled") CANCELED("canceled"); + } + + enum class SourceType( + val value: String + ) { + @SerializedName("unknown") + UNKNOWN("unknown"), - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Status?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE + @SerializedName("retargeting_group") + RETARGETING_GROUP("retargeting_group"), - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Status { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } + @SerializedName("promoted_post") + PROMOTED_POST("promoted_post"); } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLookalikeRequestSaveAudienceLevel.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLookalikeRequestSaveAudienceLevel.kt index 3c50d6293c..fe589c7956 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLookalikeRequestSaveAudienceLevel.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsLookalikeRequestSaveAudienceLevel.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param level Save audience level id, which is used in save audience queries - * @param audienceCount Saved audience audience size for according level + * @param level - Save audience level id, which is used in save audience queries + * @param audienceCount - Saved audience audience size for according level */ data class AdsLookalikeRequestSaveAudienceLevel( - @SerializedName(value="level") + @SerializedName("level") val level: Int? = null, - @SerializedName(value="audience_count") + @SerializedName("audience_count") val audienceCount: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsMusician.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsMusician.kt index 1bb4c634f5..23c2b01791 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsMusician.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsMusician.kt @@ -32,15 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param id Targeting music artist ID - * @param name Music artist name - * @param avatar Music artist photo + * @param id - Targeting music artist ID + * @param name - Music artist name + * @param avatar - Music artist photo */ data class AdsMusician( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="avatar") + @SerializedName("avatar") val avatar: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsObjectType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsObjectType.kt index c6b575290c..80c760c1ab 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsObjectType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsObjectType.kt @@ -27,44 +27,21 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AdsObjectType( val value: String ) { + @SerializedName("ad") AD("ad"), + @SerializedName("campaign") CAMPAIGN("campaign"), + @SerializedName("client") CLIENT("client"), + @SerializedName("office") OFFICE("office"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsObjectType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsObjectType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsParagraphs.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsParagraphs.kt index bbe60f5704..6ef741a34b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsParagraphs.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsParagraphs.kt @@ -31,9 +31,9 @@ import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param paragraph Rules paragraph + * @param paragraph - Rules paragraph */ data class AdsParagraphs( - @SerializedName(value="paragraph") + @SerializedName("paragraph") val paragraph: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsPromotedPostReach.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsPromotedPostReach.kt index b9e76c0eeb..68d60fd333 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsPromotedPostReach.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsPromotedPostReach.kt @@ -31,51 +31,51 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param hide Hides amount - * @param id Object ID from 'ids' parameter - * @param joinGroup Community joins - * @param links Link clicks - * @param reachSubscribers Subscribers reach - * @param reachTotal Total reach - * @param report Reports amount - * @param toGroup Community clicks - * @param unsubscribe 'Unsubscribe' events amount - * @param videoViews100p Video views for 100 percent - * @param videoViews25p Video views for 25 percent - * @param videoViews3s Video views for 3 seconds - * @param videoViews50p Video views for 50 percent - * @param videoViews75p Video views for 75 percent - * @param videoViewsStart Video starts + * @param hide - Hides amount + * @param id - Object ID from 'ids' parameter + * @param joinGroup - Community joins + * @param links - Link clicks + * @param reachSubscribers - Subscribers reach + * @param reachTotal - Total reach + * @param report - Reports amount + * @param toGroup - Community clicks + * @param unsubscribe - 'Unsubscribe' events amount + * @param videoViews100p - Video views for 100 percent + * @param videoViews25p - Video views for 25 percent + * @param videoViews3s - Video views for 3 seconds + * @param videoViews50p - Video views for 50 percent + * @param videoViews75p - Video views for 75 percent + * @param videoViewsStart - Video starts */ data class AdsPromotedPostReach( - @SerializedName(value="hide") + @SerializedName("hide") val hide: Int, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="join_group") + @SerializedName("join_group") val joinGroup: Int, - @SerializedName(value="links") + @SerializedName("links") val links: Int, - @SerializedName(value="reach_subscribers") + @SerializedName("reach_subscribers") val reachSubscribers: Int, - @SerializedName(value="reach_total") + @SerializedName("reach_total") val reachTotal: Int, - @SerializedName(value="report") + @SerializedName("report") val report: Int, - @SerializedName(value="to_group") + @SerializedName("to_group") val toGroup: Int, - @SerializedName(value="unsubscribe") + @SerializedName("unsubscribe") val unsubscribe: Int, - @SerializedName(value="video_views_100p") + @SerializedName("video_views_100p") val videoViews100p: Int? = null, - @SerializedName(value="video_views_25p") + @SerializedName("video_views_25p") val videoViews25p: Int? = null, - @SerializedName(value="video_views_3s") + @SerializedName("video_views_3s") val videoViews3s: Int? = null, - @SerializedName(value="video_views_50p") + @SerializedName("video_views_50p") val videoViews50p: Int? = null, - @SerializedName(value="video_views_75p") + @SerializedName("video_views_75p") val videoViews75p: Int? = null, - @SerializedName(value="video_views_start") + @SerializedName("video_views_start") val videoViewsStart: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsRejectReason.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsRejectReason.kt index 9d320af18d..cdb126a01e 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsRejectReason.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsRejectReason.kt @@ -32,12 +32,12 @@ import kotlin.String import kotlin.collections.List /** - * @param comment Comment text - * @param rules no description + * @param comment - Comment text + * @param rules */ data class AdsRejectReason( - @SerializedName(value="comment") + @SerializedName("comment") val comment: String? = null, - @SerializedName(value="rules") + @SerializedName("rules") val rules: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsRules.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsRules.kt index bf75406eee..5508b56168 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsRules.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsRules.kt @@ -32,12 +32,12 @@ import kotlin.String import kotlin.collections.List /** - * @param paragraphs no description - * @param title Comment + * @param paragraphs + * @param title - Comment */ data class AdsRules( - @SerializedName(value="paragraphs") + @SerializedName("paragraphs") val paragraphs: List? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStats.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStats.kt index 9ae2350881..825a3a74e4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStats.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStats.kt @@ -31,18 +31,18 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param id Object ID - * @param stats no description - * @param type no description - * @param viewsTimes no description + * @param id - Object ID + * @param stats + * @param type + * @param viewsTimes */ data class AdsStats( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="stats") + @SerializedName("stats") val stats: AdsStatsFormat? = null, - @SerializedName(value="type") + @SerializedName("type") val type: AdsObjectType? = null, - @SerializedName(value="views_times") + @SerializedName("views_times") val viewsTimes: AdsStatsViewsTimes? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsAge.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsAge.kt index 2514e2b6d9..c7534b5f34 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsAge.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsAge.kt @@ -32,15 +32,15 @@ import kotlin.Float import kotlin.String /** - * @param clicksRate Clicks rate - * @param impressionsRate Impressions rate - * @param value Age interval + * @param clicksRate - Clicks rate + * @param impressionsRate - Impressions rate + * @param value - Age interval */ data class AdsStatsAge( - @SerializedName(value="clicks_rate") + @SerializedName("clicks_rate") val clicksRate: Float? = null, - @SerializedName(value="impressions_rate") + @SerializedName("impressions_rate") val impressionsRate: Float? = null, - @SerializedName(value="value") + @SerializedName("value") val value: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsCities.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsCities.kt index 7ce77a1d9c..2d9536a534 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsCities.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsCities.kt @@ -33,18 +33,18 @@ import kotlin.Int import kotlin.String /** - * @param clicksRate Clicks rate - * @param impressionsRate Impressions rate - * @param name City name - * @param value City ID + * @param clicksRate - Clicks rate + * @param impressionsRate - Impressions rate + * @param name - City name + * @param value - City ID */ data class AdsStatsCities( - @SerializedName(value="clicks_rate") + @SerializedName("clicks_rate") val clicksRate: Float? = null, - @SerializedName(value="impressions_rate") + @SerializedName("impressions_rate") val impressionsRate: Float? = null, - @SerializedName(value="name") + @SerializedName("name") val name: String? = null, - @SerializedName(value="value") + @SerializedName("value") val value: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsFormat.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsFormat.kt index ca0d3475cd..0a30eb1350 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsFormat.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsFormat.kt @@ -32,42 +32,48 @@ import kotlin.Int import kotlin.String /** - * @param clicks Clicks number - * @param day Day as YYYY-MM-DD - * @param impressions Impressions number - * @param joinRate Events number - * @param month Month as YYYY-MM - * @param overall 1 if period=overall - * @param reach Reach - * @param spent Spent funds - * @param videoClicksSite Clickthoughs to the advertised site - * @param videoViews Video views number - * @param videoViewsFull Video views (full video) - * @param videoViewsHalf Video views (half of video) + * @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 + * @param joinRate - Events number + * @param month - Month as YYYY-MM + * @param overall - 1 if period=overall + * @param reach - Reach + * @param spent - Spent funds + * @param videoClicksSite - Clickthoughs to the advertised site + * @param videoViews - Video views number + * @param videoViewsFull - Video views (full video) + * @param videoViewsHalf - Video views (half of video) */ data class AdsStatsFormat( - @SerializedName(value="clicks") + @SerializedName("clicks") val clicks: Int? = null, - @SerializedName(value="day") + @SerializedName("link_owner_clicks") + val linkOwnerClicks: Int? = null, + @SerializedName("link_external_clicks") + val linkExternalClicks: Int? = null, + @SerializedName("day") val day: String? = null, - @SerializedName(value="impressions") + @SerializedName("impressions") val impressions: Int? = null, - @SerializedName(value="join_rate") + @SerializedName("join_rate") val joinRate: Int? = null, - @SerializedName(value="month") + @SerializedName("month") val month: String? = null, - @SerializedName(value="overall") + @SerializedName("overall") val overall: Int? = null, - @SerializedName(value="reach") + @SerializedName("reach") val reach: Int? = null, - @SerializedName(value="spent") + @SerializedName("spent") val spent: Int? = null, - @SerializedName(value="video_clicks_site") + @SerializedName("video_clicks_site") val videoClicksSite: Int? = null, - @SerializedName(value="video_views") + @SerializedName("video_views") val videoViews: Int? = null, - @SerializedName(value="video_views_full") + @SerializedName("video_views_full") val videoViewsFull: Int? = null, - @SerializedName(value="video_views_half") + @SerializedName("video_views_half") val videoViewsHalf: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSex.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSex.kt index bc33698518..a4c14b9f8e 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSex.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSex.kt @@ -31,15 +31,15 @@ import com.google.gson.annotations.SerializedName import kotlin.Float /** - * @param clicksRate Clicks rate - * @param impressionsRate Impressions rate - * @param value no description + * @param clicksRate - Clicks rate + * @param impressionsRate - Impressions rate + * @param value */ data class AdsStatsSex( - @SerializedName(value="clicks_rate") + @SerializedName("clicks_rate") val clicksRate: Float? = null, - @SerializedName(value="impressions_rate") + @SerializedName("impressions_rate") val impressionsRate: Float? = null, - @SerializedName(value="value") + @SerializedName("value") val value: AdsStatsSexValue? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSexAge.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSexAge.kt index 8f13923068..9d7e41a490 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSexAge.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSexAge.kt @@ -32,15 +32,15 @@ import kotlin.Float import kotlin.String /** - * @param clicksRate Clicks rate - * @param impressionsRate Impressions rate - * @param value Sex and age interval + * @param clicksRate - Clicks rate + * @param impressionsRate - Impressions rate + * @param value - Sex and age interval */ data class AdsStatsSexAge( - @SerializedName(value="clicks_rate") + @SerializedName("clicks_rate") val clicksRate: Float? = null, - @SerializedName(value="impressions_rate") + @SerializedName("impressions_rate") val impressionsRate: Float? = null, - @SerializedName(value="value") + @SerializedName("value") val value: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSexValue.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSexValue.kt index fdd6eef4b0..d8c43c21d3 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSexValue.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsSexValue.kt @@ -27,40 +27,15 @@ // ********************************************************************* package com.vk.sdk.api.ads.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class AdsStatsSexValue( val value: String ) { + @SerializedName("f") FEMALE("f"), + @SerializedName("m") MALE("m"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: AdsStatsSexValue?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AdsStatsSexValue { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsViewsTimes.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsViewsTimes.kt index eba6ce7435..e5bf35e0ce 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsViewsTimes.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsStatsViewsTimes.kt @@ -32,39 +32,39 @@ import kotlin.Int import kotlin.String /** - * @param viewsAdsTimes1 no description - * @param viewsAdsTimes2 no description - * @param viewsAdsTimes3 no description - * @param viewsAdsTimes4 no description - * @param viewsAdsTimes5 no description - * @param viewsAdsTimes6 no description - * @param viewsAdsTimes7 no description - * @param viewsAdsTimes8 no description - * @param viewsAdsTimes9 no description - * @param viewsAdsTimes10 no description - * @param viewsAdsTimes11Plus no description + * @param viewsAdsTimes1 + * @param viewsAdsTimes2 + * @param viewsAdsTimes3 + * @param viewsAdsTimes4 + * @param viewsAdsTimes5 + * @param viewsAdsTimes6 + * @param viewsAdsTimes7 + * @param viewsAdsTimes8 + * @param viewsAdsTimes9 + * @param viewsAdsTimes10 + * @param viewsAdsTimes11Plus */ data class AdsStatsViewsTimes( - @SerializedName(value="views_ads_times_1") + @SerializedName("views_ads_times_1") val viewsAdsTimes1: Int? = null, - @SerializedName(value="views_ads_times_2") + @SerializedName("views_ads_times_2") val viewsAdsTimes2: Int? = null, - @SerializedName(value="views_ads_times_3") + @SerializedName("views_ads_times_3") val viewsAdsTimes3: Int? = null, - @SerializedName(value="views_ads_times_4") + @SerializedName("views_ads_times_4") val viewsAdsTimes4: Int? = null, - @SerializedName(value="views_ads_times_5") + @SerializedName("views_ads_times_5") val viewsAdsTimes5: String? = null, - @SerializedName(value="views_ads_times_6") + @SerializedName("views_ads_times_6") val viewsAdsTimes6: Int? = null, - @SerializedName(value="views_ads_times_7") + @SerializedName("views_ads_times_7") val viewsAdsTimes7: Int? = null, - @SerializedName(value="views_ads_times_8") + @SerializedName("views_ads_times_8") val viewsAdsTimes8: Int? = null, - @SerializedName(value="views_ads_times_9") + @SerializedName("views_ads_times_9") val viewsAdsTimes9: Int? = null, - @SerializedName(value="views_ads_times_10") + @SerializedName("views_ads_times_10") val viewsAdsTimes10: Int? = null, - @SerializedName(value="views_ads_times_11_plus") + @SerializedName("views_ads_times_11_plus") val viewsAdsTimes11Plus: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargSettings.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargSettings.kt index b4e9758763..bca827f6d6 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargSettings.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargSettings.kt @@ -34,102 +34,102 @@ import kotlin.Int import kotlin.String /** - * @param id Ad ID - * @param campaignId Campaign ID - * @param ageFrom Age from - * @param ageTo Age to - * @param apps Apps IDs - * @param appsNot Apps IDs to except - * @param birthday Days to birthday - * @param cities Cities IDs - * @param citiesNot Cities IDs to except - * @param country Country ID - * @param districts Districts IDs - * @param groups Communities IDs - * @param interestCategories Interests categories IDs - * @param interests Interests - * @param paying Information whether the user has proceeded VK payments before - * @param positions Positions IDs - * @param religions Religions IDs - * @param retargetingGroups Retargeting groups IDs - * @param retargetingGroupsNot Retargeting groups IDs to except - * @param schoolFrom School graduation year from - * @param schoolTo School graduation year to - * @param schools Schools IDs - * @param sex no description - * @param stations Stations IDs - * @param statuses Relationship statuses - * @param streets Streets IDs - * @param travellers Travellers only - * @param uniFrom University graduation year from - * @param uniTo University graduation year to - * @param userBrowsers Browsers - * @param userDevices Devices - * @param userOs Operating systems + * @param id - Ad ID + * @param campaignId - Campaign ID + * @param ageFrom - Age from + * @param ageTo - Age to + * @param apps - Apps IDs + * @param appsNot - Apps IDs to except + * @param birthday - Days to birthday + * @param cities - Cities IDs + * @param citiesNot - Cities IDs to except + * @param country - Country ID + * @param districts - Districts IDs + * @param groups - Communities IDs + * @param interestCategories - Interests categories IDs + * @param interests - Interests + * @param paying - Information whether the user has proceeded VK payments before + * @param positions - Positions IDs + * @param religions - Religions IDs + * @param retargetingGroups - Retargeting groups IDs + * @param retargetingGroupsNot - Retargeting groups IDs to except + * @param schoolFrom - School graduation year from + * @param schoolTo - School graduation year to + * @param schools - Schools IDs + * @param sex + * @param stations - Stations IDs + * @param statuses - Relationship statuses + * @param streets - Streets IDs + * @param travellers - Travellers only + * @param uniFrom - University graduation year from + * @param uniTo - University graduation year to + * @param userBrowsers - Browsers + * @param userDevices - Devices + * @param userOs - Operating systems */ data class AdsTargSettings( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="campaign_id") + @SerializedName("campaign_id") val campaignId: Int? = null, - @SerializedName(value="age_from") + @SerializedName("age_from") val ageFrom: Int? = null, - @SerializedName(value="age_to") + @SerializedName("age_to") val ageTo: Int? = null, - @SerializedName(value="apps") + @SerializedName("apps") val apps: String? = null, - @SerializedName(value="apps_not") + @SerializedName("apps_not") val appsNot: String? = null, - @SerializedName(value="birthday") + @SerializedName("birthday") val birthday: Int? = null, - @SerializedName(value="cities") + @SerializedName("cities") val cities: String? = null, - @SerializedName(value="cities_not") + @SerializedName("cities_not") val citiesNot: String? = null, - @SerializedName(value="country") + @SerializedName("country") val country: Int? = null, - @SerializedName(value="districts") + @SerializedName("districts") val districts: String? = null, - @SerializedName(value="groups") + @SerializedName("groups") val groups: String? = null, - @SerializedName(value="interest_categories") + @SerializedName("interest_categories") val interestCategories: String? = null, - @SerializedName(value="interests") + @SerializedName("interests") val interests: String? = null, - @SerializedName(value="paying") + @SerializedName("paying") val paying: BaseBoolInt? = null, - @SerializedName(value="positions") + @SerializedName("positions") val positions: String? = null, - @SerializedName(value="religions") + @SerializedName("religions") val religions: String? = null, - @SerializedName(value="retargeting_groups") + @SerializedName("retargeting_groups") val retargetingGroups: String? = null, - @SerializedName(value="retargeting_groups_not") + @SerializedName("retargeting_groups_not") val retargetingGroupsNot: String? = null, - @SerializedName(value="school_from") + @SerializedName("school_from") val schoolFrom: Int? = null, - @SerializedName(value="school_to") + @SerializedName("school_to") val schoolTo: Int? = null, - @SerializedName(value="schools") + @SerializedName("schools") val schools: String? = null, - @SerializedName(value="sex") + @SerializedName("sex") val sex: AdsCriteriaSex? = null, - @SerializedName(value="stations") + @SerializedName("stations") val stations: String? = null, - @SerializedName(value="statuses") + @SerializedName("statuses") val statuses: String? = null, - @SerializedName(value="streets") + @SerializedName("streets") val streets: String? = null, - @SerializedName(value="travellers") + @SerializedName("travellers") val travellers: BasePropertyExists? = null, - @SerializedName(value="uni_from") + @SerializedName("uni_from") val uniFrom: Int? = null, - @SerializedName(value="uni_to") + @SerializedName("uni_to") val uniTo: Int? = null, - @SerializedName(value="user_browsers") + @SerializedName("user_browsers") val userBrowsers: String? = null, - @SerializedName(value="user_devices") + @SerializedName("user_devices") val userDevices: String? = null, - @SerializedName(value="user_os") + @SerializedName("user_os") val userOs: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargStats.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargStats.kt index 806e91edc3..d8c3241a9a 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargStats.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargStats.kt @@ -32,33 +32,33 @@ import kotlin.Float import kotlin.Int /** - * @param audienceCount Audience - * @param recommendedCpc Recommended CPC value for 50 percent reach (old format) - * @param recommendedCpm Recommended CPM value for 50 percent reach (old format) - * @param recommendedCpc50 Recommended CPC value for 50 percent reach - * @param recommendedCpm50 Recommended CPM value for 50 percent reach - * @param recommendedCpc70 Recommended CPC value for 70 percent reach - * @param recommendedCpm70 Recommended CPM value for 70 percent reach - * @param recommendedCpc90 Recommended CPC value for 90 percent reach - * @param recommendedCpm90 Recommended CPM value for 90 percent reach + * @param audienceCount - Audience + * @param recommendedCpc - Recommended CPC value for 50 percent reach (old format) + * @param recommendedCpm - Recommended CPM value for 50 percent reach (old format) + * @param recommendedCpc50 - Recommended CPC value for 50 percent reach + * @param recommendedCpm50 - Recommended CPM value for 50 percent reach + * @param recommendedCpc70 - Recommended CPC value for 70 percent reach + * @param recommendedCpm70 - Recommended CPM value for 70 percent reach + * @param recommendedCpc90 - Recommended CPC value for 90 percent reach + * @param recommendedCpm90 - Recommended CPM value for 90 percent reach */ data class AdsTargStats( - @SerializedName(value="audience_count") + @SerializedName("audience_count") val audienceCount: Int, - @SerializedName(value="recommended_cpc") + @SerializedName("recommended_cpc") val recommendedCpc: Float? = null, - @SerializedName(value="recommended_cpm") + @SerializedName("recommended_cpm") val recommendedCpm: Float? = null, - @SerializedName(value="recommended_cpc_50") + @SerializedName("recommended_cpc_50") val recommendedCpc50: Float? = null, - @SerializedName(value="recommended_cpm_50") + @SerializedName("recommended_cpm_50") val recommendedCpm50: Float? = null, - @SerializedName(value="recommended_cpc_70") + @SerializedName("recommended_cpc_70") val recommendedCpc70: Float? = null, - @SerializedName(value="recommended_cpm_70") + @SerializedName("recommended_cpm_70") val recommendedCpm70: Float? = null, - @SerializedName(value="recommended_cpc_90") + @SerializedName("recommended_cpc_90") val recommendedCpc90: Float? = null, - @SerializedName(value="recommended_cpm_90") + @SerializedName("recommended_cpm_90") val recommendedCpm90: Float? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargSuggestions.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargSuggestions.kt index 16f6245ef0..197c5a027c 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargSuggestions.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargSuggestions.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id Object ID - * @param name Object name + * @param id - Object ID + * @param name - Object name */ data class AdsTargSuggestions( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="name") + @SerializedName("name") val name: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargetGroup.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargetGroup.kt index 7aaeab8e8e..cc3ab4d77d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargetGroup.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsTargetGroup.kt @@ -32,24 +32,24 @@ import kotlin.Int import kotlin.String /** - * @param audienceCount Audience - * @param domain Site domain - * @param id Group ID - * @param lifetime Number of days for user to be in group - * @param name Group name - * @param pixel Pixel code + * @param audienceCount - Audience + * @param domain - Site domain + * @param id - Group ID + * @param lifetime - Number of days for user to be in group + * @param name - Group name + * @param pixel - Pixel code */ data class AdsTargetGroup( - @SerializedName(value="audience_count") + @SerializedName("audience_count") val audienceCount: Int? = null, - @SerializedName(value="domain") + @SerializedName("domain") val domain: String? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="lifetime") + @SerializedName("lifetime") val lifetime: Int? = null, - @SerializedName(value="name") + @SerializedName("name") val name: String? = null, - @SerializedName(value="pixel") + @SerializedName("pixel") val pixel: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUpdateOfficeUsersResult.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUpdateOfficeUsersResult.kt index 57f9538524..df0b6fab91 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUpdateOfficeUsersResult.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUpdateOfficeUsersResult.kt @@ -33,15 +33,15 @@ import kotlin.Boolean import kotlin.Int /** - * @param userId no description - * @param isSuccess no description - * @param error no description + * @param userId + * @param isSuccess + * @param error */ data class AdsUpdateOfficeUsersResult( - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int, - @SerializedName(value="is_success") + @SerializedName("is_success") val isSuccess: Boolean, - @SerializedName(value="error") + @SerializedName("error") val error: BaseError? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecification.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecification.kt index 4b16fce6df..0ef8fc9141 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecification.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecification.kt @@ -33,21 +33,21 @@ import kotlin.Int import kotlin.collections.List /** - * @param userId no description - * @param role no description - * @param grantAccessToAllClients no description - * @param clientIds no description - * @param viewBudget no description + * @param userId + * @param role + * @param grantAccessToAllClients + * @param clientIds + * @param viewBudget */ data class AdsUserSpecification( - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int, - @SerializedName(value="role") + @SerializedName("role") val role: AdsAccessRolePublic, - @SerializedName(value="grant_access_to_all_clients") + @SerializedName("grant_access_to_all_clients") val grantAccessToAllClients: Boolean? = null, - @SerializedName(value="client_ids") + @SerializedName("client_ids") val clientIds: List? = null, - @SerializedName(value="view_budget") + @SerializedName("view_budget") val viewBudget: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecificationCutted.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecificationCutted.kt index 530f9aa2e9..5e9e1343aa 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecificationCutted.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecificationCutted.kt @@ -32,18 +32,18 @@ import kotlin.Boolean import kotlin.Int /** - * @param userId no description - * @param role no description - * @param clientId no description - * @param viewBudget no description + * @param userId + * @param role + * @param clientId + * @param viewBudget */ data class AdsUserSpecificationCutted( - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int, - @SerializedName(value="role") + @SerializedName("role") val role: AdsAccessRolePublic, - @SerializedName(value="client_id") + @SerializedName("client_id") val clientId: Int? = null, - @SerializedName(value="view_budget") + @SerializedName("view_budget") val viewBudget: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUsers.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUsers.kt index 94e4379813..df95d5ea36 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUsers.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/AdsUsers.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param accesses no description - * @param userId User ID + * @param accesses + * @param userId - User ID */ data class AdsUsers( - @SerializedName(value="accesses") + @SerializedName("accesses") val accesses: List, - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/FieldsParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/FieldsParam.kt new file mode 100644 index 0000000000..8811b3d45f --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/FieldsParam.kt @@ -0,0 +1,38 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FieldsParam( + val value: String +) { + @SerializedName("ads_count") + ADS_COUNT("ads_count"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/IdsTypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/IdsTypeParam.kt new file mode 100644 index 0000000000..1e269877a7 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/IdsTypeParam.kt @@ -0,0 +1,41 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class IdsTypeParam( + val value: String +) { + @SerializedName("ad") + AD("ad"), + + @SerializedName("campaign") + CAMPAIGN("campaign"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/LangParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/LangParam.kt new file mode 100644 index 0000000000..ff60c0c7fe --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/LangParam.kt @@ -0,0 +1,44 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class LangParam( + val value: String +) { + @SerializedName("ru") + RUSSIAN("ru"), + + @SerializedName("ua") + UKRAINIAN("ua"), + + @SerializedName("en") + ENGLISH("en"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/LinkTypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/LinkTypeParam.kt new file mode 100644 index 0000000000..212a44a9d3 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/LinkTypeParam.kt @@ -0,0 +1,50 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class LinkTypeParam( + val value: String +) { + @SerializedName("community") + COMMUNITY("community"), + + @SerializedName("post") + POST("post"), + + @SerializedName("application") + APPLICATION("application"), + + @SerializedName("video") + VIDEO("video"), + + @SerializedName("site") + SITE("site"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/PeriodParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/PeriodParam.kt new file mode 100644 index 0000000000..eaa01a054e --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/PeriodParam.kt @@ -0,0 +1,44 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class PeriodParam( + val value: String +) { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("overall") + OVERALL("overall"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/SectionParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/SectionParam.kt new file mode 100644 index 0000000000..f0d26137de --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/SectionParam.kt @@ -0,0 +1,71 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class SectionParam( + val value: String +) { + @SerializedName("countries") + COUNTRIES("countries"), + + @SerializedName("regions") + REGIONS("regions"), + + @SerializedName("cities") + CITIES("cities"), + + @SerializedName("districts") + DISTRICTS("districts"), + + @SerializedName("stations") + STATIONS("stations"), + + @SerializedName("streets") + STREETS("streets"), + + @SerializedName("schools") + SCHOOLS("schools"), + + @SerializedName("interests") + INTERESTS("interests"), + + @SerializedName("positions") + POSITIONS("positions"), + + @SerializedName("group_types") + GROUP_TYPES("group_types"), + + @SerializedName("religions") + RELIGIONS("religions"), + + @SerializedName("browsers") + BROWSERS("browsers"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/StatsFieldsParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/StatsFieldsParam.kt new file mode 100644 index 0000000000..e65a8c0c7e --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/ads/dto/StatsFieldsParam.kt @@ -0,0 +1,38 @@ +/** + * 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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class StatsFieldsParam( + val value: String +) { + @SerializedName("views_times") + VIEWS_TIMES("views_times"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/AppWidgetsService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/AppWidgetsService.kt new file mode 100644 index 0000000000..921ff7974e --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/AppWidgetsService.kt @@ -0,0 +1,180 @@ +/** + * 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.appWidgets + +import com.google.gson.reflect.TypeToken +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.appWidgets.dto.AppWidgetsGetAppImageUploadServerResponse +import com.vk.sdk.api.appWidgets.dto.AppWidgetsGetGroupImageUploadServerResponse +import com.vk.sdk.api.appWidgets.dto.AppWidgetsPhoto +import com.vk.sdk.api.appWidgets.dto.AppWidgetsPhotos +import com.vk.sdk.api.appWidgets.dto.ImageTypeParam +import com.vk.sdk.api.appWidgets.dto.TypeParam +import com.vk.sdk.api.base.dto.BaseOkResponse +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class AppWidgetsService { + /** + * Returns a URL for uploading a photo to the community collection for community app widgets + * + * @param imageType + * @return [VKRequest] with [AppWidgetsGetAppImageUploadServerResponse] + */ + fun appWidgetsGetAppImageUploadServer(imageType: ImageTypeParam): + VKRequest = + NewApiRequest("appWidgets.getAppImageUploadServer") { + GsonHolder.gson.fromJson(it, AppWidgetsGetAppImageUploadServerResponse::class.java) + } + .apply { + addParam("image_type", imageType.value) + } + + /** + * Returns an app collection of images for community app widgets + * + * @param offset - Offset needed to return a specific subset of images. + * @param count - Maximum count of results. + * @param imageType + * @return [VKRequest] with [AppWidgetsPhotos] + */ + fun appWidgetsGetAppImages( + offset: Int? = null, + count: Int? = null, + imageType: ImageTypeParam? = null + ): VKRequest = NewApiRequest("appWidgets.getAppImages") { + GsonHolder.gson.fromJson(it, AppWidgetsPhotos::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + imageType?.let { addParam("image_type", it.value) } + } + + /** + * Returns a URL for uploading a photo to the community collection for community app widgets + * + * @param imageType + * @return [VKRequest] with [AppWidgetsGetGroupImageUploadServerResponse] + */ + fun appWidgetsGetGroupImageUploadServer(imageType: ImageTypeParam): + VKRequest = + NewApiRequest("appWidgets.getGroupImageUploadServer") { + GsonHolder.gson.fromJson(it, AppWidgetsGetGroupImageUploadServerResponse::class.java) + } + .apply { + addParam("image_type", imageType.value) + } + + /** + * Returns a community collection of images for community app widgets + * + * @param offset - Offset needed to return a specific subset of images. + * @param count - Maximum count of results. + * @param imageType + * @return [VKRequest] with [AppWidgetsPhotos] + */ + fun appWidgetsGetGroupImages( + offset: Int? = null, + count: Int? = null, + imageType: ImageTypeParam? = null + ): VKRequest = NewApiRequest("appWidgets.getGroupImages") { + GsonHolder.gson.fromJson(it, AppWidgetsPhotos::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + imageType?.let { addParam("image_type", it.value) } + } + + /** + * Returns an image for community app widgets by its ID + * + * @param images - List of images IDs + * @return [VKRequest] with [Unit] + */ + fun appWidgetsGetImagesById(images: List): VKRequest> = + NewApiRequest("appWidgets.getImagesById") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("images", images) + } + + /** + * Allows to save image into app collection for community app widgets + * + * @param hash - Parameter returned when photo is uploaded to server + * @param image - Parameter returned when photo is uploaded to server + * @return [VKRequest] with [AppWidgetsPhoto] + */ + fun appWidgetsSaveAppImage(hash: String, image: String): VKRequest = + NewApiRequest("appWidgets.saveAppImage") { + GsonHolder.gson.fromJson(it, AppWidgetsPhoto::class.java) + } + .apply { + addParam("hash", hash) + addParam("image", image) + } + + /** + * Allows to save image into community collection for community app widgets + * + * @param hash - Parameter returned when photo is uploaded to server + * @param image - Parameter returned when photo is uploaded to server + * @return [VKRequest] with [AppWidgetsPhoto] + */ + fun appWidgetsSaveGroupImage(hash: String, image: String): VKRequest = + NewApiRequest("appWidgets.saveGroupImage") { + GsonHolder.gson.fromJson(it, AppWidgetsPhoto::class.java) + } + .apply { + addParam("hash", hash) + addParam("image", image) + } + + /** + * Allows to update community app widget + * + * @param code + * @param type + * @return [VKRequest] with [BaseOkResponse] + */ + fun appWidgetsUpdate(code: String, type: TypeParam): VKRequest = + NewApiRequest("appWidgets.update") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("code", code) + addParam("type", type.value) + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImageUploadServerResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImageUploadServerResponse.kt new file mode 100644 index 0000000000..c15ed22e6a --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImageUploadServerResponse.kt @@ -0,0 +1,40 @@ +/** + * 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.appWidgets.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param uploadUrl - To upload an image, generate POST-request to upload_url with a file in photo + * field. Then call appWidgets.saveAppImage method + */ +data class AppWidgetsGetAppImageUploadServerResponse( + @SerializedName("upload_url") + val uploadUrl: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImageUploadServerResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImageUploadServerResponse.kt new file mode 100644 index 0000000000..ba67739177 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImageUploadServerResponse.kt @@ -0,0 +1,40 @@ +/** + * 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.appWidgets.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param uploadUrl - To upload an image, generate POST-request to upload_url with a file in photo + * field. Then call appWidgets.saveAppImage method + */ +data class AppWidgetsGetGroupImageUploadServerResponse( + @SerializedName("upload_url") + val uploadUrl: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsPhoto.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsPhoto.kt index a9e81969af..67ff505270 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsPhoto.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsPhoto.kt @@ -33,12 +33,12 @@ import kotlin.String import kotlin.collections.List /** - * @param id Image ID - * @param images no description + * @param id - Image ID + * @param images */ data class AppWidgetsPhoto( - @SerializedName(value="id") + @SerializedName("id") val id: String, - @SerializedName(value="images") + @SerializedName("images") val images: List ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsPhotos.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsPhotos.kt index f2d1236840..8068172830 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsPhotos.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsPhotos.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param count no description - * @param items no description + * @param count + * @param items */ data class AppWidgetsPhotos( - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null, - @SerializedName(value="items") + @SerializedName("items") val items: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/ImageTypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/ImageTypeParam.kt new file mode 100644 index 0000000000..61becddf4c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/ImageTypeParam.kt @@ -0,0 +1,50 @@ +/** + * 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.appWidgets.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class ImageTypeParam( + val value: String +) { + @SerializedName("160x160") + SIXTEEN_0X160("160x160"), + + @SerializedName("160x240") + SIXTEEN_0X240("160x240"), + + @SerializedName("24x24") + TWENTY_FOUR_X24("24x24"), + + @SerializedName("50x50") + FIFTYZERO_X50("50x50"), + + @SerializedName("510x128") + FIFTY_ONE_0X128("510x128"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/TypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/TypeParam.kt new file mode 100644 index 0000000000..23340bc7fc --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/appWidgets/dto/TypeParam.kt @@ -0,0 +1,62 @@ +/** + * 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.appWidgets.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class TypeParam( + val value: String +) { + @SerializedName("compact_list") + COMPACT_LIST("compact_list"), + + @SerializedName("cover_list") + COVER_LIST("cover_list"), + + @SerializedName("donation") + DONATION("donation"), + + @SerializedName("list") + LIST("list"), + + @SerializedName("match") + MATCH("match"), + + @SerializedName("matches") + MATCHES("matches"), + + @SerializedName("table") + TABLE("table"), + + @SerializedName("text") + TEXT("text"), + + @SerializedName("tiles") + TILES("tiles"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/AppsService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/AppsService.kt new file mode 100644 index 0000000000..2af2f0be5c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/AppsService.kt @@ -0,0 +1,315 @@ +/** + * 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.apps + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.apps.dto.AppsGetCatalogResponse +import com.vk.sdk.api.apps.dto.AppsGetFriendsListResponse +import com.vk.sdk.api.apps.dto.AppsGetLeaderboardExtendedResponse +import com.vk.sdk.api.apps.dto.AppsGetLeaderboardResponse +import com.vk.sdk.api.apps.dto.AppsGetMiniAppPoliciesResponse +import com.vk.sdk.api.apps.dto.AppsGetResponse +import com.vk.sdk.api.apps.dto.AppsGetScopesResponse +import com.vk.sdk.api.apps.dto.FilterParam +import com.vk.sdk.api.apps.dto.NameCaseParam +import com.vk.sdk.api.apps.dto.PlatformParam +import com.vk.sdk.api.apps.dto.SortParam +import com.vk.sdk.api.apps.dto.TypeParam +import com.vk.sdk.api.base.dto.BaseBoolInt +import com.vk.sdk.api.base.dto.BaseOkResponse +import com.vk.sdk.api.users.dto.UsersFields +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class AppsService { + /** + * Deletes all request notifications from the current app. + * + * @return [VKRequest] with [BaseOkResponse] + */ + fun appsDeleteAppRequests(): VKRequest = + NewApiRequest("apps.deleteAppRequests") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + + /** + * Returns applications data. + * + * @param appId - Application ID + * @param appIds - List of application ID + * @param platform - platform. Possible values: *'ios' - iOS,, *'android' - Android,, + * *'winphone' - Windows Phone,, *'web' - ---------- -- vk.com. By default: 'web'. + * @param returnFriends + * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', + * 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', + * 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities', (only + * if return_friends - 1) + * @param nameCase - Case for declension of user name and surname: 'nom' - nominative + * (default),, 'gen' - genitive,, 'dat' - dative,, 'acc' - accusative,, 'ins' - instrumental,, + * 'abl' - prepositional. (only if 'return_friends' = '1') + * @return [VKRequest] with [AppsGetResponse] + */ + fun appsGet( + appId: Int? = null, + appIds: List? = null, + platform: PlatformParam? = null, + returnFriends: Boolean? = null, + fields: List? = null, + nameCase: NameCaseParam? = null + ): VKRequest = NewApiRequest("apps.get") { + GsonHolder.gson.fromJson(it, AppsGetResponse::class.java) + } + .apply { + appId?.let { addParam("app_id", it) } + appIds?.let { addParam("app_ids", it) } + platform?.let { addParam("platform", it.value) } + returnFriends?.let { addParam("return_friends", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + nameCase?.let { addParam("name_case", it.value) } + } + + /** + * Returns a list of applications (apps) available to users in the App Catalog. + * + * @param count - Number of apps to return. + * @param sort - Sort order: 'popular_today' - popular for one day (default), 'visitors' - by + * visitors number , 'create_date' - by creation date, 'growth_rate' - by growth rate, + * 'popular_week' - popular for one week + * @param offset - Offset required to return a specific subset of apps. + * @param platform + * @param returnFriends + * @param fields + * @param nameCase + * @param q - Search query string. + * @param genreId + * @param filter - 'installed' - to return list of installed apps (only for mobile platform). + * @return [VKRequest] with [AppsGetCatalogResponse] + */ + fun appsGetCatalog( + count: Int, + sort: SortParam? = null, + offset: Int? = null, + platform: String? = null, + returnFriends: Boolean? = null, + fields: List? = null, + nameCase: String? = null, + q: String? = null, + genreId: Int? = null, + filter: FilterParam? = null + ): VKRequest = NewApiRequest("apps.getCatalog") { + GsonHolder.gson.fromJson(it, AppsGetCatalogResponse::class.java) + } + .apply { + addParam("count", count) + sort?.let { addParam("sort", it.value) } + offset?.let { addParam("offset", it) } + platform?.let { addParam("platform", it) } + returnFriends?.let { addParam("return_friends", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + nameCase?.let { addParam("name_case", it) } + q?.let { addParam("q", it) } + genreId?.let { addParam("genre_id", it) } + filter?.let { addParam("filter", it.value) } + } + + /** + * Creates friends list for requests and invites in current app. + * + * @param count - List size. + * @param offset + * @param type - List type. Possible values: * 'invite' - available for invites (don't play the + * game),, * 'request' - available for request (play the game). By default: 'invite'. + * @param fields - Additional profile fields, see [vk.com/dev/fields|description]. + * @return [VKRequest] with [AppsGetFriendsListResponse] + */ + fun appsGetFriendsList( + count: Int? = null, + offset: Int? = null, + type: TypeParam? = null, + fields: List? = null + ): VKRequest = NewApiRequest("apps.getFriendsList") { + GsonHolder.gson.fromJson(it, AppsGetFriendsListResponse::class.java) + } + .apply { + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + type?.let { addParam("type", it.value) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns players rating in the game. + * + * @param type - Leaderboard type. Possible values: *'level' - by level,, *'points' - by mission + * points,, *'score' - by score (). + * @param global - Rating type. Possible values: *'1' - global rating among all players,, *'0' - + * rating among user friends. + * @return [VKRequest] with [AppsGetLeaderboardResponse] + */ + fun appsGetLeaderboard(type: TypeParam, global: Boolean? = null): + VKRequest = NewApiRequest("apps.getLeaderboard") { + GsonHolder.gson.fromJson(it, AppsGetLeaderboardResponse::class.java) + } + .apply { + addParam("type", type.value) + global?.let { addParam("global", it) } + } + + /** + * Returns players rating in the game. + * + * @param type - Leaderboard type. Possible values: *'level' - by level,, *'points' - by mission + * points,, *'score' - by score (). + * @param global - Rating type. Possible values: *'1' - global rating among all players,, *'0' - + * rating among user friends. + * @return [VKRequest] with [AppsGetLeaderboardExtendedResponse] + */ + fun appsGetLeaderboardExtended(type: TypeParam, global: Boolean? = null): + VKRequest = NewApiRequest("apps.getLeaderboard") { + GsonHolder.gson.fromJson(it, AppsGetLeaderboardExtendedResponse::class.java) + } + .apply { + addParam("type", type.value) + global?.let { addParam("global", it) } + addParam("extended", true) + } + + /** + * Returns policies and terms given to a mini app. + * + * @param appId - Mini App ID + * @return [VKRequest] with [AppsGetMiniAppPoliciesResponse] + */ + fun appsGetMiniAppPolicies(appId: Int): VKRequest = + NewApiRequest("apps.getMiniAppPolicies") { + GsonHolder.gson.fromJson(it, AppsGetMiniAppPoliciesResponse::class.java) + } + .apply { + addParam("app_id", appId) + } + + /** + * Returns scopes for auth + * + * @param type + * @return [VKRequest] with [AppsGetScopesResponse] + */ + fun appsGetScopes(type: TypeParam? = null): VKRequest = + NewApiRequest("apps.getScopes") { + GsonHolder.gson.fromJson(it, AppsGetScopesResponse::class.java) + } + .apply { + type?.let { addParam("type", it.value) } + } + + /** + * Returns user score in app + * + * @param userId + * @return [VKRequest] with [Int] + */ + fun appsGetScore(userId: Int): VKRequest = NewApiRequest("apps.getScore") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("user_id", userId) + } + + /** + * @param promoId - Id of game promo action + * @param userId + * @return [VKRequest] with [BaseBoolInt] + */ + fun appsPromoHasActiveGift(promoId: Int, userId: Int? = null): VKRequest = + NewApiRequest("apps.promoHasActiveGift") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("promo_id", promoId) + userId?.let { addParam("user_id", it) } + } + + /** + * @param promoId - Id of game promo action + * @param userId + * @return [VKRequest] with [BaseBoolInt] + */ + fun appsPromoUseGift(promoId: Int, userId: Int? = null): VKRequest = + NewApiRequest("apps.promoUseGift") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("promo_id", promoId) + userId?.let { addParam("user_id", it) } + } + + /** + * Sends a request to another user in an app that uses VK authorization. + * + * @param userId - id of the user to send a request + * @param text - request text + * @param type - request type. Values: 'invite' - if the request is sent to a user who does not + * have the app installed,, 'request' - if a user has already installed the app + * @param name + * @param key - special string key to be sent with the request + * @param separate + * @return [VKRequest] with [Int] + */ + fun appsSendRequest( + userId: Int, + text: String? = null, + type: TypeParam? = null, + name: String? = null, + key: String? = null, + separate: Boolean? = null + ): VKRequest = NewApiRequest("apps.sendRequest") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("user_id", userId) + text?.let { addParam("text", it) } + type?.let { addParam("type", it.value) } + name?.let { addParam("name", it) } + key?.let { addParam("key", it) } + separate?.let { addParam("separate", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsApp.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsApp.kt index 8d7d578a55..6f0b95b692 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsApp.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsApp.kt @@ -35,105 +35,105 @@ import kotlin.String import kotlin.collections.List /** - * @param authorUrl Application author's URL - * @param banner1120 URL of the app banner with 1120 px in width - * @param banner560 URL of the app banner with 560 px in width - * @param icon16 URL of the app icon with 16 px in width - * @param isNew Is new flag - * @param pushEnabled Is push enabled - * @param screenOrientation Screen orientation - * @param friends no description - * @param catalogPosition Catalog position - * @param description Application description - * @param genre Genre name - * @param genreId Genre ID - * @param international Information whether the application is multilanguage - * @param isInCatalog Information whether application is in mobile catalog - * @param leaderboardType no description - * @param membersCount Members number - * @param platformId Application ID in store - * @param publishedDate Date when the application has been published in Unixtime - * @param screenName Screen name - * @param section Application section name - * @param type no description - * @param id Application ID - * @param title Application title - * @param authorOwnerId Application author's ID - * @param isInstalled Is application installed - * @param icon139 URL of the app icon with 139 px in width - * @param icon150 URL of the app icon with 150 px in width - * @param icon278 URL of the app icon with 278 px in width - * @param icon576 URL of the app icon with 576 px in width - * @param backgroundLoaderColor Hex color code without hash sign - * @param loaderIcon SVG data - * @param icon75 URL of the app icon with 75 px in width - * @param openInExternalBrowser Open in external browser + * @param authorUrl - Application author's URL + * @param banner1120 - URL of the app banner with 1120 px in width + * @param banner560 - URL of the app banner with 560 px in width + * @param icon16 - URL of the app icon with 16 px in width + * @param isNew - Is new flag + * @param pushEnabled - Is push enabled + * @param screenOrientation - Screen orientation + * @param friends + * @param catalogPosition - Catalog position + * @param description - Application description + * @param genre - Genre name + * @param genreId - Genre ID + * @param international - Information whether the application is multilanguage + * @param isInCatalog - Information whether application is in mobile catalog + * @param leaderboardType + * @param membersCount - Members number + * @param platformId - Application ID in store + * @param publishedDate - Date when the application has been published in Unixtime + * @param screenName - Screen name + * @param section - Application section name + * @param type + * @param id - Application ID + * @param title - Application title + * @param authorOwnerId - Application author's ID + * @param isInstalled - Is application installed + * @param icon139 - URL of the app icon with 139 px in width + * @param icon150 - URL of the app icon with 150 px in width + * @param icon278 - URL of the app icon with 278 px in width + * @param icon576 - URL of the app icon with 576 px in width + * @param backgroundLoaderColor - Hex color code without hash sign + * @param loaderIcon - SVG data + * @param icon75 - URL of the app icon with 75 px in width + * @param openInExternalBrowser - Open in external browser */ data class AppsApp( - @SerializedName(value="author_url") + @SerializedName("author_url") val authorUrl: String? = null, - @SerializedName(value="banner_1120") + @SerializedName("banner_1120") val banner1120: String? = null, - @SerializedName(value="banner_560") + @SerializedName("banner_560") val banner560: String? = null, - @SerializedName(value="icon_16") + @SerializedName("icon_16") val icon16: String? = null, - @SerializedName(value="is_new") + @SerializedName("is_new") val isNew: BaseBoolInt? = null, - @SerializedName(value="push_enabled") + @SerializedName("push_enabled") val pushEnabled: BaseBoolInt? = null, - @SerializedName(value="screen_orientation") + @SerializedName("screen_orientation") val screenOrientation: Int? = null, - @SerializedName(value="friends") + @SerializedName("friends") val friends: List? = null, - @SerializedName(value="catalog_position") + @SerializedName("catalog_position") val catalogPosition: Int? = null, - @SerializedName(value="description") + @SerializedName("description") val description: String? = null, - @SerializedName(value="genre") + @SerializedName("genre") val genre: String? = null, - @SerializedName(value="genre_id") + @SerializedName("genre_id") val genreId: Int? = null, - @SerializedName(value="international") + @SerializedName("international") val international: Boolean? = null, - @SerializedName(value="is_in_catalog") + @SerializedName("is_in_catalog") val isInCatalog: Int? = null, - @SerializedName(value="leaderboard_type") + @SerializedName("leaderboard_type") val leaderboardType: AppsAppLeaderboardType? = null, - @SerializedName(value="members_count") + @SerializedName("members_count") val membersCount: Int? = null, - @SerializedName(value="platform_id") + @SerializedName("platform_id") val platformId: String? = null, - @SerializedName(value="published_date") + @SerializedName("published_date") val publishedDate: Int? = null, - @SerializedName(value="screen_name") + @SerializedName("screen_name") val screenName: String? = null, - @SerializedName(value="section") + @SerializedName("section") val section: String? = null, - @SerializedName(value="type") + @SerializedName("type") val type: AppsAppType? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="author_owner_id") + @SerializedName("author_owner_id") val authorOwnerId: Int? = null, - @SerializedName(value="is_installed") + @SerializedName("is_installed") val isInstalled: Boolean? = null, - @SerializedName(value="icon_139") + @SerializedName("icon_139") val icon139: String? = null, - @SerializedName(value="icon_150") + @SerializedName("icon_150") val icon150: String? = null, - @SerializedName(value="icon_278") + @SerializedName("icon_278") val icon278: String? = null, - @SerializedName(value="icon_576") + @SerializedName("icon_576") val icon576: String? = null, - @SerializedName(value="background_loader_color") + @SerializedName("background_loader_color") val backgroundLoaderColor: String? = null, - @SerializedName(value="loader_icon") + @SerializedName("loader_icon") val loaderIcon: String? = null, - @SerializedName(value="icon_75") + @SerializedName("icon_75") val icon75: String? = null, - @SerializedName(value="open_in_external_browser") + @SerializedName("open_in_external_browser") val openInExternalBrowser: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppLeaderboardType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppLeaderboardType.kt index 030ac639eb..fe0060fbd4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppLeaderboardType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppLeaderboardType.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.apps.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class AppsAppLeaderboardType( val value: Int ) { + @SerializedName("0") NOT_SUPPORTED(0), + @SerializedName("1") LEVELS(1), + @SerializedName("2") POINTS(2); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: AppsAppLeaderboardType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): AppsAppLeaderboardType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppMin.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppMin.kt index 0c239263dc..097a2617c4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppMin.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppMin.kt @@ -33,45 +33,45 @@ import kotlin.Int import kotlin.String /** - * @param type no description - * @param id Application ID - * @param title Application title - * @param authorOwnerId Application author's ID - * @param isInstalled Is application installed - * @param icon139 URL of the app icon with 139 px in width - * @param icon150 URL of the app icon with 150 px in width - * @param icon278 URL of the app icon with 278 px in width - * @param icon576 URL of the app icon with 576 px in width - * @param backgroundLoaderColor Hex color code without hash sign - * @param loaderIcon SVG data - * @param icon75 URL of the app icon with 75 px in width - * @param openInExternalBrowser Open in external browser + * @param type + * @param id - Application ID + * @param title - Application title + * @param authorOwnerId - Application author's ID + * @param isInstalled - Is application installed + * @param icon139 - URL of the app icon with 139 px in width + * @param icon150 - URL of the app icon with 150 px in width + * @param icon278 - URL of the app icon with 278 px in width + * @param icon576 - URL of the app icon with 576 px in width + * @param backgroundLoaderColor - Hex color code without hash sign + * @param loaderIcon - SVG data + * @param icon75 - URL of the app icon with 75 px in width + * @param openInExternalBrowser - Open in external browser */ data class AppsAppMin( - @SerializedName(value="type") + @SerializedName("type") val type: AppsAppType, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="author_owner_id") + @SerializedName("author_owner_id") val authorOwnerId: Int? = null, - @SerializedName(value="is_installed") + @SerializedName("is_installed") val isInstalled: Boolean? = null, - @SerializedName(value="icon_139") + @SerializedName("icon_139") val icon139: String? = null, - @SerializedName(value="icon_150") + @SerializedName("icon_150") val icon150: String? = null, - @SerializedName(value="icon_278") + @SerializedName("icon_278") val icon278: String? = null, - @SerializedName(value="icon_576") + @SerializedName("icon_576") val icon576: String? = null, - @SerializedName(value="background_loader_color") + @SerializedName("background_loader_color") val backgroundLoaderColor: String? = null, - @SerializedName(value="loader_icon") + @SerializedName("loader_icon") val loaderIcon: String? = null, - @SerializedName(value="icon_75") + @SerializedName("icon_75") val icon75: String? = null, - @SerializedName(value="open_in_external_browser") + @SerializedName("open_in_external_browser") val openInExternalBrowser: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppType.kt index a73aa53bc9..9fc53519e8 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsAppType.kt @@ -28,14 +28,11 @@ package com.vk.sdk.api.apps.dto import com.google.gson.annotations.SerializedName +import kotlin.String -enum class AppsAppType { - @SerializedName(value="vk_app") - VK_APP, - - @SerializedName(value="community_app") - COMMUNITY_APP, - - @SerializedName(value="html5_game") - HTML5_GAME +enum class AppsAppType( + val value: String +) { + @SerializedName("mini_app") + MINI_APP("mini_app"); } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetCatalogResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetCatalogResponse.kt new file mode 100644 index 0000000000..b7d0dd5ea7 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetCatalogResponse.kt @@ -0,0 +1,47 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserMin +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param profiles + */ +data class AppsGetCatalogResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null, + @SerializedName("profiles") + val profiles: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListResponse.kt new file mode 100644 index 0000000000..e12cbac325 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class AppsGetFriendsListResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedResponse.kt new file mode 100644 index 0000000000..068e525126 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedResponse.kt @@ -0,0 +1,47 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserMin +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param profiles + */ +data class AppsGetLeaderboardExtendedResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null, + @SerializedName("profiles") + val profiles: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardResponse.kt new file mode 100644 index 0000000000..482846ddb0 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class AppsGetLeaderboardResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetMiniAppPoliciesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetMiniAppPoliciesResponse.kt new file mode 100644 index 0000000000..77df8a2979 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetMiniAppPoliciesResponse.kt @@ -0,0 +1,42 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param privacyPolicy - URL of the app's privacy policy + * @param terms - URL of the app's terms + */ +data class AppsGetMiniAppPoliciesResponse( + @SerializedName("privacy_policy") + val privacyPolicy: String? = null, + @SerializedName("terms") + val terms: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetResponse.kt new file mode 100644 index 0000000000..59dc5816eb --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number of applications + * @param items - List of applications + */ +data class AppsGetResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetScopesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetScopesResponse.kt new file mode 100644 index 0000000000..dda41fc4e6 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetScopesResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class AppsGetScopesResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsLeaderboard.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsLeaderboard.kt index e93611d934..1e7329c141 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsLeaderboard.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsLeaderboard.kt @@ -31,18 +31,18 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param userId User ID - * @param level Level - * @param points Points number - * @param score Score number + * @param userId - User ID + * @param level - Level + * @param points - Points number + * @param score - Score number */ data class AppsLeaderboard( - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int, - @SerializedName(value="level") + @SerializedName("level") val level: Int? = null, - @SerializedName(value="points") + @SerializedName("points") val points: Int? = null, - @SerializedName(value="score") + @SerializedName("score") val score: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsScope.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsScope.kt index a9982a1555..7f18fa3485 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsScope.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/AppsScope.kt @@ -27,70 +27,54 @@ // ********************************************************************* package com.vk.sdk.api.apps.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.String /** - * @param name Scope name - * @param title Scope title + * Scope description + * @param name - Scope name + * @param title - Scope title */ data class AppsScope( - @SerializedName(value="name") - val name: Name, - @SerializedName(value="title") + @SerializedName("name") + val name: AppsScope.Name, + @SerializedName("title") val title: String? = null ) { enum class Name( val value: String ) { + @SerializedName("friends") FRIENDS("friends"), + @SerializedName("photos") PHOTOS("photos"), + @SerializedName("video") VIDEO("video"), + @SerializedName("pages") PAGES("pages"), + @SerializedName("status") STATUS("status"), + @SerializedName("notes") NOTES("notes"), + @SerializedName("wall") WALL("wall"), + @SerializedName("docs") DOCS("docs"), + @SerializedName("groups") GROUPS("groups"), + @SerializedName("stats") STATS("stats"), + @SerializedName("market") MARKET("market"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Name?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Name { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/FilterParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/FilterParam.kt new file mode 100644 index 0000000000..e3277b4e4c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/FilterParam.kt @@ -0,0 +1,47 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FilterParam( + val value: String +) { + @SerializedName("favorite") + FAVORITE("favorite"), + + @SerializedName("featured") + FEATURED("featured"), + + @SerializedName("installed") + INSTALLED("installed"), + + @SerializedName("new") + NEW("new"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/NameCaseParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/NameCaseParam.kt new file mode 100644 index 0000000000..2423e5fc9a --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/NameCaseParam.kt @@ -0,0 +1,53 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class NameCaseParam( + val value: String +) { + @SerializedName("nom") + NOMINATIVE("nom"), + + @SerializedName("gen") + GENITIVE("gen"), + + @SerializedName("dat") + DATIVE("dat"), + + @SerializedName("acc") + ACCUSATIVE("acc"), + + @SerializedName("ins") + INSTRUMENTAL("ins"), + + @SerializedName("abl") + PREPOSITIONAL("abl"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/PlatformParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/PlatformParam.kt new file mode 100644 index 0000000000..9624ec62a6 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/PlatformParam.kt @@ -0,0 +1,47 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class PlatformParam( + val value: String +) { + @SerializedName("android") + ANDROID("android"), + + @SerializedName("ios") + IOS("ios"), + + @SerializedName("web") + WEB("web"), + + @SerializedName("winphone") + WINPHONE("winphone"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/SortParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/SortParam.kt new file mode 100644 index 0000000000..7a9adea1f2 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/SortParam.kt @@ -0,0 +1,50 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class SortParam( + val value: String +) { + @SerializedName("popular_today") + POPULAR_TODAY("popular_today"), + + @SerializedName("visitors") + VISITORS("visitors"), + + @SerializedName("create_date") + CREATE_DATE("create_date"), + + @SerializedName("growth_rate") + GROWTH_RATE("growth_rate"), + + @SerializedName("popular_week") + POPULAR_WEEK("popular_week"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/TypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/TypeParam.kt new file mode 100644 index 0000000000..c5f7387c9e --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/apps/dto/TypeParam.kt @@ -0,0 +1,41 @@ +/** + * 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.apps.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class TypeParam( + val value: String +) { + @SerializedName("invite") + INVITE("invite"), + + @SerializedName("request") + REQUEST("request"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioArtist.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioArtist.kt new file mode 100644 index 0000000000..bc852907c3 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioArtist.kt @@ -0,0 +1,82 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseImage +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserMin +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +/** + * @param name - Artist name + * @param domain - Artist domain + * @param id - Artist ID + * @param isAlbumCover - Mark shows that artist has no official cover, last album thumb is used + * instead + * @param photo - Artist photos + * @param photos - Artist photos by type + * @param isFollowed - Is user follow this artist + * @param canFollow - Can be this artist followed by user + * @param genres - Artist genres + * @param bio - Artist bio + * @param pages - Artist pages + * @param profiles + * @param groups + */ +data class AudioArtist( + @SerializedName("name") + val name: String, + @SerializedName("domain") + val domain: String? = null, + @SerializedName("id") + val id: String? = null, + @SerializedName("is_album_cover") + val isAlbumCover: Boolean? = null, + @SerializedName("photo") + val photo: List? = null, + @SerializedName("photos") + val photos: List? = null, + @SerializedName("is_followed") + val isFollowed: Boolean? = null, + @SerializedName("can_follow") + val canFollow: Boolean? = null, + @SerializedName("genres") + val genres: List? = null, + @SerializedName("bio") + val bio: String? = null, + @SerializedName("pages") + val pages: List? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioAudio.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioAudio.kt index f2b475f35d..ab8f63e0f9 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioAudio.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioAudio.kt @@ -32,39 +32,39 @@ import kotlin.Int import kotlin.String /** - * @param artist Artist name - * @param id Audio ID - * @param ownerId Audio owner's ID - * @param title Title - * @param duration Duration in seconds - * @param accessKey Access key for the audio - * @param url URL of mp3 file - * @param date Date when uploaded - * @param albumId Album ID - * @param genreId Genre ID - * @param performer Performer name + * @param artist - Artist name + * @param id - Audio ID + * @param ownerId - Audio owner's ID + * @param title - Title + * @param duration - Duration in seconds + * @param accessKey - Access key for the audio + * @param url - URL of mp3 file + * @param date - Date when uploaded + * @param albumId - Album ID + * @param genreId - Genre ID + * @param performer - Performer name */ data class AudioAudio( - @SerializedName(value="artist") + @SerializedName("artist") val artist: String, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="duration") + @SerializedName("duration") val duration: Int, - @SerializedName(value="access_key") + @SerializedName("access_key") val accessKey: String? = null, - @SerializedName(value="url") + @SerializedName("url") val url: String? = null, - @SerializedName(value="date") + @SerializedName("date") val date: Int? = null, - @SerializedName(value="album_id") + @SerializedName("album_id") val albumId: Int? = null, - @SerializedName(value="genre_id") + @SerializedName("genre_id") val genreId: Int? = null, - @SerializedName(value="performer") + @SerializedName("performer") val performer: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioGenre.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioGenre.kt new file mode 100644 index 0000000000..1ccf15d59d --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioGenre.kt @@ -0,0 +1,43 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param id - Genre ID + * @param name - Genre name + */ +data class AudioGenre( + @SerializedName("id") + val id: Int, + @SerializedName("name") + val name: String +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPhoto.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPhoto.kt new file mode 100644 index 0000000000..e4041745cd --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPhoto.kt @@ -0,0 +1,71 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +/** + * @param width - Photo width + * @param height - Photo height + * @param id + * @param photo34 - Photo size 34 + * @param photo68 - Photo size 68 + * @param photo135 - Photo size 135 + * @param photo270 - Photo size 270 + * @param photo300 - Photo size 300 + * @param photo600 - Photo size 600 + * @param photo1200 - Photo size 1200 + * @param sizes - Photo sizes + */ +data class AudioPhoto( + @SerializedName("width") + val width: Int, + @SerializedName("height") + val height: Int, + @SerializedName("id") + val id: String? = null, + @SerializedName("photo_34") + val photo34: String? = null, + @SerializedName("photo_68") + val photo68: String? = null, + @SerializedName("photo_135") + val photo135: String? = null, + @SerializedName("photo_270") + val photo270: String? = null, + @SerializedName("photo_300") + val photo300: String? = null, + @SerializedName("photo_600") + val photo600: String? = null, + @SerializedName("photo_1200") + val photo1200: String? = null, + @SerializedName("sizes") + val sizes: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPhotoSizes.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPhotoSizes.kt new file mode 100644 index 0000000000..a1eab4d5af --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPhotoSizes.kt @@ -0,0 +1,83 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param src - Photo url + * @param width - Photo width + * @param height - Photo height + * @param type - Photo type + */ +data class AudioPhotoSizes( + @SerializedName("src") + val src: String, + @SerializedName("width") + val width: Int, + @SerializedName("height") + val height: Int, + @SerializedName("type") + val type: AudioPhotoSizes.Type +) { + enum class Type( + val value: String + ) { + @SerializedName("s") + S("s"), + + @SerializedName("m") + M("m"), + + @SerializedName("x") + X("x"), + + @SerializedName("y") + Y("y"), + + @SerializedName("z") + Z("z"), + + @SerializedName("w") + W("w"), + + @SerializedName("o") + O("o"), + + @SerializedName("p") + P("p"), + + @SerializedName("q") + Q("q"), + + @SerializedName("r") + R("r"); + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPhotosByType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPhotosByType.kt new file mode 100644 index 0000000000..1ef92f2d40 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPhotosByType.kt @@ -0,0 +1,44 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseImage +import kotlin.String +import kotlin.collections.List + +/** + * @param type - Photos type + * @param photo - Photos + */ +data class AudioPhotosByType( + @SerializedName("type") + val type: String, + @SerializedName("photo") + val photo: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylist.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylist.kt new file mode 100644 index 0000000000..3d547fb60e --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylist.kt @@ -0,0 +1,183 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.media.dto.MediaPopup +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +/** + * @param id - Playlist ID + * @param ownerId - Playlist owner ID + * @param type - Playlist type + * @param title - Playlist title + * @param description - Playlist description + * @param count - Playlist tracks count + * @param followers - Playlist followers count + * @param plays - Playlist plays count + * @param createTime - Playlist create time + * @param updateTime - Playlist upload time + * @param playlistId - Original or followed playlist ID + * @param genres - Playlist genres + * @param isFollowing - Is user follow this playlist + * @param noDiscover - If playlist should be hidden from search results and recommendations + * @param audios - Playlist audios + * @param year - Playlist year + * @param original - Original playlist + * @param followed - Followed playlist + * @param photo - Playlist photo + * @param permissions - Playlist permissions + * @param subtitleBadge - Should show badge near playlist subtitle + * @param playButton - Should show playlist play button on cover + * @param thumbs - Playlist photos + * @param accessKey - Playlist access key + * @param umaAlbumId - UMA playlist ID + * @param subtitle - Playlist subtitle + * @param originalYear - Playlist original year + * @param isExplicit - Is playlist exist + * @param artists - Playlist artists + * @param mainArtists - Playlist main artists + * @param mainArtist - Playlist main artist name + * @param featuredArtists - Playlist featured artists + * @param albumType - Playlist type + * @param meta - Playlist meta info + * @param restriction - Playlist restriction popup + */ +data class AudioPlaylist( + @SerializedName("id") + val id: Int, + @SerializedName("owner_id") + val ownerId: Int, + @SerializedName("type") + val type: AudioPlaylist.Type, + @SerializedName("title") + val title: String, + @SerializedName("description") + val description: String, + @SerializedName("count") + val count: Int, + @SerializedName("followers") + val followers: Int, + @SerializedName("plays") + val plays: Int, + @SerializedName("create_time") + val createTime: Int, + @SerializedName("update_time") + val updateTime: Int, + @SerializedName("playlist_id") + val playlistId: Int? = null, + @SerializedName("genres") + val genres: List? = null, + @SerializedName("is_following") + val isFollowing: Boolean? = null, + @SerializedName("no_discover") + val noDiscover: Boolean? = null, + @SerializedName("audios") + val audios: List? = null, + @SerializedName("year") + val year: Int? = null, + @SerializedName("original") + val original: AudioPlaylistOriginalFollowed? = null, + @SerializedName("followed") + val followed: AudioPlaylistOriginalFollowed? = null, + @SerializedName("photo") + val photo: AudioPhoto? = null, + @SerializedName("permissions") + val permissions: AudioPlaylistPermissions? = null, + @SerializedName("subtitle_badge") + val subtitleBadge: Boolean? = null, + @SerializedName("play_button") + val playButton: Boolean? = null, + @SerializedName("thumbs") + val thumbs: List? = null, + @SerializedName("access_key") + val accessKey: String? = null, + @SerializedName("uma_album_id") + val umaAlbumId: Int? = null, + @SerializedName("subtitle") + val subtitle: String? = null, + @SerializedName("original_year") + val originalYear: Int? = null, + @SerializedName("is_explicit") + val isExplicit: Boolean? = null, + @SerializedName("artists") + val artists: List? = null, + @SerializedName("main_artists") + val mainArtists: List? = null, + @SerializedName("main_artist") + val mainArtist: String? = null, + @SerializedName("featured_artists") + val featuredArtists: List? = null, + @SerializedName("album_type") + val albumType: AudioPlaylist.AlbumType? = null, + @SerializedName("meta") + val meta: AudioPlaylistMeta? = null, + @SerializedName("restriction") + val restriction: MediaPopup? = null +) { + enum class Type( + val value: Int + ) { + @SerializedName("0") + NO_ALBUM(0), + + @SerializedName("1") + ALBUM(1), + + @SerializedName("2") + EP(2), + + @SerializedName("3") + COLLECTION(3), + + @SerializedName("4") + SINGLE(4), + + @SerializedName("5") + CHAT(5); + } + + enum class AlbumType( + val value: String + ) { + @SerializedName("playlist") + PLAYLIST("playlist"), + + @SerializedName("main_only") + MAIN_ONLY("main_only"), + + @SerializedName("main_feat") + MAIN_FEAT("main_feat"), + + @SerializedName("collection") + COLLECTION("collection"); + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistMeta.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistMeta.kt new file mode 100644 index 0000000000..440567ae11 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistMeta.kt @@ -0,0 +1,38 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName + +/** + * @param view + */ +data class AudioPlaylistMeta( + @SerializedName("view") + val view: AudioPlaylistView? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistOriginalFollowed.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistOriginalFollowed.kt new file mode 100644 index 0000000000..f845103b97 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistOriginalFollowed.kt @@ -0,0 +1,46 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param playlistId - Original or followed playlist ID + * @param ownerId - Playlist owner ID + * @param accessKey - Playlist access key + */ +data class AudioPlaylistOriginalFollowed( + @SerializedName("playlist_id") + val playlistId: Int, + @SerializedName("owner_id") + val ownerId: Int, + @SerializedName("access_key") + val accessKey: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistPermissions.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistPermissions.kt new file mode 100644 index 0000000000..2bf9918182 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistPermissions.kt @@ -0,0 +1,57 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Boolean + +/** + * @param play - Permission to play playlist + * @param share - Permission to share playlist + * @param edit - Permission to edit playlist + * @param follow - Permission to follow/unfollow playlist + * @param delete - Permission to delete playlist + * @param boomDownload - Permission to download playlist + * @param saveAsCopy - Permission to save generated playlist as copy of its content + */ +data class AudioPlaylistPermissions( + @SerializedName("play") + val play: Boolean? = null, + @SerializedName("share") + val share: Boolean? = null, + @SerializedName("edit") + val edit: Boolean? = null, + @SerializedName("follow") + val follow: Boolean? = null, + @SerializedName("delete") + val delete: Boolean? = null, + @SerializedName("boom_download") + val boomDownload: Boolean? = null, + @SerializedName("save_as_copy") + val saveAsCopy: Boolean? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistView.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistView.kt new file mode 100644 index 0000000000..06bbcb1daf --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/audio/dto/AudioPlaylistView.kt @@ -0,0 +1,38 @@ +/** + * 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.audio.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class AudioPlaylistView( + val value: String +) { + @SerializedName("compact") + COMPACT("compact"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/auth/AuthService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/auth/AuthService.kt new file mode 100644 index 0000000000..ad7143f05c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/auth/AuthService.kt @@ -0,0 +1,53 @@ +/** + * 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.auth + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.auth.dto.AuthRestoreResponse +import kotlin.String + +class AuthService { + /** + * Allows to restore account access using a code received via SMS. " This method is only + * available for apps with [vk.com/dev/auth_direct|Direct authorization] access. " + * + * @param phone - User phone number. + * @param lastName - User last name. + * @return [VKRequest] with [AuthRestoreResponse] + */ + fun authRestore(phone: String, lastName: String): VKRequest = + NewApiRequest("auth.restore") { + GsonHolder.gson.fromJson(it, AuthRestoreResponse::class.java) + } + .apply { + addParam("phone", phone) + addParam("last_name", lastName) + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/auth/dto/AuthRestoreResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/auth/dto/AuthRestoreResponse.kt new file mode 100644 index 0000000000..f7d307f8da --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/auth/dto/AuthRestoreResponse.kt @@ -0,0 +1,50 @@ +/** + * 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.auth.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param success - 1 if success + * @param sid - Parameter needed to grant access by code + */ +data class AuthRestoreResponse( + @SerializedName("success") + val success: AuthRestoreResponse.Success? = null, + @SerializedName("sid") + val sid: String? = null +) { + enum class Success( + val value: Int + ) { + @SerializedName("1") + OK(1); + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseBoolInt.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseBoolInt.kt index bb7a48db55..8959edd448 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseBoolInt.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseBoolInt.kt @@ -27,40 +27,15 @@ // ********************************************************************* package com.vk.sdk.api.base.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class BaseBoolInt( val value: Int ) { + @SerializedName("0") NO(0), + @SerializedName("1") YES(1); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: BaseBoolInt?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): BaseBoolInt { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCity.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCity.kt index 69e1502e3d..014cdbe8e5 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCity.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCity.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id City ID - * @param title City title + * @param id - City ID + * @param title - City title */ data class BaseCity( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="title") + @SerializedName("title") val title: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCommentsInfo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCommentsInfo.kt index f0ad3a3901..650b80aeb5 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCommentsInfo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCommentsInfo.kt @@ -33,18 +33,21 @@ import kotlin.Boolean import kotlin.Int /** - * @param canPost Information whether current user can comment the post - * @param count Comments number - * @param groupsCanPost Information whether groups can comment the post - * @param donut no description + * @param canPost - Information whether current user can comment the post + * @param canView - Information whether current user can view the comments + * @param count - Comments number + * @param groupsCanPost - Information whether groups can comment the post + * @param donut */ data class BaseCommentsInfo( - @SerializedName(value="can_post") + @SerializedName("can_post") val canPost: BaseBoolInt? = null, - @SerializedName(value="count") + @SerializedName("can_view") + val canView: BaseBoolInt? = null, + @SerializedName("count") val count: Int? = null, - @SerializedName(value="groups_can_post") + @SerializedName("groups_can_post") val groupsCanPost: Boolean? = null, - @SerializedName(value="donut") + @SerializedName("donut") val donut: WallWallpostCommentsDonut? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCountry.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCountry.kt index a1c6c07255..29a87231fc 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCountry.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCountry.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id Country ID - * @param title Country title + * @param id - Country ID + * @param title - Country title */ data class BaseCountry( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="title") + @SerializedName("title") val title: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhoto.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhoto.kt index 5bb24d13bd..bc94505e47 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhoto.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhoto.kt @@ -31,15 +31,15 @@ import com.google.gson.annotations.SerializedName import com.vk.sdk.api.photos.dto.PhotosPhoto /** - * @param photo no description - * @param crop no description - * @param rect no description + * @param photo + * @param crop + * @param rect */ data class BaseCropPhoto( - @SerializedName(value="photo") + @SerializedName("photo") val photo: PhotosPhoto, - @SerializedName(value="crop") + @SerializedName("crop") val crop: BaseCropPhotoCrop, - @SerializedName(value="rect") + @SerializedName("rect") val rect: BaseCropPhotoRect ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhotoCrop.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhotoCrop.kt index 62a2825c4c..b3606a5aa6 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhotoCrop.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhotoCrop.kt @@ -31,18 +31,18 @@ import com.google.gson.annotations.SerializedName import kotlin.Float /** - * @param x Coordinate X of the left upper corner - * @param y Coordinate Y of the left upper corner - * @param x2 Coordinate X of the right lower corner - * @param y2 Coordinate Y of the right lower corner + * @param x - Coordinate X of the left upper corner + * @param y - Coordinate Y of the left upper corner + * @param x2 - Coordinate X of the right lower corner + * @param y2 - Coordinate Y of the right lower corner */ data class BaseCropPhotoCrop( - @SerializedName(value="x") + @SerializedName("x") val x: Float, - @SerializedName(value="y") + @SerializedName("y") val y: Float, - @SerializedName(value="x2") + @SerializedName("x2") val x2: Float, - @SerializedName(value="y2") + @SerializedName("y2") val y2: Float ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhotoRect.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhotoRect.kt index e2555f14af..7ce00536f3 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhotoRect.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseCropPhotoRect.kt @@ -31,18 +31,18 @@ import com.google.gson.annotations.SerializedName import kotlin.Float /** - * @param x Coordinate X of the left upper corner - * @param y Coordinate Y of the left upper corner - * @param x2 Coordinate X of the right lower corner - * @param y2 Coordinate Y of the right lower corner + * @param x - Coordinate X of the left upper corner + * @param y - Coordinate Y of the left upper corner + * @param x2 - Coordinate X of the right lower corner + * @param y2 - Coordinate Y of the right lower corner */ data class BaseCropPhotoRect( - @SerializedName(value="x") + @SerializedName("x") val x: Float, - @SerializedName(value="y") + @SerializedName("y") val y: Float, - @SerializedName(value="x2") + @SerializedName("x2") val x2: Float, - @SerializedName(value="y2") + @SerializedName("y2") val y2: Float ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseError.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseError.kt index 01927eeed2..0954b98672 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseError.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseError.kt @@ -33,21 +33,21 @@ import kotlin.String import kotlin.collections.List /** - * @param errorCode Error code - * @param errorSubcode Error subcode - * @param errorMsg Error message - * @param errorText Localized error message - * @param requestParams no description + * @param errorCode - Error code + * @param errorSubcode - Error subcode + * @param errorMsg - Error message + * @param errorText - Localized error message + * @param requestParams */ data class BaseError( - @SerializedName(value="error_code") + @SerializedName("error_code") val errorCode: Int? = null, - @SerializedName(value="error_subcode") + @SerializedName("error_subcode") val errorSubcode: Int? = null, - @SerializedName(value="error_msg") + @SerializedName("error_msg") val errorMsg: String? = null, - @SerializedName(value="error_text") + @SerializedName("error_text") val errorText: String? = null, - @SerializedName(value="request_params") + @SerializedName("request_params") val requestParams: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGeo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGeo.kt index 90156ca58d..84fe35df4b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGeo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGeo.kt @@ -32,18 +32,18 @@ import kotlin.Int import kotlin.String /** - * @param coordinates no description - * @param place no description - * @param showmap Information whether a map is showed - * @param type Place type + * @param coordinates + * @param place + * @param showmap - Information whether a map is showed + * @param type - Place type */ data class BaseGeo( - @SerializedName(value="coordinates") + @SerializedName("coordinates") val coordinates: BaseGeoCoordinates? = null, - @SerializedName(value="place") + @SerializedName("place") val place: BasePlace? = null, - @SerializedName(value="showmap") + @SerializedName("showmap") val showmap: Int? = null, - @SerializedName(value="type") + @SerializedName("type") val type: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGeoCoordinates.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGeoCoordinates.kt index bdaf967f00..b426226746 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGeoCoordinates.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGeoCoordinates.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.Float /** - * @param latitude no description - * @param longitude no description + * @param latitude + * @param longitude */ data class BaseGeoCoordinates( - @SerializedName(value="latitude") + @SerializedName("latitude") val latitude: Float, - @SerializedName(value="longitude") + @SerializedName("longitude") val longitude: Float ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGradientPoint.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGradientPoint.kt index c680e20865..c417f2224b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGradientPoint.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseGradientPoint.kt @@ -32,12 +32,12 @@ import kotlin.Float import kotlin.String /** - * @param color Hex color code without # - * @param position Point position + * @param color - Hex color code without # + * @param position - Point position */ data class BaseGradientPoint( - @SerializedName(value="color") + @SerializedName("color") val color: String, - @SerializedName(value="position") + @SerializedName("position") val position: Float ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseImage.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseImage.kt index c287dd690c..2bdee1b2b0 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseImage.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseImage.kt @@ -32,18 +32,18 @@ import kotlin.Int import kotlin.String /** - * @param height Image height - * @param url Image url - * @param width Image width - * @param id no description + * @param height - Image height + * @param url - Image url + * @param width - Image width + * @param id */ data class BaseImage( - @SerializedName(value="height") + @SerializedName("height") val height: Int, - @SerializedName(value="url") + @SerializedName("url") val url: String, - @SerializedName(value="width") + @SerializedName("width") val width: Int, - @SerializedName(value="id") + @SerializedName("id") val id: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLikes.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLikes.kt index d1a81a6488..47f8bf87b2 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLikes.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLikes.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param count Likes number - * @param userLikes Information whether current user likes the photo + * @param count - Likes number + * @param userLikes - Information whether current user likes the photo */ data class BaseLikes( - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null, - @SerializedName(value="user_likes") + @SerializedName("user_likes") val userLikes: BaseBoolInt? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLikesInfo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLikesInfo.kt index a16bb287be..605003e5a7 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLikesInfo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLikesInfo.kt @@ -31,18 +31,18 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param canLike Information whether current user can like the post - * @param count Likes number - * @param userLikes Information whether current uer has liked the post - * @param canPublish Information whether current user can repost + * @param canLike - Information whether current user can like the post + * @param count - Likes number + * @param userLikes - Information whether current uer has liked the post + * @param canPublish - Information whether current user can repost */ data class BaseLikesInfo( - @SerializedName(value="can_like") + @SerializedName("can_like") val canLike: BaseBoolInt, - @SerializedName(value="count") + @SerializedName("count") val count: Int, - @SerializedName(value="user_likes") + @SerializedName("user_likes") val userLikes: Int, - @SerializedName(value="can_publish") + @SerializedName("can_publish") val canPublish: BaseBoolInt? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLink.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLink.kt index a53c5320a7..af0d828ad4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLink.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLink.kt @@ -35,54 +35,54 @@ import kotlin.Boolean import kotlin.String /** - * @param url Link URL - * @param application no description - * @param button no description - * @param caption Link caption - * @param description Link description - * @param id Link ID - * @param isFavorite no description - * @param photo no description - * @param previewPage String ID of the page with article preview - * @param previewUrl URL of the page with article preview - * @param product no description - * @param rating no description - * @param title Link title - * @param targetObject no description - * @param isExternal Information whether the current link is external - * @param video Video from link + * @param url - Link URL + * @param application + * @param button + * @param caption - Link caption + * @param description - Link description + * @param id - Link ID + * @param isFavorite + * @param photo + * @param previewPage - String ID of the page with article preview + * @param previewUrl - URL of the page with article preview + * @param product + * @param rating + * @param title - Link title + * @param targetObject + * @param isExternal - Information whether the current link is external + * @param video - Video from link */ data class BaseLink( - @SerializedName(value="url") + @SerializedName("url") val url: String, - @SerializedName(value="application") + @SerializedName("application") val application: BaseLinkApplication? = null, - @SerializedName(value="button") + @SerializedName("button") val button: BaseLinkButton? = null, - @SerializedName(value="caption") + @SerializedName("caption") val caption: String? = null, - @SerializedName(value="description") + @SerializedName("description") val description: String? = null, - @SerializedName(value="id") + @SerializedName("id") val id: String? = null, - @SerializedName(value="is_favorite") + @SerializedName("is_favorite") val isFavorite: Boolean? = null, - @SerializedName(value="photo") + @SerializedName("photo") val photo: PhotosPhoto? = null, - @SerializedName(value="preview_page") + @SerializedName("preview_page") val previewPage: String? = null, - @SerializedName(value="preview_url") + @SerializedName("preview_url") val previewUrl: String? = null, - @SerializedName(value="product") + @SerializedName("product") val product: BaseLinkProduct? = null, - @SerializedName(value="rating") + @SerializedName("rating") val rating: BaseLinkRating? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="target_object") + @SerializedName("target_object") val targetObject: LinkTargetObject? = null, - @SerializedName(value="is_external") + @SerializedName("is_external") val isExternal: Boolean? = null, - @SerializedName(value="video") + @SerializedName("video") val video: VideoVideo? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkApplication.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkApplication.kt index 569d8504b6..9d04fe3973 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkApplication.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkApplication.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.Float /** - * @param appId Application Id - * @param store no description + * @param appId - Application Id + * @param store */ data class BaseLinkApplication( - @SerializedName(value="app_id") + @SerializedName("app_id") val appId: Float? = null, - @SerializedName(value="store") + @SerializedName("store") val store: BaseLinkApplicationStore? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkApplicationStore.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkApplicationStore.kt index 318ad860a1..f2cf44780c 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkApplicationStore.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkApplicationStore.kt @@ -32,12 +32,12 @@ import kotlin.Float import kotlin.String /** - * @param id Store Id - * @param name Store name + * @param id - Store Id + * @param name - Store name */ data class BaseLinkApplicationStore( - @SerializedName(value="id") + @SerializedName("id") val id: Float? = null, - @SerializedName(value="name") + @SerializedName("name") val name: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButton.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButton.kt index c9df4c5cc8..d6b7668673 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButton.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButton.kt @@ -32,30 +32,33 @@ import kotlin.Int import kotlin.String /** - * @param action Button action - * @param title Button title - * @param blockId Target block id - * @param sectionId Target section id - * @param curatorId curator id - * @param ownerId Owner id - * @param icon Button icon name, e.g. 'phone' or 'gift' - * @param style no description + * @param action - Button action + * @param title - Button title + * @param blockId - Target block id + * @param sectionId - Target section id + * @param artistId - artist id + * @param curatorId - curator id + * @param ownerId - Owner id + * @param icon - Button icon name, e.g. 'phone' or 'gift' + * @param style */ data class BaseLinkButton( - @SerializedName(value="action") + @SerializedName("action") val action: BaseLinkButtonAction? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="block_id") + @SerializedName("block_id") val blockId: String? = null, - @SerializedName(value="section_id") + @SerializedName("section_id") val sectionId: String? = null, - @SerializedName(value="curator_id") + @SerializedName("artist_id") + val artistId: String? = null, + @SerializedName("curator_id") val curatorId: Int? = null, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int? = null, - @SerializedName(value="icon") + @SerializedName("icon") val icon: String? = null, - @SerializedName(value="style") + @SerializedName("style") val style: BaseLinkButtonStyle? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonAction.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonAction.kt index 5d4bef22a5..2ad4309121 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonAction.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonAction.kt @@ -31,15 +31,15 @@ import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param type no description - * @param url Action URL - * @param consumeReason no description + * @param type + * @param url - Action URL + * @param consumeReason */ data class BaseLinkButtonAction( - @SerializedName(value="type") + @SerializedName("type") val type: BaseLinkButtonActionType, - @SerializedName(value="url") + @SerializedName("url") val url: String? = null, - @SerializedName(value="consume_reason") + @SerializedName("consume_reason") val consumeReason: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonActionType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonActionType.kt index 6ba074b599..bf068f9a47 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonActionType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonActionType.kt @@ -27,115 +27,126 @@ // ********************************************************************* package com.vk.sdk.api.base.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class BaseLinkButtonActionType( val value: String ) { + @SerializedName("open_url") OPEN_URL("open_url"), + @SerializedName("join_group_and_open_url") JOIN_GROUP_AND_OPEN_URL("join_group_and_open_url"), + @SerializedName("open_section") OPEN_SECTION("open_section"), + @SerializedName("follow") FOLLOW("follow"), + @SerializedName("upload_video") UPLOAD_VIDEO("upload_video"), + @SerializedName("create_playlist") CREATE_PLAYLIST("create_playlist"), + @SerializedName("create_album") CREATE_ALBUM("create_album"), + @SerializedName("friends_lists") FRIENDS_LISTS("friends_lists"), + @SerializedName("friends_sort_modes") FRIENDS_SORT_MODES("friends_sort_modes"), + @SerializedName("add_friend") ADD_FRIEND("add_friend"), + @SerializedName("qr_camera") QR_CAMERA("qr_camera"), + @SerializedName("friends_requests") FRIENDS_REQUESTS("friends_requests"), + @SerializedName("open_screen") OPEN_SCREEN("open_screen"), + @SerializedName("open_screen_large") OPEN_SCREEN_LARGE("open_screen_large"), + @SerializedName("friends_message") FRIENDS_MESSAGE("friends_message"), + @SerializedName("friends_call") FRIENDS_CALL("friends_call"), + @SerializedName("friends_send_gift") FRIENDS_SEND_GIFT("friends_send_gift"), + @SerializedName("friends_label") FRIENDS_LABEL("friends_label"), + @SerializedName("play_audios_from_block") PLAY_AUDIOS_FROM_BLOCK("play_audios_from_block"), + @SerializedName("play_shuffled_audios_from_block") PLAY_SHUFFLED_AUDIOS_FROM_BLOCK("play_shuffled_audios_from_block"), + @SerializedName("unfollow_artist") UNFOLLOW_ARTIST("unfollow_artist"), + @SerializedName("create_group") CREATE_GROUP("create_group"), + @SerializedName("close_notification") CLOSE_NOTIFICATION("close_notification"), + @SerializedName("switch_section") SWITCH_SECTION("switch_section"), + @SerializedName("clear_recent_groups") CLEAR_RECENT_GROUPS("clear_recent_groups"), + @SerializedName("close_catalog_banner") CLOSE_CATALOG_BANNER("close_catalog_banner"), + @SerializedName("enable_top_newsfeed") ENABLE_TOP_NEWSFEED("enable_top_newsfeed"), + @SerializedName("groups_advertisement") GROUPS_ADVERTISEMENT("groups_advertisement"), + @SerializedName("owner_button") OWNER_BUTTON("owner_button"), + @SerializedName("enter_edit_mode") ENTER_EDIT_MODE("enter_edit_mode"), + @SerializedName("playlists_lists") PLAYLISTS_LISTS("playlists_lists"), + @SerializedName("unfollow_curator") UNFOLLOW_CURATOR("unfollow_curator"), + @SerializedName("reorder_items") REORDER_ITEMS("reorder_items"), + @SerializedName("edit_items") EDIT_ITEMS("edit_items"), + @SerializedName("select_sorting") SELECT_SORTING("select_sorting"), + @SerializedName("market_abandoned_carts") MARKET_ABANDONED_CARTS("market_abandoned_carts"), - WRITE_IM("write_im"), + @SerializedName("market_write") + MARKET_WRITE("market_write"), + @SerializedName("call") CALL("call"), + @SerializedName("modal_page") MODAL_PAGE("modal_page"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: BaseLinkButtonActionType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): BaseLinkButtonActionType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonStyle.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonStyle.kt index f6f7dacd94..5784fd1cb1 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonStyle.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonStyle.kt @@ -27,40 +27,15 @@ // ********************************************************************* package com.vk.sdk.api.base.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class BaseLinkButtonStyle( val value: String ) { + @SerializedName("primary") PRIMARY("primary"), + @SerializedName("secondary") SECONDARY("secondary"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: BaseLinkButtonStyle?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): BaseLinkButtonStyle { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProduct.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProduct.kt index 95550dd1e9..4e32633962 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProduct.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProduct.kt @@ -33,15 +33,27 @@ import kotlin.Int import kotlin.String /** - * @param price no description - * @param merchant no description - * @param ordersCount no description + * @param price + * @param merchant + * @param category + * @param geo + * @param distance + * @param status + * @param ordersCount */ data class BaseLinkProduct( - @SerializedName(value="price") + @SerializedName("price") val price: MarketPrice, - @SerializedName(value="merchant") + @SerializedName("merchant") val merchant: String? = null, - @SerializedName(value="orders_count") + @SerializedName("category") + val category: BaseLinkProductCategory? = null, + @SerializedName("geo") + val geo: BaseGeoCoordinates? = null, + @SerializedName("distance") + val distance: Int? = null, + @SerializedName("status") + val status: BaseLinkProductStatus? = null, + @SerializedName("orders_count") val ordersCount: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProductCategory.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProductCategory.kt new file mode 100644 index 0000000000..36e3392908 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProductCategory.kt @@ -0,0 +1,47 @@ +/** + * 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.base.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.market.dto.MarketMarketCategoryNested +import kotlin.Int +import kotlin.String + +/** + * @param id - Category ID + * @param name - Category name + * @param parent + */ +data class BaseLinkProductCategory( + @SerializedName("id") + val id: Int? = null, + @SerializedName("name") + val name: String? = null, + @SerializedName("parent") + val parent: MarketMarketCategoryNested? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProductStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProductStatus.kt index 2465b64264..20d67f84ca 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProductStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkProductStatus.kt @@ -27,47 +27,24 @@ // ********************************************************************* package com.vk.sdk.api.base.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class BaseLinkProductStatus( val value: String ) { + @SerializedName("active") ACTIVE("active"), + @SerializedName("blocked") BLOCKED("blocked"), + @SerializedName("sold") SOLD("sold"), + @SerializedName("deleted") DELETED("deleted"), + @SerializedName("archived") ARCHIVED("archived"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: BaseLinkProductStatus?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): BaseLinkProductStatus { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkRating.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkRating.kt index e7f2a874ee..da7eea9079 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkRating.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkRating.kt @@ -32,12 +32,12 @@ import kotlin.Float import kotlin.Int /** - * @param reviewsCount Count of reviews - * @param stars Count of stars + * @param reviewsCount - Count of reviews + * @param stars - Count of stars */ data class BaseLinkRating( - @SerializedName(value="reviews_count") + @SerializedName("reviews_count") val reviewsCount: Int? = null, - @SerializedName(value="stars") + @SerializedName("stars") val stars: Float? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObject.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObject.kt index b150117440..0f3e742d75 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObject.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObject.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id Object ID - * @param title Object title + * @param id - Object ID + * @param title - Object title */ data class BaseObject( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="title") + @SerializedName("title") val title: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObjectCount.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObjectCount.kt index 25d79977d6..4859ef41a5 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObjectCount.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObjectCount.kt @@ -31,9 +31,9 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param count Items count + * @param count - Items count */ data class BaseObjectCount( - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObjectWithName.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObjectWithName.kt index 731c8708cd..96978b659a 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObjectWithName.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseObjectWithName.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id Object ID - * @param name Object name + * @param id - Object ID + * @param name - Object name */ data class BaseObjectWithName( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseOkResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseOkResponse.kt new file mode 100644 index 0000000000..4fa3092e42 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseOkResponse.kt @@ -0,0 +1,38 @@ +/** + * 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.base.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class BaseOkResponse( + val value: Int +) { + @SerializedName("1") + OK(1); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BasePlace.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BasePlace.kt index 514fee04e1..5752d34070 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BasePlace.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BasePlace.kt @@ -33,39 +33,39 @@ import kotlin.Int import kotlin.String /** - * @param address Place address - * @param checkins Checkins number - * @param city City name - * @param country Country name - * @param created Date of the place creation in Unixtime - * @param icon URL of the place's icon - * @param id Place ID - * @param latitude Place latitude - * @param longitude Place longitude - * @param title Place title - * @param type Place type + * @param address - Place address + * @param checkins - Checkins number + * @param city - City name + * @param country - Country name + * @param created - Date of the place creation in Unixtime + * @param icon - URL of the place's icon + * @param id - Place ID + * @param latitude - Place latitude + * @param longitude - Place longitude + * @param title - Place title + * @param type - Place type */ data class BasePlace( - @SerializedName(value="address") + @SerializedName("address") val address: String? = null, - @SerializedName(value="checkins") + @SerializedName("checkins") val checkins: Int? = null, - @SerializedName(value="city") + @SerializedName("city") val city: String? = null, - @SerializedName(value="country") + @SerializedName("country") val country: String? = null, - @SerializedName(value="created") + @SerializedName("created") val created: Int? = null, - @SerializedName(value="icon") + @SerializedName("icon") val icon: String? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="latitude") + @SerializedName("latitude") val latitude: Float? = null, - @SerializedName(value="longitude") + @SerializedName("longitude") val longitude: Float? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="type") + @SerializedName("type") val type: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BasePropertyExists.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BasePropertyExists.kt index 96d06f190e..5ff6fa95fa 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BasePropertyExists.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BasePropertyExists.kt @@ -27,38 +27,12 @@ // ********************************************************************* package com.vk.sdk.api.base.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class BasePropertyExists( val value: Int ) { + @SerializedName("1") PROPERTY_EXISTS(1); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: BasePropertyExists?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): BasePropertyExists { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseRepostsInfo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseRepostsInfo.kt index b062db6358..60fd400795 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseRepostsInfo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseRepostsInfo.kt @@ -31,18 +31,19 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param count Total reposts counter. Sum of wall and mail reposts counters - * @param wallCount Wall reposts counter - * @param mailCount Mail reposts counter - * @param userReposted Information whether current user has reposted the post + * Count of views + * @param count - Total reposts counter. Sum of wall and mail reposts counters + * @param wallCount - Wall reposts counter + * @param mailCount - Mail reposts counter + * @param userReposted - Information whether current user has reposted the post */ data class BaseRepostsInfo( - @SerializedName(value="count") + @SerializedName("count") val count: Int, - @SerializedName(value="wall_count") + @SerializedName("wall_count") val wallCount: Int? = null, - @SerializedName(value="mail_count") + @SerializedName("mail_count") val mailCount: Int? = null, - @SerializedName(value="user_reposted") + @SerializedName("user_reposted") val userReposted: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseRequestParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseRequestParam.kt index f0a173de0c..01318ce863 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseRequestParam.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseRequestParam.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param key Parameter name - * @param value Parameter value + * @param key - Parameter name + * @param value - Parameter value */ data class BaseRequestParam( - @SerializedName(value="key") + @SerializedName("key") val key: String? = null, - @SerializedName(value="value") + @SerializedName("value") val value: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseSex.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseSex.kt index a4dce9def1..532eb2e6df 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseSex.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseSex.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.base.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class BaseSex( val value: Int ) { + @SerializedName("0") UNKNOWN(0), + @SerializedName("1") FEMALE(1), + @SerializedName("2") MALE(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: BaseSex?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): BaseSex { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseSticker.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseSticker.kt index bb29b87d7e..846f40fb30 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseSticker.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseSticker.kt @@ -34,27 +34,27 @@ import kotlin.String import kotlin.collections.List /** - * @param stickerId Sticker ID - * @param productId Pack ID - * @param images no description - * @param imagesWithBackground no description - * @param animationUrl URL of sticker animation script - * @param animations Array of sticker animation script objects - * @param isAllowed Information whether the sticker is allowed + * @param stickerId - Sticker ID + * @param productId - Pack ID + * @param images + * @param imagesWithBackground + * @param animationUrl - URL of sticker animation script + * @param animations - Array of sticker animation script objects + * @param isAllowed - Information whether the sticker is allowed */ data class BaseSticker( - @SerializedName(value="sticker_id") + @SerializedName("sticker_id") val stickerId: Int? = null, - @SerializedName(value="product_id") + @SerializedName("product_id") val productId: Int? = null, - @SerializedName(value="images") + @SerializedName("images") val images: List? = null, - @SerializedName(value="images_with_background") + @SerializedName("images_with_background") val imagesWithBackground: List? = null, - @SerializedName(value="animation_url") + @SerializedName("animation_url") val animationUrl: String? = null, - @SerializedName(value="animations") + @SerializedName("animations") val animations: List? = null, - @SerializedName(value="is_allowed") + @SerializedName("is_allowed") val isAllowed: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseStickerAnimation.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseStickerAnimation.kt index 99d1aaa789..52f0151323 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseStickerAnimation.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseStickerAnimation.kt @@ -27,51 +27,26 @@ // ********************************************************************* package com.vk.sdk.api.base.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param type Type of animation script - * @param url URL of animation script + * @param type - Type of animation script + * @param url - URL of animation script */ data class BaseStickerAnimation( - @SerializedName(value="type") - val type: Type? = null, - @SerializedName(value="url") + @SerializedName("type") + val type: BaseStickerAnimation.Type? = null, + @SerializedName("url") val url: String? = null ) { enum class Type( val value: String ) { + @SerializedName("light") LIGHT("light"), + @SerializedName("dark") DARK("dark"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Type?, - typeOfSrc: java.lang.reflect.Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: java.lang.reflect.Type?, - context: JsonDeserializationContext? - ): Type { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUploadServer.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUploadServer.kt index fe94096bbd..846d5af70d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUploadServer.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUploadServer.kt @@ -31,9 +31,9 @@ import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param uploadUrl Upload URL + * @param uploadUrl - Upload URL */ data class BaseUploadServer( - @SerializedName(value="upload_url") + @SerializedName("upload_url") val uploadUrl: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUserGroupFields.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUserGroupFields.kt index d854430fee..109171177d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUserGroupFields.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUserGroupFields.kt @@ -27,236 +27,309 @@ // ********************************************************************* package com.vk.sdk.api.base.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class BaseUserGroupFields( val value: String ) { + @SerializedName("about") ABOUT("about"), + @SerializedName("action_button") ACTION_BUTTON("action_button"), + @SerializedName("activities") ACTIVITIES("activities"), + @SerializedName("activity") ACTIVITY("activity"), + @SerializedName("addresses") ADDRESSES("addresses"), + @SerializedName("admin_level") ADMIN_LEVEL("admin_level"), + @SerializedName("age_limits") AGE_LIMITS("age_limits"), + @SerializedName("author_id") AUTHOR_ID("author_id"), + @SerializedName("ban_info") BAN_INFO("ban_info"), + @SerializedName("bdate") BDATE("bdate"), + @SerializedName("blacklisted") BLACKLISTED("blacklisted"), + @SerializedName("blacklisted_by_me") BLACKLISTED_BY_ME("blacklisted_by_me"), + @SerializedName("books") BOOKS("books"), + @SerializedName("can_create_topic") CAN_CREATE_TOPIC("can_create_topic"), + @SerializedName("can_message") CAN_MESSAGE("can_message"), + @SerializedName("can_post") CAN_POST("can_post"), + @SerializedName("can_see_all_posts") CAN_SEE_ALL_POSTS("can_see_all_posts"), + @SerializedName("can_see_audio") CAN_SEE_AUDIO("can_see_audio"), + @SerializedName("can_send_friend_request") CAN_SEND_FRIEND_REQUEST("can_send_friend_request"), + @SerializedName("can_upload_video") CAN_UPLOAD_VIDEO("can_upload_video"), + @SerializedName("can_write_private_message") CAN_WRITE_PRIVATE_MESSAGE("can_write_private_message"), + @SerializedName("career") CAREER("career"), + @SerializedName("city") CITY("city"), + @SerializedName("common_count") COMMON_COUNT("common_count"), + @SerializedName("connections") CONNECTIONS("connections"), + @SerializedName("contacts") CONTACTS("contacts"), + @SerializedName("counters") COUNTERS("counters"), + @SerializedName("country") COUNTRY("country"), + @SerializedName("cover") COVER("cover"), + @SerializedName("crop_photo") CROP_PHOTO("crop_photo"), + @SerializedName("deactivated") DEACTIVATED("deactivated"), + @SerializedName("description") DESCRIPTION("description"), + @SerializedName("domain") DOMAIN("domain"), + @SerializedName("education") EDUCATION("education"), + @SerializedName("exports") EXPORTS("exports"), + @SerializedName("finish_date") FINISH_DATE("finish_date"), + @SerializedName("fixed_post") FIXED_POST("fixed_post"), + @SerializedName("followers_count") FOLLOWERS_COUNT("followers_count"), + @SerializedName("friend_status") FRIEND_STATUS("friend_status"), + @SerializedName("games") GAMES("games"), + @SerializedName("has_market_app") HAS_MARKET_APP("has_market_app"), + @SerializedName("has_mobile") HAS_MOBILE("has_mobile"), + @SerializedName("has_photo") HAS_PHOTO("has_photo"), + @SerializedName("home_town") HOME_TOWN("home_town"), + @SerializedName("id") ID("id"), + @SerializedName("interests") INTERESTS("interests"), + @SerializedName("is_admin") IS_ADMIN("is_admin"), + @SerializedName("is_closed") IS_CLOSED("is_closed"), + @SerializedName("is_favorite") IS_FAVORITE("is_favorite"), + @SerializedName("is_friend") IS_FRIEND("is_friend"), + @SerializedName("is_hidden_from_feed") IS_HIDDEN_FROM_FEED("is_hidden_from_feed"), + @SerializedName("is_member") IS_MEMBER("is_member"), + @SerializedName("is_messages_blocked") IS_MESSAGES_BLOCKED("is_messages_blocked"), + @SerializedName("can_send_notify") CAN_SEND_NOTIFY("can_send_notify"), + @SerializedName("is_subscribed") IS_SUBSCRIBED("is_subscribed"), + @SerializedName("last_seen") LAST_SEEN("last_seen"), + @SerializedName("links") LINKS("links"), + @SerializedName("lists") LISTS("lists"), + @SerializedName("maiden_name") MAIDEN_NAME("maiden_name"), + @SerializedName("main_album_id") MAIN_ALBUM_ID("main_album_id"), + @SerializedName("main_section") MAIN_SECTION("main_section"), + @SerializedName("market") MARKET("market"), + @SerializedName("member_status") MEMBER_STATUS("member_status"), + @SerializedName("members_count") MEMBERS_COUNT("members_count"), + @SerializedName("military") MILITARY("military"), + @SerializedName("movies") MOVIES("movies"), + @SerializedName("music") MUSIC("music"), + @SerializedName("name") NAME("name"), + @SerializedName("nickname") NICKNAME("nickname"), + @SerializedName("occupation") OCCUPATION("occupation"), + @SerializedName("online") ONLINE("online"), + @SerializedName("online_status") ONLINE_STATUS("online_status"), + @SerializedName("personal") PERSONAL("personal"), + @SerializedName("phone") PHONE("phone"), + @SerializedName("photo_100") PHOTO_100("photo_100"), + @SerializedName("photo_200") PHOTO_200("photo_200"), + @SerializedName("photo_200_orig") PHOTO_200_ORIG("photo_200_orig"), + @SerializedName("photo_400_orig") PHOTO_400_ORIG("photo_400_orig"), + @SerializedName("photo_50") PHOTO_50("photo_50"), + @SerializedName("photo_id") PHOTO_ID("photo_id"), + @SerializedName("photo_max") PHOTO_MAX("photo_max"), + @SerializedName("photo_max_orig") PHOTO_MAX_ORIG("photo_max_orig"), + @SerializedName("quotes") QUOTES("quotes"), + @SerializedName("relation") RELATION("relation"), + @SerializedName("relatives") RELATIVES("relatives"), + @SerializedName("schools") SCHOOLS("schools"), + @SerializedName("screen_name") SCREEN_NAME("screen_name"), + @SerializedName("sex") SEX("sex"), + @SerializedName("site") SITE("site"), + @SerializedName("start_date") START_DATE("start_date"), + @SerializedName("status") STATUS("status"), + @SerializedName("timezone") TIMEZONE("timezone"), + @SerializedName("trending") TRENDING("trending"), + @SerializedName("tv") TV("tv"), + @SerializedName("type") TYPE("type"), + @SerializedName("universities") UNIVERSITIES("universities"), + @SerializedName("verified") VERIFIED("verified"), + @SerializedName("wall_comments") WALL_COMMENTS("wall_comments"), + @SerializedName("wiki_page") WIKI_PAGE("wiki_page"), + @SerializedName("vk_admin_status") VK_ADMIN_STATUS("vk_admin_status"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: BaseUserGroupFields?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): BaseUserGroupFields { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUserId.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUserId.kt index 0554a5cb31..cb28475177 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUserId.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/base/dto/BaseUserId.kt @@ -31,9 +31,9 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param userId User ID + * @param userId - User ID */ data class BaseUserId( - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/BoardService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/BoardService.kt new file mode 100644 index 0000000000..b5cd51faeb --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/BoardService.kt @@ -0,0 +1,441 @@ +/** + * 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.board + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.base.dto.BaseOkResponse +import com.vk.sdk.api.board.dto.BoardGetCommentsExtendedResponse +import com.vk.sdk.api.board.dto.BoardGetCommentsResponse +import com.vk.sdk.api.board.dto.BoardGetTopicsExtendedResponse +import com.vk.sdk.api.board.dto.BoardGetTopicsResponse +import com.vk.sdk.api.board.dto.OrderParam +import com.vk.sdk.api.board.dto.PreviewParam +import com.vk.sdk.api.board.dto.SortParam +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class BoardService { + /** + * Creates a new topic on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param title - Topic title. + * @param text - Text of the topic. + * @param fromGroup - For a community: '1' - to post the topic as by the community, '0' - to + * post the topic as by the user (default) + * @param attachments - List of media objects attached to the topic, in the following format: + * "_,_", '' - Type of media object: 'photo' - photo, + * 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media owner. + * '' - Media ID. Example: "photo100172_166443618,photo66748_265827614", , "NOTE: If you + * try to attach more than one reference, an error will be thrown.", + * @return [VKRequest] with [Int] + */ + fun boardAddTopic( + groupId: Int, + title: String, + text: String? = null, + fromGroup: Boolean? = null, + attachments: List? = null + ): VKRequest = NewApiRequest("board.addTopic") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("title", title) + text?.let { addParam("text", it) } + fromGroup?.let { addParam("from_group", it) } + attachments?.let { addParam("attachments", it) } + } + + /** + * Closes a topic on a community's discussion board so that comments cannot be posted. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun boardCloseTopic(groupId: Int, topicId: Int): VKRequest = + NewApiRequest("board.closeTopic") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + } + + /** + * Adds a comment on a topic on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - ID of the topic to be commented on. + * @param message - (Required if 'attachments' is not set.) Text of the comment. + * @param attachments - (Required if 'text' is not set.) List of media objects attached to the + * comment, in the following format: "_,_", '' - Type of + * media object: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, + * '' - ID of the media owner. '' - Media ID. + * @param fromGroup - '1' - to post the comment as by the community, '0' - to post the comment + * as by the user (default) + * @param stickerId - Sticker ID. + * @param guid - Unique identifier to avoid repeated comments. + * @return [VKRequest] with [Int] + */ + fun boardCreateComment( + groupId: Int, + topicId: Int, + message: String? = null, + attachments: List? = null, + fromGroup: Boolean? = null, + stickerId: Int? = null, + guid: String? = null + ): VKRequest = NewApiRequest("board.createComment") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + message?.let { addParam("message", it) } + attachments?.let { addParam("attachments", it) } + fromGroup?.let { addParam("from_group", it) } + stickerId?.let { addParam("sticker_id", it) } + guid?.let { addParam("guid", it) } + } + + /** + * Deletes a comment on a topic on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @param commentId - Comment ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun boardDeleteComment( + groupId: Int, + topicId: Int, + commentId: Int + ): VKRequest = NewApiRequest("board.deleteComment") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + addParam("comment_id", commentId) + } + + /** + * Deletes a topic from a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun boardDeleteTopic(groupId: Int, topicId: Int): VKRequest = + NewApiRequest("board.deleteTopic") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + } + + /** + * Edits a comment on a topic on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @param commentId - ID of the comment on the topic. + * @param message - (Required if 'attachments' is not set). New comment text. + * @param attachments - (Required if 'message' is not set.) List of media objects attached to + * the comment, in the following format: "_,_", '' - Type + * of media object: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, + * '' - ID of the media owner. '' - Media ID. Example: + * "photo100172_166443618,photo66748_265827614" + * @return [VKRequest] with [BaseOkResponse] + */ + fun boardEditComment( + groupId: Int, + topicId: Int, + commentId: Int, + message: String? = null, + attachments: List? = null + ): VKRequest = NewApiRequest("board.editComment") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + addParam("comment_id", commentId) + message?.let { addParam("message", it) } + attachments?.let { addParam("attachments", it) } + } + + /** + * Edits the title of a topic on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @param title - New title of the topic. + * @return [VKRequest] with [BaseOkResponse] + */ + fun boardEditTopic( + groupId: Int, + topicId: Int, + title: String + ): VKRequest = NewApiRequest("board.editTopic") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + addParam("title", title) + } + + /** + * Pins a topic (fixes its place) to the top of a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun boardFixTopic(groupId: Int, topicId: Int): VKRequest = + NewApiRequest("board.fixTopic") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + } + + /** + * Returns a list of comments on a topic on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @param needLikes - '1' - to return the 'likes' field, '0' - not to return the 'likes' field + * (default) + * @param startCommentId + * @param offset - Offset needed to return a specific subset of comments. + * @param count - Number of comments to return. + * @param sort - Sort order: 'asc' - by creation date in chronological order, 'desc' - by + * creation date in reverse chronological order, + * @return [VKRequest] with [BoardGetCommentsResponse] + */ + fun boardGetComments( + groupId: Int, + topicId: Int, + needLikes: Boolean? = null, + startCommentId: Int? = null, + offset: Int? = null, + count: Int? = null, + sort: SortParam? = null + ): VKRequest = NewApiRequest("board.getComments") { + GsonHolder.gson.fromJson(it, BoardGetCommentsResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + needLikes?.let { addParam("need_likes", it) } + startCommentId?.let { addParam("start_comment_id", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + sort?.let { addParam("sort", it.value) } + } + + /** + * Returns a list of comments on a topic on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @param needLikes - '1' - to return the 'likes' field, '0' - not to return the 'likes' field + * (default) + * @param startCommentId + * @param offset - Offset needed to return a specific subset of comments. + * @param count - Number of comments to return. + * @param sort - Sort order: 'asc' - by creation date in chronological order, 'desc' - by + * creation date in reverse chronological order, + * @return [VKRequest] with [BoardGetCommentsExtendedResponse] + */ + fun boardGetCommentsExtended( + groupId: Int, + topicId: Int, + needLikes: Boolean? = null, + startCommentId: Int? = null, + offset: Int? = null, + count: Int? = null, + sort: SortParam? = null + ): VKRequest = NewApiRequest("board.getComments") { + GsonHolder.gson.fromJson(it, BoardGetCommentsExtendedResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + needLikes?.let { addParam("need_likes", it) } + startCommentId?.let { addParam("start_comment_id", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + addParam("extended", true) + sort?.let { addParam("sort", it.value) } + } + + /** + * Returns a list of topics on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicIds - IDs of topics to be returned (100 maximum). By default, all topics are + * returned. If this parameter is set, the 'order', 'offset', and 'count' parameters are ignored. + * @param order - Sort order: '1' - by date updated in reverse chronological order. '2' - by + * date created in reverse chronological order. '-1' - by date updated in chronological order. + * '-2' - by date created in chronological order. If no sort order is specified, topics are + * returned in the order specified by the group administrator. Pinned topics are returned first, + * regardless of the sorting. + * @param offset - Offset needed to return a specific subset of topics. + * @param count - Number of topics to return. + * @param preview - '1' - to return the first comment in each topic,, '2' - to return the last + * comment in each topic,, '0' - to return no comments. By default: '0'. + * @param previewLength - Number of characters after which to truncate the previewed comment. To + * preview the full comment, specify '0'. + * @return [VKRequest] with [BoardGetTopicsResponse] + */ + fun boardGetTopics( + groupId: Int, + topicIds: List? = null, + order: OrderParam? = null, + offset: Int? = null, + count: Int? = null, + preview: PreviewParam? = null, + previewLength: Int? = null + ): VKRequest = NewApiRequest("board.getTopics") { + GsonHolder.gson.fromJson(it, BoardGetTopicsResponse::class.java) + } + .apply { + addParam("group_id", groupId) + topicIds?.let { addParam("topic_ids", it) } + order?.let { addParam("order", it.value) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + preview?.let { addParam("preview", it.value) } + previewLength?.let { addParam("preview_length", it) } + } + + /** + * Returns a list of topics on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicIds - IDs of topics to be returned (100 maximum). By default, all topics are + * returned. If this parameter is set, the 'order', 'offset', and 'count' parameters are ignored. + * @param order - Sort order: '1' - by date updated in reverse chronological order. '2' - by + * date created in reverse chronological order. '-1' - by date updated in chronological order. + * '-2' - by date created in chronological order. If no sort order is specified, topics are + * returned in the order specified by the group administrator. Pinned topics are returned first, + * regardless of the sorting. + * @param offset - Offset needed to return a specific subset of topics. + * @param count - Number of topics to return. + * @param preview - '1' - to return the first comment in each topic,, '2' - to return the last + * comment in each topic,, '0' - to return no comments. By default: '0'. + * @param previewLength - Number of characters after which to truncate the previewed comment. To + * preview the full comment, specify '0'. + * @return [VKRequest] with [BoardGetTopicsExtendedResponse] + */ + fun boardGetTopicsExtended( + groupId: Int, + topicIds: List? = null, + order: OrderParam? = null, + offset: Int? = null, + count: Int? = null, + preview: PreviewParam? = null, + previewLength: Int? = null + ): VKRequest = NewApiRequest("board.getTopics") { + GsonHolder.gson.fromJson(it, BoardGetTopicsExtendedResponse::class.java) + } + .apply { + addParam("group_id", groupId) + topicIds?.let { addParam("topic_ids", it) } + order?.let { addParam("order", it.value) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + addParam("extended", true) + preview?.let { addParam("preview", it.value) } + previewLength?.let { addParam("preview_length", it) } + } + + /** + * Re-opens a previously closed topic on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun boardOpenTopic(groupId: Int, topicId: Int): VKRequest = + NewApiRequest("board.openTopic") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + } + + /** + * Restores a comment deleted from a topic on a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @param commentId - Comment ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun boardRestoreComment( + groupId: Int, + topicId: Int, + commentId: Int + ): VKRequest = NewApiRequest("board.restoreComment") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + addParam("comment_id", commentId) + } + + /** + * Unpins a pinned topic from the top of a community's discussion board. + * + * @param groupId - ID of the community that owns the discussion board. + * @param topicId - Topic ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun boardUnfixTopic(groupId: Int, topicId: Int): VKRequest = + NewApiRequest("board.unfixTopic") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("topic_id", topicId) + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardDefaultOrder.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardDefaultOrder.kt index 7e81eee627..90c6884cdd 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardDefaultOrder.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardDefaultOrder.kt @@ -27,44 +27,21 @@ // ********************************************************************* package com.vk.sdk.api.board.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class BoardDefaultOrder( val value: Int ) { + @SerializedName("1") DESC_UPDATED(1), + @SerializedName("2") DESC_CREATED(2), + @SerializedName("-1") ASC_UPDATED(-1), + @SerializedName("-2") ASC_CREATED(-2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: BoardDefaultOrder?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): BoardDefaultOrder { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsExtendedResponse.kt new file mode 100644 index 0000000000..d5e62bcf87 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsExtendedResponse.kt @@ -0,0 +1,54 @@ +/** + * 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.board.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroup +import com.vk.sdk.api.users.dto.UsersUser +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param profiles + * @param groups + * @param poll + */ +data class BoardGetCommentsExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List, + @SerializedName("groups") + val groups: List, + @SerializedName("poll") + val poll: BoardTopicPoll? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsResponse.kt new file mode 100644 index 0000000000..0b2a2d305b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsResponse.kt @@ -0,0 +1,46 @@ +/** + * 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.board.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param poll + */ +data class BoardGetCommentsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("poll") + val poll: BoardTopicPoll? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedResponse.kt new file mode 100644 index 0000000000..b6932867a6 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedResponse.kt @@ -0,0 +1,54 @@ +/** + * 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.board.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseBoolInt +import com.vk.sdk.api.users.dto.UsersUserMin +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param defaultOrder + * @param canAddTopics - Information whether current user can add topic + * @param profiles + */ +data class BoardGetTopicsExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("default_order") + val defaultOrder: BoardDefaultOrder, + @SerializedName("can_add_topics") + val canAddTopics: BaseBoolInt, + @SerializedName("profiles") + val profiles: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsResponse.kt new file mode 100644 index 0000000000..5c3bc15a95 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsResponse.kt @@ -0,0 +1,50 @@ +/** + * 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.board.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseBoolInt +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param defaultOrder + * @param canAddTopics - Information whether current user can add topic + */ +data class BoardGetTopicsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("default_order") + val defaultOrder: BoardDefaultOrder, + @SerializedName("can_add_topics") + val canAddTopics: BaseBoolInt +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopic.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopic.kt index 3cb5b087df..cb6bb7d48b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopic.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopic.kt @@ -33,33 +33,33 @@ import kotlin.Int import kotlin.String /** - * @param comments Comments number - * @param created Date when the topic has been created in Unixtime - * @param createdBy Creator ID - * @param id Topic ID - * @param isClosed Information whether the topic is closed - * @param isFixed Information whether the topic is fixed - * @param title Topic title - * @param updated Date when the topic has been updated in Unixtime - * @param updatedBy ID of user who updated the topic + * @param comments - Comments number + * @param created - Date when the topic has been created in Unixtime + * @param createdBy - Creator ID + * @param id - Topic ID + * @param isClosed - Information whether the topic is closed + * @param isFixed - Information whether the topic is fixed + * @param title - Topic title + * @param updated - Date when the topic has been updated in Unixtime + * @param updatedBy - ID of user who updated the topic */ data class BoardTopic( - @SerializedName(value="comments") + @SerializedName("comments") val comments: Int? = null, - @SerializedName(value="created") + @SerializedName("created") val created: Int? = null, - @SerializedName(value="created_by") + @SerializedName("created_by") val createdBy: Int? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="is_closed") + @SerializedName("is_closed") val isClosed: BaseBoolInt? = null, - @SerializedName(value="is_fixed") + @SerializedName("is_fixed") val isFixed: BaseBoolInt? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="updated") + @SerializedName("updated") val updated: Int? = null, - @SerializedName(value="updated_by") + @SerializedName("updated_by") val updatedBy: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopicComment.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopicComment.kt index 3a5e224aa9..02bfad09bc 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopicComment.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopicComment.kt @@ -36,30 +36,30 @@ import kotlin.String import kotlin.collections.List /** - * @param date Date when the comment has been added in Unixtime - * @param fromId Author ID - * @param id Comment ID - * @param text Comment text - * @param attachments no description - * @param realOffset Real position of the comment - * @param canEdit Information whether current user can edit the comment - * @param likes no description + * @param date - Date when the comment has been added in Unixtime + * @param fromId - Author ID + * @param id - Comment ID + * @param text - Comment text + * @param attachments + * @param realOffset - Real position of the comment + * @param canEdit - Information whether current user can edit the comment + * @param likes */ data class BoardTopicComment( - @SerializedName(value="date") + @SerializedName("date") val date: Int, - @SerializedName(value="from_id") + @SerializedName("from_id") val fromId: Int, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="text") + @SerializedName("text") val text: String, - @SerializedName(value="attachments") + @SerializedName("attachments") val attachments: List? = null, - @SerializedName(value="real_offset") + @SerializedName("real_offset") val realOffset: Int? = null, - @SerializedName(value="can_edit") + @SerializedName("can_edit") val canEdit: BaseBoolInt? = null, - @SerializedName(value="likes") + @SerializedName("likes") val likes: BaseLikesInfo? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopicPoll.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopicPoll.kt index cdd18bc7b7..25593141e3 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopicPoll.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/BoardTopicPoll.kt @@ -35,30 +35,30 @@ import kotlin.String import kotlin.collections.List /** - * @param ownerId Poll owner's ID - * @param pollId Poll ID - * @param created Date when poll has been created in Unixtime - * @param question Poll question - * @param votes Votes number - * @param answerId Current user's answer ID - * @param answers no description - * @param isClosed Information whether the poll is closed + * @param ownerId - Poll owner's ID + * @param pollId - Poll ID + * @param created - Date when poll has been created in Unixtime + * @param question - Poll question + * @param votes - Votes number + * @param answerId - Current user's answer ID + * @param answers + * @param isClosed - Information whether the poll is closed */ data class BoardTopicPoll( - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="poll_id") + @SerializedName("poll_id") val pollId: Int, - @SerializedName(value="created") + @SerializedName("created") val created: Int, - @SerializedName(value="question") + @SerializedName("question") val question: String, - @SerializedName(value="votes") + @SerializedName("votes") val votes: Int, - @SerializedName(value="answer_id") + @SerializedName("answer_id") val answerId: Int, - @SerializedName(value="answers") + @SerializedName("answers") val answers: List, - @SerializedName(value="is_closed") + @SerializedName("is_closed") val isClosed: BaseBoolInt? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/OrderParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/OrderParam.kt new file mode 100644 index 0000000000..8a9dd939f3 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/OrderParam.kt @@ -0,0 +1,50 @@ +/** + * 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.board.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class OrderParam( + val value: Int +) { + @SerializedName("1") + UPDATED_DESC(1), + + @SerializedName("2") + CREATED_DESC(2), + + @SerializedName("-1") + UPDATED_ASC(-1), + + @SerializedName("-2") + CREATED_ASC(-2), + + @SerializedName("0") + AS_BY_ADMINISTRATOR(0); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/PreviewParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/PreviewParam.kt new file mode 100644 index 0000000000..c85ef9ee1c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/PreviewParam.kt @@ -0,0 +1,44 @@ +/** + * 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.board.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class PreviewParam( + val value: Int +) { + @SerializedName("1") + FIRST(1), + + @SerializedName("2") + LAST(2), + + @SerializedName("0") + NONE(0); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/SortParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/SortParam.kt new file mode 100644 index 0000000000..5c587b4773 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/board/dto/SortParam.kt @@ -0,0 +1,41 @@ +/** + * 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.board.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class SortParam( + val value: String +) { + @SerializedName("asc") + CHRONOLOGICAL("asc"), + + @SerializedName("desc") + REVERSE_CHRONOLOGICAL("desc"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsCall.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsCall.kt index 90891b27b1..59b6d815b7 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsCall.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsCall.kt @@ -32,24 +32,27 @@ import kotlin.Boolean import kotlin.Int /** - * @param initiatorId Caller initiator - * @param receiverId Caller receiver - * @param state no description - * @param time Timestamp for call - * @param duration Call duration - * @param video Was this call initiated as video call + * @param initiatorId - Caller initiator + * @param receiverId - Caller receiver + * @param state + * @param time - Timestamp for call + * @param duration - Call duration + * @param video - Was this call initiated as video call + * @param participants */ data class CallsCall( - @SerializedName(value="initiator_id") + @SerializedName("initiator_id") val initiatorId: Int, - @SerializedName(value="receiver_id") + @SerializedName("receiver_id") val receiverId: Int, - @SerializedName(value="state") + @SerializedName("state") val state: CallsEndState, - @SerializedName(value="time") + @SerializedName("time") val time: Int, - @SerializedName(value="duration") + @SerializedName("duration") val duration: Int? = null, - @SerializedName(value="video") - val video: Boolean? = null + @SerializedName("video") + val video: Boolean? = null, + @SerializedName("participants") + val participants: CallsParticipants? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsEndState.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsEndState.kt index c9e5222826..29545287e4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsEndState.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsEndState.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.calls.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class CallsEndState( val value: String ) { + @SerializedName("canceled_by_initiator") CANCELED_BY_INITIATOR("canceled_by_initiator"), + @SerializedName("canceled_by_receiver") CANCELED_BY_RECEIVER("canceled_by_receiver"), + @SerializedName("reached") REACHED("reached"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: CallsEndState?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): CallsEndState { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsParticipants.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsParticipants.kt index 11b28ad93b..3ebeb786ed 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsParticipants.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/calls/dto/CallsParticipants.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param list no description - * @param count Participants count + * @param list + * @param count - Participants count */ data class CallsParticipants( - @SerializedName(value="list") + @SerializedName("list") val list: List? = null, - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/comment/dto/CommentThread.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/comment/dto/CommentThread.kt index 5603713d64..b039b5c374 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/comment/dto/CommentThread.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/comment/dto/CommentThread.kt @@ -34,21 +34,21 @@ import kotlin.Int import kotlin.collections.List /** - * @param count Comments number - * @param canPost Information whether current user can comment the post - * @param groupsCanPost Information whether groups can comment the post - * @param items no description - * @param showReplyButton Information whether recommended to display reply button + * @param count - Comments number + * @param canPost - Information whether current user can comment the post + * @param groupsCanPost - Information whether groups can comment the post + * @param items + * @param showReplyButton - Information whether recommended to display reply button */ data class CommentThread( - @SerializedName(value="count") + @SerializedName("count") val count: Int, - @SerializedName(value="can_post") + @SerializedName("can_post") val canPost: Boolean? = null, - @SerializedName(value="groups_can_post") + @SerializedName("groups_can_post") val groupsCanPost: Boolean? = null, - @SerializedName(value="items") + @SerializedName("items") val items: List? = null, - @SerializedName(value="show_reply_button") + @SerializedName("show_reply_button") val showReplyButton: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/DatabaseService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/DatabaseService.kt new file mode 100644 index 0000000000..151f9f84a5 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/DatabaseService.kt @@ -0,0 +1,305 @@ +/** + * 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.database + +import com.google.gson.reflect.TypeToken +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.base.dto.BaseCountry +import com.vk.sdk.api.base.dto.BaseObject +import com.vk.sdk.api.database.dto.DatabaseGetChairsResponse +import com.vk.sdk.api.database.dto.DatabaseGetCitiesResponse +import com.vk.sdk.api.database.dto.DatabaseGetCountriesResponse +import com.vk.sdk.api.database.dto.DatabaseGetFacultiesResponse +import com.vk.sdk.api.database.dto.DatabaseGetMetroStationsResponse +import com.vk.sdk.api.database.dto.DatabaseGetRegionsResponse +import com.vk.sdk.api.database.dto.DatabaseGetSchoolsResponse +import com.vk.sdk.api.database.dto.DatabaseGetUniversitiesResponse +import com.vk.sdk.api.database.dto.DatabaseStation +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class DatabaseService { + /** + * Returns list of chairs on a specified faculty. + * + * @param facultyId - id of the faculty to get chairs from + * @param offset - offset required to get a certain subset of chairs + * @param count - amount of chairs to get + * @return [VKRequest] with [DatabaseGetChairsResponse] + */ + fun databaseGetChairs( + facultyId: Int, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("database.getChairs") { + GsonHolder.gson.fromJson(it, DatabaseGetChairsResponse::class.java) + } + .apply { + addParam("faculty_id", facultyId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns a list of cities. + * + * @param countryId - Country ID. + * @param regionId - Region ID. + * @param q - Search query. + * @param needAll - '1' - to return all cities in the country, '0' - to return major cities in + * the country (default), + * @param offset - Offset needed to return a specific subset of cities. + * @param count - Number of cities to return. + * @return [VKRequest] with [DatabaseGetCitiesResponse] + */ + fun databaseGetCities( + countryId: Int, + regionId: Int? = null, + q: String? = null, + needAll: Boolean? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("database.getCities") { + GsonHolder.gson.fromJson(it, DatabaseGetCitiesResponse::class.java) + } + .apply { + addParam("country_id", countryId) + regionId?.let { addParam("region_id", it) } + q?.let { addParam("q", it) } + needAll?.let { addParam("need_all", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns information about cities by their IDs. + * + * @param cityIds - City IDs. + * @return [VKRequest] with [Unit] + */ + fun databaseGetCitiesById(cityIds: List? = null): VKRequest> = + NewApiRequest("database.getCitiesById") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + cityIds?.let { addParam("city_ids", it) } + } + + /** + * Returns a list of countries. + * + * @param needAll - '1' - to return a full list of all countries, '0' - to return a list of + * countries near the current user's country (default). + * @param code - Country codes in [vk.com/dev/country_codes|ISO 3166-1 alpha-2] standard. + * @param offset - Offset needed to return a specific subset of countries. + * @param count - Number of countries to return. + * @return [VKRequest] with [DatabaseGetCountriesResponse] + */ + fun databaseGetCountries( + needAll: Boolean? = null, + code: String? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("database.getCountries") { + GsonHolder.gson.fromJson(it, DatabaseGetCountriesResponse::class.java) + } + .apply { + needAll?.let { addParam("need_all", it) } + code?.let { addParam("code", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns information about countries by their IDs. + * + * @param countryIds - Country IDs. + * @return [VKRequest] with [Unit] + */ + fun databaseGetCountriesById(countryIds: List? = null): VKRequest> = + NewApiRequest("database.getCountriesById") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + countryIds?.let { addParam("country_ids", it) } + } + + /** + * Returns a list of faculties (i.e., university departments). + * + * @param universityId - University ID. + * @param offset - Offset needed to return a specific subset of faculties. + * @param count - Number of faculties to return. + * @return [VKRequest] with [DatabaseGetFacultiesResponse] + */ + fun databaseGetFaculties( + universityId: Int, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("database.getFaculties") { + GsonHolder.gson.fromJson(it, DatabaseGetFacultiesResponse::class.java) + } + .apply { + addParam("university_id", universityId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Get metro stations by city + * + * @param cityId + * @param offset + * @param count + * @return [VKRequest] with [DatabaseGetMetroStationsResponse] + */ + fun databaseGetMetroStations( + cityId: Int, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("database.getMetroStations") { + GsonHolder.gson.fromJson(it, DatabaseGetMetroStationsResponse::class.java) + } + .apply { + addParam("city_id", cityId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Get metro station by his id + * + * @param stationIds + * @return [VKRequest] with [Unit] + */ + fun databaseGetMetroStationsById(stationIds: List? = null): + VKRequest> = NewApiRequest("database.getMetroStationsById") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + stationIds?.let { addParam("station_ids", it) } + } + + /** + * Returns a list of regions. + * + * @param countryId - Country ID, received in + * [vk.com/dev/database.getCountries|database.getCountries] method. + * @param q - Search query. + * @param offset - Offset needed to return specific subset of regions. + * @param count - Number of regions to return. + * @return [VKRequest] with [DatabaseGetRegionsResponse] + */ + fun databaseGetRegions( + countryId: Int, + q: String? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("database.getRegions") { + GsonHolder.gson.fromJson(it, DatabaseGetRegionsResponse::class.java) + } + .apply { + addParam("country_id", countryId) + q?.let { addParam("q", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns a list of school classes specified for the country. + * + * @param countryId - Country ID. + * @return [VKRequest] with [Unit] + */ + fun databaseGetSchoolClasses(countryId: Int? = null): VKRequest>> = + NewApiRequest("database.getSchoolClasses") { + val typeToken = object: TypeToken>>() {}.type + GsonHolder.gson.fromJson>>(it, typeToken) + } + .apply { + countryId?.let { addParam("country_id", it) } + } + + /** + * Returns a list of schools. + * + * @param cityId - City ID. + * @param q - Search query. + * @param offset - Offset needed to return a specific subset of schools. + * @param count - Number of schools to return. + * @return [VKRequest] with [DatabaseGetSchoolsResponse] + */ + fun databaseGetSchools( + cityId: Int, + q: String? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("database.getSchools") { + GsonHolder.gson.fromJson(it, DatabaseGetSchoolsResponse::class.java) + } + .apply { + addParam("city_id", cityId) + q?.let { addParam("q", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns a list of higher education institutions. + * + * @param q - Search query. + * @param countryId - Country ID. + * @param cityId - City ID. + * @param offset - Offset needed to return a specific subset of universities. + * @param count - Number of universities to return. + * @return [VKRequest] with [DatabaseGetUniversitiesResponse] + */ + fun databaseGetUniversities( + q: String? = null, + countryId: Int? = null, + cityId: Int? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("database.getUniversities") { + GsonHolder.gson.fromJson(it, DatabaseGetUniversitiesResponse::class.java) + } + .apply { + q?.let { addParam("q", it) } + countryId?.let { addParam("country_id", it) } + cityId?.let { addParam("city_id", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCity.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCity.kt index 9a0aed7c2c..1f1a0e1379 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCity.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCity.kt @@ -33,21 +33,21 @@ import kotlin.Int import kotlin.String /** - * @param area Area title - * @param region Region title - * @param important Information whether the city is included in important cities list - * @param id Object ID - * @param title Object title + * @param area - Area title + * @param region - Region title + * @param important - Information whether the city is included in important cities list + * @param id - Object ID + * @param title - Object title */ data class DatabaseCity( - @SerializedName(value="area") + @SerializedName("area") val area: String? = null, - @SerializedName(value="region") + @SerializedName("region") val region: String? = null, - @SerializedName(value="important") + @SerializedName("important") val important: BaseBoolInt? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseFaculty.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseFaculty.kt index e26515528c..3156f3ee96 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseFaculty.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseFaculty.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id Faculty ID - * @param title Faculty title + * @param id - Faculty ID + * @param title - Faculty title */ data class DatabaseFaculty( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetChairsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetChairsResponse.kt new file mode 100644 index 0000000000..e23c3ddaf0 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetChairsResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.database.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseObject +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DatabaseGetChairsResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCitiesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCitiesResponse.kt new file mode 100644 index 0000000000..e1aa8839c1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCitiesResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.database.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DatabaseGetCitiesResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCountriesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCountriesResponse.kt new file mode 100644 index 0000000000..ea86589fd6 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCountriesResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.database.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseCountry +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DatabaseGetCountriesResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetFacultiesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetFacultiesResponse.kt new file mode 100644 index 0000000000..8d9c1f5698 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetFacultiesResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.database.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DatabaseGetFacultiesResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetMetroStationsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetMetroStationsResponse.kt new file mode 100644 index 0000000000..11b021fee6 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetMetroStationsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.database.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DatabaseGetMetroStationsResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetRegionsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetRegionsResponse.kt new file mode 100644 index 0000000000..8db475d22b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetRegionsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.database.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DatabaseGetRegionsResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetSchoolsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetSchoolsResponse.kt new file mode 100644 index 0000000000..fa0b5108c8 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetSchoolsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.database.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DatabaseGetSchoolsResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetUniversitiesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetUniversitiesResponse.kt new file mode 100644 index 0000000000..fb07d1c9cd --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetUniversitiesResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.database.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DatabaseGetUniversitiesResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseRegion.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseRegion.kt index 06c8901a6e..2a75ce1b98 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseRegion.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseRegion.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id Region ID - * @param title Region title + * @param id - Region ID + * @param title - Region title */ data class DatabaseRegion( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseSchool.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseSchool.kt index 9d6183ae24..b4fc2a4da4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseSchool.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseSchool.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id School ID - * @param title School title + * @param id - School ID + * @param title - School title */ data class DatabaseSchool( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseStation.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseStation.kt index c5d52a7fc0..31311ab593 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseStation.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseStation.kt @@ -32,18 +32,18 @@ import kotlin.Int import kotlin.String /** - * @param id Station ID - * @param name Station name - * @param cityId City ID - * @param color Hex color code without # + * @param id - Station ID + * @param name - Station name + * @param cityId - City ID + * @param color - Hex color code without # */ data class DatabaseStation( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="city_id") + @SerializedName("city_id") val cityId: Int? = null, - @SerializedName(value="color") + @SerializedName("color") val color: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseUniversity.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseUniversity.kt index 61c02ce438..ecf379d879 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseUniversity.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/database/dto/DatabaseUniversity.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id University ID - * @param title University title + * @param id - University ID + * @param title - University title */ data class DatabaseUniversity( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButton.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButton.kt new file mode 100644 index 0000000000..b82a44b5f4 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButton.kt @@ -0,0 +1,45 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param action + * @param title + * @param style + */ +data class DiscoverCarouselButton( + @SerializedName("action") + val action: DiscoverCarouselButtonAction, + @SerializedName("title") + val title: String, + @SerializedName("style") + val style: DiscoverCarouselButtonType? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonAction.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonAction.kt new file mode 100644 index 0000000000..b20f132648 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonAction.kt @@ -0,0 +1,48 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param type + * @param context + * @param target + * @param url + */ +data class DiscoverCarouselButtonAction( + @SerializedName("type") + val type: DiscoverCarouselButtonActionType, + @SerializedName("context") + val context: DiscoverCarouselButtonContext? = null, + @SerializedName("target") + val target: DiscoverCarouselButtonActionTarget? = null, + @SerializedName("url") + val url: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonActionTarget.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonActionTarget.kt new file mode 100644 index 0000000000..e741853cd4 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonActionTarget.kt @@ -0,0 +1,38 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class DiscoverCarouselButtonActionTarget( + val value: String +) { + @SerializedName("internal") + INTERNAL("internal"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonActionType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonActionType.kt new file mode 100644 index 0000000000..4dabae9781 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonActionType.kt @@ -0,0 +1,44 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class DiscoverCarouselButtonActionType( + val value: String +) { + @SerializedName("open_url") + OPEN_URL("open_url"), + + @SerializedName("open_vkapp") + OPEN_VKAPP("open_vkapp"), + + @SerializedName("open_game") + OPEN_GAME("open_game"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonContext.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonContext.kt new file mode 100644 index 0000000000..b0f2cfccef --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonContext.kt @@ -0,0 +1,46 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param objectId + * @param viewUrl + * @param originalUrl + */ +data class DiscoverCarouselButtonContext( + @SerializedName("object_id") + val objectId: Int, + @SerializedName("view_url") + val viewUrl: String, + @SerializedName("original_url") + val originalUrl: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonType.kt new file mode 100644 index 0000000000..50ac01f835 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselButtonType.kt @@ -0,0 +1,41 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class DiscoverCarouselButtonType( + val value: String +) { + @SerializedName("outline") + OUTLINE("outline"), + + @SerializedName("tertiary") + TERTIARY("tertiary"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselItem.kt new file mode 100644 index 0000000000..6f31bd1973 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselItem.kt @@ -0,0 +1,50 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseImage +import kotlin.String +import kotlin.collections.List + +/** + * @param button + * @param description + * @param title + * @param images + */ +data class DiscoverCarouselItem( + @SerializedName("button") + val button: DiscoverCarouselButton, + @SerializedName("description") + val description: DiscoverCarouselItemDescription, + @SerializedName("title") + val title: String, + @SerializedName("images") + val images: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselItemDescription.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselItemDescription.kt new file mode 100644 index 0000000000..6c715ab135 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselItemDescription.kt @@ -0,0 +1,42 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param text + * @param type + */ +data class DiscoverCarouselItemDescription( + @SerializedName("text") + val text: String? = null, + @SerializedName("type") + val type: DiscoverCarouselItemDescriptionType? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselItemDescriptionType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselItemDescriptionType.kt new file mode 100644 index 0000000000..7eef7bb25b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselItemDescriptionType.kt @@ -0,0 +1,38 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class DiscoverCarouselItemDescriptionType( + val value: String +) { + @SerializedName("plain") + PLAIN("plain"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselObjectsType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselObjectsType.kt new file mode 100644 index 0000000000..61677d1902 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/discover/dto/DiscoverCarouselObjectsType.kt @@ -0,0 +1,41 @@ +/** + * 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.discover.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class DiscoverCarouselObjectsType( + val value: String +) { + @SerializedName("vk_app") + VK_APP("vk_app"), + + @SerializedName("direct_game") + DIRECT_GAME("direct_game"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/DocsService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/DocsService.kt new file mode 100644 index 0000000000..d7fa518e72 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/DocsService.kt @@ -0,0 +1,268 @@ +/** + * 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.docs + +import com.google.gson.reflect.TypeToken +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.base.dto.BaseOkResponse +import com.vk.sdk.api.base.dto.BaseUploadServer +import com.vk.sdk.api.docs.dto.DocsDoc +import com.vk.sdk.api.docs.dto.DocsGetResponse +import com.vk.sdk.api.docs.dto.DocsGetTypesResponse +import com.vk.sdk.api.docs.dto.DocsSaveResponse +import com.vk.sdk.api.docs.dto.DocsSearchResponse +import com.vk.sdk.api.docs.dto.TypeParam +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class DocsService { + /** + * Copies a document to a user's or community's document list. + * + * @param ownerId - ID of the user or community that owns the document. Use a negative value to + * designate a community ID. + * @param docId - Document ID. + * @param accessKey - Access key. This parameter is required if 'access_key' was returned with + * the document's data. + * @return [VKRequest] with [Int] + */ + fun docsAdd( + ownerId: Int, + docId: Int, + accessKey: String? = null + ): VKRequest = NewApiRequest("docs.add") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("doc_id", docId) + accessKey?.let { addParam("access_key", it) } + } + + /** + * Deletes a user or community document. + * + * @param ownerId - ID of the user or community that owns the document. Use a negative value to + * designate a community ID. + * @param docId - Document ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun docsDelete(ownerId: Int, docId: Int): VKRequest = + NewApiRequest("docs.delete") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("doc_id", docId) + } + + /** + * Edits a document. + * + * @param ownerId - User ID or community ID. Use a negative value to designate a community ID. + * @param docId - Document ID. + * @param title - Document title. + * @param tags - Document tags. + * @return [VKRequest] with [BaseOkResponse] + */ + fun docsEdit( + ownerId: Int, + docId: Int, + title: String? = null, + tags: List? = null + ): VKRequest = NewApiRequest("docs.edit") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("doc_id", docId) + title?.let { addParam("title", it) } + tags?.let { addParam("tags", it) } + } + + /** + * Returns detailed information about user or community documents. + * + * @param count - Number of documents to return. By default, all documents. + * @param offset - Offset needed to return a specific subset of documents. + * @param type + * @param ownerId - ID of the user or community that owns the documents. Use a negative value to + * designate a community ID. + * @param returnTags + * @return [VKRequest] with [DocsGetResponse] + */ + fun docsGet( + count: Int? = null, + offset: Int? = null, + type: TypeParam? = null, + ownerId: Int? = null, + returnTags: Boolean? = null + ): VKRequest = NewApiRequest("docs.get") { + GsonHolder.gson.fromJson(it, DocsGetResponse::class.java) + } + .apply { + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + type?.let { addParam("type", it.value) } + ownerId?.let { addParam("owner_id", it) } + returnTags?.let { addParam("return_tags", it) } + } + + /** + * Returns information about documents by their IDs. + * + * @param docs - Document IDs. Example: , "66748_91488,66748_91455", + * @param returnTags + * @return [VKRequest] with [Unit] + */ + fun docsGetById(docs: List, returnTags: Boolean? = null): VKRequest> = + NewApiRequest("docs.getById") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("docs", docs) + returnTags?.let { addParam("return_tags", it) } + } + + /** + * Returns the server address for document upload. + * + * @param type - Document type. + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * @return [VKRequest] with [BaseUploadServer] + */ + fun docsGetMessagesUploadServer(type: TypeParam? = null, peerId: Int? = null): + VKRequest = NewApiRequest("docs.getMessagesUploadServer") { + GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) + } + .apply { + type?.let { addParam("type", it.value) } + peerId?.let { addParam("peer_id", it) } + } + + /** + * Returns documents types available for current user. + * + * @param ownerId - ID of the user or community that owns the documents. Use a negative value to + * designate a community ID. + * @return [VKRequest] with [DocsGetTypesResponse] + */ + fun docsGetTypes(ownerId: Int): VKRequest = + NewApiRequest("docs.getTypes") { + GsonHolder.gson.fromJson(it, DocsGetTypesResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + } + + /** + * Returns the server address for document upload. + * + * @param groupId - Community ID (if the document will be uploaded to the community). + * @return [VKRequest] with [BaseUploadServer] + */ + fun docsGetUploadServer(groupId: Int? = null): VKRequest = + NewApiRequest("docs.getUploadServer") { + GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) + } + .apply { + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns the server address for document upload onto a user's or community's wall. + * + * @param groupId - Community ID (if the document will be uploaded to the community). + * @return [VKRequest] with [BaseUploadServer] + */ + fun docsGetWallUploadServer(groupId: Int? = null): VKRequest = + NewApiRequest("docs.getWallUploadServer") { + GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) + } + .apply { + groupId?.let { addParam("group_id", it) } + } + + /** + * Saves a document after [vk.com/dev/upload_files_2|uploading it to a server]. + * + * @param file - This parameter is returned when the file is [vk.com/dev/upload_files_2|uploaded + * to the server]. + * @param title - Document title. + * @param tags - Document tags. + * @param returnTags + * @return [VKRequest] with [DocsSaveResponse] + */ + fun docsSave( + file: String, + title: String? = null, + tags: String? = null, + returnTags: Boolean? = null + ): VKRequest = NewApiRequest("docs.save") { + GsonHolder.gson.fromJson(it, DocsSaveResponse::class.java) + } + .apply { + addParam("file", file) + title?.let { addParam("title", it) } + tags?.let { addParam("tags", it) } + returnTags?.let { addParam("return_tags", it) } + } + + /** + * Returns a list of documents matching the search criteria. + * + * @param q - Search query string. + * @param searchOwn + * @param count - Number of results to return. + * @param offset - Offset needed to return a specific subset of results. + * @param returnTags + * @return [VKRequest] with [DocsSearchResponse] + */ + fun docsSearch( + q: String, + searchOwn: Boolean? = null, + count: Int? = null, + offset: Int? = null, + returnTags: Boolean? = null + ): VKRequest = NewApiRequest("docs.search") { + GsonHolder.gson.fromJson(it, DocsSearchResponse::class.java) + } + .apply { + addParam("q", q) + searchOwn?.let { addParam("search_own", it) } + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + returnTags?.let { addParam("return_tags", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDoc.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDoc.kt index d394b7f715..d0a764ec24 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDoc.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDoc.kt @@ -34,42 +34,42 @@ import kotlin.String import kotlin.collections.List /** - * @param id Document ID - * @param ownerId Document owner ID - * @param title Document title - * @param size File size in bites - * @param ext File extension - * @param date Date when file has been uploaded in Unixtime - * @param type Document type - * @param url File URL - * @param preview no description - * @param isLicensed no description - * @param accessKey Access key for the document - * @param tags Document tags + * @param id - Document ID + * @param ownerId - Document owner ID + * @param title - Document title + * @param size - File size in bites + * @param ext - File extension + * @param date - Date when file has been uploaded in Unixtime + * @param type - Document type + * @param url - File URL + * @param preview + * @param isLicensed + * @param accessKey - Access key for the document + * @param tags - Document tags */ data class DocsDoc( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="size") + @SerializedName("size") val size: Int, - @SerializedName(value="ext") + @SerializedName("ext") val ext: String, - @SerializedName(value="date") + @SerializedName("date") val date: Int, - @SerializedName(value="type") + @SerializedName("type") val type: Int, - @SerializedName(value="url") + @SerializedName("url") val url: String? = null, - @SerializedName(value="preview") + @SerializedName("preview") val preview: DocsDocPreview? = null, - @SerializedName(value="is_licensed") + @SerializedName("is_licensed") val isLicensed: BaseBoolInt? = null, - @SerializedName(value="access_key") + @SerializedName("access_key") val accessKey: String? = null, - @SerializedName(value="tags") + @SerializedName("tags") val tags: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocAttachmentType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocAttachmentType.kt index 3c54b4e6df..7e851493d4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocAttachmentType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocAttachmentType.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.docs.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class DocsDocAttachmentType( val value: String ) { + @SerializedName("doc") DOC("doc"), + @SerializedName("graffiti") GRAFFITI("graffiti"), + @SerializedName("audio_message") AUDIO_MESSAGE("audio_message"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: DocsDocAttachmentType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): DocsDocAttachmentType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreview.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreview.kt index f46e520867..2c5f67eb5e 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreview.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreview.kt @@ -30,18 +30,18 @@ package com.vk.sdk.api.docs.dto import com.google.gson.annotations.SerializedName /** - * @param audioMsg no description - * @param graffiti no description - * @param photo no description - * @param video no description + * @param audioMsg + * @param graffiti + * @param photo + * @param video */ data class DocsDocPreview( - @SerializedName(value="audio_msg") + @SerializedName("audio_msg") val audioMsg: DocsDocPreviewAudioMsg? = null, - @SerializedName(value="graffiti") + @SerializedName("graffiti") val graffiti: DocsDocPreviewGraffiti? = null, - @SerializedName(value="photo") + @SerializedName("photo") val photo: DocsDocPreviewPhoto? = null, - @SerializedName(value="video") + @SerializedName("video") val video: DocsDocPreviewVideo? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewAudioMsg.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewAudioMsg.kt index 4ca5dfd5ed..af8271b51b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewAudioMsg.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewAudioMsg.kt @@ -33,18 +33,18 @@ import kotlin.String import kotlin.collections.List /** - * @param duration Audio message duration in seconds - * @param linkMp3 MP3 file URL - * @param linkOgg OGG file URL - * @param waveform no description + * @param duration - Audio message duration in seconds + * @param linkMp3 - MP3 file URL + * @param linkOgg - OGG file URL + * @param waveform */ data class DocsDocPreviewAudioMsg( - @SerializedName(value="duration") + @SerializedName("duration") val duration: Int, - @SerializedName(value="link_mp3") + @SerializedName("link_mp3") val linkMp3: String, - @SerializedName(value="link_ogg") + @SerializedName("link_ogg") val linkOgg: String, - @SerializedName(value="waveform") + @SerializedName("waveform") val waveform: List ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewGraffiti.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewGraffiti.kt index 0558fb1746..44d065402e 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewGraffiti.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewGraffiti.kt @@ -32,15 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param src Graffiti file URL - * @param width Graffiti width - * @param height Graffiti height + * @param src - Graffiti file URL + * @param width - Graffiti width + * @param height - Graffiti height */ data class DocsDocPreviewGraffiti( - @SerializedName(value="src") + @SerializedName("src") val src: String, - @SerializedName(value="width") + @SerializedName("width") val width: Int, - @SerializedName(value="height") + @SerializedName("height") val height: Int ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewPhoto.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewPhoto.kt index 72b888971c..7129882408 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewPhoto.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewPhoto.kt @@ -31,9 +31,9 @@ import com.google.gson.annotations.SerializedName import kotlin.collections.List /** - * @param sizes no description + * @param sizes */ data class DocsDocPreviewPhoto( - @SerializedName(value="sizes") + @SerializedName("sizes") val sizes: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewPhotoSizes.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewPhotoSizes.kt index 244dbcd78a..338f25a6e4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewPhotoSizes.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewPhotoSizes.kt @@ -33,18 +33,18 @@ import kotlin.Int import kotlin.String /** - * @param src URL of the image - * @param width Width in px - * @param height Height in px - * @param type no description + * @param src - URL of the image + * @param width - Width in px + * @param height - Height in px + * @param type */ data class DocsDocPreviewPhotoSizes( - @SerializedName(value="src") + @SerializedName("src") val src: String, - @SerializedName(value="width") + @SerializedName("width") val width: Int, - @SerializedName(value="height") + @SerializedName("height") val height: Int, - @SerializedName(value="type") + @SerializedName("type") val type: PhotosPhotoSizesType ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewVideo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewVideo.kt index 98ccc42a80..1f12966856 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewVideo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocPreviewVideo.kt @@ -32,18 +32,18 @@ import kotlin.Int import kotlin.String /** - * @param src Video URL - * @param width Video's width in pixels - * @param height Video's height in pixels - * @param fileSize Video file size in bites + * @param src - Video URL + * @param width - Video's width in pixels + * @param height - Video's height in pixels + * @param fileSize - Video file size in bites */ data class DocsDocPreviewVideo( - @SerializedName(value="src") + @SerializedName("src") val src: String, - @SerializedName(value="width") + @SerializedName("width") val width: Int, - @SerializedName(value="height") + @SerializedName("height") val height: Int, - @SerializedName(value="file_size") + @SerializedName("file_size") val fileSize: Int ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocTypes.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocTypes.kt index a3387697be..d2eb820abd 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocTypes.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsDocTypes.kt @@ -32,15 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param id Doc type ID - * @param name Doc type title - * @param count Number of docs + * @param id - Doc type ID + * @param name - Doc type title + * @param count - Number of docs */ data class DocsDocTypes( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="count") + @SerializedName("count") val count: Int ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetResponse.kt new file mode 100644 index 0000000000..f393f19da6 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.docs.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DocsGetResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetTypesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetTypesResponse.kt new file mode 100644 index 0000000000..337f8635fa --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetTypesResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.docs.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DocsGetTypesResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsSaveResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsSaveResponse.kt new file mode 100644 index 0000000000..543cd26c93 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsSaveResponse.kt @@ -0,0 +1,49 @@ +/** + * 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.docs.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.messages.dto.MessagesAudioMessage +import com.vk.sdk.api.messages.dto.MessagesGraffiti + +/** + * @param type + * @param audioMessage + * @param doc + * @param graffiti + */ +data class DocsSaveResponse( + @SerializedName("type") + val type: DocsDocAttachmentType? = null, + @SerializedName("audio_message") + val audioMessage: MessagesAudioMessage? = null, + @SerializedName("doc") + val doc: DocsDoc? = null, + @SerializedName("graffiti") + val graffiti: MessagesGraffiti? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsSearchResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsSearchResponse.kt new file mode 100644 index 0000000000..6324cb911a --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/DocsSearchResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.docs.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class DocsSearchResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/TypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/TypeParam.kt new file mode 100644 index 0000000000..e03067877e --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/docs/dto/TypeParam.kt @@ -0,0 +1,62 @@ +/** + * 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.docs.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class TypeParam( + val value: Int +) { + @SerializedName("0") + ALL(0), + + @SerializedName("1") + TEXT(1), + + @SerializedName("2") + ARCHIVE(2), + + @SerializedName("3") + GIF(3), + + @SerializedName("4") + IMAGE(4), + + @SerializedName("5") + AUDIO(5), + + @SerializedName("6") + VIDEO(6), + + @SerializedName("7") + EBOOK(7), + + @SerializedName("8") + DEFAULT(8); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/DonutService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/DonutService.kt new file mode 100644 index 0000000000..6fec23af21 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/DonutService.kt @@ -0,0 +1,111 @@ +/** + * 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.donut + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.base.dto.BaseBoolInt +import com.vk.sdk.api.base.dto.BaseUserGroupFields +import com.vk.sdk.api.donut.dto.DonutDonatorSubscriptionInfo +import com.vk.sdk.api.donut.dto.DonutGetSubscriptionsResponse +import com.vk.sdk.api.groups.dto.GroupsGetMembersFieldsResponse +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class DonutService { + /** + * @param ownerId + * @param offset + * @param count + * @param fields + * @return [VKRequest] with [GroupsGetMembersFieldsResponse] + */ + fun donutGetFriends( + ownerId: Int, + offset: Int? = null, + count: Int? = null, + fields: List? = null + ): VKRequest = NewApiRequest("donut.getFriends") { + GsonHolder.gson.fromJson(it, GroupsGetMembersFieldsResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + fields?.let { addParam("fields", it) } + } + + /** + * @param ownerId + * @return [VKRequest] with [DonutDonatorSubscriptionInfo] + */ + fun donutGetSubscription(ownerId: Int): VKRequest = + NewApiRequest("donut.getSubscription") { + GsonHolder.gson.fromJson(it, DonutDonatorSubscriptionInfo::class.java) + } + .apply { + addParam("owner_id", ownerId) + } + + /** + * Returns a list of user's VK Donut subscriptions. + * + * @param fields + * @param offset + * @param count + * @return [VKRequest] with [DonutGetSubscriptionsResponse] + */ + fun donutGetSubscriptions( + fields: List? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("donut.getSubscriptions") { + GsonHolder.gson.fromJson(it, DonutGetSubscriptionsResponse::class.java) + } + .apply { + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * @param ownerId + * @return [VKRequest] with [BaseBoolInt] + */ + fun donutIsDon(ownerId: Int): VKRequest = NewApiRequest("donut.isDon") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("owner_id", ownerId) + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/dto/DonutDonatorSubscriptionInfo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/dto/DonutDonatorSubscriptionInfo.kt index bff8566506..fd17ec7b64 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/dto/DonutDonatorSubscriptionInfo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/dto/DonutDonatorSubscriptionInfo.kt @@ -27,59 +27,34 @@ // ********************************************************************* package com.vk.sdk.api.donut.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.Int import kotlin.String /** - * @param ownerId no description - * @param nextPaymentDate no description - * @param amount no description - * @param status no description + * Info about user VK Donut subscription + * @param ownerId + * @param nextPaymentDate + * @param amount + * @param status */ data class DonutDonatorSubscriptionInfo( - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="next_payment_date") + @SerializedName("next_payment_date") val nextPaymentDate: Int, - @SerializedName(value="amount") + @SerializedName("amount") val amount: Int, - @SerializedName(value="status") - val status: Status + @SerializedName("status") + val status: DonutDonatorSubscriptionInfo.Status ) { enum class Status( val value: String ) { + @SerializedName("active") ACTIVE("active"), + @SerializedName("expiring") EXPIRING("expiring"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Status?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Status { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/dto/DonutGetSubscriptionsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/dto/DonutGetSubscriptionsResponse.kt new file mode 100644 index 0000000000..a44ec323a6 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/donut/dto/DonutGetSubscriptionsResponse.kt @@ -0,0 +1,51 @@ +/** + * 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.donut.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param subscriptions + * @param count + * @param profiles + * @param groups + */ +data class DonutGetSubscriptionsResponse( + @SerializedName("subscriptions") + val subscriptions: List, + @SerializedName("count") + val count: Int? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/downloadedGames/DownloadedGamesService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/downloadedGames/DownloadedGamesService.kt new file mode 100644 index 0000000000..8e84f9e574 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/downloadedGames/DownloadedGamesService.kt @@ -0,0 +1,49 @@ +/** + * 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.downloadedGames + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.downloadedGames.dto.DownloadedGamesPaidStatusResponse +import kotlin.Int + +class DownloadedGamesService { + /** + * @param userId + * @return [VKRequest] with [DownloadedGamesPaidStatusResponse] + */ + fun downloadedGamesGetPaidStatus(userId: Int? = null): + VKRequest = + NewApiRequest("downloadedGames.getPaidStatus") { + GsonHolder.gson.fromJson(it, DownloadedGamesPaidStatusResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/downloadedGames/dto/DownloadedGamesPaidStatusResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/downloadedGames/dto/DownloadedGamesPaidStatusResponse.kt new file mode 100644 index 0000000000..c92e90c482 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/downloadedGames/dto/DownloadedGamesPaidStatusResponse.kt @@ -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.downloadedGames.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Boolean + +/** + * @param isPaid - Game has been paid + */ +data class DownloadedGamesPaidStatusResponse( + @SerializedName("is_paid") + val isPaid: Boolean +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/events/dto/EventsEventAttach.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/events/dto/EventsEventAttach.kt index c433a4dfae..24b9decc50 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/events/dto/EventsEventAttach.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/events/dto/EventsEventAttach.kt @@ -35,30 +35,30 @@ import kotlin.String import kotlin.collections.List /** - * @param buttonText text of attach - * @param friends array of friends ids - * @param id event ID - * @param isFavorite is favorite - * @param text text of attach - * @param address address of event - * @param memberStatus Current user's member status - * @param time event start time + * @param buttonText - text of attach + * @param friends - array of friends ids + * @param id - event ID + * @param isFavorite - is favorite + * @param text - text of attach + * @param address - address of event + * @param memberStatus - Current user's member status + * @param time - event start time */ data class EventsEventAttach( - @SerializedName(value="button_text") + @SerializedName("button_text") val buttonText: String, - @SerializedName(value="friends") + @SerializedName("friends") val friends: List, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="is_favorite") + @SerializedName("is_favorite") val isFavorite: Boolean, - @SerializedName(value="text") + @SerializedName("text") val text: String, - @SerializedName(value="address") + @SerializedName("address") val address: String? = null, - @SerializedName(value="member_status") + @SerializedName("member_status") val memberStatus: GroupsGroupFullMemberStatus? = null, - @SerializedName(value="time") + @SerializedName("time") val time: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/execute/ExecuteService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/execute/ExecuteService.kt new file mode 100644 index 0000000000..c791e9e0e1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/execute/ExecuteService.kt @@ -0,0 +1,40 @@ +/** + * 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.execute + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.NewApiRequest +import kotlin.Unit + +class ExecuteService { + /** + * @return [VKRequest] with [Unit] + */ + fun execute(): VKRequest = NewApiRequest("execute") { + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/FaveService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/FaveService.kt new file mode 100644 index 0000000000..6ca2d3d323 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/FaveService.kt @@ -0,0 +1,442 @@ +/** + * 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.fave + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.base.dto.BaseBoolInt +import com.vk.sdk.api.base.dto.BaseOkResponse +import com.vk.sdk.api.base.dto.BaseUserGroupFields +import com.vk.sdk.api.fave.dto.FaveGetExtendedResponse +import com.vk.sdk.api.fave.dto.FaveGetPagesResponse +import com.vk.sdk.api.fave.dto.FaveGetResponse +import com.vk.sdk.api.fave.dto.FaveGetTagsResponse +import com.vk.sdk.api.fave.dto.FaveTag +import com.vk.sdk.api.fave.dto.ItemTypeParam +import com.vk.sdk.api.fave.dto.PositionParam +import com.vk.sdk.api.fave.dto.TypeParam +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class FaveService { + /** + * @param url + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveAddArticle(url: String): VKRequest = NewApiRequest("fave.addArticle") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("url", url) + } + + /** + * Adds a link to user faves. + * + * @param link - Link URL. + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveAddLink(link: String): VKRequest = NewApiRequest("fave.addLink") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("link", link) + } + + /** + * @param userId + * @param groupId + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveAddPage(userId: Int? = null, groupId: Int? = null): VKRequest = + NewApiRequest("fave.addPage") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * @param ownerId + * @param id + * @param accessKey + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveAddPost( + ownerId: Int, + id: Int, + accessKey: String? = null + ): VKRequest = NewApiRequest("fave.addPost") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("id", id) + accessKey?.let { addParam("access_key", it) } + } + + /** + * @param ownerId + * @param id + * @param accessKey + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveAddProduct( + ownerId: Int, + id: Int, + accessKey: String? = null + ): VKRequest = NewApiRequest("fave.addProduct") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("id", id) + accessKey?.let { addParam("access_key", it) } + } + + /** + * @param name + * @param position + * @return [VKRequest] with [FaveTag] + */ + fun faveAddTag(name: String? = null, position: PositionParam? = null): VKRequest = + NewApiRequest("fave.addTag") { + GsonHolder.gson.fromJson(it, FaveTag::class.java) + } + .apply { + name?.let { addParam("name", it) } + position?.let { addParam("position", it.value) } + } + + /** + * @param ownerId + * @param id + * @param accessKey + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveAddVideo( + ownerId: Int, + id: Int, + accessKey: String? = null + ): VKRequest = NewApiRequest("fave.addVideo") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("id", id) + accessKey?.let { addParam("access_key", it) } + } + + /** + * @param id + * @param name + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveEditTag(id: Int, name: String): VKRequest = + NewApiRequest("fave.editTag") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("id", id) + addParam("name", name) + } + + /** + * @param itemType + * @param tagId - Tag ID. + * @param offset - Offset needed to return a specific subset of users. + * @param count - Number of users to return. + * @param fields + * @param isFromSnackbar + * @return [VKRequest] with [FaveGetResponse] + */ + fun faveGet( + itemType: ItemTypeParam? = null, + tagId: Int? = null, + offset: Int? = null, + count: Int? = null, + fields: String? = null, + isFromSnackbar: Boolean? = null + ): VKRequest = NewApiRequest("fave.get") { + GsonHolder.gson.fromJson(it, FaveGetResponse::class.java) + } + .apply { + itemType?.let { addParam("item_type", it.value) } + tagId?.let { addParam("tag_id", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + fields?.let { addParam("fields", it) } + isFromSnackbar?.let { addParam("is_from_snackbar", it) } + } + + /** + * @param itemType + * @param tagId - Tag ID. + * @param offset - Offset needed to return a specific subset of users. + * @param count - Number of users to return. + * @param fields + * @param isFromSnackbar + * @return [VKRequest] with [FaveGetExtendedResponse] + */ + fun faveGetExtended( + itemType: ItemTypeParam? = null, + tagId: Int? = null, + offset: Int? = null, + count: Int? = null, + fields: String? = null, + isFromSnackbar: Boolean? = null + ): VKRequest = NewApiRequest("fave.get") { + GsonHolder.gson.fromJson(it, FaveGetExtendedResponse::class.java) + } + .apply { + addParam("extended", true) + itemType?.let { addParam("item_type", it.value) } + tagId?.let { addParam("tag_id", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + fields?.let { addParam("fields", it) } + isFromSnackbar?.let { addParam("is_from_snackbar", it) } + } + + /** + * @param offset + * @param count + * @param type + * @param fields + * @param tagId + * @return [VKRequest] with [FaveGetPagesResponse] + */ + fun faveGetPages( + offset: Int? = null, + count: Int? = null, + type: TypeParam? = null, + fields: List? = null, + tagId: Int? = null + ): VKRequest = NewApiRequest("fave.getPages") { + GsonHolder.gson.fromJson(it, FaveGetPagesResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + type?.let { addParam("type", it.value) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + tagId?.let { addParam("tag_id", it) } + } + + /** + * @return [VKRequest] with [FaveGetTagsResponse] + */ + fun faveGetTags(): VKRequest = NewApiRequest("fave.getTags") { + GsonHolder.gson.fromJson(it, FaveGetTagsResponse::class.java) + } + + /** + * @return [VKRequest] with [BaseBoolInt] + */ + fun faveMarkSeen(): VKRequest = NewApiRequest("fave.markSeen") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + + /** + * @param ownerId + * @param articleId + * @return [VKRequest] with [BaseBoolInt] + */ + fun faveRemoveArticle(ownerId: Int, articleId: Int): VKRequest = + NewApiRequest("fave.removeArticle") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("article_id", articleId) + } + + /** + * Removes link from the user's faves. + * + * @param linkId - Link ID (can be obtained by [vk.com/dev/faves.getLinks|faves.getLinks] + * method). + * @param link - Link URL + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveRemoveLink(linkId: String? = null, link: String? = null): VKRequest = + NewApiRequest("fave.removeLink") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + linkId?.let { addParam("link_id", it) } + link?.let { addParam("link", it) } + } + + /** + * @param userId + * @param groupId + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveRemovePage(userId: Int? = null, groupId: Int? = null): VKRequest = + NewApiRequest("fave.removePage") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * @param ownerId + * @param id + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveRemovePost(ownerId: Int, id: Int): VKRequest = + NewApiRequest("fave.removePost") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("id", id) + } + + /** + * @param ownerId + * @param id + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveRemoveProduct(ownerId: Int, id: Int): VKRequest = + NewApiRequest("fave.removeProduct") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("id", id) + } + + /** + * @param id + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveRemoveTag(id: Int): VKRequest = NewApiRequest("fave.removeTag") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("id", id) + } + + /** + * @param ownerId + * @param id + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveRemoveVideo(ownerId: Int, id: Int): VKRequest = + NewApiRequest("fave.removeVideo") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("id", id) + } + + /** + * @param ids + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveReorderTags(ids: List): VKRequest = + NewApiRequest("fave.reorderTags") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("ids", ids) + } + + /** + * @param userId + * @param groupId + * @param tagIds + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveSetPageTags( + userId: Int? = null, + groupId: Int? = null, + tagIds: List? = null + ): VKRequest = NewApiRequest("fave.setPageTags") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + groupId?.let { addParam("group_id", it) } + tagIds?.let { addParam("tag_ids", it) } + } + + /** + * @param itemType + * @param itemOwnerId + * @param itemId + * @param tagIds + * @param linkId + * @param linkUrl + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveSetTags( + itemType: ItemTypeParam? = null, + itemOwnerId: Int? = null, + itemId: Int? = null, + tagIds: List? = null, + linkId: String? = null, + linkUrl: String? = null + ): VKRequest = NewApiRequest("fave.setTags") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + itemType?.let { addParam("item_type", it.value) } + itemOwnerId?.let { addParam("item_owner_id", it) } + itemId?.let { addParam("item_id", it) } + tagIds?.let { addParam("tag_ids", it) } + linkId?.let { addParam("link_id", it) } + linkUrl?.let { addParam("link_url", it) } + } + + /** + * @param userId + * @param groupId + * @return [VKRequest] with [BaseOkResponse] + */ + fun faveTrackPageInteraction(userId: Int? = null, groupId: Int? = null): + VKRequest = NewApiRequest("fave.trackPageInteraction") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + groupId?.let { addParam("group_id", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveBookmark.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveBookmark.kt index f90b176b02..ed1e933570 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveBookmark.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveBookmark.kt @@ -37,30 +37,30 @@ import kotlin.Int import kotlin.collections.List /** - * @param addedDate Timestamp, when this item was bookmarked - * @param seen Has user seen this item - * @param tags no description - * @param type Item type - * @param link no description - * @param post no description - * @param product no description - * @param video no description + * @param addedDate - Timestamp, when this item was bookmarked + * @param seen - Has user seen this item + * @param tags + * @param type - Item type + * @param link + * @param post + * @param product + * @param video */ data class FaveBookmark( - @SerializedName(value="added_date") + @SerializedName("added_date") val addedDate: Int, - @SerializedName(value="seen") + @SerializedName("seen") val seen: Boolean, - @SerializedName(value="tags") + @SerializedName("tags") val tags: List, - @SerializedName(value="type") + @SerializedName("type") val type: FaveBookmarkType, - @SerializedName(value="link") + @SerializedName("link") val link: BaseLink? = null, - @SerializedName(value="post") + @SerializedName("post") val post: WallWallpostFull? = null, - @SerializedName(value="product") + @SerializedName("product") val product: MarketMarketItem? = null, - @SerializedName(value="video") + @SerializedName("video") val video: VideoVideo? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveBookmarkType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveBookmarkType.kt index da410379e3..dc134acb39 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveBookmarkType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveBookmarkType.kt @@ -27,50 +27,33 @@ // ********************************************************************* package com.vk.sdk.api.fave.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class FaveBookmarkType( val value: String ) { + @SerializedName("post") POST("post"), + @SerializedName("video") VIDEO("video"), + @SerializedName("product") PRODUCT("product"), + @SerializedName("article") ARTICLE("article"), + @SerializedName("link") LINK("link"), + @SerializedName("podcast") PODCAST("podcast"), - NARRATIVE("narrative"); + @SerializedName("narrative") + NARRATIVE("narrative"), - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: FaveBookmarkType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): FaveBookmarkType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } + @SerializedName("youla_product") + YOULA_PRODUCT("youla_product"); } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetExtendedResponse.kt new file mode 100644 index 0000000000..b80cf98eeb --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetExtendedResponse.kt @@ -0,0 +1,51 @@ +/** + * 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.fave.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroup +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param profiles + * @param groups + */ +data class FaveGetExtendedResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetPagesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetPagesResponse.kt new file mode 100644 index 0000000000..016a65c8d9 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetPagesResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.fave.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count + * @param items + */ +data class FaveGetPagesResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetResponse.kt new file mode 100644 index 0000000000..12c40800f3 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.fave.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class FaveGetResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetTagsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetTagsResponse.kt new file mode 100644 index 0000000000..0b1fa84771 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetTagsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.fave.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count + * @param items + */ +data class FaveGetTagsResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FavePage.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FavePage.kt index 73d92c2cd6..9d34d28550 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FavePage.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FavePage.kt @@ -35,24 +35,24 @@ import kotlin.String import kotlin.collections.List /** - * @param description Some info about user or group - * @param tags no description - * @param type Item type - * @param group no description - * @param updatedDate Timestamp, when this page was bookmarked - * @param user no description + * @param description - Some info about user or group + * @param tags + * @param type - Item type + * @param group + * @param updatedDate - Timestamp, when this page was bookmarked + * @param user */ data class FavePage( - @SerializedName(value="description") + @SerializedName("description") val description: String, - @SerializedName(value="tags") + @SerializedName("tags") val tags: List, - @SerializedName(value="type") + @SerializedName("type") val type: FavePageType, - @SerializedName(value="group") + @SerializedName("group") val group: GroupsGroupFull? = null, - @SerializedName(value="updated_date") + @SerializedName("updated_date") val updatedDate: Int? = null, - @SerializedName(value="user") + @SerializedName("user") val user: UsersUserFull? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FavePageType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FavePageType.kt index 1c364df150..e80355d9e4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FavePageType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FavePageType.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.fave.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class FavePageType( val value: String ) { + @SerializedName("user") USER("user"), + @SerializedName("group") GROUP("group"), + @SerializedName("hints") HINTS("hints"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: FavePageType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): FavePageType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveTag.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveTag.kt index cb96c25ead..1cc2214ac9 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveTag.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/FaveTag.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id Tag id - * @param name Tag name + * @param id - Tag id + * @param name - Tag name */ data class FaveTag( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="name") + @SerializedName("name") val name: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/ItemTypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/ItemTypeParam.kt new file mode 100644 index 0000000000..ec567c77dc --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/ItemTypeParam.kt @@ -0,0 +1,65 @@ +/** + * 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.fave.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class ItemTypeParam( + val value: String +) { + @SerializedName("article") + ARTICLE("article"), + + @SerializedName("clip") + CLIP("clip"), + + @SerializedName("link") + LINK("link"), + + @SerializedName("narrative") + NARRATIVE("narrative"), + + @SerializedName("page") + PAGE("page"), + + @SerializedName("podcast") + PODCAST("podcast"), + + @SerializedName("post") + POST("post"), + + @SerializedName("product") + PRODUCT("product"), + + @SerializedName("video") + VIDEO("video"), + + @SerializedName("youla_product") + YOULA_PRODUCT("youla_product"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/PositionParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/PositionParam.kt new file mode 100644 index 0000000000..51467b3f7f --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/PositionParam.kt @@ -0,0 +1,41 @@ +/** + * 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.fave.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class PositionParam( + val value: String +) { + @SerializedName("back") + BACK("back"), + + @SerializedName("front") + FRONT("front"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/TypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/TypeParam.kt new file mode 100644 index 0000000000..fae64023c9 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/fave/dto/TypeParam.kt @@ -0,0 +1,44 @@ +/** + * 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.fave.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class TypeParam( + val value: String +) { + @SerializedName("groups") + GROUPS("groups"), + + @SerializedName("hints") + HINTS("hints"), + + @SerializedName("users") + USERS("users"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/FriendsService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/FriendsService.kt new file mode 100644 index 0000000000..57aac08166 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/FriendsService.kt @@ -0,0 +1,517 @@ +/** + * 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.friends + +import com.google.gson.reflect.TypeToken +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.base.dto.BaseOkResponse +import com.vk.sdk.api.friends.dto.FilterParam +import com.vk.sdk.api.friends.dto.FriendsAddListResponse +import com.vk.sdk.api.friends.dto.FriendsAddResponse +import com.vk.sdk.api.friends.dto.FriendsDeleteResponse +import com.vk.sdk.api.friends.dto.FriendsFriendExtendedStatus +import com.vk.sdk.api.friends.dto.FriendsFriendStatus +import com.vk.sdk.api.friends.dto.FriendsGetFieldsResponse +import com.vk.sdk.api.friends.dto.FriendsGetListsResponse +import com.vk.sdk.api.friends.dto.FriendsGetRequestsResponse +import com.vk.sdk.api.friends.dto.FriendsGetSuggestionsResponse +import com.vk.sdk.api.friends.dto.FriendsSearchResponse +import com.vk.sdk.api.friends.dto.FriendsUserXtrPhone +import com.vk.sdk.api.friends.dto.NameCaseParam +import com.vk.sdk.api.friends.dto.OrderParam +import com.vk.sdk.api.friends.dto.SortParam +import com.vk.sdk.api.users.dto.UsersFields +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class FriendsService { + /** + * Approves or creates a friend request. + * + * @param userId - ID of the user whose friend request will be approved or to whom a friend + * request will be sent. + * @param text - Text of the message (up to 500 characters) for the friend request, if any. + * @param follow - '1' to pass an incoming request to followers list. + * @return [VKRequest] with [FriendsAddResponse] + */ + fun friendsAdd( + userId: Int? = null, + text: String? = null, + follow: Boolean? = null + ): VKRequest = NewApiRequest("friends.add") { + GsonHolder.gson.fromJson(it, FriendsAddResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + text?.let { addParam("text", it) } + follow?.let { addParam("follow", it) } + } + + /** + * Creates a new friend list for the current user. + * + * @param name - Name of the friend list. + * @param userIds - IDs of users to be added to the friend list. + * @return [VKRequest] with [FriendsAddListResponse] + */ + fun friendsAddList(name: String, userIds: List? = null): VKRequest + = NewApiRequest("friends.addList") { + GsonHolder.gson.fromJson(it, FriendsAddListResponse::class.java) + } + .apply { + addParam("name", name) + userIds?.let { addParam("user_ids", it) } + } + + /** + * Checks the current user's friendship status with other specified users. + * + * @param userIds - IDs of the users whose friendship status to check. + * @param needSign - '1' - to return 'sign' field. 'sign' is + * md5("{id}_{user_id}_{friends_status}_{application_secret}"), where id is current user ID. This + * field allows to check that data has not been modified by the client. By default: '0'. + * @return [VKRequest] with [Unit] + */ + fun friendsAreFriends(userIds: List, needSign: Boolean? = null): + VKRequest> = NewApiRequest("friends.areFriends") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("user_ids", userIds) + needSign?.let { addParam("need_sign", it) } + } + + /** + * Checks the current user's friendship status with other specified users. + * + * @param userIds - IDs of the users whose friendship status to check. + * @param needSign - '1' - to return 'sign' field. 'sign' is + * md5("{id}_{user_id}_{friends_status}_{application_secret}"), where id is current user ID. This + * field allows to check that data has not been modified by the client. By default: '0'. + * @return [VKRequest] with [Unit] + */ + fun friendsAreFriendsExtended(userIds: List, needSign: Boolean? = null): + VKRequest> = NewApiRequest("friends.areFriends") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("user_ids", userIds) + needSign?.let { addParam("need_sign", it) } + addParam("extended", true) + } + + /** + * Declines a friend request or deletes a user from the current user's friend list. + * + * @param userId - ID of the user whose friend request is to be declined or who is to be deleted + * from the current user's friend list. + * @return [VKRequest] with [FriendsDeleteResponse] + */ + fun friendsDelete(userId: Int? = null): VKRequest = + NewApiRequest("friends.delete") { + GsonHolder.gson.fromJson(it, FriendsDeleteResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + } + + /** + * Marks all incoming friend requests as viewed. + * + * @return [VKRequest] with [BaseOkResponse] + */ + fun friendsDeleteAllRequests(): VKRequest = + NewApiRequest("friends.deleteAllRequests") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + + /** + * Deletes a friend list of the current user. + * + * @param listId - ID of the friend list to delete. + * @return [VKRequest] with [BaseOkResponse] + */ + fun friendsDeleteList(listId: Int): VKRequest = + NewApiRequest("friends.deleteList") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("list_id", listId) + } + + /** + * Edits the friend lists of the selected user. + * + * @param userId - ID of the user whose friend list is to be edited. + * @param listIds - IDs of the friend lists to which to add the user. + * @return [VKRequest] with [BaseOkResponse] + */ + fun friendsEdit(userId: Int, listIds: List? = null): VKRequest = + NewApiRequest("friends.edit") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("user_id", userId) + listIds?.let { addParam("list_ids", it) } + } + + /** + * Edits a friend list of the current user. + * + * @param listId - Friend list ID. + * @param name - Name of the friend list. + * @param userIds - IDs of users in the friend list. + * @param addUserIds - (Applies if 'user_ids' parameter is not set.), User IDs to add to the + * friend list. + * @param deleteUserIds - (Applies if 'user_ids' parameter is not set.), User IDs to delete from + * the friend list. + * @return [VKRequest] with [BaseOkResponse] + */ + fun friendsEditList( + listId: Int, + name: String? = null, + userIds: List? = null, + addUserIds: List? = null, + deleteUserIds: List? = null + ): VKRequest = NewApiRequest("friends.editList") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("list_id", listId) + name?.let { addParam("name", it) } + userIds?.let { addParam("user_ids", it) } + addUserIds?.let { addParam("add_user_ids", it) } + deleteUserIds?.let { addParam("delete_user_ids", it) } + } + + /** + * Returns a list of user IDs or detailed information about a user's friends. + * + * @param userId - User ID. By default, the current user ID. + * @param order - Sort order: , 'name' - by name (enabled only if the 'fields' parameter is + * used), 'hints' - by rating, similar to how friends are sorted in My friends section, , This + * parameter is available only for [vk.com/dev/standalone|desktop applications]. + * @param listId - ID of the friend list returned by the + * [vk.com/dev/friends.getLists|friends.getLists] method to be used as the source. This parameter + * is taken into account only when the uid parameter is set to the current user ID. This parameter + * is available only for [vk.com/dev/standalone|desktop applications]. + * @param count - Number of friends to return. + * @param offset - Offset needed to return a specific subset of friends. + * @param fields - Profile fields to return. Sample values: 'uid', 'first_name', 'last_name', + * 'nickname', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', + * 'photo_big', 'domain', 'has_mobile', 'rate', 'contacts', 'education'. + * @param nameCase - Case for declension of user name and surname: , 'nom' - nominative + * (default) , 'gen' - genitive , 'dat' - dative , 'acc' - accusative , 'ins' - instrumental , + * 'abl' - prepositional + * @param ref + * @return [VKRequest] with [FriendsGetFieldsResponse] + */ + fun friendsGet( + userId: Int? = null, + order: OrderParam? = null, + listId: Int? = null, + count: Int? = null, + offset: Int? = null, + fields: List? = null, + nameCase: NameCaseParam? = null, + ref: String? = null + ): VKRequest = NewApiRequest("friends.get") { + GsonHolder.gson.fromJson(it, FriendsGetFieldsResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + order?.let { addParam("order", it.value) } + listId?.let { addParam("list_id", it) } + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + nameCase?.let { addParam("name_case", it.value) } + ref?.let { addParam("ref", it) } + } + + /** + * Returns a list of IDs of the current user's friends who installed the application. + * + * @return [VKRequest] with [Unit] + */ + fun friendsGetAppUsers(): VKRequest> = NewApiRequest("friends.getAppUsers") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + + /** + * Returns a list of the current user's friends whose phone numbers, validated or specified in a + * profile, are in a given list. + * + * @param phones - List of phone numbers in MSISDN format (maximum 1000). Example: + * "+79219876543,+79111234567" + * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', + * 'has_mobile', 'rate', 'contacts', 'education', 'online, counters'. + * @return [VKRequest] with [Unit] + */ + fun friendsGetByPhones(phones: List? = null, fields: List? = null): + VKRequest> = NewApiRequest("friends.getByPhones") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + phones?.let { addParam("phones", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns a list of the user's friend lists. + * + * @param userId - User ID. + * @param returnSystem - '1' - to return system friend lists. By default: '0'. + * @return [VKRequest] with [FriendsGetListsResponse] + */ + fun friendsGetLists(userId: Int? = null, returnSystem: Boolean? = null): + VKRequest = NewApiRequest("friends.getLists") { + GsonHolder.gson.fromJson(it, FriendsGetListsResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + returnSystem?.let { addParam("return_system", it) } + } + + /** + * Returns a list of user IDs of the mutual friends of two users. + * + * @param sourceUid - ID of the user whose friends will be checked against the friends of the + * user specified in 'target_uid'. + * @param targetUid - ID of the user whose friends will be checked against the friends of the + * user specified in 'source_uid'. + * @param targetUids - IDs of the users whose friends will be checked against the friends of the + * user specified in 'source_uid'. + * @param order - Sort order: 'random' - random order + * @param count - Number of mutual friends to return. + * @param offset - Offset needed to return a specific subset of mutual friends. + * @return [VKRequest] with [Unit] + */ + fun friendsGetMutual( + sourceUid: Int? = null, + targetUid: Int? = null, + targetUids: List? = null, + order: String? = null, + count: Int? = null, + offset: Int? = null + ): VKRequest> = NewApiRequest("friends.getMutual") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + sourceUid?.let { addParam("source_uid", it) } + targetUid?.let { addParam("target_uid", it) } + targetUids?.let { addParam("target_uids", it) } + order?.let { addParam("order", it) } + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + } + + /** + * Returns a list of user IDs of a user's friends who are online. + * + * @param userId - User ID. + * @param listId - Friend list ID. If this parameter is not set, information about all online + * friends is returned. + * @param onlineMobile - '1' - to return an additional 'online_mobile' field, '0' - (default), + * @param order - Sort order: 'random' - random order + * @param count - Number of friends to return. + * @param offset - Offset needed to return a specific subset of friends. + * @return [VKRequest] with [Unit] + */ + fun friendsGetOnline( + userId: Int? = null, + listId: Int? = null, + onlineMobile: Boolean? = null, + order: String? = null, + count: Int? = null, + offset: Int? = null + ): VKRequest> = NewApiRequest("friends.getOnline") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + userId?.let { addParam("user_id", it) } + listId?.let { addParam("list_id", it) } + onlineMobile?.let { addParam("online_mobile", it) } + order?.let { addParam("order", it) } + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + } + + /** + * Returns a list of user IDs of the current user's recently added friends. + * + * @param count - Number of recently added friends to return. + * @return [VKRequest] with [Unit] + */ + fun friendsGetRecent(count: Int? = null): VKRequest> = + NewApiRequest("friends.getRecent") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + count?.let { addParam("count", it) } + } + + /** + * Returns information about the current user's incoming and outgoing friend requests. + * + * @param offset - Offset needed to return a specific subset of friend requests. + * @param count - Number of friend requests to return (default 100, maximum 1000). + * @param needMutual - '1' - to return a list of mutual friends (up to 20), if any + * @param out - '1' - to return outgoing requests, '0' - to return incoming requests (default) + * @param sort - Sort order: '1' - by number of mutual friends, '0' - by date + * @param needViewed + * @param suggested - '1' - to return a list of suggested friends, '0' - to return friend + * requests (default) + * @param ref + * @param fields + * @return [VKRequest] with [FriendsGetRequestsResponse] + */ + fun friendsGetRequests( + offset: Int? = null, + count: Int? = null, + needMutual: Boolean? = null, + out: Boolean? = null, + sort: SortParam? = null, + needViewed: Boolean? = null, + suggested: Boolean? = null, + ref: String? = null, + fields: List? = null + ): VKRequest = NewApiRequest("friends.getRequests") { + GsonHolder.gson.fromJson(it, FriendsGetRequestsResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + needMutual?.let { addParam("need_mutual", it) } + out?.let { addParam("out", it) } + sort?.let { addParam("sort", it.value) } + needViewed?.let { addParam("need_viewed", it) } + suggested?.let { addParam("suggested", it) } + ref?.let { addParam("ref", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns a list of profiles of users whom the current user may know. + * + * @param filter - Types of potential friends to return: 'mutual' - users with many mutual + * friends , 'contacts' - users found with the + * [vk.com/dev/account.importContacts|account.importContacts] method , 'mutual_contacts' - users + * who imported the same contacts as the current user with the + * [vk.com/dev/account.importContacts|account.importContacts] method + * @param count - Number of suggestions to return. + * @param offset - Offset needed to return a specific subset of suggestions. + * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', + * 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'. + * @param nameCase - Case for declension of user name and surname: , 'nom' - nominative + * (default) , 'gen' - genitive , 'dat' - dative , 'acc' - accusative , 'ins' - instrumental , + * 'abl' - prepositional + * @return [VKRequest] with [FriendsGetSuggestionsResponse] + */ + fun friendsGetSuggestions( + filter: List? = null, + count: Int? = null, + offset: Int? = null, + fields: List? = null, + nameCase: NameCaseParam? = null + ): VKRequest = NewApiRequest("friends.getSuggestions") { + GsonHolder.gson.fromJson(it, FriendsGetSuggestionsResponse::class.java) + } + .apply { + val filterJsonConverted = filter?.map { + it.value + } + filterJsonConverted?.let { addParam("filter", it) } + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + nameCase?.let { addParam("name_case", it.value) } + } + + /** + * Returns a list of friends matching the search criteria. + * + * @param userId - User ID. + * @param q - Search query string (e.g., 'Vasya Babich'). + * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', + * 'has_mobile', 'rate', 'contacts', 'education', 'online', + * @param nameCase - Case for declension of user name and surname: 'nom' - nominative (default), + * 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - + * prepositional + * @param offset - Offset needed to return a specific subset of friends. + * @param count - Number of friends to return. + * @return [VKRequest] with [FriendsSearchResponse] + */ + fun friendsSearch( + userId: Int, + q: String? = null, + fields: List? = null, + nameCase: NameCaseParam? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("friends.search") { + GsonHolder.gson.fromJson(it, FriendsSearchResponse::class.java) + } + .apply { + addParam("user_id", userId) + q?.let { addParam("q", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + nameCase?.let { addParam("name_case", it.value) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FilterParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FilterParam.kt new file mode 100644 index 0000000000..197d6a5b5c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FilterParam.kt @@ -0,0 +1,44 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FilterParam( + val value: String +) { + @SerializedName("mutual") + MUTUAL("mutual"), + + @SerializedName("contacts") + CONTACTS("contacts"), + + @SerializedName("mutual_contacts") + MUTUAL_CONTACTS("mutual_contacts"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsAddListResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsAddListResponse.kt new file mode 100644 index 0000000000..b08617dc30 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsAddListResponse.kt @@ -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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param listId - List ID + */ +data class FriendsAddListResponse( + @SerializedName("list_id") + val listId: Int +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsAddResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsAddResponse.kt new file mode 100644 index 0000000000..af640bbea6 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsAddResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class FriendsAddResponse( + val value: Int +) { + @SerializedName("1") + SEND(1), + + @SerializedName("2") + APPROVED(2), + + @SerializedName("4") + RESEND(4); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsDeleteResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsDeleteResponse.kt new file mode 100644 index 0000000000..80827f9aaf --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsDeleteResponse.kt @@ -0,0 +1,79 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param success + * @param friendDeleted - Returns 1 if friend has been deleted + * @param outRequestDeleted - Returns 1 if out request has been canceled + * @param inRequestDeleted - Returns 1 if incoming request has been declined + * @param suggestionDeleted - Returns 1 if suggestion has been declined + */ +data class FriendsDeleteResponse( + @SerializedName("success") + val success: Int, + @SerializedName("friend_deleted") + val friendDeleted: FriendsDeleteResponse.FriendDeleted? = null, + @SerializedName("out_request_deleted") + val outRequestDeleted: FriendsDeleteResponse.OutRequestDeleted? = null, + @SerializedName("in_request_deleted") + val inRequestDeleted: FriendsDeleteResponse.InRequestDeleted? = null, + @SerializedName("suggestion_deleted") + val suggestionDeleted: FriendsDeleteResponse.SuggestionDeleted? = null +) { + enum class FriendDeleted( + val value: Int + ) { + @SerializedName("1") + OK(1); + } + + enum class OutRequestDeleted( + val value: Int + ) { + @SerializedName("1") + OK(1); + } + + enum class InRequestDeleted( + val value: Int + ) { + @SerializedName("1") + OK(1); + } + + enum class SuggestionDeleted( + val value: Int + ) { + @SerializedName("1") + OK(1); + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendExtendedStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendExtendedStatus.kt index 9e2b155455..415df424a6 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendExtendedStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendExtendedStatus.kt @@ -33,18 +33,18 @@ import kotlin.Int import kotlin.String /** - * @param isRequestUnread Is friend request from other user unread - * @param friendStatus no description - * @param sign MD5 hash for the result validation - * @param userId User ID + * @param isRequestUnread - Is friend request from other user unread + * @param friendStatus + * @param sign - MD5 hash for the result validation + * @param userId - User ID */ data class FriendsFriendExtendedStatus( - @SerializedName(value="is_request_unread") + @SerializedName("is_request_unread") val isRequestUnread: Boolean? = null, - @SerializedName(value="friend_status") + @SerializedName("friend_status") val friendStatus: FriendsFriendStatusStatus? = null, - @SerializedName(value="sign") + @SerializedName("sign") val sign: String? = null, - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendStatus.kt index 1c7d21c2ba..42ea756a28 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendStatus.kt @@ -32,15 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param friendStatus no description - * @param userId User ID - * @param sign MD5 hash for the result validation + * @param friendStatus + * @param userId - User ID + * @param sign - MD5 hash for the result validation */ data class FriendsFriendStatus( - @SerializedName(value="friend_status") + @SerializedName("friend_status") val friendStatus: FriendsFriendStatusStatus, - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int, - @SerializedName(value="sign") + @SerializedName("sign") val sign: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendStatusStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendStatusStatus.kt index dd7be2352a..a4d127eae5 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendStatusStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendStatusStatus.kt @@ -27,45 +27,21 @@ // ********************************************************************* package com.vk.sdk.api.friends.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class FriendsFriendStatusStatus( val value: Int ) { + @SerializedName("0") NOT_A_FRIEND(0), + @SerializedName("1") OUTCOMING_REQUEST(1), + @SerializedName("2") INCOMING_REQUEST(2), + @SerializedName("3") IS_FRIEND(3); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: FriendsFriendStatusStatus?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): FriendsFriendStatusStatus { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendsList.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendsList.kt index 559a4d12e4..1ea7748b0e 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendsList.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendsList.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id List ID - * @param name List title + * @param id - List ID + * @param name - List title */ data class FriendsFriendsList( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetFieldsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetFieldsResponse.kt new file mode 100644 index 0000000000..7cd9d0a3cb --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetFieldsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total friends number + * @param items + */ +data class FriendsGetFieldsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetListsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetListsResponse.kt new file mode 100644 index 0000000000..640e1b2ffc --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetListsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number of friends lists + * @param items + */ +data class FriendsGetListsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsResponse.kt new file mode 100644 index 0000000000..33f0650db8 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsResponse.kt @@ -0,0 +1,46 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total requests number + * @param items + * @param countUnread - Total unread requests number + */ +data class FriendsGetRequestsResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null, + @SerializedName("count_unread") + val countUnread: Int? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsResponse.kt new file mode 100644 index 0000000000..8e0b56c724 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total results number + * @param items + */ +data class FriendsGetSuggestionsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsRequestsMutual.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsRequestsMutual.kt index 061b827bc3..a126adfd71 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsRequestsMutual.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsRequestsMutual.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param count Total mutual friends number - * @param users no description + * @param count - Total mutual friends number + * @param users */ data class FriendsRequestsMutual( - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null, - @SerializedName(value="users") + @SerializedName("users") val users: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsSearchResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsSearchResponse.kt new file mode 100644 index 0000000000..5a6f4288dc --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsSearchResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class FriendsSearchResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrLists.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrLists.kt index c26fb59929..4714d099f6 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrLists.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrLists.kt @@ -27,14 +27,6 @@ // ********************************************************************* package com.vk.sdk.api.friends.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName import com.vk.sdk.api.audio.dto.AudioAudio import com.vk.sdk.api.base.dto.BaseBoolInt @@ -59,7 +51,6 @@ import com.vk.sdk.api.users.dto.UsersUserMin import com.vk.sdk.api.users.dto.UsersUserRelation import com.vk.sdk.api.users.dto.UsersUserType import com.vk.sdk.api.video.dto.VideoLiveInfo -import java.lang.reflect.Type import kotlin.Boolean import kotlin.Float import kotlin.Int @@ -67,433 +58,425 @@ import kotlin.String import kotlin.collections.List /** - * @param lists no description - * @param firstNameNom User's first name in nominative case - * @param firstNameGen User's first name in genitive case - * @param firstNameDat User's first name in dative case - * @param firstNameAcc User's first name in accusative case - * @param firstNameIns User's first name in instrumental case - * @param firstNameAbl User's first name in prepositional case - * @param lastNameNom User's last name in nominative case - * @param lastNameGen User's last name in genitive case - * @param lastNameDat User's last name in dative case - * @param lastNameAcc User's last name in accusative case - * @param lastNameIns User's last name in instrumental case - * @param lastNameAbl User's last name in prepositional case - * @param nickname User nickname - * @param maidenName User maiden name - * @param contactName User contact name - * @param domain Domain name of the user's page - * @param bdate User's date of birth - * @param city no description - * @param country no description - * @param timezone User's timezone - * @param ownerState no description - * @param photo200 URL of square photo of the user with 200 pixels in width - * @param photoMax URL of square photo of the user with maximum width - * @param photo200Orig URL of user's photo with 200 pixels in width - * @param photo400Orig URL of user's photo with 400 pixels in width - * @param photoMaxOrig URL of user's photo of maximum size - * @param photoId ID of the user's main photo - * @param hasPhoto Information whether the user has main photo - * @param hasMobile Information whether the user specified his phone number - * @param isFriend Information whether the user is a friend of current user - * @param wallComments Information whether current user can comment wall posts - * @param canPost Information whether current user can post on the user's wall - * @param canSeeAllPosts Information whether current user can see other users' audio on the wall - * @param canSeeAudio Information whether current user can see the user's audio - * @param type no description - * @param email no description - * @param skype no description - * @param facebook no description - * @param facebookName no description - * @param twitter no description - * @param livejournal no description - * @param instagram no description - * @param test no description - * @param videoLive no description - * @param isVideoLiveNotificationsBlocked no description - * @param isService no description - * @param serviceDescription no description - * @param photo no description - * @param photoBig no description - * @param photo400 no description - * @param photoMaxSize no description - * @param language no description - * @param storiesArchiveCount no description - * @param wallDefault no description - * @param canCall Information whether current user can call - * @param canSeeWishes Information whether current user can see the user's wishes - * @param canSeeGifts Information whether current user can see the user's gifts - * @param interests no description - * @param books no description - * @param tv no description - * @param quotes no description - * @param about no description - * @param games no description - * @param movies no description - * @param activities no description - * @param music no description - * @param canWritePrivateMessage Information whether current user can write private message - * @param canSendFriendRequest Information whether current user can send a friend request - * @param canBeInvitedGroup Information whether current user can be invited to the community - * @param mobilePhone User's mobile phone number - * @param homePhone User's additional phone number - * @param site User's website - * @param statusAudio no description - * @param status User's status - * @param activity User's status - * @param lastSeen no description - * @param exports no description - * @param cropPhoto no description - * @param followersCount Number of user's followers - * @param videoLiveLevel User level in live streams achievements - * @param videoLiveCount Number of user's live streams - * @param clipsCount Number of user's clips - * @param blacklisted Information whether current user is in the requested user's blacklist. - * @param blacklistedByMe Information whether the requested user is in current user's blacklist - * @param isFavorite Information whether the requested user is in faves of current user - * @param isHiddenFromFeed Information whether the requested user is hidden from current user's + * @param lists + * @param firstNameNom - User's first name in nominative case + * @param firstNameGen - User's first name in genitive case + * @param firstNameDat - User's first name in dative case + * @param firstNameAcc - User's first name in accusative case + * @param firstNameIns - User's first name in instrumental case + * @param firstNameAbl - User's first name in prepositional case + * @param lastNameNom - User's last name in nominative case + * @param lastNameGen - User's last name in genitive case + * @param lastNameDat - User's last name in dative case + * @param lastNameAcc - User's last name in accusative case + * @param lastNameIns - User's last name in instrumental case + * @param lastNameAbl - User's last name in prepositional case + * @param nickname - User nickname + * @param maidenName - User maiden name + * @param contactName - User contact name + * @param domain - Domain name of the user's page + * @param bdate - User's date of birth + * @param city + * @param country + * @param timezone - User's timezone + * @param ownerState + * @param photo200 - URL of square photo of the user with 200 pixels in width + * @param photoMax - URL of square photo of the user with maximum width + * @param photo200Orig - URL of user's photo with 200 pixels in width + * @param photo400Orig - URL of user's photo with 400 pixels in width + * @param photoMaxOrig - URL of user's photo of maximum size + * @param photoId - ID of the user's main photo + * @param hasPhoto - Information whether the user has main photo + * @param hasMobile - Information whether the user specified his phone number + * @param isFriend - Information whether the user is a friend of current user + * @param wallComments - Information whether current user can comment wall posts + * @param canPost - Information whether current user can post on the user's wall + * @param canSeeAllPosts - Information whether current user can see other users' audio on the wall + * @param canSeeAudio - Information whether current user can see the user's audio + * @param type + * @param email + * @param skype + * @param facebook + * @param facebookName + * @param twitter + * @param livejournal + * @param instagram + * @param test + * @param videoLive + * @param isVideoLiveNotificationsBlocked + * @param isService + * @param serviceDescription + * @param photoRec + * @param photoMedium + * @param photoMediumRec + * @param photo + * @param photoBig + * @param photo400 + * @param photoMaxSize + * @param language + * @param storiesArchiveCount + * @param wallDefault + * @param canCall - Information whether current user can call + * @param canSeeWishes - Information whether current user can see the user's wishes + * @param canSeeGifts - Information whether current user can see the user's gifts + * @param interests + * @param books + * @param tv + * @param quotes + * @param about + * @param games + * @param movies + * @param activities + * @param music + * @param canWritePrivateMessage - Information whether current user can write private message + * @param canSendFriendRequest - Information whether current user can send a friend request + * @param canBeInvitedGroup - Information whether current user can be invited to the community + * @param mobilePhone - User's mobile phone number + * @param homePhone - User's additional phone number + * @param site - User's website + * @param statusAudio + * @param status - User's status + * @param activity - User's status + * @param lastSeen + * @param exports + * @param cropPhoto + * @param followersCount - Number of user's followers + * @param videoLiveLevel - User level in live streams achievements + * @param videoLiveCount - Number of user's live streams + * @param clipsCount - Number of user's clips + * @param blacklisted - Information whether current user is in the requested user's blacklist. + * @param blacklistedByMe - Information whether the requested user is in current user's blacklist + * @param isFavorite - Information whether the requested user is in faves of current user + * @param isHiddenFromFeed - Information whether the requested user is hidden from current user's * newsfeed - * @param commonCount Number of common friends with current user - * @param occupation no description - * @param career no description - * @param military no description - * @param university University ID - * @param universityName University name - * @param universityGroupId no description - * @param faculty Faculty ID - * @param facultyName Faculty name - * @param graduation Graduation year - * @param educationForm Education form - * @param educationStatus User's education status - * @param homeTown User hometown - * @param relation User relationship status - * @param relationPartner no description - * @param personal no description - * @param universities no description - * @param schools no description - * @param relatives no description - * @param isSubscribedPodcasts Information whether current user is subscribed to podcasts - * @param canSubscribePodcasts Owner in whitelist or not - * @param canSubscribePosts Can subscribe to wall - * @param counters no description - * @param accessKey no description - * @param canUploadDoc no description - * @param hash no description - * @param hasEmail no description - * @param sex User sex - * @param screenName Domain name of the user's page - * @param photo50 URL of square photo of the user with 50 pixels in width - * @param photo100 URL of square photo of the user with 100 pixels in width - * @param onlineInfo no description - * @param online Information whether the user is online - * @param onlineMobile Information whether the user is online in mobile site or application - * @param onlineApp Application ID - * @param verified Information whether the user is verified - * @param trending Information whether the user has a "fire" pictogram. - * @param friendStatus no description - * @param mutual no description - * @param deactivated Returns if a profile is deleted or blocked - * @param firstName User first name - * @param hidden Returns if a profile is hidden. - * @param id User ID - * @param lastName User last name - * @param canAccessClosed no description - * @param isClosed no description + * @param commonCount - Number of common friends with current user + * @param occupation + * @param career + * @param military + * @param university - University ID + * @param universityName - University name + * @param universityGroupId + * @param faculty - Faculty ID + * @param facultyName - Faculty name + * @param graduation - Graduation year + * @param educationForm - Education form + * @param educationStatus - User's education status + * @param homeTown - User hometown + * @param relation - User relationship status + * @param relationPartner + * @param personal + * @param universities + * @param schools + * @param relatives + * @param isSubscribedPodcasts - Information whether current user is subscribed to podcasts + * @param canSubscribePodcasts - Owner in whitelist or not + * @param canSubscribePosts - Can subscribe to wall + * @param counters + * @param accessKey + * @param canUploadDoc + * @param hash + * @param hasEmail + * @param sex - User sex + * @param screenName - Domain name of the user's page + * @param photo50 - URL of square photo of the user with 50 pixels in width + * @param photo100 - URL of square photo of the user with 100 pixels in width + * @param onlineInfo + * @param online - Information whether the user is online + * @param onlineMobile - Information whether the user is online in mobile site or application + * @param onlineApp - Application ID + * @param verified - Information whether the user is verified + * @param trending - Information whether the user has a "fire" pictogram. + * @param friendStatus + * @param mutual + * @param deactivated - Returns if a profile is deleted or blocked + * @param firstName - User first name + * @param hidden - Returns if a profile is hidden. + * @param id - User ID + * @param lastName - User last name + * @param canAccessClosed + * @param isClosed */ data class FriendsUserXtrLists( - @SerializedName(value="lists") + @SerializedName("lists") val lists: List? = null, - @SerializedName(value="first_name_nom") + @SerializedName("first_name_nom") val firstNameNom: String? = null, - @SerializedName(value="first_name_gen") + @SerializedName("first_name_gen") val firstNameGen: String? = null, - @SerializedName(value="first_name_dat") + @SerializedName("first_name_dat") val firstNameDat: String? = null, - @SerializedName(value="first_name_acc") + @SerializedName("first_name_acc") val firstNameAcc: String? = null, - @SerializedName(value="first_name_ins") + @SerializedName("first_name_ins") val firstNameIns: String? = null, - @SerializedName(value="first_name_abl") + @SerializedName("first_name_abl") val firstNameAbl: String? = null, - @SerializedName(value="last_name_nom") + @SerializedName("last_name_nom") val lastNameNom: String? = null, - @SerializedName(value="last_name_gen") + @SerializedName("last_name_gen") val lastNameGen: String? = null, - @SerializedName(value="last_name_dat") + @SerializedName("last_name_dat") val lastNameDat: String? = null, - @SerializedName(value="last_name_acc") + @SerializedName("last_name_acc") val lastNameAcc: String? = null, - @SerializedName(value="last_name_ins") + @SerializedName("last_name_ins") val lastNameIns: String? = null, - @SerializedName(value="last_name_abl") + @SerializedName("last_name_abl") val lastNameAbl: String? = null, - @SerializedName(value="nickname") + @SerializedName("nickname") val nickname: String? = null, - @SerializedName(value="maiden_name") + @SerializedName("maiden_name") val maidenName: String? = null, - @SerializedName(value="contact_name") + @SerializedName("contact_name") val contactName: String? = null, - @SerializedName(value="domain") + @SerializedName("domain") val domain: String? = null, - @SerializedName(value="bdate") + @SerializedName("bdate") val bdate: String? = null, - @SerializedName(value="city") + @SerializedName("city") val city: BaseCity? = null, - @SerializedName(value="country") + @SerializedName("country") val country: BaseCountry? = null, - @SerializedName(value="timezone") + @SerializedName("timezone") val timezone: Float? = null, - @SerializedName(value="owner_state") + @SerializedName("owner_state") val ownerState: OwnerState? = null, - @SerializedName(value="photo_200") + @SerializedName("photo_200") val photo200: String? = null, - @SerializedName(value="photo_max") + @SerializedName("photo_max") val photoMax: String? = null, - @SerializedName(value="photo_200_orig") + @SerializedName("photo_200_orig") val photo200Orig: String? = null, - @SerializedName(value="photo_400_orig") + @SerializedName("photo_400_orig") val photo400Orig: String? = null, - @SerializedName(value="photo_max_orig") + @SerializedName("photo_max_orig") val photoMaxOrig: String? = null, - @SerializedName(value="photo_id") + @SerializedName("photo_id") val photoId: String? = null, - @SerializedName(value="has_photo") + @SerializedName("has_photo") val hasPhoto: BaseBoolInt? = null, - @SerializedName(value="has_mobile") + @SerializedName("has_mobile") val hasMobile: BaseBoolInt? = null, - @SerializedName(value="is_friend") + @SerializedName("is_friend") val isFriend: BaseBoolInt? = null, - @SerializedName(value="wall_comments") + @SerializedName("wall_comments") val wallComments: BaseBoolInt? = null, - @SerializedName(value="can_post") + @SerializedName("can_post") val canPost: BaseBoolInt? = null, - @SerializedName(value="can_see_all_posts") + @SerializedName("can_see_all_posts") val canSeeAllPosts: BaseBoolInt? = null, - @SerializedName(value="can_see_audio") + @SerializedName("can_see_audio") val canSeeAudio: BaseBoolInt? = null, - @SerializedName(value="type") + @SerializedName("type") val type: UsersUserType? = null, - @SerializedName(value="email") + @SerializedName("email") val email: String? = null, - @SerializedName(value="skype") + @SerializedName("skype") val skype: String? = null, - @SerializedName(value="facebook") + @SerializedName("facebook") val facebook: String? = null, - @SerializedName(value="facebook_name") + @SerializedName("facebook_name") val facebookName: String? = null, - @SerializedName(value="twitter") + @SerializedName("twitter") val twitter: String? = null, - @SerializedName(value="livejournal") + @SerializedName("livejournal") val livejournal: String? = null, - @SerializedName(value="instagram") + @SerializedName("instagram") val instagram: String? = null, - @SerializedName(value="test") + @SerializedName("test") val test: BaseBoolInt? = null, - @SerializedName(value="video_live") + @SerializedName("video_live") val videoLive: VideoLiveInfo? = null, - @SerializedName(value="is_video_live_notifications_blocked") + @SerializedName("is_video_live_notifications_blocked") val isVideoLiveNotificationsBlocked: BaseBoolInt? = null, - @SerializedName(value="is_service") + @SerializedName("is_service") val isService: Boolean? = null, - @SerializedName(value="service_description") + @SerializedName("service_description") val serviceDescription: String? = null, - @SerializedName(value="photo") + @SerializedName("photo_rec") + val photoRec: String? = null, + @SerializedName("photo_medium") + val photoMedium: String? = null, + @SerializedName("photo_medium_rec") + val photoMediumRec: String? = null, + @SerializedName("photo") val photo: String? = null, - @SerializedName(value="photo_big") + @SerializedName("photo_big") val photoBig: String? = null, - @SerializedName(value="photo_400") + @SerializedName("photo_400") val photo400: String? = null, - @SerializedName(value="photo_max_size") + @SerializedName("photo_max_size") val photoMaxSize: PhotosPhoto? = null, - @SerializedName(value="language") + @SerializedName("language") val language: String? = null, - @SerializedName(value="stories_archive_count") + @SerializedName("stories_archive_count") val storiesArchiveCount: Int? = null, - @SerializedName(value="wall_default") - val wallDefault: WallDefault? = null, - @SerializedName(value="can_call") + @SerializedName("wall_default") + val wallDefault: FriendsUserXtrLists.WallDefault? = null, + @SerializedName("can_call") val canCall: Boolean? = null, - @SerializedName(value="can_see_wishes") + @SerializedName("can_see_wishes") val canSeeWishes: Boolean? = null, - @SerializedName(value="can_see_gifts") + @SerializedName("can_see_gifts") val canSeeGifts: BaseBoolInt? = null, - @SerializedName(value="interests") + @SerializedName("interests") val interests: String? = null, - @SerializedName(value="books") + @SerializedName("books") val books: String? = null, - @SerializedName(value="tv") + @SerializedName("tv") val tv: String? = null, - @SerializedName(value="quotes") + @SerializedName("quotes") val quotes: String? = null, - @SerializedName(value="about") + @SerializedName("about") val about: String? = null, - @SerializedName(value="games") + @SerializedName("games") val games: String? = null, - @SerializedName(value="movies") + @SerializedName("movies") val movies: String? = null, - @SerializedName(value="activities") + @SerializedName("activities") val activities: String? = null, - @SerializedName(value="music") + @SerializedName("music") val music: String? = null, - @SerializedName(value="can_write_private_message") + @SerializedName("can_write_private_message") val canWritePrivateMessage: BaseBoolInt? = null, - @SerializedName(value="can_send_friend_request") + @SerializedName("can_send_friend_request") val canSendFriendRequest: BaseBoolInt? = null, - @SerializedName(value="can_be_invited_group") + @SerializedName("can_be_invited_group") val canBeInvitedGroup: Boolean? = null, - @SerializedName(value="mobile_phone") + @SerializedName("mobile_phone") val mobilePhone: String? = null, - @SerializedName(value="home_phone") + @SerializedName("home_phone") val homePhone: String? = null, - @SerializedName(value="site") + @SerializedName("site") val site: String? = null, - @SerializedName(value="status_audio") + @SerializedName("status_audio") val statusAudio: AudioAudio? = null, - @SerializedName(value="status") + @SerializedName("status") val status: String? = null, - @SerializedName(value="activity") + @SerializedName("activity") val activity: String? = null, - @SerializedName(value="last_seen") + @SerializedName("last_seen") val lastSeen: UsersLastSeen? = null, - @SerializedName(value="exports") + @SerializedName("exports") val exports: UsersExports? = null, - @SerializedName(value="crop_photo") + @SerializedName("crop_photo") val cropPhoto: BaseCropPhoto? = null, - @SerializedName(value="followers_count") + @SerializedName("followers_count") val followersCount: Int? = null, - @SerializedName(value="video_live_level") + @SerializedName("video_live_level") val videoLiveLevel: Int? = null, - @SerializedName(value="video_live_count") + @SerializedName("video_live_count") val videoLiveCount: Int? = null, - @SerializedName(value="clips_count") + @SerializedName("clips_count") val clipsCount: Int? = null, - @SerializedName(value="blacklisted") + @SerializedName("blacklisted") val blacklisted: BaseBoolInt? = null, - @SerializedName(value="blacklisted_by_me") + @SerializedName("blacklisted_by_me") val blacklistedByMe: BaseBoolInt? = null, - @SerializedName(value="is_favorite") + @SerializedName("is_favorite") val isFavorite: BaseBoolInt? = null, - @SerializedName(value="is_hidden_from_feed") + @SerializedName("is_hidden_from_feed") val isHiddenFromFeed: BaseBoolInt? = null, - @SerializedName(value="common_count") + @SerializedName("common_count") val commonCount: Int? = null, - @SerializedName(value="occupation") + @SerializedName("occupation") val occupation: UsersOccupation? = null, - @SerializedName(value="career") + @SerializedName("career") val career: List? = null, - @SerializedName(value="military") + @SerializedName("military") val military: List? = null, - @SerializedName(value="university") + @SerializedName("university") val university: Int? = null, - @SerializedName(value="university_name") + @SerializedName("university_name") val universityName: String? = null, - @SerializedName(value="university_group_id") + @SerializedName("university_group_id") val universityGroupId: Int? = null, - @SerializedName(value="faculty") + @SerializedName("faculty") val faculty: Int? = null, - @SerializedName(value="faculty_name") + @SerializedName("faculty_name") val facultyName: String? = null, - @SerializedName(value="graduation") + @SerializedName("graduation") val graduation: Int? = null, - @SerializedName(value="education_form") + @SerializedName("education_form") val educationForm: String? = null, - @SerializedName(value="education_status") + @SerializedName("education_status") val educationStatus: String? = null, - @SerializedName(value="home_town") + @SerializedName("home_town") val homeTown: String? = null, - @SerializedName(value="relation") + @SerializedName("relation") val relation: UsersUserRelation? = null, - @SerializedName(value="relation_partner") + @SerializedName("relation_partner") val relationPartner: UsersUserMin? = null, - @SerializedName(value="personal") + @SerializedName("personal") val personal: UsersPersonal? = null, - @SerializedName(value="universities") + @SerializedName("universities") val universities: List? = null, - @SerializedName(value="schools") + @SerializedName("schools") val schools: List? = null, - @SerializedName(value="relatives") + @SerializedName("relatives") val relatives: List? = null, - @SerializedName(value="is_subscribed_podcasts") + @SerializedName("is_subscribed_podcasts") val isSubscribedPodcasts: Boolean? = null, - @SerializedName(value="can_subscribe_podcasts") + @SerializedName("can_subscribe_podcasts") val canSubscribePodcasts: Boolean? = null, - @SerializedName(value="can_subscribe_posts") + @SerializedName("can_subscribe_posts") val canSubscribePosts: Boolean? = null, - @SerializedName(value="counters") + @SerializedName("counters") val counters: UsersUserCounters? = null, - @SerializedName(value="access_key") + @SerializedName("access_key") val accessKey: String? = null, - @SerializedName(value="can_upload_doc") + @SerializedName("can_upload_doc") val canUploadDoc: BaseBoolInt? = null, - @SerializedName(value="hash") + @SerializedName("hash") val hash: String? = null, - @SerializedName(value="has_email") + @SerializedName("has_email") val hasEmail: Boolean? = null, - @SerializedName(value="sex") + @SerializedName("sex") val sex: BaseSex? = null, - @SerializedName(value="screen_name") + @SerializedName("screen_name") val screenName: String? = null, - @SerializedName(value="photo_50") + @SerializedName("photo_50") val photo50: String? = null, - @SerializedName(value="photo_100") + @SerializedName("photo_100") val photo100: String? = null, - @SerializedName(value="online_info") + @SerializedName("online_info") val onlineInfo: UsersOnlineInfo? = null, - @SerializedName(value="online") + @SerializedName("online") val online: BaseBoolInt? = null, - @SerializedName(value="online_mobile") + @SerializedName("online_mobile") val onlineMobile: BaseBoolInt? = null, - @SerializedName(value="online_app") + @SerializedName("online_app") val onlineApp: Int? = null, - @SerializedName(value="verified") + @SerializedName("verified") val verified: BaseBoolInt? = null, - @SerializedName(value="trending") + @SerializedName("trending") val trending: BaseBoolInt? = null, - @SerializedName(value="friend_status") + @SerializedName("friend_status") val friendStatus: FriendsFriendStatusStatus? = null, - @SerializedName(value="mutual") + @SerializedName("mutual") val mutual: FriendsRequestsMutual? = null, - @SerializedName(value="deactivated") + @SerializedName("deactivated") val deactivated: String? = null, - @SerializedName(value="first_name") + @SerializedName("first_name") val firstName: String? = null, - @SerializedName(value="hidden") + @SerializedName("hidden") val hidden: Int? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="last_name") + @SerializedName("last_name") val lastName: String? = null, - @SerializedName(value="can_access_closed") + @SerializedName("can_access_closed") val canAccessClosed: Boolean? = null, - @SerializedName(value="is_closed") + @SerializedName("is_closed") val isClosed: Boolean? = null ) { enum class WallDefault( val value: String ) { + @SerializedName("owner") OWNER("owner"), + @SerializedName("all") ALL("all"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: WallDefault?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): WallDefault { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrPhone.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrPhone.kt index 3d3ebe8b37..d00bbcfa27 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrPhone.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrPhone.kt @@ -27,14 +27,6 @@ // ********************************************************************* package com.vk.sdk.api.friends.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName import com.vk.sdk.api.audio.dto.AudioAudio import com.vk.sdk.api.base.dto.BaseBoolInt @@ -59,7 +51,6 @@ import com.vk.sdk.api.users.dto.UsersUserMin import com.vk.sdk.api.users.dto.UsersUserRelation import com.vk.sdk.api.users.dto.UsersUserType import com.vk.sdk.api.video.dto.VideoLiveInfo -import java.lang.reflect.Type import kotlin.Boolean import kotlin.Float import kotlin.Int @@ -67,433 +58,425 @@ import kotlin.String import kotlin.collections.List /** - * @param phone User phone - * @param firstNameNom User's first name in nominative case - * @param firstNameGen User's first name in genitive case - * @param firstNameDat User's first name in dative case - * @param firstNameAcc User's first name in accusative case - * @param firstNameIns User's first name in instrumental case - * @param firstNameAbl User's first name in prepositional case - * @param lastNameNom User's last name in nominative case - * @param lastNameGen User's last name in genitive case - * @param lastNameDat User's last name in dative case - * @param lastNameAcc User's last name in accusative case - * @param lastNameIns User's last name in instrumental case - * @param lastNameAbl User's last name in prepositional case - * @param nickname User nickname - * @param maidenName User maiden name - * @param contactName User contact name - * @param domain Domain name of the user's page - * @param bdate User's date of birth - * @param city no description - * @param country no description - * @param timezone User's timezone - * @param ownerState no description - * @param photo200 URL of square photo of the user with 200 pixels in width - * @param photoMax URL of square photo of the user with maximum width - * @param photo200Orig URL of user's photo with 200 pixels in width - * @param photo400Orig URL of user's photo with 400 pixels in width - * @param photoMaxOrig URL of user's photo of maximum size - * @param photoId ID of the user's main photo - * @param hasPhoto Information whether the user has main photo - * @param hasMobile Information whether the user specified his phone number - * @param isFriend Information whether the user is a friend of current user - * @param wallComments Information whether current user can comment wall posts - * @param canPost Information whether current user can post on the user's wall - * @param canSeeAllPosts Information whether current user can see other users' audio on the wall - * @param canSeeAudio Information whether current user can see the user's audio - * @param type no description - * @param email no description - * @param skype no description - * @param facebook no description - * @param facebookName no description - * @param twitter no description - * @param livejournal no description - * @param instagram no description - * @param test no description - * @param videoLive no description - * @param isVideoLiveNotificationsBlocked no description - * @param isService no description - * @param serviceDescription no description - * @param photo no description - * @param photoBig no description - * @param photo400 no description - * @param photoMaxSize no description - * @param language no description - * @param storiesArchiveCount no description - * @param wallDefault no description - * @param canCall Information whether current user can call - * @param canSeeWishes Information whether current user can see the user's wishes - * @param canSeeGifts Information whether current user can see the user's gifts - * @param interests no description - * @param books no description - * @param tv no description - * @param quotes no description - * @param about no description - * @param games no description - * @param movies no description - * @param activities no description - * @param music no description - * @param canWritePrivateMessage Information whether current user can write private message - * @param canSendFriendRequest Information whether current user can send a friend request - * @param canBeInvitedGroup Information whether current user can be invited to the community - * @param mobilePhone User's mobile phone number - * @param homePhone User's additional phone number - * @param site User's website - * @param statusAudio no description - * @param status User's status - * @param activity User's status - * @param lastSeen no description - * @param exports no description - * @param cropPhoto no description - * @param followersCount Number of user's followers - * @param videoLiveLevel User level in live streams achievements - * @param videoLiveCount Number of user's live streams - * @param clipsCount Number of user's clips - * @param blacklisted Information whether current user is in the requested user's blacklist. - * @param blacklistedByMe Information whether the requested user is in current user's blacklist - * @param isFavorite Information whether the requested user is in faves of current user - * @param isHiddenFromFeed Information whether the requested user is hidden from current user's + * @param phone - User phone + * @param firstNameNom - User's first name in nominative case + * @param firstNameGen - User's first name in genitive case + * @param firstNameDat - User's first name in dative case + * @param firstNameAcc - User's first name in accusative case + * @param firstNameIns - User's first name in instrumental case + * @param firstNameAbl - User's first name in prepositional case + * @param lastNameNom - User's last name in nominative case + * @param lastNameGen - User's last name in genitive case + * @param lastNameDat - User's last name in dative case + * @param lastNameAcc - User's last name in accusative case + * @param lastNameIns - User's last name in instrumental case + * @param lastNameAbl - User's last name in prepositional case + * @param nickname - User nickname + * @param maidenName - User maiden name + * @param contactName - User contact name + * @param domain - Domain name of the user's page + * @param bdate - User's date of birth + * @param city + * @param country + * @param timezone - User's timezone + * @param ownerState + * @param photo200 - URL of square photo of the user with 200 pixels in width + * @param photoMax - URL of square photo of the user with maximum width + * @param photo200Orig - URL of user's photo with 200 pixels in width + * @param photo400Orig - URL of user's photo with 400 pixels in width + * @param photoMaxOrig - URL of user's photo of maximum size + * @param photoId - ID of the user's main photo + * @param hasPhoto - Information whether the user has main photo + * @param hasMobile - Information whether the user specified his phone number + * @param isFriend - Information whether the user is a friend of current user + * @param wallComments - Information whether current user can comment wall posts + * @param canPost - Information whether current user can post on the user's wall + * @param canSeeAllPosts - Information whether current user can see other users' audio on the wall + * @param canSeeAudio - Information whether current user can see the user's audio + * @param type + * @param email + * @param skype + * @param facebook + * @param facebookName + * @param twitter + * @param livejournal + * @param instagram + * @param test + * @param videoLive + * @param isVideoLiveNotificationsBlocked + * @param isService + * @param serviceDescription + * @param photoRec + * @param photoMedium + * @param photoMediumRec + * @param photo + * @param photoBig + * @param photo400 + * @param photoMaxSize + * @param language + * @param storiesArchiveCount + * @param wallDefault + * @param canCall - Information whether current user can call + * @param canSeeWishes - Information whether current user can see the user's wishes + * @param canSeeGifts - Information whether current user can see the user's gifts + * @param interests + * @param books + * @param tv + * @param quotes + * @param about + * @param games + * @param movies + * @param activities + * @param music + * @param canWritePrivateMessage - Information whether current user can write private message + * @param canSendFriendRequest - Information whether current user can send a friend request + * @param canBeInvitedGroup - Information whether current user can be invited to the community + * @param mobilePhone - User's mobile phone number + * @param homePhone - User's additional phone number + * @param site - User's website + * @param statusAudio + * @param status - User's status + * @param activity - User's status + * @param lastSeen + * @param exports + * @param cropPhoto + * @param followersCount - Number of user's followers + * @param videoLiveLevel - User level in live streams achievements + * @param videoLiveCount - Number of user's live streams + * @param clipsCount - Number of user's clips + * @param blacklisted - Information whether current user is in the requested user's blacklist. + * @param blacklistedByMe - Information whether the requested user is in current user's blacklist + * @param isFavorite - Information whether the requested user is in faves of current user + * @param isHiddenFromFeed - Information whether the requested user is hidden from current user's * newsfeed - * @param commonCount Number of common friends with current user - * @param occupation no description - * @param career no description - * @param military no description - * @param university University ID - * @param universityName University name - * @param universityGroupId no description - * @param faculty Faculty ID - * @param facultyName Faculty name - * @param graduation Graduation year - * @param educationForm Education form - * @param educationStatus User's education status - * @param homeTown User hometown - * @param relation User relationship status - * @param relationPartner no description - * @param personal no description - * @param universities no description - * @param schools no description - * @param relatives no description - * @param isSubscribedPodcasts Information whether current user is subscribed to podcasts - * @param canSubscribePodcasts Owner in whitelist or not - * @param canSubscribePosts Can subscribe to wall - * @param counters no description - * @param accessKey no description - * @param canUploadDoc no description - * @param hash no description - * @param hasEmail no description - * @param sex User sex - * @param screenName Domain name of the user's page - * @param photo50 URL of square photo of the user with 50 pixels in width - * @param photo100 URL of square photo of the user with 100 pixels in width - * @param onlineInfo no description - * @param online Information whether the user is online - * @param onlineMobile Information whether the user is online in mobile site or application - * @param onlineApp Application ID - * @param verified Information whether the user is verified - * @param trending Information whether the user has a "fire" pictogram. - * @param friendStatus no description - * @param mutual no description - * @param deactivated Returns if a profile is deleted or blocked - * @param firstName User first name - * @param hidden Returns if a profile is hidden. - * @param id User ID - * @param lastName User last name - * @param canAccessClosed no description - * @param isClosed no description + * @param commonCount - Number of common friends with current user + * @param occupation + * @param career + * @param military + * @param university - University ID + * @param universityName - University name + * @param universityGroupId + * @param faculty - Faculty ID + * @param facultyName - Faculty name + * @param graduation - Graduation year + * @param educationForm - Education form + * @param educationStatus - User's education status + * @param homeTown - User hometown + * @param relation - User relationship status + * @param relationPartner + * @param personal + * @param universities + * @param schools + * @param relatives + * @param isSubscribedPodcasts - Information whether current user is subscribed to podcasts + * @param canSubscribePodcasts - Owner in whitelist or not + * @param canSubscribePosts - Can subscribe to wall + * @param counters + * @param accessKey + * @param canUploadDoc + * @param hash + * @param hasEmail + * @param sex - User sex + * @param screenName - Domain name of the user's page + * @param photo50 - URL of square photo of the user with 50 pixels in width + * @param photo100 - URL of square photo of the user with 100 pixels in width + * @param onlineInfo + * @param online - Information whether the user is online + * @param onlineMobile - Information whether the user is online in mobile site or application + * @param onlineApp - Application ID + * @param verified - Information whether the user is verified + * @param trending - Information whether the user has a "fire" pictogram. + * @param friendStatus + * @param mutual + * @param deactivated - Returns if a profile is deleted or blocked + * @param firstName - User first name + * @param hidden - Returns if a profile is hidden. + * @param id - User ID + * @param lastName - User last name + * @param canAccessClosed + * @param isClosed */ data class FriendsUserXtrPhone( - @SerializedName(value="phone") + @SerializedName("phone") val phone: String? = null, - @SerializedName(value="first_name_nom") + @SerializedName("first_name_nom") val firstNameNom: String? = null, - @SerializedName(value="first_name_gen") + @SerializedName("first_name_gen") val firstNameGen: String? = null, - @SerializedName(value="first_name_dat") + @SerializedName("first_name_dat") val firstNameDat: String? = null, - @SerializedName(value="first_name_acc") + @SerializedName("first_name_acc") val firstNameAcc: String? = null, - @SerializedName(value="first_name_ins") + @SerializedName("first_name_ins") val firstNameIns: String? = null, - @SerializedName(value="first_name_abl") + @SerializedName("first_name_abl") val firstNameAbl: String? = null, - @SerializedName(value="last_name_nom") + @SerializedName("last_name_nom") val lastNameNom: String? = null, - @SerializedName(value="last_name_gen") + @SerializedName("last_name_gen") val lastNameGen: String? = null, - @SerializedName(value="last_name_dat") + @SerializedName("last_name_dat") val lastNameDat: String? = null, - @SerializedName(value="last_name_acc") + @SerializedName("last_name_acc") val lastNameAcc: String? = null, - @SerializedName(value="last_name_ins") + @SerializedName("last_name_ins") val lastNameIns: String? = null, - @SerializedName(value="last_name_abl") + @SerializedName("last_name_abl") val lastNameAbl: String? = null, - @SerializedName(value="nickname") + @SerializedName("nickname") val nickname: String? = null, - @SerializedName(value="maiden_name") + @SerializedName("maiden_name") val maidenName: String? = null, - @SerializedName(value="contact_name") + @SerializedName("contact_name") val contactName: String? = null, - @SerializedName(value="domain") + @SerializedName("domain") val domain: String? = null, - @SerializedName(value="bdate") + @SerializedName("bdate") val bdate: String? = null, - @SerializedName(value="city") + @SerializedName("city") val city: BaseCity? = null, - @SerializedName(value="country") + @SerializedName("country") val country: BaseCountry? = null, - @SerializedName(value="timezone") + @SerializedName("timezone") val timezone: Float? = null, - @SerializedName(value="owner_state") + @SerializedName("owner_state") val ownerState: OwnerState? = null, - @SerializedName(value="photo_200") + @SerializedName("photo_200") val photo200: String? = null, - @SerializedName(value="photo_max") + @SerializedName("photo_max") val photoMax: String? = null, - @SerializedName(value="photo_200_orig") + @SerializedName("photo_200_orig") val photo200Orig: String? = null, - @SerializedName(value="photo_400_orig") + @SerializedName("photo_400_orig") val photo400Orig: String? = null, - @SerializedName(value="photo_max_orig") + @SerializedName("photo_max_orig") val photoMaxOrig: String? = null, - @SerializedName(value="photo_id") + @SerializedName("photo_id") val photoId: String? = null, - @SerializedName(value="has_photo") + @SerializedName("has_photo") val hasPhoto: BaseBoolInt? = null, - @SerializedName(value="has_mobile") + @SerializedName("has_mobile") val hasMobile: BaseBoolInt? = null, - @SerializedName(value="is_friend") + @SerializedName("is_friend") val isFriend: BaseBoolInt? = null, - @SerializedName(value="wall_comments") + @SerializedName("wall_comments") val wallComments: BaseBoolInt? = null, - @SerializedName(value="can_post") + @SerializedName("can_post") val canPost: BaseBoolInt? = null, - @SerializedName(value="can_see_all_posts") + @SerializedName("can_see_all_posts") val canSeeAllPosts: BaseBoolInt? = null, - @SerializedName(value="can_see_audio") + @SerializedName("can_see_audio") val canSeeAudio: BaseBoolInt? = null, - @SerializedName(value="type") + @SerializedName("type") val type: UsersUserType? = null, - @SerializedName(value="email") + @SerializedName("email") val email: String? = null, - @SerializedName(value="skype") + @SerializedName("skype") val skype: String? = null, - @SerializedName(value="facebook") + @SerializedName("facebook") val facebook: String? = null, - @SerializedName(value="facebook_name") + @SerializedName("facebook_name") val facebookName: String? = null, - @SerializedName(value="twitter") + @SerializedName("twitter") val twitter: String? = null, - @SerializedName(value="livejournal") + @SerializedName("livejournal") val livejournal: String? = null, - @SerializedName(value="instagram") + @SerializedName("instagram") val instagram: String? = null, - @SerializedName(value="test") + @SerializedName("test") val test: BaseBoolInt? = null, - @SerializedName(value="video_live") + @SerializedName("video_live") val videoLive: VideoLiveInfo? = null, - @SerializedName(value="is_video_live_notifications_blocked") + @SerializedName("is_video_live_notifications_blocked") val isVideoLiveNotificationsBlocked: BaseBoolInt? = null, - @SerializedName(value="is_service") + @SerializedName("is_service") val isService: Boolean? = null, - @SerializedName(value="service_description") + @SerializedName("service_description") val serviceDescription: String? = null, - @SerializedName(value="photo") + @SerializedName("photo_rec") + val photoRec: String? = null, + @SerializedName("photo_medium") + val photoMedium: String? = null, + @SerializedName("photo_medium_rec") + val photoMediumRec: String? = null, + @SerializedName("photo") val photo: String? = null, - @SerializedName(value="photo_big") + @SerializedName("photo_big") val photoBig: String? = null, - @SerializedName(value="photo_400") + @SerializedName("photo_400") val photo400: String? = null, - @SerializedName(value="photo_max_size") + @SerializedName("photo_max_size") val photoMaxSize: PhotosPhoto? = null, - @SerializedName(value="language") + @SerializedName("language") val language: String? = null, - @SerializedName(value="stories_archive_count") + @SerializedName("stories_archive_count") val storiesArchiveCount: Int? = null, - @SerializedName(value="wall_default") - val wallDefault: WallDefault? = null, - @SerializedName(value="can_call") + @SerializedName("wall_default") + val wallDefault: FriendsUserXtrPhone.WallDefault? = null, + @SerializedName("can_call") val canCall: Boolean? = null, - @SerializedName(value="can_see_wishes") + @SerializedName("can_see_wishes") val canSeeWishes: Boolean? = null, - @SerializedName(value="can_see_gifts") + @SerializedName("can_see_gifts") val canSeeGifts: BaseBoolInt? = null, - @SerializedName(value="interests") + @SerializedName("interests") val interests: String? = null, - @SerializedName(value="books") + @SerializedName("books") val books: String? = null, - @SerializedName(value="tv") + @SerializedName("tv") val tv: String? = null, - @SerializedName(value="quotes") + @SerializedName("quotes") val quotes: String? = null, - @SerializedName(value="about") + @SerializedName("about") val about: String? = null, - @SerializedName(value="games") + @SerializedName("games") val games: String? = null, - @SerializedName(value="movies") + @SerializedName("movies") val movies: String? = null, - @SerializedName(value="activities") + @SerializedName("activities") val activities: String? = null, - @SerializedName(value="music") + @SerializedName("music") val music: String? = null, - @SerializedName(value="can_write_private_message") + @SerializedName("can_write_private_message") val canWritePrivateMessage: BaseBoolInt? = null, - @SerializedName(value="can_send_friend_request") + @SerializedName("can_send_friend_request") val canSendFriendRequest: BaseBoolInt? = null, - @SerializedName(value="can_be_invited_group") + @SerializedName("can_be_invited_group") val canBeInvitedGroup: Boolean? = null, - @SerializedName(value="mobile_phone") + @SerializedName("mobile_phone") val mobilePhone: String? = null, - @SerializedName(value="home_phone") + @SerializedName("home_phone") val homePhone: String? = null, - @SerializedName(value="site") + @SerializedName("site") val site: String? = null, - @SerializedName(value="status_audio") + @SerializedName("status_audio") val statusAudio: AudioAudio? = null, - @SerializedName(value="status") + @SerializedName("status") val status: String? = null, - @SerializedName(value="activity") + @SerializedName("activity") val activity: String? = null, - @SerializedName(value="last_seen") + @SerializedName("last_seen") val lastSeen: UsersLastSeen? = null, - @SerializedName(value="exports") + @SerializedName("exports") val exports: UsersExports? = null, - @SerializedName(value="crop_photo") + @SerializedName("crop_photo") val cropPhoto: BaseCropPhoto? = null, - @SerializedName(value="followers_count") + @SerializedName("followers_count") val followersCount: Int? = null, - @SerializedName(value="video_live_level") + @SerializedName("video_live_level") val videoLiveLevel: Int? = null, - @SerializedName(value="video_live_count") + @SerializedName("video_live_count") val videoLiveCount: Int? = null, - @SerializedName(value="clips_count") + @SerializedName("clips_count") val clipsCount: Int? = null, - @SerializedName(value="blacklisted") + @SerializedName("blacklisted") val blacklisted: BaseBoolInt? = null, - @SerializedName(value="blacklisted_by_me") + @SerializedName("blacklisted_by_me") val blacklistedByMe: BaseBoolInt? = null, - @SerializedName(value="is_favorite") + @SerializedName("is_favorite") val isFavorite: BaseBoolInt? = null, - @SerializedName(value="is_hidden_from_feed") + @SerializedName("is_hidden_from_feed") val isHiddenFromFeed: BaseBoolInt? = null, - @SerializedName(value="common_count") + @SerializedName("common_count") val commonCount: Int? = null, - @SerializedName(value="occupation") + @SerializedName("occupation") val occupation: UsersOccupation? = null, - @SerializedName(value="career") + @SerializedName("career") val career: List? = null, - @SerializedName(value="military") + @SerializedName("military") val military: List? = null, - @SerializedName(value="university") + @SerializedName("university") val university: Int? = null, - @SerializedName(value="university_name") + @SerializedName("university_name") val universityName: String? = null, - @SerializedName(value="university_group_id") + @SerializedName("university_group_id") val universityGroupId: Int? = null, - @SerializedName(value="faculty") + @SerializedName("faculty") val faculty: Int? = null, - @SerializedName(value="faculty_name") + @SerializedName("faculty_name") val facultyName: String? = null, - @SerializedName(value="graduation") + @SerializedName("graduation") val graduation: Int? = null, - @SerializedName(value="education_form") + @SerializedName("education_form") val educationForm: String? = null, - @SerializedName(value="education_status") + @SerializedName("education_status") val educationStatus: String? = null, - @SerializedName(value="home_town") + @SerializedName("home_town") val homeTown: String? = null, - @SerializedName(value="relation") + @SerializedName("relation") val relation: UsersUserRelation? = null, - @SerializedName(value="relation_partner") + @SerializedName("relation_partner") val relationPartner: UsersUserMin? = null, - @SerializedName(value="personal") + @SerializedName("personal") val personal: UsersPersonal? = null, - @SerializedName(value="universities") + @SerializedName("universities") val universities: List? = null, - @SerializedName(value="schools") + @SerializedName("schools") val schools: List? = null, - @SerializedName(value="relatives") + @SerializedName("relatives") val relatives: List? = null, - @SerializedName(value="is_subscribed_podcasts") + @SerializedName("is_subscribed_podcasts") val isSubscribedPodcasts: Boolean? = null, - @SerializedName(value="can_subscribe_podcasts") + @SerializedName("can_subscribe_podcasts") val canSubscribePodcasts: Boolean? = null, - @SerializedName(value="can_subscribe_posts") + @SerializedName("can_subscribe_posts") val canSubscribePosts: Boolean? = null, - @SerializedName(value="counters") + @SerializedName("counters") val counters: UsersUserCounters? = null, - @SerializedName(value="access_key") + @SerializedName("access_key") val accessKey: String? = null, - @SerializedName(value="can_upload_doc") + @SerializedName("can_upload_doc") val canUploadDoc: BaseBoolInt? = null, - @SerializedName(value="hash") + @SerializedName("hash") val hash: String? = null, - @SerializedName(value="has_email") + @SerializedName("has_email") val hasEmail: Boolean? = null, - @SerializedName(value="sex") + @SerializedName("sex") val sex: BaseSex? = null, - @SerializedName(value="screen_name") + @SerializedName("screen_name") val screenName: String? = null, - @SerializedName(value="photo_50") + @SerializedName("photo_50") val photo50: String? = null, - @SerializedName(value="photo_100") + @SerializedName("photo_100") val photo100: String? = null, - @SerializedName(value="online_info") + @SerializedName("online_info") val onlineInfo: UsersOnlineInfo? = null, - @SerializedName(value="online") + @SerializedName("online") val online: BaseBoolInt? = null, - @SerializedName(value="online_mobile") + @SerializedName("online_mobile") val onlineMobile: BaseBoolInt? = null, - @SerializedName(value="online_app") + @SerializedName("online_app") val onlineApp: Int? = null, - @SerializedName(value="verified") + @SerializedName("verified") val verified: BaseBoolInt? = null, - @SerializedName(value="trending") + @SerializedName("trending") val trending: BaseBoolInt? = null, - @SerializedName(value="friend_status") + @SerializedName("friend_status") val friendStatus: FriendsFriendStatusStatus? = null, - @SerializedName(value="mutual") + @SerializedName("mutual") val mutual: FriendsRequestsMutual? = null, - @SerializedName(value="deactivated") + @SerializedName("deactivated") val deactivated: String? = null, - @SerializedName(value="first_name") + @SerializedName("first_name") val firstName: String? = null, - @SerializedName(value="hidden") + @SerializedName("hidden") val hidden: Int? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="last_name") + @SerializedName("last_name") val lastName: String? = null, - @SerializedName(value="can_access_closed") + @SerializedName("can_access_closed") val canAccessClosed: Boolean? = null, - @SerializedName(value="is_closed") + @SerializedName("is_closed") val isClosed: Boolean? = null ) { enum class WallDefault( val value: String ) { + @SerializedName("owner") OWNER("owner"), + @SerializedName("all") ALL("all"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: WallDefault?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): WallDefault { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/NameCaseParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/NameCaseParam.kt new file mode 100644 index 0000000000..b831c8ea55 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/NameCaseParam.kt @@ -0,0 +1,53 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class NameCaseParam( + val value: String +) { + @SerializedName("nom") + NOMINATIVE("nom"), + + @SerializedName("gen") + GENITIVE("gen"), + + @SerializedName("dat") + DATIVE("dat"), + + @SerializedName("acc") + ACCUSATIVE("acc"), + + @SerializedName("ins") + INSTRUMENTAL("ins"), + + @SerializedName("abl") + PREPOSITIONAL("abl"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/OrderParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/OrderParam.kt new file mode 100644 index 0000000000..09b8da52b0 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/OrderParam.kt @@ -0,0 +1,50 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class OrderParam( + val value: String +) { + @SerializedName("hints") + HINTS("hints"), + + @SerializedName("random") + RANDOM("random"), + + @SerializedName("mobile") + MOBILE("mobile"), + + @SerializedName("name") + NAME("name"), + + @SerializedName("smart") + SMART("smart"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/SortParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/SortParam.kt new file mode 100644 index 0000000000..37075947c6 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/friends/dto/SortParam.kt @@ -0,0 +1,44 @@ +/** + * 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.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class SortParam( + val value: Int +) { + @SerializedName("0") + DATE(0), + + @SerializedName("1") + MUTUAL(1), + + @SerializedName("2") + ROTATE(2); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/GiftsService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/GiftsService.kt new file mode 100644 index 0000000000..1eafb5b011 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/GiftsService.kt @@ -0,0 +1,57 @@ +/** + * 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.gifts + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.gifts.dto.GiftsGetResponse +import kotlin.Int + +class GiftsService { + /** + * Returns a list of user gifts. + * + * @param userId - User ID. + * @param count - Number of gifts to return. + * @param offset - Offset needed to return a specific subset of results. + * @return [VKRequest] with [GiftsGetResponse] + */ + fun giftsGet( + userId: Int? = null, + count: Int? = null, + offset: Int? = null + ): VKRequest = NewApiRequest("gifts.get") { + GsonHolder.gson.fromJson(it, GiftsGetResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGetResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGetResponse.kt new file mode 100644 index 0000000000..416353c2a5 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGetResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.gifts.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class GiftsGetResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGift.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGift.kt index fd8dec691c..73d38a8e6e 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGift.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGift.kt @@ -32,27 +32,27 @@ import kotlin.Int import kotlin.String /** - * @param date Date when gist has been sent in Unixtime - * @param fromId Gift sender ID - * @param gift no description - * @param giftHash Hash - * @param id Gift ID - * @param message Comment text - * @param privacy no description + * @param date - Date when gist has been sent in Unixtime + * @param fromId - Gift sender ID + * @param gift + * @param giftHash - Hash + * @param id - Gift ID + * @param message - Comment text + * @param privacy */ data class GiftsGift( - @SerializedName(value="date") + @SerializedName("date") val date: Int? = null, - @SerializedName(value="from_id") + @SerializedName("from_id") val fromId: Int? = null, - @SerializedName(value="gift") + @SerializedName("gift") val gift: GiftsLayout? = null, - @SerializedName(value="gift_hash") + @SerializedName("gift_hash") val giftHash: String? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="message") + @SerializedName("message") val message: String? = null, - @SerializedName(value="privacy") + @SerializedName("privacy") val privacy: GiftsGiftPrivacy? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGiftPrivacy.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGiftPrivacy.kt index 825da161a6..06740fe198 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGiftPrivacy.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsGiftPrivacy.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.gifts.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GiftsGiftPrivacy( val value: Int ) { + @SerializedName("0") NAME_AND_MESSAGE_FOR_ALL(0), + @SerializedName("1") NAME_FOR_ALL(1), + @SerializedName("2") NAME_AND_MESSAGE_FOR_RECIPIENT_ONLY(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GiftsGiftPrivacy?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GiftsGiftPrivacy { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsLayout.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsLayout.kt index e395852aca..c4f35ae19b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsLayout.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/gifts/dto/GiftsLayout.kt @@ -33,33 +33,33 @@ import kotlin.Int import kotlin.String /** - * @param id Gift ID - * @param thumb512 URL of the preview image with 512 px in width - * @param thumb256 URL of the preview image with 256 px in width - * @param thumb48 URL of the preview image with 48 px in width - * @param thumb96 URL of the preview image with 96 px in width - * @param stickersProductId ID of the sticker pack, if the gift is representing one - * @param isStickersStyle Information whether gift represents a stickers style - * @param buildId ID of the build of constructor gift - * @param keywords Keywords used for search + * @param id - Gift ID + * @param thumb512 - URL of the preview image with 512 px in width + * @param thumb256 - URL of the preview image with 256 px in width + * @param thumb48 - URL of the preview image with 48 px in width + * @param thumb96 - URL of the preview image with 96 px in width + * @param stickersProductId - ID of the sticker pack, if the gift is representing one + * @param isStickersStyle - Information whether gift represents a stickers style + * @param buildId - ID of the build of constructor gift + * @param keywords - Keywords used for search */ data class GiftsLayout( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="thumb_512") + @SerializedName("thumb_512") val thumb512: String? = null, - @SerializedName(value="thumb_256") + @SerializedName("thumb_256") val thumb256: String? = null, - @SerializedName(value="thumb_48") + @SerializedName("thumb_48") val thumb48: String? = null, - @SerializedName(value="thumb_96") + @SerializedName("thumb_96") val thumb96: String? = null, - @SerializedName(value="stickers_product_id") + @SerializedName("stickers_product_id") val stickersProductId: Int? = null, - @SerializedName(value="is_stickers_style") + @SerializedName("is_stickers_style") val isStickersStyle: Boolean? = null, - @SerializedName(value="build_id") + @SerializedName("build_id") val buildId: String? = null, - @SerializedName(value="keywords") + @SerializedName("keywords") val keywords: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/GroupsService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/GroupsService.kt new file mode 100644 index 0000000000..0fde74c009 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/GroupsService.kt @@ -0,0 +1,1759 @@ +/** + * 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.groups + +import com.google.gson.reflect.TypeToken +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.addresses.dto.AddressesFields +import com.vk.sdk.api.base.dto.BaseBoolInt +import com.vk.sdk.api.base.dto.BaseOkResponse +import com.vk.sdk.api.base.dto.BaseUserGroupFields +import com.vk.sdk.api.groups.dto.ActParam +import com.vk.sdk.api.groups.dto.AgeLimitsParam +import com.vk.sdk.api.groups.dto.FilterParam +import com.vk.sdk.api.groups.dto.GroupsAddCallbackServerResponse +import com.vk.sdk.api.groups.dto.GroupsAddress +import com.vk.sdk.api.groups.dto.GroupsCallbackSettings +import com.vk.sdk.api.groups.dto.GroupsFields +import com.vk.sdk.api.groups.dto.GroupsFilter +import com.vk.sdk.api.groups.dto.GroupsGetAddressesResponse +import com.vk.sdk.api.groups.dto.GroupsGetBannedResponse +import com.vk.sdk.api.groups.dto.GroupsGetByIdResponse +import com.vk.sdk.api.groups.dto.GroupsGetCallbackConfirmationCodeResponse +import com.vk.sdk.api.groups.dto.GroupsGetCallbackServersResponse +import com.vk.sdk.api.groups.dto.GroupsGetCatalogInfoExtendedResponse +import com.vk.sdk.api.groups.dto.GroupsGetCatalogInfoResponse +import com.vk.sdk.api.groups.dto.GroupsGetCatalogResponse +import com.vk.sdk.api.groups.dto.GroupsGetExtendedResponse +import com.vk.sdk.api.groups.dto.GroupsGetInvitedUsersResponse +import com.vk.sdk.api.groups.dto.GroupsGetInvitesExtendedResponse +import com.vk.sdk.api.groups.dto.GroupsGetInvitesResponse +import com.vk.sdk.api.groups.dto.GroupsGetMembersFieldsResponse +import com.vk.sdk.api.groups.dto.GroupsGetRequestsFieldsResponse +import com.vk.sdk.api.groups.dto.GroupsGetResponse +import com.vk.sdk.api.groups.dto.GroupsGetSettingsResponse +import com.vk.sdk.api.groups.dto.GroupsGetTokenPermissionsResponse +import com.vk.sdk.api.groups.dto.GroupsGroup +import com.vk.sdk.api.groups.dto.GroupsGroupLink +import com.vk.sdk.api.groups.dto.GroupsGroupTag +import com.vk.sdk.api.groups.dto.GroupsLongPollServer +import com.vk.sdk.api.groups.dto.GroupsLongPollSettings +import com.vk.sdk.api.groups.dto.GroupsSearchResponse +import com.vk.sdk.api.groups.dto.NameCaseParam +import com.vk.sdk.api.groups.dto.SortParam +import com.vk.sdk.api.groups.dto.StateParam +import com.vk.sdk.api.groups.dto.SubtypeParam +import com.vk.sdk.api.groups.dto.TagColorParam +import com.vk.sdk.api.groups.dto.TypeParam +import com.vk.sdk.api.groups.dto.WorkInfoStatusParam +import com.vk.sdk.api.users.dto.UsersFields +import kotlin.Boolean +import kotlin.Float +import kotlin.Int +import kotlin.String +import kotlin.Unit +import kotlin.collections.List + +class GroupsService { + /** + * @param groupId + * @param title + * @param address + * @param countryId + * @param cityId + * @param latitude + * @param longitude + * @param additionalAddress + * @param metroId + * @param phone + * @param workInfoStatus + * @param timetable + * @param isMainAddress + * @return [VKRequest] with [GroupsAddress] + */ + fun groupsAddAddress( + groupId: Int, + title: String, + address: String, + countryId: Int, + cityId: Int, + latitude: Float, + longitude: Float, + additionalAddress: String? = null, + metroId: Int? = null, + phone: String? = null, + workInfoStatus: WorkInfoStatusParam? = null, + timetable: String? = null, + isMainAddress: Boolean? = null + ): VKRequest = NewApiRequest("groups.addAddress") { + GsonHolder.gson.fromJson(it, GroupsAddress::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("title", title) + addParam("address", address) + addParam("country_id", countryId) + addParam("city_id", cityId) + addParam("latitude", latitude) + addParam("longitude", longitude) + additionalAddress?.let { addParam("additional_address", it) } + metroId?.let { addParam("metro_id", it) } + phone?.let { addParam("phone", it) } + workInfoStatus?.let { addParam("work_info_status", it.value) } + timetable?.let { addParam("timetable", it) } + isMainAddress?.let { addParam("is_main_address", it) } + } + + /** + * @param groupId + * @param url + * @param title + * @param secretKey + * @return [VKRequest] with [GroupsAddCallbackServerResponse] + */ + fun groupsAddCallbackServer( + groupId: Int, + url: String, + title: String, + secretKey: String? = null + ): VKRequest = NewApiRequest("groups.addCallbackServer") { + GsonHolder.gson.fromJson(it, GroupsAddCallbackServerResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("url", url) + addParam("title", title) + secretKey?.let { addParam("secret_key", it) } + } + + /** + * Allows to add a link to the community. + * + * @param groupId - Community ID. + * @param link - Link URL. + * @param text - Description text for the link. + * @return [VKRequest] with [GroupsGroupLink] + */ + fun groupsAddLink( + groupId: Int, + link: String, + text: String? = null + ): VKRequest = NewApiRequest("groups.addLink") { + GsonHolder.gson.fromJson(it, GroupsGroupLink::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("link", link) + text?.let { addParam("text", it) } + } + + /** + * Allows to approve join request to the community. + * + * @param groupId - Community ID. + * @param userId - User ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsApproveRequest(groupId: Int, userId: Int): VKRequest = + NewApiRequest("groups.approveRequest") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("user_id", userId) + } + + /** + * @param groupId + * @param ownerId + * @param endDate + * @param reason + * @param comment + * @param commentVisible + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsBan( + groupId: Int, + ownerId: Int? = null, + endDate: Int? = null, + reason: Int? = null, + comment: String? = null, + commentVisible: Boolean? = null + ): VKRequest = NewApiRequest("groups.ban") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + ownerId?.let { addParam("owner_id", it) } + endDate?.let { addParam("end_date", it) } + reason?.let { addParam("reason", it) } + comment?.let { addParam("comment", it) } + commentVisible?.let { addParam("comment_visible", it) } + } + + /** + * Creates a new community. + * + * @param title - Community title. + * @param description - Community description (ignored for 'type' = 'public'). + * @param type - Community type. Possible values: *'group' - group,, *'event' - event,, + * *'public' - public page + * @param publicCategory - Category ID (for 'type' = 'public' only). + * @param subtype - Public page subtype. Possible values: *'1' - place or small business,, + * *'2' - company, organization or website,, *'3' - famous person or group of people,, *'4' - + * product or work of art. + * @return [VKRequest] with [GroupsGroup] + */ + fun groupsCreate( + title: String, + description: String? = null, + type: TypeParam? = null, + publicCategory: Int? = null, + subtype: SubtypeParam? = null + ): VKRequest = NewApiRequest("groups.create") { + GsonHolder.gson.fromJson(it, GroupsGroup::class.java) + } + .apply { + addParam("title", title) + description?.let { addParam("description", it) } + type?.let { addParam("type", it.value) } + publicCategory?.let { addParam("public_category", it) } + subtype?.let { addParam("subtype", it.value) } + } + + /** + * @param groupId + * @param addressId + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsDeleteAddress(groupId: Int, addressId: Int): VKRequest = + NewApiRequest("groups.deleteAddress") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("address_id", addressId) + } + + /** + * @param groupId + * @param serverId + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsDeleteCallbackServer(groupId: Int, serverId: Int): VKRequest = + NewApiRequest("groups.deleteCallbackServer") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("server_id", serverId) + } + + /** + * Allows to delete a link from the community. + * + * @param groupId - Community ID. + * @param linkId - Link ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsDeleteLink(groupId: Int, linkId: Int): VKRequest = + NewApiRequest("groups.deleteLink") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("link_id", linkId) + } + + /** + * @param groupId + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsDisableOnline(groupId: Int): VKRequest = + NewApiRequest("groups.disableOnline") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + } + + /** + * Edits a community. + * + * @param groupId - Community ID. + * @param title - Community title. + * @param description - Community description. + * @param screenName - Community screen name. + * @param access - Community type. Possible values: *'0' - open,, *'1' - closed,, *'2' - + * private. + * @param website - Website that will be displayed in the community information field. + * @param subject - Community subject. Possible values: , *'1' - auto/moto,, *'2' - activity + * holidays,, *'3' - business,, *'4' - pets,, *'5' - health,, *'6' - dating and communication, , + * *'7' - games,, *'8' - IT (computers and software),, *'9' - cinema,, *'10' - beauty and fashion,, + * *'11' - cooking,, *'12' - art and culture,, *'13' - literature,, *'14' - mobile services and + * internet,, *'15' - music,, *'16' - science and technology,, *'17' - real estate,, *'18' - news + * and media,, *'19' - security,, *'20' - education,, *'21' - home and renovations,, *'22' - + * politics,, *'23' - food,, *'24' - industry,, *'25' - travel,, *'26' - work,, *'27' - + * entertainment,, *'28' - religion,, *'29' - family,, *'30' - sports,, *'31' - insurance,, *'32' - + * television,, *'33' - goods and services,, *'34' - hobbies,, *'35' - finance,, *'36' - photo,, + * *'37' - esoterics,, *'38' - electronics and appliances,, *'39' - erotic,, *'40' - humor,, + * *'41' - society, humanities,, *'42' - design and graphics. + * @param email - Organizer email (for events). + * @param phone - Organizer phone number (for events). + * @param rss - RSS feed address for import (available only to communities with special + * permission. Contact vk.com/support to get it. + * @param eventStartDate - Event start date in Unixtime format. + * @param eventFinishDate - Event finish date in Unixtime format. + * @param eventGroupId - Organizer community ID (for events only). + * @param publicCategory - Public page category ID. + * @param publicSubcategory - Public page subcategory ID. + * @param publicDate - Founding date of a company or organization owning the community in + * "dd.mm.YYYY" format. + * @param wall - Wall settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited + * (groups and events only),, *'3' - closed (groups and events only). + * @param topics - Board topics settings. Possbile values: , *'0' - disabled,, *'1' - open,, + * *'2' - limited (for groups and events only). + * @param photos - Photos settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * limited (for groups and events only). + * @param video - Video settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * limited (for groups and events only). + * @param audio - Audio settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * limited (for groups and events only). + * @param links - Links settings (for public pages only). Possible values: *'0' - disabled,, + * *'1' - enabled. + * @param events - Events settings (for public pages only). Possible values: *'0' - disabled,, + * *'1' - enabled. + * @param places - Places settings (for public pages only). Possible values: *'0' - disabled,, + * *'1' - enabled. + * @param contacts - Contacts settings (for public pages only). Possible values: *'0' - + * disabled,, *'1' - enabled. + * @param docs - Documents settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * limited (for groups and events only). + * @param wiki - Wiki pages settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * limited (for groups and events only). + * @param messages - Community messages. Possible values: *'0' - disabled,, *'1' - enabled. + * @param articles + * @param addresses + * @param ageLimits - Community age limits. Possible values: *'1' - no limits,, *'2' - 16+,, + * *'3' - 18+. + * @param market - Market settings. Possible values: *'0' - disabled,, *'1' - enabled. + * @param marketComments - market comments settings. Possible values: *'0' - disabled,, *'1' - + * enabled. + * @param marketCountry - Market delivery countries. + * @param marketCity - Market delivery cities (if only one country is specified). + * @param marketCurrency - Market currency settings. Possbile values: , *'643' - Russian + * rubles,, *'980' - Ukrainian hryvnia,, *'398' - Kazakh tenge,, *'978' - Euro,, *'840' - US + * dollars + * @param marketContact - Seller contact for market. Set '0' for community messages. + * @param marketWiki - ID of a wiki page with market description. + * @param obsceneFilter - Obscene expressions filter in comments. Possible values: , *'0' - + * disabled,, *'1' - enabled. + * @param obsceneStopwords - Stopwords filter in comments. Possible values: , *'0' - disabled,, + * *'1' - enabled. + * @param obsceneWords - Keywords for stopwords filter. + * @param mainSection + * @param secondarySection + * @param country - Country of the community. + * @param city - City of the community. + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsEdit( + groupId: Int, + title: String? = null, + description: String? = null, + screenName: String? = null, + access: Int? = null, + website: String? = null, + subject: String? = null, + email: String? = null, + phone: String? = null, + rss: String? = null, + eventStartDate: Int? = null, + eventFinishDate: Int? = null, + eventGroupId: Int? = null, + publicCategory: Int? = null, + publicSubcategory: Int? = null, + publicDate: String? = null, + wall: Int? = null, + topics: Int? = null, + photos: Int? = null, + video: Int? = null, + audio: Int? = null, + links: Boolean? = null, + events: Boolean? = null, + places: Boolean? = null, + contacts: Boolean? = null, + docs: Int? = null, + wiki: Int? = null, + messages: Boolean? = null, + articles: Boolean? = null, + addresses: Boolean? = null, + ageLimits: AgeLimitsParam? = null, + market: Boolean? = null, + marketComments: Boolean? = null, + marketCountry: List? = null, + marketCity: List? = null, + marketCurrency: Int? = null, + marketContact: Int? = null, + marketWiki: Int? = null, + obsceneFilter: Boolean? = null, + obsceneStopwords: Boolean? = null, + obsceneWords: List? = null, + mainSection: Int? = null, + secondarySection: Int? = null, + country: Int? = null, + city: Int? = null + ): VKRequest = NewApiRequest("groups.edit") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + title?.let { addParam("title", it) } + description?.let { addParam("description", it) } + screenName?.let { addParam("screen_name", it) } + access?.let { addParam("access", it) } + website?.let { addParam("website", it) } + subject?.let { addParam("subject", it) } + email?.let { addParam("email", it) } + phone?.let { addParam("phone", it) } + rss?.let { addParam("rss", it) } + eventStartDate?.let { addParam("event_start_date", it) } + eventFinishDate?.let { addParam("event_finish_date", it) } + eventGroupId?.let { addParam("event_group_id", it) } + publicCategory?.let { addParam("public_category", it) } + publicSubcategory?.let { addParam("public_subcategory", it) } + publicDate?.let { addParam("public_date", it) } + wall?.let { addParam("wall", it) } + topics?.let { addParam("topics", it) } + photos?.let { addParam("photos", it) } + video?.let { addParam("video", it) } + audio?.let { addParam("audio", it) } + links?.let { addParam("links", it) } + events?.let { addParam("events", it) } + places?.let { addParam("places", it) } + contacts?.let { addParam("contacts", it) } + docs?.let { addParam("docs", it) } + wiki?.let { addParam("wiki", it) } + messages?.let { addParam("messages", it) } + articles?.let { addParam("articles", it) } + addresses?.let { addParam("addresses", it) } + ageLimits?.let { addParam("age_limits", it.value) } + market?.let { addParam("market", it) } + marketComments?.let { addParam("market_comments", it) } + marketCountry?.let { addParam("market_country", it) } + marketCity?.let { addParam("market_city", it) } + marketCurrency?.let { addParam("market_currency", it) } + marketContact?.let { addParam("market_contact", it) } + marketWiki?.let { addParam("market_wiki", it) } + obsceneFilter?.let { addParam("obscene_filter", it) } + obsceneStopwords?.let { addParam("obscene_stopwords", it) } + obsceneWords?.let { addParam("obscene_words", it) } + mainSection?.let { addParam("main_section", it) } + secondarySection?.let { addParam("secondary_section", it) } + country?.let { addParam("country", it) } + city?.let { addParam("city", it) } + } + + /** + * @param groupId + * @param addressId + * @param title + * @param address + * @param additionalAddress + * @param countryId + * @param cityId + * @param metroId + * @param latitude + * @param longitude + * @param phone + * @param workInfoStatus + * @param timetable + * @param isMainAddress + * @return [VKRequest] with [GroupsAddress] + */ + fun groupsEditAddress( + groupId: Int, + addressId: Int, + title: String? = null, + address: String? = null, + additionalAddress: String? = null, + countryId: Int? = null, + cityId: Int? = null, + metroId: Int? = null, + latitude: Float? = null, + longitude: Float? = null, + phone: String? = null, + workInfoStatus: WorkInfoStatusParam? = null, + timetable: String? = null, + isMainAddress: Boolean? = null + ): VKRequest = NewApiRequest("groups.editAddress") { + GsonHolder.gson.fromJson(it, GroupsAddress::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("address_id", addressId) + title?.let { addParam("title", it) } + address?.let { addParam("address", it) } + additionalAddress?.let { addParam("additional_address", it) } + countryId?.let { addParam("country_id", it) } + cityId?.let { addParam("city_id", it) } + metroId?.let { addParam("metro_id", it) } + latitude?.let { addParam("latitude", it) } + longitude?.let { addParam("longitude", it) } + phone?.let { addParam("phone", it) } + workInfoStatus?.let { addParam("work_info_status", it.value) } + timetable?.let { addParam("timetable", it) } + isMainAddress?.let { addParam("is_main_address", it) } + } + + /** + * @param groupId + * @param serverId + * @param url + * @param title + * @param secretKey + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsEditCallbackServer( + groupId: Int, + serverId: Int, + url: String, + title: String, + secretKey: String? = null + ): VKRequest = NewApiRequest("groups.editCallbackServer") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("server_id", serverId) + addParam("url", url) + addParam("title", title) + secretKey?.let { addParam("secret_key", it) } + } + + /** + * Allows to edit a link in the community. + * + * @param groupId - Community ID. + * @param linkId - Link ID. + * @param text - New description text for the link. + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsEditLink( + groupId: Int, + linkId: Int, + text: String? = null + ): VKRequest = NewApiRequest("groups.editLink") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("link_id", linkId) + text?.let { addParam("text", it) } + } + + /** + * Allows to add, remove or edit the community manager. + * + * @param groupId - Community ID. + * @param userId - User ID. + * @param role - Manager role. Possible values: *'moderator',, *'editor',, *'administrator',, + * *'advertiser'. + * @param isContact - '1' - to show the manager in Contacts block of the community. + * @param contactPosition - Position to show in Contacts block. + * @param contactPhone - Contact phone. + * @param contactEmail - Contact e-mail. + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsEditManager( + groupId: Int, + userId: Int, + role: String? = null, + isContact: Boolean? = null, + contactPosition: String? = null, + contactPhone: String? = null, + contactEmail: String? = null + ): VKRequest = NewApiRequest("groups.editManager") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("user_id", userId) + role?.let { addParam("role", it) } + isContact?.let { addParam("is_contact", it) } + contactPosition?.let { addParam("contact_position", it) } + contactPhone?.let { addParam("contact_phone", it) } + contactEmail?.let { addParam("contact_email", it) } + } + + /** + * @param groupId + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsEnableOnline(groupId: Int): VKRequest = + NewApiRequest("groups.enableOnline") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + } + + /** + * Returns a list of the communities to which a user belongs. + * + * @param userId - User ID. + * @param filter - Types of communities to return: 'admin' - to return communities administered + * by the user , 'editor' - to return communities where the user is an administrator or editor, + * 'moder' - to return communities where the user is an administrator, editor, or moderator, + * 'groups' - to return only groups, 'publics' - to return only public pages, 'events' - to return + * only events + * @param fields - Profile fields to return. + * @param offset - Offset needed to return a specific subset of communities. + * @param count - Number of communities to return. + * @return [VKRequest] with [GroupsGetResponse] + */ + fun groupsGet( + userId: Int? = null, + filter: List? = null, + fields: List? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("groups.get") { + GsonHolder.gson.fromJson(it, GroupsGetResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + val filterJsonConverted = filter?.map { + it.value + } + filterJsonConverted?.let { addParam("filter", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns a list of the communities to which a user belongs. + * + * @param userId - User ID. + * @param filter - Types of communities to return: 'admin' - to return communities administered + * by the user , 'editor' - to return communities where the user is an administrator or editor, + * 'moder' - to return communities where the user is an administrator, editor, or moderator, + * 'groups' - to return only groups, 'publics' - to return only public pages, 'events' - to return + * only events + * @param fields - Profile fields to return. + * @param offset - Offset needed to return a specific subset of communities. + * @param count - Number of communities to return. + * @return [VKRequest] with [GroupsGetExtendedResponse] + */ + fun groupsGetExtended( + userId: Int? = null, + filter: List? = null, + fields: List? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("groups.get") { + GsonHolder.gson.fromJson(it, GroupsGetExtendedResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + addParam("extended", true) + val filterJsonConverted = filter?.map { + it.value + } + filterJsonConverted?.let { addParam("filter", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns a list of community addresses. + * + * @param groupId - ID or screen name of the community. + * @param addressIds + * @param latitude - Latitude of the user geo position. + * @param longitude - Longitude of the user geo position. + * @param offset - Offset needed to return a specific subset of community addresses. + * @param count - Number of community addresses to return. + * @param fields - Address fields + * @return [VKRequest] with [GroupsGetAddressesResponse] + */ + fun groupsGetAddresses( + groupId: Int, + addressIds: List? = null, + latitude: Float? = null, + longitude: Float? = null, + offset: Int? = null, + count: Int? = null, + fields: List? = null + ): VKRequest = NewApiRequest("groups.getAddresses") { + GsonHolder.gson.fromJson(it, GroupsGetAddressesResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addressIds?.let { addParam("address_ids", it) } + latitude?.let { addParam("latitude", it) } + longitude?.let { addParam("longitude", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns a list of users on a community blacklist. + * + * @param groupId - Community ID. + * @param offset - Offset needed to return a specific subset of users. + * @param count - Number of users to return. + * @param fields + * @param ownerId + * @return [VKRequest] with [GroupsGetBannedResponse] + */ + fun groupsGetBanned( + groupId: Int, + offset: Int? = null, + count: Int? = null, + fields: List? = null, + ownerId: Int? = null + ): VKRequest = NewApiRequest("groups.getBanned") { + GsonHolder.gson.fromJson(it, GroupsGetBannedResponse::class.java) + } + .apply { + addParam("group_id", groupId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + ownerId?.let { addParam("owner_id", it) } + } + + /** + * Returns information about communities by their IDs. + * + * @param groupIds - IDs or screen names of communities. + * @param groupId - ID or screen name of the community. + * @param fields - Group fields to return. + * @return [VKRequest] with [GroupsGetByIdResponse] + */ + fun groupsGetById( + groupIds: List? = null, + groupId: String? = null, + fields: List? = null + ): VKRequest = NewApiRequest("groups.getById") { + GsonHolder.gson.fromJson(it, GroupsGetByIdResponse::class.java) + } + .apply { + groupIds?.let { addParam("group_ids", it) } + groupId?.let { addParam("group_id", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns Callback API confirmation code for the community. + * + * @param groupId - Community ID. + * @return [VKRequest] with [GroupsGetCallbackConfirmationCodeResponse] + */ + fun groupsGetCallbackConfirmationCode(groupId: Int): + VKRequest = + NewApiRequest("groups.getCallbackConfirmationCode") { + GsonHolder.gson.fromJson(it, GroupsGetCallbackConfirmationCodeResponse::class.java) + } + .apply { + addParam("group_id", groupId) + } + + /** + * @param groupId + * @param serverIds + * @return [VKRequest] with [GroupsGetCallbackServersResponse] + */ + fun groupsGetCallbackServers(groupId: Int, serverIds: List? = null): + VKRequest = + NewApiRequest("groups.getCallbackServers") { + GsonHolder.gson.fromJson(it, GroupsGetCallbackServersResponse::class.java) + } + .apply { + addParam("group_id", groupId) + serverIds?.let { addParam("server_ids", it) } + } + + /** + * Returns [vk.com/dev/callback_api|Callback API] notifications settings. + * + * @param groupId - Community ID. + * @param serverId - Server ID. + * @return [VKRequest] with [GroupsCallbackSettings] + */ + fun groupsGetCallbackSettings(groupId: Int, serverId: Int? = null): + VKRequest = NewApiRequest("groups.getCallbackSettings") { + GsonHolder.gson.fromJson(it, GroupsCallbackSettings::class.java) + } + .apply { + addParam("group_id", groupId) + serverId?.let { addParam("server_id", it) } + } + + /** + * Returns communities list for a catalog category. + * + * @param categoryId - Category id received from + * [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. + * @param subcategoryId - Subcategory id received from + * [vk.com/dev/groups.getCatalogInfo|groups.getCatalogInfo]. + * @return [VKRequest] with [GroupsGetCatalogResponse] + */ + fun groupsGetCatalog(categoryId: Int? = null, subcategoryId: Int? = null): + VKRequest = NewApiRequest("groups.getCatalog") { + GsonHolder.gson.fromJson(it, GroupsGetCatalogResponse::class.java) + } + .apply { + categoryId?.let { addParam("category_id", it) } + subcategoryId?.let { addParam("subcategory_id", it) } + } + + /** + * Returns categories list for communities catalog + * + * @param subcategories - 1 - to return subcategories info. By default: 0. + * @return [VKRequest] with [GroupsGetCatalogInfoResponse] + */ + fun groupsGetCatalogInfo(subcategories: Boolean? = null): + VKRequest = NewApiRequest("groups.getCatalogInfo") { + GsonHolder.gson.fromJson(it, GroupsGetCatalogInfoResponse::class.java) + } + .apply { + subcategories?.let { addParam("subcategories", it) } + } + + /** + * Returns categories list for communities catalog + * + * @param subcategories - 1 - to return subcategories info. By default: 0. + * @return [VKRequest] with [GroupsGetCatalogInfoExtendedResponse] + */ + fun groupsGetCatalogInfoExtended(subcategories: Boolean? = null): + VKRequest = + NewApiRequest("groups.getCatalogInfo") { + GsonHolder.gson.fromJson(it, GroupsGetCatalogInfoExtendedResponse::class.java) + } + .apply { + addParam("extended", true) + subcategories?.let { addParam("subcategories", it) } + } + + /** + * Returns invited users list of a community + * + * @param groupId - Group ID to return invited users for. + * @param offset - Offset needed to return a specific subset of results. + * @param count - Number of results to return. + * @param fields - List of additional fields to be returned. Available values: 'sex, bdate, + * city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, + * photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, + * education, universities, schools, can_post, can_see_all_posts, can_see_audio, + * can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. + * @param nameCase - Case for declension of user name and surname. Possible values: *'nom' - + * nominative (default),, *'gen' - genitive,, *'dat' - dative,, *'acc' - accusative, , *'ins' - + * instrumental,, *'abl' - prepositional. + * @return [VKRequest] with [GroupsGetInvitedUsersResponse] + */ + fun groupsGetInvitedUsers( + groupId: Int, + offset: Int? = null, + count: Int? = null, + fields: List? = null, + nameCase: NameCaseParam? = null + ): VKRequest = NewApiRequest("groups.getInvitedUsers") { + GsonHolder.gson.fromJson(it, GroupsGetInvitedUsersResponse::class.java) + } + .apply { + addParam("group_id", groupId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + nameCase?.let { addParam("name_case", it.value) } + } + + /** + * Returns a list of invitations to join communities and events. + * + * @param offset - Offset needed to return a specific subset of invitations. + * @param count - Number of invitations to return. + * @return [VKRequest] with [GroupsGetInvitesResponse] + */ + fun groupsGetInvites(offset: Int? = null, count: Int? = null): + VKRequest = NewApiRequest("groups.getInvites") { + GsonHolder.gson.fromJson(it, GroupsGetInvitesResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns a list of invitations to join communities and events. + * + * @param offset - Offset needed to return a specific subset of invitations. + * @param count - Number of invitations to return. + * @return [VKRequest] with [GroupsGetInvitesExtendedResponse] + */ + fun groupsGetInvitesExtended(offset: Int? = null, count: Int? = null): + VKRequest = NewApiRequest("groups.getInvites") { + GsonHolder.gson.fromJson(it, GroupsGetInvitesExtendedResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + addParam("extended", true) + } + + /** + * Returns the data needed to query a Long Poll server for events + * + * @param groupId - Community ID + * @return [VKRequest] with [GroupsLongPollServer] + */ + fun groupsGetLongPollServer(groupId: Int): VKRequest = + NewApiRequest("groups.getLongPollServer") { + GsonHolder.gson.fromJson(it, GroupsLongPollServer::class.java) + } + .apply { + addParam("group_id", groupId) + } + + /** + * Returns Long Poll notification settings + * + * @param groupId - Community ID. + * @return [VKRequest] with [GroupsLongPollSettings] + */ + fun groupsGetLongPollSettings(groupId: Int): VKRequest = + NewApiRequest("groups.getLongPollSettings") { + GsonHolder.gson.fromJson(it, GroupsLongPollSettings::class.java) + } + .apply { + addParam("group_id", groupId) + } + + /** + * Returns a list of community members. + * + * @param groupId - ID or screen name of the community. + * @param sort - Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', 'time_desc'. + * 'time_asc' and 'time_desc' are availavle only if the method is called by the group's + * 'moderator'. + * @param offset - Offset needed to return a specific subset of community members. + * @param count - Number of community members to return. + * @param fields - List of additional fields to be returned. Available values: 'sex, bdate, + * city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, + * photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, + * education, universities, schools, can_post, can_see_all_posts, can_see_audio, + * can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. + * @param filter - *'friends' - only friends in this community will be returned,, *'unsure' - + * only those who pressed 'I may attend' will be returned (if it's an event). + * @return [VKRequest] with [GroupsGetMembersFieldsResponse] + */ + fun groupsGetMembers( + groupId: String? = null, + sort: SortParam? = null, + offset: Int? = null, + count: Int? = null, + fields: List? = null, + filter: FilterParam? = null + ): VKRequest = NewApiRequest("groups.getMembers") { + GsonHolder.gson.fromJson(it, GroupsGetMembersFieldsResponse::class.java) + } + .apply { + groupId?.let { addParam("group_id", it) } + sort?.let { addParam("sort", it.value) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + filter?.let { addParam("filter", it.value) } + } + + /** + * @param groupId + * @return [VKRequest] with [Unit] + */ + fun groupsGetOnlineStatus(groupId: Int): VKRequest = + NewApiRequest("groups.getOnlineStatus") { + } + .apply { + addParam("group_id", groupId) + } + + /** + * Returns a list of requests to the community. + * + * @param groupId - Community ID. + * @param offset - Offset needed to return a specific subset of results. + * @param count - Number of results to return. + * @param fields - Profile fields to return. + * @return [VKRequest] with [GroupsGetRequestsFieldsResponse] + */ + fun groupsGetRequests( + groupId: Int, + offset: Int? = null, + count: Int? = null, + fields: List? = null + ): VKRequest = NewApiRequest("groups.getRequests") { + GsonHolder.gson.fromJson(it, GroupsGetRequestsFieldsResponse::class.java) + } + .apply { + addParam("group_id", groupId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns community settings. + * + * @param groupId - Community ID. + * @return [VKRequest] with [GroupsGetSettingsResponse] + */ + fun groupsGetSettings(groupId: Int): VKRequest = + NewApiRequest("groups.getSettings") { + GsonHolder.gson.fromJson(it, GroupsGetSettingsResponse::class.java) + } + .apply { + addParam("group_id", groupId) + } + + /** + * List of group's tags + * + * @param groupId + * @return [VKRequest] with [Unit] + */ + fun groupsGetTagList(groupId: Int): VKRequest> = + NewApiRequest("groups.getTagList") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + addParam("group_id", groupId) + } + + /** + * @return [VKRequest] with [GroupsGetTokenPermissionsResponse] + */ + fun groupsGetTokenPermissions(): VKRequest = + NewApiRequest("groups.getTokenPermissions") { + GsonHolder.gson.fromJson(it, GroupsGetTokenPermissionsResponse::class.java) + } + + /** + * Allows to invite friends to the community. + * + * @param groupId - Community ID. + * @param userId - User ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsInvite(groupId: Int, userId: Int): VKRequest = + NewApiRequest("groups.invite") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("user_id", userId) + } + + /** + * Returns information specifying whether a user is a member of a community. + * + * @param groupId - ID or screen name of the community. + * @param userId - User ID. + * @param userIds - User IDs. + * @return [VKRequest] with [BaseBoolInt] + */ + fun groupsIsMember( + groupId: String, + userId: Int? = null, + userIds: List? = null + ): VKRequest = NewApiRequest("groups.isMember") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("group_id", groupId) + userId?.let { addParam("user_id", it) } + userIds?.let { addParam("user_ids", it) } + } + + /** + * With this method you can join the group or public page, and also confirm your participation + * in an event. + * + * @param groupId - ID or screen name of the community. + * @param notSure - Optional parameter which is taken into account when 'gid' belongs to the + * event: '1' - Perhaps I will attend, '0' - I will be there for sure (default), , + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsJoin(groupId: Int? = null, notSure: String? = null): VKRequest = + NewApiRequest("groups.join") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + groupId?.let { addParam("group_id", it) } + notSure?.let { addParam("not_sure", it) } + } + + /** + * With this method you can leave a group, public page, or event. + * + * @param groupId - ID or screen name of the community. + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsLeave(groupId: Int): VKRequest = NewApiRequest("groups.leave") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + } + + /** + * Removes a user from the community. + * + * @param groupId - Community ID. + * @param userId - User ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsRemoveUser(groupId: Int, userId: Int): VKRequest = + NewApiRequest("groups.removeUser") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("user_id", userId) + } + + /** + * Allows to reorder links in the community. + * + * @param groupId - Community ID. + * @param linkId - Link ID. + * @param after - ID of the link after which to place the link with 'link_id'. + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsReorderLink( + groupId: Int, + linkId: Int, + after: Int? = null + ): VKRequest = NewApiRequest("groups.reorderLink") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("link_id", linkId) + after?.let { addParam("after", it) } + } + + /** + * Returns a list of communities matching the search criteria. + * + * @param q - Search query string. + * @param type - Community type. Possible values: 'group, page, event.' + * @param countryId - Country ID. + * @param cityId - City ID. If this parameter is transmitted, country_id is ignored. + * @param future - '1' - to return only upcoming events. Works with the 'type' = 'event' only. + * @param market - '1' - to return communities with enabled market only. + * @param sort - Sort order. Possible values: *'0' - default sorting (similar the full version + * of the site),, *'1' - by growth speed,, *'2'- by the "day attendance/members number" ratio,, + * *'3' - by the "Likes number/members number" ratio,, *'4' - by the "comments number/members + * number" ratio,, *'5' - by the "boards entries number/members number" ratio. + * @param offset - Offset needed to return a specific subset of results. + * @param count - Number of communities to return. "Note that you can not receive more than + * first thousand of results, regardless of 'count' and 'offset' values." + * @return [VKRequest] with [GroupsSearchResponse] + */ + fun groupsSearch( + q: String, + type: TypeParam? = null, + countryId: Int? = null, + cityId: Int? = null, + future: Boolean? = null, + market: Boolean? = null, + sort: SortParam? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("groups.search") { + GsonHolder.gson.fromJson(it, GroupsSearchResponse::class.java) + } + .apply { + addParam("q", q) + type?.let { addParam("type", it.value) } + countryId?.let { addParam("country_id", it) } + cityId?.let { addParam("city_id", it) } + future?.let { addParam("future", it) } + market?.let { addParam("market", it) } + sort?.let { addParam("sort", it.value) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Allow to set notifications settings for group. + * + * @param groupId - Community ID. + * @param serverId - Server ID. + * @param apiVersion + * @param messageNew - A new incoming message has been received ('0' - disabled, '1' - enabled). + * @param messageReply - A new outcoming message has been received ('0' - disabled, '1' - + * enabled). + * @param messageAllow - Allowed messages notifications ('0' - disabled, '1' - enabled). + * @param messageEdit + * @param messageDeny - Denied messages notifications ('0' - disabled, '1' - enabled). + * @param messageTypingState + * @param photoNew - New photos notifications ('0' - disabled, '1' - enabled). + * @param audioNew - New audios notifications ('0' - disabled, '1' - enabled). + * @param videoNew - New videos notifications ('0' - disabled, '1' - enabled). + * @param wallReplyNew - New wall replies notifications ('0' - disabled, '1' - enabled). + * @param wallReplyEdit - Wall replies edited notifications ('0' - disabled, '1' - enabled). + * @param wallReplyDelete - A wall comment has been deleted ('0' - disabled, '1' - enabled). + * @param wallReplyRestore - A wall comment has been restored ('0' - disabled, '1' - enabled). + * @param wallPostNew - New wall posts notifications ('0' - disabled, '1' - enabled). + * @param wallRepost - New wall posts notifications ('0' - disabled, '1' - enabled). + * @param boardPostNew - New board posts notifications ('0' - disabled, '1' - enabled). + * @param boardPostEdit - Board posts edited notifications ('0' - disabled, '1' - enabled). + * @param boardPostRestore - Board posts restored notifications ('0' - disabled, '1' - enabled). + * @param boardPostDelete - Board posts deleted notifications ('0' - disabled, '1' - enabled). + * @param photoCommentNew - New comment to photo notifications ('0' - disabled, '1' - enabled). + * @param photoCommentEdit - A photo comment has been edited ('0' - disabled, '1' - enabled). + * @param photoCommentDelete - A photo comment has been deleted ('0' - disabled, '1' - enabled). + * @param photoCommentRestore - A photo comment has been restored ('0' - disabled, '1' - + * enabled). + * @param videoCommentNew - New comment to video notifications ('0' - disabled, '1' - enabled). + * @param videoCommentEdit - A video comment has been edited ('0' - disabled, '1' - enabled). + * @param videoCommentDelete - A video comment has been deleted ('0' - disabled, '1' - enabled). + * @param videoCommentRestore - A video comment has been restored ('0' - disabled, '1' - + * enabled). + * @param marketCommentNew - New comment to market item notifications ('0' - disabled, '1' - + * enabled). + * @param marketCommentEdit - A market comment has been edited ('0' - disabled, '1' - enabled). + * @param marketCommentDelete - A market comment has been deleted ('0' - disabled, '1' - + * enabled). + * @param marketCommentRestore - A market comment has been restored ('0' - disabled, '1' - + * enabled). + * @param marketOrderNew + * @param marketOrderEdit + * @param pollVoteNew - A vote in a public poll has been added ('0' - disabled, '1' - enabled). + * @param groupJoin - Joined community notifications ('0' - disabled, '1' - enabled). + * @param groupLeave - Left community notifications ('0' - disabled, '1' - enabled). + * @param groupChangeSettings + * @param groupChangePhoto + * @param groupOfficersEdit + * @param userBlock - User added to community blacklist + * @param userUnblock - User removed from community blacklist + * @param leadFormsNew - New form in lead forms + * @param likeAdd + * @param likeRemove + * @param messageEvent + * @param donutSubscriptionCreate + * @param donutSubscriptionProlonged + * @param donutSubscriptionCancelled + * @param donutSubscriptionPriceChanged + * @param donutSubscriptionExpired + * @param donutMoneyWithdraw + * @param donutMoneyWithdrawError + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsSetCallbackSettings( + groupId: Int, + serverId: Int? = null, + apiVersion: String? = null, + messageNew: Boolean? = null, + messageReply: Boolean? = null, + messageAllow: Boolean? = null, + messageEdit: Boolean? = null, + messageDeny: Boolean? = null, + messageTypingState: Boolean? = null, + photoNew: Boolean? = null, + audioNew: Boolean? = null, + videoNew: Boolean? = null, + wallReplyNew: Boolean? = null, + wallReplyEdit: Boolean? = null, + wallReplyDelete: Boolean? = null, + wallReplyRestore: Boolean? = null, + wallPostNew: Boolean? = null, + wallRepost: Boolean? = null, + boardPostNew: Boolean? = null, + boardPostEdit: Boolean? = null, + boardPostRestore: Boolean? = null, + boardPostDelete: Boolean? = null, + photoCommentNew: Boolean? = null, + photoCommentEdit: Boolean? = null, + photoCommentDelete: Boolean? = null, + photoCommentRestore: Boolean? = null, + videoCommentNew: Boolean? = null, + videoCommentEdit: Boolean? = null, + videoCommentDelete: Boolean? = null, + videoCommentRestore: Boolean? = null, + marketCommentNew: Boolean? = null, + marketCommentEdit: Boolean? = null, + marketCommentDelete: Boolean? = null, + marketCommentRestore: Boolean? = null, + marketOrderNew: Boolean? = null, + marketOrderEdit: Boolean? = null, + pollVoteNew: Boolean? = null, + groupJoin: Boolean? = null, + groupLeave: Boolean? = null, + groupChangeSettings: Boolean? = null, + groupChangePhoto: Boolean? = null, + groupOfficersEdit: Boolean? = null, + userBlock: Boolean? = null, + userUnblock: Boolean? = null, + leadFormsNew: Boolean? = null, + likeAdd: Boolean? = null, + likeRemove: Boolean? = null, + messageEvent: Boolean? = null, + donutSubscriptionCreate: Boolean? = null, + donutSubscriptionProlonged: Boolean? = null, + donutSubscriptionCancelled: Boolean? = null, + donutSubscriptionPriceChanged: Boolean? = null, + donutSubscriptionExpired: Boolean? = null, + donutMoneyWithdraw: Boolean? = null, + donutMoneyWithdrawError: Boolean? = null + ): VKRequest = NewApiRequest("groups.setCallbackSettings") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + serverId?.let { addParam("server_id", it) } + apiVersion?.let { addParam("api_version", it) } + messageNew?.let { addParam("message_new", it) } + messageReply?.let { addParam("message_reply", it) } + messageAllow?.let { addParam("message_allow", it) } + messageEdit?.let { addParam("message_edit", it) } + messageDeny?.let { addParam("message_deny", it) } + messageTypingState?.let { addParam("message_typing_state", it) } + photoNew?.let { addParam("photo_new", it) } + audioNew?.let { addParam("audio_new", it) } + videoNew?.let { addParam("video_new", it) } + wallReplyNew?.let { addParam("wall_reply_new", it) } + wallReplyEdit?.let { addParam("wall_reply_edit", it) } + wallReplyDelete?.let { addParam("wall_reply_delete", it) } + wallReplyRestore?.let { addParam("wall_reply_restore", it) } + wallPostNew?.let { addParam("wall_post_new", it) } + wallRepost?.let { addParam("wall_repost", it) } + boardPostNew?.let { addParam("board_post_new", it) } + boardPostEdit?.let { addParam("board_post_edit", it) } + boardPostRestore?.let { addParam("board_post_restore", it) } + boardPostDelete?.let { addParam("board_post_delete", it) } + photoCommentNew?.let { addParam("photo_comment_new", it) } + photoCommentEdit?.let { addParam("photo_comment_edit", it) } + photoCommentDelete?.let { addParam("photo_comment_delete", it) } + photoCommentRestore?.let { addParam("photo_comment_restore", it) } + videoCommentNew?.let { addParam("video_comment_new", it) } + videoCommentEdit?.let { addParam("video_comment_edit", it) } + videoCommentDelete?.let { addParam("video_comment_delete", it) } + videoCommentRestore?.let { addParam("video_comment_restore", it) } + marketCommentNew?.let { addParam("market_comment_new", it) } + marketCommentEdit?.let { addParam("market_comment_edit", it) } + marketCommentDelete?.let { addParam("market_comment_delete", it) } + marketCommentRestore?.let { addParam("market_comment_restore", it) } + marketOrderNew?.let { addParam("market_order_new", it) } + marketOrderEdit?.let { addParam("market_order_edit", it) } + pollVoteNew?.let { addParam("poll_vote_new", it) } + groupJoin?.let { addParam("group_join", it) } + groupLeave?.let { addParam("group_leave", it) } + groupChangeSettings?.let { addParam("group_change_settings", it) } + groupChangePhoto?.let { addParam("group_change_photo", it) } + groupOfficersEdit?.let { addParam("group_officers_edit", it) } + userBlock?.let { addParam("user_block", it) } + userUnblock?.let { addParam("user_unblock", it) } + leadFormsNew?.let { addParam("lead_forms_new", it) } + likeAdd?.let { addParam("like_add", it) } + likeRemove?.let { addParam("like_remove", it) } + messageEvent?.let { addParam("message_event", it) } + donutSubscriptionCreate?.let { addParam("donut_subscription_create", it) } + donutSubscriptionProlonged?.let { addParam("donut_subscription_prolonged", it) } + donutSubscriptionCancelled?.let { addParam("donut_subscription_cancelled", it) } + donutSubscriptionPriceChanged?.let { addParam("donut_subscription_price_changed", it) } + donutSubscriptionExpired?.let { addParam("donut_subscription_expired", it) } + donutMoneyWithdraw?.let { addParam("donut_money_withdraw", it) } + donutMoneyWithdrawError?.let { addParam("donut_money_withdraw_error", it) } + } + + /** + * Sets Long Poll notification settings + * + * @param groupId - Community ID. + * @param enabled - Sets whether Long Poll is enabled ('0' - disabled, '1' - enabled). + * @param apiVersion + * @param messageNew - A new incoming message has been received ('0' - disabled, '1' - enabled). + * @param messageReply - A new outcoming message has been received ('0' - disabled, '1' - + * enabled). + * @param messageAllow - Allowed messages notifications ('0' - disabled, '1' - enabled). + * @param messageDeny - Denied messages notifications ('0' - disabled, '1' - enabled). + * @param messageEdit - A message has been edited ('0' - disabled, '1' - enabled). + * @param messageTypingState + * @param photoNew - New photos notifications ('0' - disabled, '1' - enabled). + * @param audioNew - New audios notifications ('0' - disabled, '1' - enabled). + * @param videoNew - New videos notifications ('0' - disabled, '1' - enabled). + * @param wallReplyNew - New wall replies notifications ('0' - disabled, '1' - enabled). + * @param wallReplyEdit - Wall replies edited notifications ('0' - disabled, '1' - enabled). + * @param wallReplyDelete - A wall comment has been deleted ('0' - disabled, '1' - enabled). + * @param wallReplyRestore - A wall comment has been restored ('0' - disabled, '1' - enabled). + * @param wallPostNew - New wall posts notifications ('0' - disabled, '1' - enabled). + * @param wallRepost - New wall posts notifications ('0' - disabled, '1' - enabled). + * @param boardPostNew - New board posts notifications ('0' - disabled, '1' - enabled). + * @param boardPostEdit - Board posts edited notifications ('0' - disabled, '1' - enabled). + * @param boardPostRestore - Board posts restored notifications ('0' - disabled, '1' - enabled). + * @param boardPostDelete - Board posts deleted notifications ('0' - disabled, '1' - enabled). + * @param photoCommentNew - New comment to photo notifications ('0' - disabled, '1' - enabled). + * @param photoCommentEdit - A photo comment has been edited ('0' - disabled, '1' - enabled). + * @param photoCommentDelete - A photo comment has been deleted ('0' - disabled, '1' - enabled). + * @param photoCommentRestore - A photo comment has been restored ('0' - disabled, '1' - + * enabled). + * @param videoCommentNew - New comment to video notifications ('0' - disabled, '1' - enabled). + * @param videoCommentEdit - A video comment has been edited ('0' - disabled, '1' - enabled). + * @param videoCommentDelete - A video comment has been deleted ('0' - disabled, '1' - enabled). + * @param videoCommentRestore - A video comment has been restored ('0' - disabled, '1' - + * enabled). + * @param marketCommentNew - New comment to market item notifications ('0' - disabled, '1' - + * enabled). + * @param marketCommentEdit - A market comment has been edited ('0' - disabled, '1' - enabled). + * @param marketCommentDelete - A market comment has been deleted ('0' - disabled, '1' - + * enabled). + * @param marketCommentRestore - A market comment has been restored ('0' - disabled, '1' - + * enabled). + * @param pollVoteNew - A vote in a public poll has been added ('0' - disabled, '1' - enabled). + * @param groupJoin - Joined community notifications ('0' - disabled, '1' - enabled). + * @param groupLeave - Left community notifications ('0' - disabled, '1' - enabled). + * @param groupChangeSettings + * @param groupChangePhoto + * @param groupOfficersEdit + * @param userBlock - User added to community blacklist + * @param userUnblock - User removed from community blacklist + * @param likeAdd + * @param likeRemove + * @param messageEvent + * @param donutSubscriptionCreate + * @param donutSubscriptionProlonged + * @param donutSubscriptionCancelled + * @param donutSubscriptionPriceChanged + * @param donutSubscriptionExpired + * @param donutMoneyWithdraw + * @param donutMoneyWithdrawError + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsSetLongPollSettings( + groupId: Int, + enabled: Boolean? = null, + apiVersion: String? = null, + messageNew: Boolean? = null, + messageReply: Boolean? = null, + messageAllow: Boolean? = null, + messageDeny: Boolean? = null, + messageEdit: Boolean? = null, + messageTypingState: Boolean? = null, + photoNew: Boolean? = null, + audioNew: Boolean? = null, + videoNew: Boolean? = null, + wallReplyNew: Boolean? = null, + wallReplyEdit: Boolean? = null, + wallReplyDelete: Boolean? = null, + wallReplyRestore: Boolean? = null, + wallPostNew: Boolean? = null, + wallRepost: Boolean? = null, + boardPostNew: Boolean? = null, + boardPostEdit: Boolean? = null, + boardPostRestore: Boolean? = null, + boardPostDelete: Boolean? = null, + photoCommentNew: Boolean? = null, + photoCommentEdit: Boolean? = null, + photoCommentDelete: Boolean? = null, + photoCommentRestore: Boolean? = null, + videoCommentNew: Boolean? = null, + videoCommentEdit: Boolean? = null, + videoCommentDelete: Boolean? = null, + videoCommentRestore: Boolean? = null, + marketCommentNew: Boolean? = null, + marketCommentEdit: Boolean? = null, + marketCommentDelete: Boolean? = null, + marketCommentRestore: Boolean? = null, + pollVoteNew: Boolean? = null, + groupJoin: Boolean? = null, + groupLeave: Boolean? = null, + groupChangeSettings: Boolean? = null, + groupChangePhoto: Boolean? = null, + groupOfficersEdit: Boolean? = null, + userBlock: Boolean? = null, + userUnblock: Boolean? = null, + likeAdd: Boolean? = null, + likeRemove: Boolean? = null, + messageEvent: Boolean? = null, + donutSubscriptionCreate: Boolean? = null, + donutSubscriptionProlonged: Boolean? = null, + donutSubscriptionCancelled: Boolean? = null, + donutSubscriptionPriceChanged: Boolean? = null, + donutSubscriptionExpired: Boolean? = null, + donutMoneyWithdraw: Boolean? = null, + donutMoneyWithdrawError: Boolean? = null + ): VKRequest = NewApiRequest("groups.setLongPollSettings") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + enabled?.let { addParam("enabled", it) } + apiVersion?.let { addParam("api_version", it) } + messageNew?.let { addParam("message_new", it) } + messageReply?.let { addParam("message_reply", it) } + messageAllow?.let { addParam("message_allow", it) } + messageDeny?.let { addParam("message_deny", it) } + messageEdit?.let { addParam("message_edit", it) } + messageTypingState?.let { addParam("message_typing_state", it) } + photoNew?.let { addParam("photo_new", it) } + audioNew?.let { addParam("audio_new", it) } + videoNew?.let { addParam("video_new", it) } + wallReplyNew?.let { addParam("wall_reply_new", it) } + wallReplyEdit?.let { addParam("wall_reply_edit", it) } + wallReplyDelete?.let { addParam("wall_reply_delete", it) } + wallReplyRestore?.let { addParam("wall_reply_restore", it) } + wallPostNew?.let { addParam("wall_post_new", it) } + wallRepost?.let { addParam("wall_repost", it) } + boardPostNew?.let { addParam("board_post_new", it) } + boardPostEdit?.let { addParam("board_post_edit", it) } + boardPostRestore?.let { addParam("board_post_restore", it) } + boardPostDelete?.let { addParam("board_post_delete", it) } + photoCommentNew?.let { addParam("photo_comment_new", it) } + photoCommentEdit?.let { addParam("photo_comment_edit", it) } + photoCommentDelete?.let { addParam("photo_comment_delete", it) } + photoCommentRestore?.let { addParam("photo_comment_restore", it) } + videoCommentNew?.let { addParam("video_comment_new", it) } + videoCommentEdit?.let { addParam("video_comment_edit", it) } + videoCommentDelete?.let { addParam("video_comment_delete", it) } + videoCommentRestore?.let { addParam("video_comment_restore", it) } + marketCommentNew?.let { addParam("market_comment_new", it) } + marketCommentEdit?.let { addParam("market_comment_edit", it) } + marketCommentDelete?.let { addParam("market_comment_delete", it) } + marketCommentRestore?.let { addParam("market_comment_restore", it) } + pollVoteNew?.let { addParam("poll_vote_new", it) } + groupJoin?.let { addParam("group_join", it) } + groupLeave?.let { addParam("group_leave", it) } + groupChangeSettings?.let { addParam("group_change_settings", it) } + groupChangePhoto?.let { addParam("group_change_photo", it) } + groupOfficersEdit?.let { addParam("group_officers_edit", it) } + userBlock?.let { addParam("user_block", it) } + userUnblock?.let { addParam("user_unblock", it) } + likeAdd?.let { addParam("like_add", it) } + likeRemove?.let { addParam("like_remove", it) } + messageEvent?.let { addParam("message_event", it) } + donutSubscriptionCreate?.let { addParam("donut_subscription_create", it) } + donutSubscriptionProlonged?.let { addParam("donut_subscription_prolonged", it) } + donutSubscriptionCancelled?.let { addParam("donut_subscription_cancelled", it) } + donutSubscriptionPriceChanged?.let { addParam("donut_subscription_price_changed", it) } + donutSubscriptionExpired?.let { addParam("donut_subscription_expired", it) } + donutMoneyWithdraw?.let { addParam("donut_money_withdraw", it) } + donutMoneyWithdrawError?.let { addParam("donut_money_withdraw_error", it) } + } + + /** + * @param groupId + * @param messages + * @param botsCapabilities + * @param botsStartButton + * @param botsAddToChat + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsSetSettings( + groupId: Int, + messages: Boolean? = null, + botsCapabilities: Boolean? = null, + botsStartButton: Boolean? = null, + botsAddToChat: Boolean? = null + ): VKRequest = NewApiRequest("groups.setSettings") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + messages?.let { addParam("messages", it) } + botsCapabilities?.let { addParam("bots_capabilities", it) } + botsStartButton?.let { addParam("bots_start_button", it) } + botsAddToChat?.let { addParam("bots_add_to_chat", it) } + } + + /** + * In order to save note about group participant + * + * @param groupId + * @param userId + * @param note - Note body + * @return [VKRequest] with [BaseBoolInt] + */ + fun groupsSetUserNote( + groupId: Int, + userId: Int, + note: String? = null + ): VKRequest = NewApiRequest("groups.setUserNote") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("user_id", userId) + note?.let { addParam("note", it) } + } + + /** + * Add new group's tag + * + * @param groupId + * @param tagName + * @param tagColor + * @return [VKRequest] with [BaseBoolInt] + */ + fun groupsTagAdd( + groupId: Int, + tagName: String, + tagColor: TagColorParam? = null + ): VKRequest = NewApiRequest("groups.tagAdd") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("tag_name", tagName) + tagColor?.let { addParam("tag_color", it.value) } + } + + /** + * Bind or unbind group's tag to user + * + * @param groupId + * @param tagId + * @param userId + * @param act - Describe the action + * @return [VKRequest] with [BaseBoolInt] + */ + fun groupsTagBind( + groupId: Int, + tagId: Int, + userId: Int, + act: ActParam + ): VKRequest = NewApiRequest("groups.tagBind") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("tag_id", tagId) + addParam("user_id", userId) + addParam("act", act.value) + } + + /** + * Delete group's tag + * + * @param groupId + * @param tagId + * @return [VKRequest] with [BaseBoolInt] + */ + fun groupsTagDelete(groupId: Int, tagId: Int): VKRequest = + NewApiRequest("groups.tagDelete") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("tag_id", tagId) + } + + /** + * Update group's tag + * + * @param groupId + * @param tagId + * @param tagName + * @return [VKRequest] with [BaseBoolInt] + */ + fun groupsTagUpdate( + groupId: Int, + tagId: Int, + tagName: String + ): VKRequest = NewApiRequest("groups.tagUpdate") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("tag_id", tagId) + addParam("tag_name", tagName) + } + + /** + * @param groupId + * @param state + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsToggleMarket(groupId: Int, state: StateParam): VKRequest = + NewApiRequest("groups.toggleMarket") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("state", state.value) + } + + /** + * @param groupId + * @param ownerId + * @return [VKRequest] with [BaseOkResponse] + */ + fun groupsUnban(groupId: Int, ownerId: Int? = null): VKRequest = + NewApiRequest("groups.unban") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + ownerId?.let { addParam("owner_id", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/ActParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/ActParam.kt new file mode 100644 index 0000000000..b1252a1911 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/ActParam.kt @@ -0,0 +1,41 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class ActParam( + val value: String +) { + @SerializedName("bind") + BIND("bind"), + + @SerializedName("unbind") + UNBIND("unbind"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/AgeLimitsParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/AgeLimitsParam.kt new file mode 100644 index 0000000000..86923485fa --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/AgeLimitsParam.kt @@ -0,0 +1,44 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class AgeLimitsParam( + val value: Int +) { + @SerializedName("1") + ONE_(1), + + @SerializedName("2") + TWO_(2), + + @SerializedName("3") + THREE_(3); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/FilterParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/FilterParam.kt new file mode 100644 index 0000000000..31b5bad7d1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/FilterParam.kt @@ -0,0 +1,47 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FilterParam( + val value: String +) { + @SerializedName("friends") + FRIENDS("friends"), + + @SerializedName("unsure") + UNSURE("unsure"), + + @SerializedName("managers") + MANAGERS("managers"), + + @SerializedName("donut") + DONUT("donut"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddCallbackServerResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddCallbackServerResponse.kt new file mode 100644 index 0000000000..96a0a6b112 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddCallbackServerResponse.kt @@ -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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param serverId + */ +data class GroupsAddCallbackServerResponse( + @SerializedName("server_id") + val serverId: Int +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddress.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddress.kt index de4830a3ce..9765d59ae7 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddress.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddress.kt @@ -33,48 +33,51 @@ import kotlin.Int import kotlin.String /** - * @param id Address id - * @param additionalAddress Additional address to the place (6 floor, left door) - * @param address String address to the place (Nevsky, 28) - * @param cityId City id of address - * @param countryId Country id of address - * @param distance Distance from the point - * @param latitude Address latitude - * @param longitude Address longitude - * @param metroStationId Metro id of address - * @param phone Address phone - * @param timeOffset Time offset int minutes from utc time - * @param timetable Week timetable for the address - * @param title Title of the place (Zinger, etc) - * @param workInfoStatus Status of information about timetable + * @param id - Address id + * @param additionalAddress - Additional address to the place (6 floor, left door) + * @param address - String address to the place (Nevsky, 28) + * @param cityId - City id of address + * @param countryId - Country id of address + * @param distance - Distance from the point + * @param latitude - Address latitude + * @param longitude - Address longitude + * @param metroStationId - Metro id of address + * @param phone - Address phone + * @param timeOffset - Time offset int minutes from utc time + * @param timetable - Week timetable for the address + * @param title - Title of the place (Zinger, etc) + * @param workInfoStatus - Status of information about timetable + * @param placeId */ data class GroupsAddress( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="additional_address") + @SerializedName("additional_address") val additionalAddress: String? = null, - @SerializedName(value="address") + @SerializedName("address") val address: String? = null, - @SerializedName(value="city_id") + @SerializedName("city_id") val cityId: Int? = null, - @SerializedName(value="country_id") + @SerializedName("country_id") val countryId: Int? = null, - @SerializedName(value="distance") + @SerializedName("distance") val distance: Int? = null, - @SerializedName(value="latitude") + @SerializedName("latitude") val latitude: Float? = null, - @SerializedName(value="longitude") + @SerializedName("longitude") val longitude: Float? = null, - @SerializedName(value="metro_station_id") + @SerializedName("metro_station_id") val metroStationId: Int? = null, - @SerializedName(value="phone") + @SerializedName("phone") val phone: String? = null, - @SerializedName(value="time_offset") + @SerializedName("time_offset") val timeOffset: Int? = null, - @SerializedName(value="timetable") + @SerializedName("timetable") val timetable: GroupsAddressTimetable? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="work_info_status") - val workInfoStatus: GroupsAddressWorkInfoStatus? = null + @SerializedName("work_info_status") + val workInfoStatus: GroupsAddressWorkInfoStatus? = null, + @SerializedName("place_id") + val placeId: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressTimetable.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressTimetable.kt index 5372b02ccf..4c69752fce 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressTimetable.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressTimetable.kt @@ -30,27 +30,28 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName /** - * @param fri Timetable for friday - * @param mon Timetable for monday - * @param sat Timetable for saturday - * @param sun Timetable for sunday - * @param thu Timetable for thursday - * @param tue Timetable for tuesday - * @param wed Timetable for wednesday + * Timetable for a week + * @param fri - Timetable for friday + * @param mon - Timetable for monday + * @param sat - Timetable for saturday + * @param sun - Timetable for sunday + * @param thu - Timetable for thursday + * @param tue - Timetable for tuesday + * @param wed - Timetable for wednesday */ data class GroupsAddressTimetable( - @SerializedName(value="fri") + @SerializedName("fri") val fri: GroupsAddressTimetableDay? = null, - @SerializedName(value="mon") + @SerializedName("mon") val mon: GroupsAddressTimetableDay? = null, - @SerializedName(value="sat") + @SerializedName("sat") val sat: GroupsAddressTimetableDay? = null, - @SerializedName(value="sun") + @SerializedName("sun") val sun: GroupsAddressTimetableDay? = null, - @SerializedName(value="thu") + @SerializedName("thu") val thu: GroupsAddressTimetableDay? = null, - @SerializedName(value="tue") + @SerializedName("tue") val tue: GroupsAddressTimetableDay? = null, - @SerializedName(value="wed") + @SerializedName("wed") val wed: GroupsAddressTimetableDay? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressTimetableDay.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressTimetableDay.kt index 8aad184526..0749f8db79 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressTimetableDay.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressTimetableDay.kt @@ -31,18 +31,19 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param closeTime Close time in minutes - * @param openTime Open time in minutes - * @param breakCloseTime Close time of the break in minutes - * @param breakOpenTime Start time of the break in minutes + * Timetable for one day + * @param closeTime - Close time in minutes + * @param openTime - Open time in minutes + * @param breakCloseTime - Close time of the break in minutes + * @param breakOpenTime - Start time of the break in minutes */ data class GroupsAddressTimetableDay( - @SerializedName(value="close_time") + @SerializedName("close_time") val closeTime: Int, - @SerializedName(value="open_time") + @SerializedName("open_time") val openTime: Int, - @SerializedName(value="break_close_time") + @SerializedName("break_close_time") val breakCloseTime: Int? = null, - @SerializedName(value="break_open_time") + @SerializedName("break_open_time") val breakOpenTime: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressWorkInfoStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressWorkInfoStatus.kt index a7ce039fe1..a0da4f4da9 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressWorkInfoStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressWorkInfoStatus.kt @@ -27,47 +27,24 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class GroupsAddressWorkInfoStatus( val value: String ) { + @SerializedName("no_information") NO_INFORMATION("no_information"), + @SerializedName("temporarily_closed") TEMPORARILY_CLOSED("temporarily_closed"), + @SerializedName("always_opened") ALWAYS_OPENED("always_opened"), + @SerializedName("timetable") TIMETABLE("timetable"), + @SerializedName("forever_closed") FOREVER_CLOSED("forever_closed"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: GroupsAddressWorkInfoStatus?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsAddressWorkInfoStatus { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressesInfo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressesInfo.kt index 88659b5ff9..9a81dcf39b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressesInfo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddressesInfo.kt @@ -32,12 +32,12 @@ import kotlin.Boolean import kotlin.Int /** - * @param isEnabled Information whether addresses is enabled - * @param mainAddressId Main address id for group + * @param isEnabled - Information whether addresses is enabled + * @param mainAddressId - Main address id for group */ data class GroupsAddressesInfo( - @SerializedName(value="is_enabled") + @SerializedName("is_enabled") val isEnabled: Boolean, - @SerializedName(value="main_address_id") + @SerializedName("main_address_id") val mainAddressId: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBanInfo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBanInfo.kt index 71f05bf1a0..157ab8c60b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBanInfo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBanInfo.kt @@ -33,27 +33,27 @@ import kotlin.Int import kotlin.String /** - * @param adminId Administrator ID - * @param comment Comment for a ban - * @param commentVisible Show comment for user - * @param isClosed no description - * @param date Date when user has been added to blacklist in Unixtime - * @param endDate Date when user will be removed from blacklist in Unixtime - * @param reason no description + * @param adminId - Administrator ID + * @param comment - Comment for a ban + * @param commentVisible - Show comment for user + * @param isClosed + * @param date - Date when user has been added to blacklist in Unixtime + * @param endDate - Date when user will be removed from blacklist in Unixtime + * @param reason */ data class GroupsBanInfo( - @SerializedName(value="admin_id") + @SerializedName("admin_id") val adminId: Int? = null, - @SerializedName(value="comment") + @SerializedName("comment") val comment: String? = null, - @SerializedName(value="comment_visible") + @SerializedName("comment_visible") val commentVisible: Boolean? = null, - @SerializedName(value="is_closed") + @SerializedName("is_closed") val isClosed: Boolean? = null, - @SerializedName(value="date") + @SerializedName("date") val date: Int? = null, - @SerializedName(value="end_date") + @SerializedName("end_date") val endDate: Int? = null, - @SerializedName(value="reason") + @SerializedName("reason") val reason: GroupsBanInfoReason? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBanInfoReason.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBanInfoReason.kt index b71d379f77..cd764c6d7e 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBanInfoReason.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBanInfoReason.kt @@ -27,46 +27,24 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsBanInfoReason( val value: Int ) { + @SerializedName("0") OTHER(0), + @SerializedName("1") SPAM(1), + @SerializedName("2") VERBAL_ABUSE(2), + @SerializedName("3") STRONG_LANGUAGE(3), + @SerializedName("4") FLOOD(4); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsBanInfoReason?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsBanInfoReason { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBannedItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBannedItem.kt index 3dcfc4dab6..2e78ab1b80 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBannedItem.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsBannedItem.kt @@ -31,18 +31,18 @@ import com.google.gson.annotations.SerializedName import com.vk.sdk.api.users.dto.UsersUser /** - * @param banInfo no description - * @param group Information about group if type = group - * @param profile Information about group if type = profile - * @param type no description + * @param banInfo + * @param group - Information about group if type = group + * @param profile - Information about group if type = profile + * @param type */ data class GroupsBannedItem( - @SerializedName(value="ban_info") + @SerializedName("ban_info") val banInfo: GroupsBanInfo? = null, - @SerializedName(value="group") + @SerializedName("group") val group: GroupsGroup? = null, - @SerializedName(value="profile") + @SerializedName("profile") val profile: UsersUser? = null, - @SerializedName(value="type") + @SerializedName("type") val type: GroupsOwnerXtrBanInfoType? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCallbackServer.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCallbackServer.kt index bc58f99e99..9ba5c24e09 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCallbackServer.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCallbackServer.kt @@ -27,69 +27,45 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.Int import kotlin.String /** - * @param id no description - * @param title no description - * @param creatorId no description - * @param url no description - * @param secretKey no description - * @param status no description + * @param id + * @param title + * @param creatorId + * @param url + * @param secretKey + * @param status */ data class GroupsCallbackServer( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="creator_id") + @SerializedName("creator_id") val creatorId: Int, - @SerializedName(value="url") + @SerializedName("url") val url: String, - @SerializedName(value="secret_key") + @SerializedName("secret_key") val secretKey: String, - @SerializedName(value="status") - val status: Status + @SerializedName("status") + val status: GroupsCallbackServer.Status ) { enum class Status( val value: String ) { + @SerializedName("unconfigured") UNCONFIGURED("unconfigured"), + @SerializedName("failed") FAILED("failed"), + @SerializedName("wait") WAIT("wait"), + @SerializedName("ok") OK("ok"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Status?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Status { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCallbackSettings.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCallbackSettings.kt index c2a8aa29a7..9bc3d10627 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCallbackSettings.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCallbackSettings.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param apiVersion API version used for the events - * @param events no description + * @param apiVersion - API version used for the events + * @param events */ data class GroupsCallbackSettings( - @SerializedName(value="api_version") + @SerializedName("api_version") val apiVersion: String? = null, - @SerializedName(value="events") + @SerializedName("events") val events: GroupsLongPollEvents? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsContactsItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsContactsItem.kt index bc60481089..9991a9396d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsContactsItem.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsContactsItem.kt @@ -32,18 +32,18 @@ import kotlin.Int import kotlin.String /** - * @param userId User ID - * @param desc Contact description - * @param phone Contact phone - * @param email Contact email + * @param userId - User ID + * @param desc - Contact description + * @param phone - Contact phone + * @param email - Contact email */ data class GroupsContactsItem( - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int? = null, - @SerializedName(value="desc") + @SerializedName("desc") val desc: String? = null, - @SerializedName(value="phone") + @SerializedName("phone") val phone: String? = null, - @SerializedName(value="email") + @SerializedName("email") val email: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCountersGroup.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCountersGroup.kt index bb9dbf0d53..8c1c0aea53 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCountersGroup.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCountersGroup.kt @@ -31,33 +31,33 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param addresses Addresses number - * @param albums Photo albums number - * @param audios Audios number - * @param audioPlaylists Audio playlists number - * @param docs Docs number - * @param market Market items number - * @param photos Photos number - * @param topics Topics number - * @param videos Videos number + * @param addresses - Addresses number + * @param albums - Photo albums number + * @param audios - Audios number + * @param audioPlaylists - Audio playlists number + * @param docs - Docs number + * @param market - Market items number + * @param photos - Photos number + * @param topics - Topics number + * @param videos - Videos number */ data class GroupsCountersGroup( - @SerializedName(value="addresses") + @SerializedName("addresses") val addresses: Int? = null, - @SerializedName(value="albums") + @SerializedName("albums") val albums: Int? = null, - @SerializedName(value="audios") + @SerializedName("audios") val audios: Int? = null, - @SerializedName(value="audio_playlists") + @SerializedName("audio_playlists") val audioPlaylists: Int? = null, - @SerializedName(value="docs") + @SerializedName("docs") val docs: Int? = null, - @SerializedName(value="market") + @SerializedName("market") val market: Int? = null, - @SerializedName(value="photos") + @SerializedName("photos") val photos: Int? = null, - @SerializedName(value="topics") + @SerializedName("topics") val topics: Int? = null, - @SerializedName(value="videos") + @SerializedName("videos") val videos: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCover.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCover.kt index 5917d15414..cbd05f395f 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCover.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCover.kt @@ -33,12 +33,12 @@ import com.vk.sdk.api.base.dto.BaseImage import kotlin.collections.List /** - * @param enabled Information whether cover is enabled - * @param images no description + * @param enabled - Information whether cover is enabled + * @param images */ data class GroupsCover( - @SerializedName(value="enabled") + @SerializedName("enabled") val enabled: BaseBoolInt, - @SerializedName(value="images") + @SerializedName("images") val images: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFields.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFields.kt index 8255b63ac0..f0da8a57f4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFields.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFields.kt @@ -27,208 +27,282 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class GroupsFields( val value: String ) { + @SerializedName("market") MARKET("market"), + @SerializedName("market_services") MARKET_SERVICES("market_services"), + @SerializedName("member_status") MEMBER_STATUS("member_status"), + @SerializedName("is_favorite") IS_FAVORITE("is_favorite"), + @SerializedName("is_subscribed") IS_SUBSCRIBED("is_subscribed"), + @SerializedName("is_subscribed_podcasts") IS_SUBSCRIBED_PODCASTS("is_subscribed_podcasts"), + @SerializedName("can_subscribe_podcasts") CAN_SUBSCRIBE_PODCASTS("can_subscribe_podcasts"), + @SerializedName("city") CITY("city"), + @SerializedName("country") COUNTRY("country"), + @SerializedName("verified") VERIFIED("verified"), + @SerializedName("description") DESCRIPTION("description"), + @SerializedName("wiki_page") WIKI_PAGE("wiki_page"), + @SerializedName("members_count") MEMBERS_COUNT("members_count"), + @SerializedName("requests_count") REQUESTS_COUNT("requests_count"), + @SerializedName("counters") COUNTERS("counters"), + @SerializedName("cover") COVER("cover"), + @SerializedName("can_post") CAN_POST("can_post"), + @SerializedName("can_suggest") CAN_SUGGEST("can_suggest"), + @SerializedName("can_upload_story") CAN_UPLOAD_STORY("can_upload_story"), + @SerializedName("can_upload_doc") CAN_UPLOAD_DOC("can_upload_doc"), + @SerializedName("can_upload_video") CAN_UPLOAD_VIDEO("can_upload_video"), + @SerializedName("can_upload_clip") CAN_UPLOAD_CLIP("can_upload_clip"), + @SerializedName("can_see_all_posts") CAN_SEE_ALL_POSTS("can_see_all_posts"), + @SerializedName("can_create_topic") CAN_CREATE_TOPIC("can_create_topic"), + @SerializedName("crop_photo") + CROP_PHOTO("crop_photo"), + + @SerializedName("activity") ACTIVITY("activity"), + @SerializedName("fixed_post") FIXED_POST("fixed_post"), + @SerializedName("has_photo") HAS_PHOTO("has_photo"), + @SerializedName("status") STATUS("status"), + @SerializedName("main_album_id") MAIN_ALBUM_ID("main_album_id"), + @SerializedName("links") LINKS("links"), + @SerializedName("contacts") CONTACTS("contacts"), + @SerializedName("site") SITE("site"), + @SerializedName("main_section") MAIN_SECTION("main_section"), + @SerializedName("secondary_section") SECONDARY_SECTION("secondary_section"), + @SerializedName("wall") WALL("wall"), + @SerializedName("trending") TRENDING("trending"), + @SerializedName("had_torch") HAD_TORCH("had_torch"), + @SerializedName("can_message") CAN_MESSAGE("can_message"), + @SerializedName("is_market_cart_enabled") IS_MARKET_CART_ENABLED("is_market_cart_enabled"), + @SerializedName("is_messages_blocked") IS_MESSAGES_BLOCKED("is_messages_blocked"), + @SerializedName("can_send_notify") CAN_SEND_NOTIFY("can_send_notify"), + @SerializedName("has_group_channel") HAS_GROUP_CHANNEL("has_group_channel"), + @SerializedName("group_channel") GROUP_CHANNEL("group_channel"), + @SerializedName("online_status") ONLINE_STATUS("online_status"), + @SerializedName("start_date") START_DATE("start_date"), + @SerializedName("finish_date") FINISH_DATE("finish_date"), + @SerializedName("age_limits") AGE_LIMITS("age_limits"), + @SerializedName("ban_info") BAN_INFO("ban_info"), + @SerializedName("action_button") ACTION_BUTTON("action_button"), + @SerializedName("author_id") AUTHOR_ID("author_id"), + @SerializedName("phone") PHONE("phone"), + @SerializedName("has_market_app") HAS_MARKET_APP("has_market_app"), + @SerializedName("vkpay_can_transfer") VKPAY_CAN_TRANSFER("vkpay_can_transfer"), + @SerializedName("vkpay_receiver_id") VKPAY_RECEIVER_ID("vkpay_receiver_id"), + @SerializedName("using_vkpay_market_app") USING_VKPAY_MARKET_APP("using_vkpay_market_app"), + @SerializedName("addresses") ADDRESSES("addresses"), + @SerializedName("live_covers") LIVE_COVERS("live_covers"), + @SerializedName("is_adult") IS_ADULT("is_adult"), + @SerializedName("is_hidden_from_feed") + IS_HIDDEN_FROM_FEED("is_hidden_from_feed"), + + @SerializedName("can_subscribe_posts") CAN_SUBSCRIBE_POSTS("can_subscribe_posts"), + @SerializedName("create_date") CREATE_DATE("create_date"), + @SerializedName("menu") MENU("menu"), + @SerializedName("warning_notification") WARNING_NOTIFICATION("warning_notification"), + @SerializedName("donut") DONUT("donut"), + @SerializedName("donut_payment_info") DONUT_PAYMENT_INFO("donut_payment_info"), + @SerializedName("can_post_donut") CAN_POST_DONUT("can_post_donut"), + @SerializedName("can_see_members") CAN_SEE_MEMBERS("can_see_members"), + @SerializedName("msg_push_allowed") MSG_PUSH_ALLOWED("msg_push_allowed"), + @SerializedName("chats_status") CHATS_STATUS("chats_status"), + @SerializedName("can_report") CAN_REPORT("can_report"), + @SerializedName("has_suggestions") HAS_SUGGESTIONS("has_suggestions"), + @SerializedName("show_suggestions") SHOW_SUGGESTIONS("show_suggestions"), + @SerializedName("verification_end_time") VERIFICATION_END_TIME("verification_end_time"), + @SerializedName("can_manage") CAN_MANAGE("can_manage"), + @SerializedName("can_view_stats") CAN_VIEW_STATS("can_view_stats"), + @SerializedName("can_view_post_reach_stats") CAN_VIEW_POST_REACH_STATS("can_view_post_reach_stats"), + @SerializedName("stories_archive_count") STORIES_ARCHIVE_COUNT("stories_archive_count"), + @SerializedName("video_live_level") VIDEO_LIVE_LEVEL("video_live_level"), + @SerializedName("video_live_count") VIDEO_LIVE_COUNT("video_live_count"), + @SerializedName("clips_count") CLIPS_COUNT("clips_count"), + @SerializedName("microlanding") MICROLANDING("microlanding"), + @SerializedName("like") LIKE("like"), + @SerializedName("youla_status") YOULA_STATUS("youla_status"), + @SerializedName("youla_use_wallpost_redirect") + YOULA_USE_WALLPOST_REDIRECT("youla_use_wallpost_redirect"), + + @SerializedName("worki_use_wallpost_redirect") + WORKI_USE_WALLPOST_REDIRECT("worki_use_wallpost_redirect"), + + @SerializedName("is_business") IS_BUSINESS("is_business"), + @SerializedName("new_posts_count") NEW_POSTS_COUNT("new_posts_count"), + @SerializedName("textlive") TEXTLIVE("textlive"), - TEXTLIVES_COUNT("textlives_count"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsFields?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsFields { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } + @SerializedName("textlives_count") + TEXTLIVES_COUNT("textlives_count"), + + @SerializedName("friends") + FRIENDS("friends"); } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFilter.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFilter.kt index 6680bb9a60..7eca07a908 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFilter.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFilter.kt @@ -27,60 +27,45 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class GroupsFilter( val value: String ) { + @SerializedName("admin") ADMIN("admin"), + @SerializedName("editor") EDITOR("editor"), + @SerializedName("moder") MODER("moder"), + @SerializedName("advertiser") ADVERTISER("advertiser"), + @SerializedName("enabled_notifications") ENABLED_NOTIFICATIONS("enabled_notifications"), + @SerializedName("can_enable_notifications") CAN_ENABLE_NOTIFICATIONS("can_enable_notifications"), + @SerializedName("stories_not_pinned") STORIES_NOT_PINNED("stories_not_pinned"), + @SerializedName("groups") GROUPS("groups"), + @SerializedName("publics") PUBLICS("publics"), + @SerializedName("events") EVENTS("events"), + @SerializedName("has_addresses") HAS_ADDRESSES("has_addresses"), + @SerializedName("can_post_clips") CAN_POST_CLIPS("can_post_clips"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsFilter?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsFilter { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetAddressesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetAddressesResponse.kt new file mode 100644 index 0000000000..b8a43c4e16 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetAddressesResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total count of addresses + * @param items + */ +data class GroupsGetAddressesResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetBannedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetBannedResponse.kt new file mode 100644 index 0000000000..1fe6280aca --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetBannedResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total users number + * @param items + */ +data class GroupsGetBannedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetByIdResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetByIdResponse.kt new file mode 100644 index 0000000000..1b565e7da1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetByIdResponse.kt @@ -0,0 +1,42 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.collections.List + +/** + * @param groups + * @param profiles + */ +data class GroupsGetByIdResponse( + @SerializedName("groups") + val groups: List? = null, + @SerializedName("profiles") + val profiles: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCallbackConfirmationCodeResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCallbackConfirmationCodeResponse.kt new file mode 100644 index 0000000000..20a18a9b96 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCallbackConfirmationCodeResponse.kt @@ -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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param code - Confirmation code + */ +data class GroupsGetCallbackConfirmationCodeResponse( + @SerializedName("code") + val code: String +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCallbackServersResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCallbackServersResponse.kt new file mode 100644 index 0000000000..3b153ed58a --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCallbackServersResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count + * @param items + */ +data class GroupsGetCallbackServersResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCatalogInfoExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCatalogInfoExtendedResponse.kt new file mode 100644 index 0000000000..ba52cb8ae0 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCatalogInfoExtendedResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseBoolInt +import kotlin.collections.List + +/** + * @param enabled - Information whether catalog is enabled for current user + * @param categories + */ +data class GroupsGetCatalogInfoExtendedResponse( + @SerializedName("enabled") + val enabled: BaseBoolInt, + @SerializedName("categories") + val categories: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCatalogInfoResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCatalogInfoResponse.kt new file mode 100644 index 0000000000..db2ff80102 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCatalogInfoResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseBoolInt +import kotlin.collections.List + +/** + * @param enabled - Information whether catalog is enabled for current user + * @param categories + */ +data class GroupsGetCatalogInfoResponse( + @SerializedName("enabled") + val enabled: BaseBoolInt, + @SerializedName("categories") + val categories: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCatalogResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCatalogResponse.kt new file mode 100644 index 0000000000..5534f6edff --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetCatalogResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total communities number + * @param items + */ +data class GroupsGetCatalogResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetExtendedResponse.kt new file mode 100644 index 0000000000..a72cfad670 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetExtendedResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total communities number + * @param items + */ +data class GroupsGetExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitedUsersResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitedUsersResponse.kt new file mode 100644 index 0000000000..e43334766c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitedUsersResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total communities number + * @param items + */ +data class GroupsGetInvitedUsersResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitesExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitesExtendedResponse.kt new file mode 100644 index 0000000000..fdec200fa3 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitesExtendedResponse.kt @@ -0,0 +1,50 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserMin +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total communities number + * @param items + * @param profiles + * @param groups + */ +data class GroupsGetInvitesExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List, + @SerializedName("groups") + val groups: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitesResponse.kt new file mode 100644 index 0000000000..19a9e2b73d --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitesResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total communities number + * @param items + */ +data class GroupsGetInvitesResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetMembersFieldsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetMembersFieldsResponse.kt new file mode 100644 index 0000000000..6139d5ae18 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetMembersFieldsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total members number + * @param items + */ +data class GroupsGetMembersFieldsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetRequestsFieldsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetRequestsFieldsResponse.kt new file mode 100644 index 0000000000..198f926579 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetRequestsFieldsResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total communities number + * @param items + */ +data class GroupsGetRequestsFieldsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetResponse.kt new file mode 100644 index 0000000000..aea1a841e3 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total communities number + * @param items + */ +data class GroupsGetResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetSettingsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetSettingsResponse.kt new file mode 100644 index 0000000000..e477493013 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetSettingsResponse.kt @@ -0,0 +1,162 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseBoolInt +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +/** + * @param audio - Audio settings + * @param articles - Articles settings + * @param cityId - City id of group + * @param countryId - Country id of group + * @param description - Community description + * @param docs - Docs settings + * @param obsceneFilter - Information whether the obscene filter is enabled + * @param obsceneStopwords - Information whether the stop words filter is enabled + * @param obsceneWords - The list of stop words + * @param photos - Photos settings + * @param title - Community title + * @param topics - Topics settings + * @param video - Video settings + * @param wall - Wall settings + * @param wiki - Wiki settings + * @param access - Community access settings + * @param address - Community's page domain + * @param recognizePhoto - Photo suggests setting + * @param contacts + * @param links + * @param sectionsList + * @param mainSection + * @param secondarySection + * @param ageLimits + * @param events + * @param eventGroupId + * @param publicCategory - Information about the group category + * @param publicCategoryList + * @param publicDate + * @param publicDateLabel + * @param publicSubcategory - Information about the group subcategory + * @param rss - URL of the RSS feed + * @param startDate - Start date + * @param finishDate - Finish date in Unix-time format + * @param subject - Community subject ID + * @param subjectList + * @param suggestedPrivacy + * @param twitter + * @param website - Community website + * @param phone - Community phone + * @param email - Community email + */ +data class GroupsGetSettingsResponse( + @SerializedName("audio") + val audio: GroupsGroupAudio, + @SerializedName("articles") + val articles: Int, + @SerializedName("city_id") + val cityId: Int, + @SerializedName("country_id") + val countryId: Int, + @SerializedName("description") + val description: String, + @SerializedName("docs") + val docs: GroupsGroupDocs, + @SerializedName("obscene_filter") + val obsceneFilter: BaseBoolInt, + @SerializedName("obscene_stopwords") + val obsceneStopwords: BaseBoolInt, + @SerializedName("obscene_words") + val obsceneWords: List, + @SerializedName("photos") + val photos: GroupsGroupPhotos, + @SerializedName("title") + val title: String, + @SerializedName("topics") + val topics: GroupsGroupTopics, + @SerializedName("video") + val video: GroupsGroupVideo, + @SerializedName("wall") + val wall: GroupsGroupWall, + @SerializedName("wiki") + val wiki: GroupsGroupWiki, + @SerializedName("access") + val access: GroupsGroupAccess? = null, + @SerializedName("address") + val address: String? = null, + @SerializedName("recognize_photo") + val recognizePhoto: Int? = null, + @SerializedName("contacts") + val contacts: BaseBoolInt? = null, + @SerializedName("links") + val links: BaseBoolInt? = null, + @SerializedName("sections_list") + val sectionsList: List? = null, + @SerializedName("main_section") + val mainSection: GroupsGroupFullMainSection? = null, + @SerializedName("secondary_section") + val secondarySection: Int? = null, + @SerializedName("age_limits") + val ageLimits: GroupsGroupAgeLimits? = null, + @SerializedName("events") + val events: BaseBoolInt? = null, + @SerializedName("event_group_id") + val eventGroupId: Int? = null, + @SerializedName("public_category") + val publicCategory: Int? = null, + @SerializedName("public_category_list") + val publicCategoryList: List? = null, + @SerializedName("public_date") + val publicDate: String? = null, + @SerializedName("public_date_label") + val publicDateLabel: String? = null, + @SerializedName("public_subcategory") + val publicSubcategory: Int? = null, + @SerializedName("rss") + val rss: String? = null, + @SerializedName("start_date") + val startDate: Int? = null, + @SerializedName("finish_date") + val finishDate: Int? = null, + @SerializedName("subject") + val subject: Int? = null, + @SerializedName("subject_list") + val subjectList: List? = null, + @SerializedName("suggested_privacy") + val suggestedPrivacy: GroupsGroupSuggestedPrivacy? = null, + @SerializedName("twitter") + val twitter: GroupsSettingsTwitter? = null, + @SerializedName("website") + val website: String? = null, + @SerializedName("phone") + val phone: String? = null, + @SerializedName("email") + val email: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetTokenPermissionsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetTokenPermissionsResponse.kt new file mode 100644 index 0000000000..c99a907914 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetTokenPermissionsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param mask + * @param permissions + */ +data class GroupsGetTokenPermissionsResponse( + @SerializedName("mask") + val mask: Int, + @SerializedName("permissions") + val permissions: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroup.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroup.kt index acbf4360ff..4bcc73dec0 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroup.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroup.kt @@ -33,51 +33,51 @@ import kotlin.Int import kotlin.String /** - * @param id Community ID - * @param name Community name - * @param screenName Domain of the community page - * @param isClosed no description - * @param type no description - * @param isAdmin Information whether current user is administrator - * @param adminLevel no description - * @param isMember Information whether current user is member - * @param isAdvertiser Information whether current user is advertiser - * @param startDate Start date in Unixtime format - * @param finishDate Finish date in Unixtime format - * @param deactivated Information whether community is banned - * @param photo50 URL of square photo of the community with 50 pixels in width - * @param photo100 URL of square photo of the community with 100 pixels in width - * @param photo200 URL of square photo of the community with 200 pixels in width + * @param id - Community ID + * @param name - Community name + * @param screenName - Domain of the community page + * @param isClosed + * @param type + * @param isAdmin - Information whether current user is administrator + * @param adminLevel + * @param isMember - Information whether current user is member + * @param isAdvertiser - Information whether current user is advertiser + * @param startDate - Start date in Unixtime format + * @param finishDate - Finish date in Unixtime format + * @param deactivated - Information whether community is banned + * @param photo50 - URL of square photo of the community with 50 pixels in width + * @param photo100 - URL of square photo of the community with 100 pixels in width + * @param photo200 - URL of square photo of the community with 200 pixels in width */ data class GroupsGroup( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="screen_name") + @SerializedName("screen_name") val screenName: String, - @SerializedName(value="is_closed") + @SerializedName("is_closed") val isClosed: GroupsGroupIsClosed, - @SerializedName(value="type") + @SerializedName("type") val type: GroupsGroupType? = null, - @SerializedName(value="is_admin") + @SerializedName("is_admin") val isAdmin: BaseBoolInt? = null, - @SerializedName(value="admin_level") + @SerializedName("admin_level") val adminLevel: GroupsGroupAdminLevel? = null, - @SerializedName(value="is_member") + @SerializedName("is_member") val isMember: BaseBoolInt? = null, - @SerializedName(value="is_advertiser") + @SerializedName("is_advertiser") val isAdvertiser: BaseBoolInt? = null, - @SerializedName(value="start_date") + @SerializedName("start_date") val startDate: Int? = null, - @SerializedName(value="finish_date") + @SerializedName("finish_date") val finishDate: Int? = null, - @SerializedName(value="deactivated") + @SerializedName("deactivated") val deactivated: String? = null, - @SerializedName(value="photo_50") + @SerializedName("photo_50") val photo50: String? = null, - @SerializedName(value="photo_100") + @SerializedName("photo_100") val photo100: String? = null, - @SerializedName(value="photo_200") + @SerializedName("photo_200") val photo200: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAccess.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAccess.kt index 0ed517bd73..51c218ca53 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAccess.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAccess.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupAccess( val value: Int ) { + @SerializedName("0") OPEN(0), + @SerializedName("1") CLOSED(1), + @SerializedName("2") PRIVATE(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupAccess?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupAccess { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAdminLevel.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAdminLevel.kt index 154240361b..d720ece047 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAdminLevel.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAdminLevel.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupAdminLevel( val value: Int ) { + @SerializedName("1") MODERATOR(1), + @SerializedName("2") EDITOR(2), + @SerializedName("3") ADMINISTRATOR(3); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: GroupsGroupAdminLevel?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupAdminLevel { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAgeLimits.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAgeLimits.kt index 9b6dae2793..cd1c31f6af 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAgeLimits.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAgeLimits.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupAgeLimits( val value: Int ) { + @SerializedName("1") UNLIMITED(1), + @SerializedName("2") SIXTEEN__PLUS(2), + @SerializedName("3") EIGHTEEN__PLUS(3); - - class Serializer : JsonSerializer, JsonDeserializer - { - override fun serialize( - src: GroupsGroupAgeLimits?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupAgeLimits { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAttach.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAttach.kt index 4bc7b884e5..ebeff3eda2 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAttach.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAttach.kt @@ -33,21 +33,21 @@ import kotlin.Int import kotlin.String /** - * @param id group ID - * @param text text of attach - * @param status activity or category of group - * @param size size of group - * @param isFavorite is favorite + * @param id - group ID + * @param text - text of attach + * @param status - activity or category of group + * @param size - size of group + * @param isFavorite - is favorite */ data class GroupsGroupAttach( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="text") + @SerializedName("text") val text: String, - @SerializedName(value="status") + @SerializedName("status") val status: String, - @SerializedName(value="size") + @SerializedName("size") val size: Int, - @SerializedName(value="is_favorite") + @SerializedName("is_favorite") val isFavorite: Boolean ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAudio.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAudio.kt index 47418d5caf..5cfca249d0 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAudio.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupAudio.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupAudio( val value: Int ) { + @SerializedName("0") DISABLED(0), + @SerializedName("1") OPEN(1), + @SerializedName("2") LIMITED(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupAudio?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupAudio { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupBanInfo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupBanInfo.kt index c01af2dd04..af1e950205 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupBanInfo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupBanInfo.kt @@ -32,15 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param comment Ban comment - * @param endDate End date of ban in Unixtime - * @param reason no description + * @param comment - Ban comment + * @param endDate - End date of ban in Unixtime + * @param reason */ data class GroupsGroupBanInfo( - @SerializedName(value="comment") + @SerializedName("comment") val comment: String? = null, - @SerializedName(value="end_date") + @SerializedName("end_date") val endDate: Int? = null, - @SerializedName(value="reason") + @SerializedName("reason") val reason: GroupsBanInfoReason? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategory.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategory.kt index dadf90f328..c598e94002 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategory.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategory.kt @@ -34,15 +34,15 @@ import kotlin.String import kotlin.collections.List /** - * @param id Category ID - * @param name Category name - * @param subcategories no description + * @param id - Category ID + * @param name - Category name + * @param subcategories */ data class GroupsGroupCategory( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="subcategories") + @SerializedName("subcategories") val subcategories: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategoryFull.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategoryFull.kt index 92b82dee43..c8f1cc8a6d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategoryFull.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategoryFull.kt @@ -33,21 +33,21 @@ import kotlin.String import kotlin.collections.List /** - * @param id Category ID - * @param name Category name - * @param pageCount Pages number - * @param pagePreviews no description - * @param subcategories no description + * @param id - Category ID + * @param name - Category name + * @param pageCount - Pages number + * @param pagePreviews + * @param subcategories */ data class GroupsGroupCategoryFull( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="page_count") + @SerializedName("page_count") val pageCount: Int, - @SerializedName(value="page_previews") + @SerializedName("page_previews") val pagePreviews: List, - @SerializedName(value="subcategories") + @SerializedName("subcategories") val subcategories: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategoryType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategoryType.kt index daedd7c16b..11d5d86c76 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategoryType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupCategoryType.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id no description - * @param name no description + * @param id + * @param name */ data class GroupsGroupCategoryType( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupDocs.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupDocs.kt index 395bdce8df..c762543bfd 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupDocs.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupDocs.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupDocs( val value: Int ) { + @SerializedName("0") DISABLED(0), + @SerializedName("1") OPEN(1), + @SerializedName("2") LIMITED(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupDocs?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupDocs { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFull.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFull.kt index 849fd1029c..cadc8d51f6 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFull.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFull.kt @@ -27,270 +27,252 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName import com.vk.sdk.api.audio.dto.AudioAudio import com.vk.sdk.api.base.dto.BaseBoolInt import com.vk.sdk.api.base.dto.BaseCountry import com.vk.sdk.api.base.dto.BaseCropPhoto import com.vk.sdk.api.base.dto.BaseObject -import java.lang.reflect.Type import kotlin.Boolean import kotlin.Int import kotlin.String import kotlin.collections.List /** - * @param market no description - * @param memberStatus Current user's member status - * @param isAdult Information whether community is adult - * @param isHiddenFromFeed Information whether community is hidden from current user's newsfeed - * @param isFavorite Information whether community is in faves - * @param isSubscribed Information whether current user is subscribed - * @param city no description - * @param country no description - * @param verified Information whether community is verified - * @param description Community description - * @param wikiPage Community's main wiki page title - * @param membersCount Community members number - * @param requestsCount The number of incoming requests to the community - * @param videoLiveLevel Community level live streams achievements - * @param videoLiveCount Number of community's live streams - * @param clipsCount Number of community's clips - * @param counters no description - * @param cover no description - * @param canPost Information whether current user can post on community's wall - * @param canSuggest no description - * @param canUploadStory Information whether current user can upload story - * @param canUploadDoc Information whether current user can upload doc - * @param canUploadVideo Information whether current user can upload video - * @param canSeeAllPosts Information whether current user can see all posts on community's wall - * @param canCreateTopic Information whether current user can create topic - * @param activity Type of group, start date of event or category of public page - * @param fixedPost Fixed post ID - * @param hasPhoto Information whether community has photo + * @param market + * @param memberStatus - Current user's member status + * @param isAdult - Information whether community is adult + * @param isHiddenFromFeed - Information whether community is hidden from current user's newsfeed + * @param isFavorite - Information whether community is in faves + * @param isSubscribed - Information whether current user is subscribed + * @param city + * @param country + * @param verified - Information whether community is verified + * @param description - Community description + * @param wikiPage - Community's main wiki page title + * @param membersCount - Community members number + * @param requestsCount - The number of incoming requests to the community + * @param videoLiveLevel - Community level live streams achievements + * @param videoLiveCount - Number of community's live streams + * @param clipsCount - Number of community's clips + * @param counters + * @param textlivesCount - Textlives number + * @param cover + * @param canPost - Information whether current user can post on community's wall + * @param canSuggest + * @param canUploadStory - Information whether current user can upload story + * @param canUploadDoc - Information whether current user can upload doc + * @param canUploadVideo - Information whether current user can upload video + * @param canUploadClip - Information whether current user can upload clip + * @param canSeeAllPosts - Information whether current user can see all posts on community's wall + * @param canCreateTopic - Information whether current user can create topic + * @param activity - Type of group, start date of event or category of public page + * @param fixedPost - Fixed post ID + * @param hasPhoto - Information whether community has photo * @param - * cropPhoto ------ - ------, -- ------- -------- ---------- - ----------- ---------- ---------- - * @param status Community status - * @param statusAudio no description - * @param mainAlbumId Community's main photo album ID - * @param links no description - * @param contacts no description - * @param wall Information about wall status in community - * @param site Community's website - * @param mainSection no description - * @param secondarySection no description - * @param trending Information whether the community has a "fire" pictogram. - * @param canMessage Information whether current user can send a message to community - * @param isMessagesBlocked Information whether community can send a message to current user - * @param canSendNotify Information whether community can send notifications by phone number to + * cropPhoto - ------ - ------, -- ------- -------- ---------- - ----------- ---------- ---------- + * @param status - Community status + * @param statusAudio + * @param mainAlbumId - Community's main photo album ID + * @param links + * @param contacts + * @param wall - Information about wall status in community + * @param site - Community's website + * @param mainSection + * @param secondarySection + * @param trending - Information whether the community has a "fire" pictogram. + * @param canMessage - Information whether current user can send a message to community + * @param isMessagesBlocked - Information whether community can send a message to current user + * @param canSendNotify - Information whether community can send notifications by phone number to * current user - * @param onlineStatus Status of replies in community messages - * @param invitedBy Inviter ID - * @param ageLimits Information whether age limit - * @param banInfo User ban info - * @param hasMarketApp Information whether community has installed market app - * @param usingVkpayMarketApp no description - * @param hasGroupChannel no description - * @param addresses Info about addresses in groups - * @param isSubscribedPodcasts Information whether current user is subscribed to podcasts - * @param canSubscribePodcasts Owner in whitelist or not - * @param canSubscribePosts Can subscribe to wall - * @param liveCovers Live covers state - * @param storiesArchiveCount no description - * @param id Community ID - * @param name Community name - * @param screenName Domain of the community page - * @param isClosed no description - * @param type no description - * @param isAdmin Information whether current user is administrator - * @param adminLevel no description - * @param isMember Information whether current user is member - * @param isAdvertiser Information whether current user is advertiser - * @param startDate Start date in Unixtime format - * @param finishDate Finish date in Unixtime format - * @param deactivated Information whether community is banned - * @param photo50 URL of square photo of the community with 50 pixels in width - * @param photo100 URL of square photo of the community with 100 pixels in width - * @param photo200 URL of square photo of the community with 200 pixels in width + * @param onlineStatus - Status of replies in community messages + * @param invitedBy - Inviter ID + * @param ageLimits - Information whether age limit + * @param banInfo - User ban info + * @param hasMarketApp - Information whether community has installed market app + * @param usingVkpayMarketApp + * @param hasGroupChannel + * @param addresses - Info about addresses in groups + * @param isSubscribedPodcasts - Information whether current user is subscribed to podcasts + * @param canSubscribePodcasts - Owner in whitelist or not + * @param canSubscribePosts - Can subscribe to wall + * @param liveCovers - Live covers state + * @param storiesArchiveCount + * @param id - Community ID + * @param name - Community name + * @param screenName - Domain of the community page + * @param isClosed + * @param type + * @param isAdmin - Information whether current user is administrator + * @param adminLevel + * @param isMember - Information whether current user is member + * @param isAdvertiser - Information whether current user is advertiser + * @param startDate - Start date in Unixtime format + * @param finishDate - Finish date in Unixtime format + * @param deactivated - Information whether community is banned + * @param photo50 - URL of square photo of the community with 50 pixels in width + * @param photo100 - URL of square photo of the community with 100 pixels in width + * @param photo200 - URL of square photo of the community with 200 pixels in width */ data class GroupsGroupFull( - @SerializedName(value="market") + @SerializedName("market") val market: GroupsMarketInfo? = null, - @SerializedName(value="member_status") + @SerializedName("member_status") val memberStatus: GroupsGroupFullMemberStatus? = null, - @SerializedName(value="is_adult") + @SerializedName("is_adult") val isAdult: BaseBoolInt? = null, - @SerializedName(value="is_hidden_from_feed") + @SerializedName("is_hidden_from_feed") val isHiddenFromFeed: BaseBoolInt? = null, - @SerializedName(value="is_favorite") + @SerializedName("is_favorite") val isFavorite: BaseBoolInt? = null, - @SerializedName(value="is_subscribed") + @SerializedName("is_subscribed") val isSubscribed: BaseBoolInt? = null, - @SerializedName(value="city") + @SerializedName("city") val city: BaseObject? = null, - @SerializedName(value="country") + @SerializedName("country") val country: BaseCountry? = null, - @SerializedName(value="verified") + @SerializedName("verified") val verified: BaseBoolInt? = null, - @SerializedName(value="description") + @SerializedName("description") val description: String? = null, - @SerializedName(value="wiki_page") + @SerializedName("wiki_page") val wikiPage: String? = null, - @SerializedName(value="members_count") + @SerializedName("members_count") val membersCount: Int? = null, - @SerializedName(value="requests_count") + @SerializedName("requests_count") val requestsCount: Int? = null, - @SerializedName(value="video_live_level") + @SerializedName("video_live_level") val videoLiveLevel: Int? = null, - @SerializedName(value="video_live_count") + @SerializedName("video_live_count") val videoLiveCount: Int? = null, - @SerializedName(value="clips_count") + @SerializedName("clips_count") val clipsCount: Int? = null, - @SerializedName(value="counters") + @SerializedName("counters") val counters: GroupsCountersGroup? = null, - @SerializedName(value="cover") + @SerializedName("textlives_count") + val textlivesCount: Int? = null, + @SerializedName("cover") val cover: GroupsCover? = null, - @SerializedName(value="can_post") + @SerializedName("can_post") val canPost: BaseBoolInt? = null, - @SerializedName(value="can_suggest") + @SerializedName("can_suggest") val canSuggest: BaseBoolInt? = null, - @SerializedName(value="can_upload_story") + @SerializedName("can_upload_story") val canUploadStory: BaseBoolInt? = null, - @SerializedName(value="can_upload_doc") + @SerializedName("can_upload_doc") val canUploadDoc: BaseBoolInt? = null, - @SerializedName(value="can_upload_video") + @SerializedName("can_upload_video") val canUploadVideo: BaseBoolInt? = null, - @SerializedName(value="can_see_all_posts") + @SerializedName("can_upload_clip") + val canUploadClip: BaseBoolInt? = null, + @SerializedName("can_see_all_posts") val canSeeAllPosts: BaseBoolInt? = null, - @SerializedName(value="can_create_topic") + @SerializedName("can_create_topic") val canCreateTopic: BaseBoolInt? = null, - @SerializedName(value="activity") + @SerializedName("activity") val activity: String? = null, - @SerializedName(value="fixed_post") + @SerializedName("fixed_post") val fixedPost: Int? = null, - @SerializedName(value="has_photo") + @SerializedName("has_photo") val hasPhoto: BaseBoolInt? = null, - @SerializedName(value="crop_photo") + @SerializedName("crop_photo") val cropPhoto: BaseCropPhoto? = null, - @SerializedName(value="status") + @SerializedName("status") val status: String? = null, - @SerializedName(value="status_audio") + @SerializedName("status_audio") val statusAudio: AudioAudio? = null, - @SerializedName(value="main_album_id") + @SerializedName("main_album_id") val mainAlbumId: Int? = null, - @SerializedName(value="links") + @SerializedName("links") val links: List? = null, - @SerializedName(value="contacts") + @SerializedName("contacts") val contacts: List? = null, - @SerializedName(value="wall") - val wall: Wall? = null, - @SerializedName(value="site") + @SerializedName("wall") + val wall: GroupsGroupFull.Wall? = null, + @SerializedName("site") val site: String? = null, - @SerializedName(value="main_section") + @SerializedName("main_section") val mainSection: GroupsGroupFullMainSection? = null, - @SerializedName(value="secondary_section") + @SerializedName("secondary_section") val secondarySection: Int? = null, - @SerializedName(value="trending") + @SerializedName("trending") val trending: BaseBoolInt? = null, - @SerializedName(value="can_message") + @SerializedName("can_message") val canMessage: BaseBoolInt? = null, - @SerializedName(value="is_messages_blocked") + @SerializedName("is_messages_blocked") val isMessagesBlocked: BaseBoolInt? = null, - @SerializedName(value="can_send_notify") + @SerializedName("can_send_notify") val canSendNotify: BaseBoolInt? = null, - @SerializedName(value="online_status") + @SerializedName("online_status") val onlineStatus: GroupsOnlineStatus? = null, - @SerializedName(value="invited_by") + @SerializedName("invited_by") val invitedBy: Int? = null, - @SerializedName(value="age_limits") + @SerializedName("age_limits") val ageLimits: GroupsGroupFullAgeLimits? = null, - @SerializedName(value="ban_info") + @SerializedName("ban_info") val banInfo: GroupsGroupBanInfo? = null, - @SerializedName(value="has_market_app") + @SerializedName("has_market_app") val hasMarketApp: Boolean? = null, - @SerializedName(value="using_vkpay_market_app") + @SerializedName("using_vkpay_market_app") val usingVkpayMarketApp: Boolean? = null, - @SerializedName(value="has_group_channel") + @SerializedName("has_group_channel") val hasGroupChannel: Boolean? = null, - @SerializedName(value="addresses") + @SerializedName("addresses") val addresses: GroupsAddressesInfo? = null, - @SerializedName(value="is_subscribed_podcasts") + @SerializedName("is_subscribed_podcasts") val isSubscribedPodcasts: Boolean? = null, - @SerializedName(value="can_subscribe_podcasts") + @SerializedName("can_subscribe_podcasts") val canSubscribePodcasts: Boolean? = null, - @SerializedName(value="can_subscribe_posts") + @SerializedName("can_subscribe_posts") val canSubscribePosts: Boolean? = null, - @SerializedName(value="live_covers") + @SerializedName("live_covers") val liveCovers: GroupsLiveCovers? = null, - @SerializedName(value="stories_archive_count") + @SerializedName("stories_archive_count") val storiesArchiveCount: Int? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="name") + @SerializedName("name") val name: String? = null, - @SerializedName(value="screen_name") + @SerializedName("screen_name") val screenName: String? = null, - @SerializedName(value="is_closed") + @SerializedName("is_closed") val isClosed: GroupsGroupIsClosed? = null, - @SerializedName(value="type") + @SerializedName("type") val type: GroupsGroupType? = null, - @SerializedName(value="is_admin") + @SerializedName("is_admin") val isAdmin: BaseBoolInt? = null, - @SerializedName(value="admin_level") + @SerializedName("admin_level") val adminLevel: GroupsGroupAdminLevel? = null, - @SerializedName(value="is_member") + @SerializedName("is_member") val isMember: BaseBoolInt? = null, - @SerializedName(value="is_advertiser") + @SerializedName("is_advertiser") val isAdvertiser: BaseBoolInt? = null, - @SerializedName(value="start_date") + @SerializedName("start_date") val startDate: Int? = null, - @SerializedName(value="finish_date") + @SerializedName("finish_date") val finishDate: Int? = null, - @SerializedName(value="deactivated") + @SerializedName("deactivated") val deactivated: String? = null, - @SerializedName(value="photo_50") + @SerializedName("photo_50") val photo50: String? = null, - @SerializedName(value="photo_100") + @SerializedName("photo_100") val photo100: String? = null, - @SerializedName(value="photo_200") + @SerializedName("photo_200") val photo200: String? = null ) { enum class Wall( val value: Int ) { + @SerializedName("0") DISABLED(0), + @SerializedName("1") OPEN(1), + @SerializedName("2") LIMITED(2), + @SerializedName("3") RESTRICTED(3); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Wall?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Wall { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullAgeLimits.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullAgeLimits.kt index 6e942dc573..b62c6d9b08 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullAgeLimits.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullAgeLimits.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupFullAgeLimits( val value: Int ) { + @SerializedName("1") NO(1), + @SerializedName("2") OVER_16(2), + @SerializedName("3") OVER_18(3); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: GroupsGroupFullAgeLimits?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupFullAgeLimits { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullMainSection.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullMainSection.kt index 5459158230..966c914e2f 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullMainSection.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullMainSection.kt @@ -27,49 +27,27 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupFullMainSection( val value: Int ) { + @SerializedName("0") ABSENT(0), + @SerializedName("1") PHOTOS(1), + @SerializedName("2") TOPICS(2), + @SerializedName("3") AUDIO(3), + @SerializedName("4") VIDEO(4), + @SerializedName("5") MARKET(5); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: GroupsGroupFullMainSection?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupFullMainSection { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullMemberStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullMemberStatus.kt index 976e2b7e22..24d7e76aea 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullMemberStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullMemberStatus.kt @@ -27,49 +27,27 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupFullMemberStatus( val value: Int ) { + @SerializedName("0") NOT_A_MEMBER(0), + @SerializedName("1") MEMBER(1), + @SerializedName("2") NOT_SURE(2), + @SerializedName("3") DECLINED(3), + @SerializedName("4") HAS_SENT_A_REQUEST(4), + @SerializedName("5") INVITED(5); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: GroupsGroupFullMemberStatus?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupFullMemberStatus { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupIsClosed.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupIsClosed.kt index cbb4459409..920e743532 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupIsClosed.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupIsClosed.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupIsClosed( val value: Int ) { + @SerializedName("0") OPEN(0), + @SerializedName("1") CLOSED(1), + @SerializedName("2") PRIVATE(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupIsClosed?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupIsClosed { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupLink.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupLink.kt index 9bd88490de..c2edb4e98b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupLink.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupLink.kt @@ -33,24 +33,24 @@ import kotlin.Int import kotlin.String /** - * @param name Link label - * @param desc Link description - * @param editTitle Information whether the title can be edited - * @param id Link ID - * @param imageProcessing Information whether the image on processing - * @param url Link URL + * @param name - Link label + * @param desc - Link description + * @param editTitle - Information whether the title can be edited + * @param id - Link ID + * @param imageProcessing - Information whether the image on processing + * @param url - Link URL */ data class GroupsGroupLink( - @SerializedName(value="name") + @SerializedName("name") val name: String? = null, - @SerializedName(value="desc") + @SerializedName("desc") val desc: String? = null, - @SerializedName(value="edit_title") + @SerializedName("edit_title") val editTitle: BaseBoolInt? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="image_processing") + @SerializedName("image_processing") val imageProcessing: BaseBoolInt? = null, - @SerializedName(value="url") + @SerializedName("url") val url: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupPhotos.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupPhotos.kt index 62c96f4da7..9143aeabf2 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupPhotos.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupPhotos.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupPhotos( val value: Int ) { + @SerializedName("0") DISABLED(0), + @SerializedName("1") OPEN(1), + @SerializedName("2") LIMITED(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupPhotos?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupPhotos { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupPublicCategoryList.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupPublicCategoryList.kt index 577affed5e..34bce3e149 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupPublicCategoryList.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupPublicCategoryList.kt @@ -33,15 +33,15 @@ import kotlin.String import kotlin.collections.List /** - * @param id no description - * @param name no description - * @param subcategories no description + * @param id + * @param name + * @param subcategories */ data class GroupsGroupPublicCategoryList( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="name") + @SerializedName("name") val name: String? = null, - @SerializedName(value="subcategories") + @SerializedName("subcategories") val subcategories: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupSuggestedPrivacy.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupSuggestedPrivacy.kt index 39cf235751..4b158b354d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupSuggestedPrivacy.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupSuggestedPrivacy.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupSuggestedPrivacy( val value: Int ) { + @SerializedName("0") NONE(0), + @SerializedName("1") ALL(1), + @SerializedName("2") SUBSCRIBERS(2); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: GroupsGroupSuggestedPrivacy?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupSuggestedPrivacy { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupTag.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupTag.kt index 06af3d3f50..bd0a008306 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupTag.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupTag.kt @@ -27,95 +27,87 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.Int import kotlin.String /** - * @param id no description - * @param name no description - * @param color no description - * @param uses no description + * @param id + * @param name + * @param color + * @param uses */ data class GroupsGroupTag( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="color") - val color: Color, - @SerializedName(value="uses") + @SerializedName("color") + val color: GroupsGroupTag.Color, + @SerializedName("uses") val uses: Int? = null ) { enum class Color( val value: String ) { + @SerializedName("454647") FORTY_FIVE_4647("454647"), + @SerializedName("45678f") FORTY_FIVE_678F("45678f"), + @SerializedName("4bb34b") FOUR_BB34B("4bb34b"), + @SerializedName("5181b8") FIFTY_ONE_81B8("5181b8"), + @SerializedName("539b9c") FIFTY_THREE_9B9C("539b9c"), + @SerializedName("5c9ce6") FIVE_C9CE6("5c9ce6"), + @SerializedName("63b9ba") SIXTY_THREE_B9BA("63b9ba"), + @SerializedName("6bc76b") SIX_BC76B("6bc76b"), + @SerializedName("76787a") SEVENTY_SIX_787A("76787a"), + @SerializedName("792ec0") SEVENTY_NINE_2EC0("792ec0"), + @SerializedName("7a6c4f") SEVEN_A6C4F("7a6c4f"), + @SerializedName("7ececf") SEVEN_ECECF("7ececf"), + @SerializedName("9e8d6b") NINE_E8D6B("9e8d6b"), + @SerializedName("a162de") A162DE("a162de"), + @SerializedName("aaaeb3") AAAEB3("aaaeb3"), + @SerializedName("bbaa84") BBAA84("bbaa84"), + @SerializedName("e64646") E64646("e64646"), + @SerializedName("ff5c5c") FF5C5C("ff5c5c"), + @SerializedName("ffa000") FFA000("ffa000"), + @SerializedName("ffc107") FFC107("ffc107"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Color?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Color { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupTopics.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupTopics.kt index be655cc41f..9b56fc05a0 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupTopics.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupTopics.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupTopics( val value: Int ) { + @SerializedName("0") DISABLED(0), + @SerializedName("1") OPEN(1), + @SerializedName("2") LIMITED(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupTopics?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupTopics { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupType.kt index e7db03a485..9270229e62 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupType.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class GroupsGroupType( val value: String ) { + @SerializedName("group") GROUP("group"), + @SerializedName("page") PAGE("page"), + @SerializedName("event") EVENT("event"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupVideo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupVideo.kt index 81076bfe5c..194ddd7ffc 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupVideo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupVideo.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupVideo( val value: Int ) { + @SerializedName("0") DISABLED(0), + @SerializedName("1") OPEN(1), + @SerializedName("2") LIMITED(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupVideo?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupVideo { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupWall.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupWall.kt index 271cfdf85e..d87f62ea32 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupWall.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupWall.kt @@ -27,44 +27,21 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupWall( val value: Int ) { + @SerializedName("0") DISABLED(0), + @SerializedName("1") OPEN(1), + @SerializedName("2") LIMITED(2), + @SerializedName("3") CLOSED(3); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupWall?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupWall { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupWiki.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupWiki.kt index 9fe854b740..07990f6be3 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupWiki.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupWiki.kt @@ -27,42 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class GroupsGroupWiki( val value: Int ) { + @SerializedName("0") DISABLED(0), + @SerializedName("1") OPEN(1), + @SerializedName("2") LIMITED(2); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsGroupWiki?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsGroupWiki { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupsArray.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupsArray.kt index e7d9ab54a2..49c61bce71 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupsArray.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupsArray.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param count Communities number - * @param items no description + * @param count - Communities number + * @param items */ data class GroupsGroupsArray( - @SerializedName(value="count") + @SerializedName("count") val count: Int, - @SerializedName(value="items") + @SerializedName("items") val items: List ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLinksItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLinksItem.kt index 977db7401a..53a3cfeee9 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLinksItem.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLinksItem.kt @@ -33,27 +33,27 @@ import kotlin.Int import kotlin.String /** - * @param desc Link description - * @param editTitle Information whether the link title can be edited - * @param id Link ID - * @param name Link title - * @param photo100 URL of square image of the link with 100 pixels in width - * @param photo50 URL of square image of the link with 50 pixels in width - * @param url Link URL + * @param desc - Link description + * @param editTitle - Information whether the link title can be edited + * @param id - Link ID + * @param name - Link title + * @param photo100 - URL of square image of the link with 100 pixels in width + * @param photo50 - URL of square image of the link with 50 pixels in width + * @param url - Link URL */ data class GroupsLinksItem( - @SerializedName(value="desc") + @SerializedName("desc") val desc: String? = null, - @SerializedName(value="edit_title") + @SerializedName("edit_title") val editTitle: BaseBoolInt? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="name") + @SerializedName("name") val name: String? = null, - @SerializedName(value="photo_100") + @SerializedName("photo_100") val photo100: String? = null, - @SerializedName(value="photo_50") + @SerializedName("photo_50") val photo50: String? = null, - @SerializedName(value="url") + @SerializedName("url") val url: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLiveCovers.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLiveCovers.kt index 98603e8272..5091db0eba 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLiveCovers.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLiveCovers.kt @@ -33,15 +33,15 @@ import kotlin.String import kotlin.collections.List /** - * @param isEnabled Information whether live covers is enabled - * @param isScalable Information whether live covers photo scaling is enabled - * @param storyIds no description + * @param isEnabled - Information whether live covers is enabled + * @param isScalable - Information whether live covers photo scaling is enabled + * @param storyIds */ data class GroupsLiveCovers( - @SerializedName(value="is_enabled") + @SerializedName("is_enabled") val isEnabled: Boolean, - @SerializedName(value="is_scalable") + @SerializedName("is_scalable") val isScalable: Boolean? = null, - @SerializedName(value="story_ids") + @SerializedName("story_ids") val storyIds: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollEvents.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollEvents.kt index 6068476ea6..c338496c35 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollEvents.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollEvents.kt @@ -31,156 +31,156 @@ import com.google.gson.annotations.SerializedName import com.vk.sdk.api.base.dto.BaseBoolInt /** - * @param audioNew no description - * @param boardPostDelete no description - * @param boardPostEdit no description - * @param boardPostNew no description - * @param boardPostRestore no description - * @param groupChangePhoto no description - * @param groupChangeSettings no description - * @param groupJoin no description - * @param groupLeave no description - * @param groupOfficersEdit no description - * @param marketCommentDelete no description - * @param marketCommentEdit no description - * @param marketCommentNew no description - * @param marketCommentRestore no description - * @param messageAllow no description - * @param messageDeny no description - * @param messageNew no description - * @param messageRead no description - * @param messageReply no description - * @param messageTypingState no description - * @param messageEdit no description - * @param photoCommentDelete no description - * @param photoCommentEdit no description - * @param photoCommentNew no description - * @param photoCommentRestore no description - * @param photoNew no description - * @param pollVoteNew no description - * @param userBlock no description - * @param userUnblock no description - * @param videoCommentDelete no description - * @param videoCommentEdit no description - * @param videoCommentNew no description - * @param videoCommentRestore no description - * @param videoNew no description - * @param wallPostNew no description - * @param wallReplyDelete no description - * @param wallReplyEdit no description - * @param wallReplyNew no description - * @param wallReplyRestore no description - * @param wallRepost no description - * @param leadFormsNew no description - * @param marketOrderNew no description - * @param marketOrderEdit no description - * @param donutSubscriptionCreate no description - * @param donutSubscriptionProlonged no description - * @param donutSubscriptionCancelled no description - * @param donutSubscriptionExpired no description - * @param donutSubscriptionPriceChanged no description - * @param donutMoneyWithdraw no description - * @param donutMoneyWithdrawError no description + * @param audioNew + * @param boardPostDelete + * @param boardPostEdit + * @param boardPostNew + * @param boardPostRestore + * @param groupChangePhoto + * @param groupChangeSettings + * @param groupJoin + * @param groupLeave + * @param groupOfficersEdit + * @param marketCommentDelete + * @param marketCommentEdit + * @param marketCommentNew + * @param marketCommentRestore + * @param messageAllow + * @param messageDeny + * @param messageNew + * @param messageRead + * @param messageReply + * @param messageTypingState + * @param messageEdit + * @param photoCommentDelete + * @param photoCommentEdit + * @param photoCommentNew + * @param photoCommentRestore + * @param photoNew + * @param pollVoteNew + * @param userBlock + * @param userUnblock + * @param videoCommentDelete + * @param videoCommentEdit + * @param videoCommentNew + * @param videoCommentRestore + * @param videoNew + * @param wallPostNew + * @param wallReplyDelete + * @param wallReplyEdit + * @param wallReplyNew + * @param wallReplyRestore + * @param wallRepost + * @param leadFormsNew + * @param marketOrderNew + * @param marketOrderEdit + * @param donutSubscriptionCreate + * @param donutSubscriptionProlonged + * @param donutSubscriptionCancelled + * @param donutSubscriptionExpired + * @param donutSubscriptionPriceChanged + * @param donutMoneyWithdraw + * @param donutMoneyWithdrawError */ data class GroupsLongPollEvents( - @SerializedName(value="audio_new") + @SerializedName("audio_new") val audioNew: BaseBoolInt, - @SerializedName(value="board_post_delete") + @SerializedName("board_post_delete") val boardPostDelete: BaseBoolInt, - @SerializedName(value="board_post_edit") + @SerializedName("board_post_edit") val boardPostEdit: BaseBoolInt, - @SerializedName(value="board_post_new") + @SerializedName("board_post_new") val boardPostNew: BaseBoolInt, - @SerializedName(value="board_post_restore") + @SerializedName("board_post_restore") val boardPostRestore: BaseBoolInt, - @SerializedName(value="group_change_photo") + @SerializedName("group_change_photo") val groupChangePhoto: BaseBoolInt, - @SerializedName(value="group_change_settings") + @SerializedName("group_change_settings") val groupChangeSettings: BaseBoolInt, - @SerializedName(value="group_join") + @SerializedName("group_join") val groupJoin: BaseBoolInt, - @SerializedName(value="group_leave") + @SerializedName("group_leave") val groupLeave: BaseBoolInt, - @SerializedName(value="group_officers_edit") + @SerializedName("group_officers_edit") val groupOfficersEdit: BaseBoolInt, - @SerializedName(value="market_comment_delete") + @SerializedName("market_comment_delete") val marketCommentDelete: BaseBoolInt, - @SerializedName(value="market_comment_edit") + @SerializedName("market_comment_edit") val marketCommentEdit: BaseBoolInt, - @SerializedName(value="market_comment_new") + @SerializedName("market_comment_new") val marketCommentNew: BaseBoolInt, - @SerializedName(value="market_comment_restore") + @SerializedName("market_comment_restore") val marketCommentRestore: BaseBoolInt, - @SerializedName(value="message_allow") + @SerializedName("message_allow") val messageAllow: BaseBoolInt, - @SerializedName(value="message_deny") + @SerializedName("message_deny") val messageDeny: BaseBoolInt, - @SerializedName(value="message_new") + @SerializedName("message_new") val messageNew: BaseBoolInt, - @SerializedName(value="message_read") + @SerializedName("message_read") val messageRead: BaseBoolInt, - @SerializedName(value="message_reply") + @SerializedName("message_reply") val messageReply: BaseBoolInt, - @SerializedName(value="message_typing_state") + @SerializedName("message_typing_state") val messageTypingState: BaseBoolInt, - @SerializedName(value="message_edit") + @SerializedName("message_edit") val messageEdit: BaseBoolInt, - @SerializedName(value="photo_comment_delete") + @SerializedName("photo_comment_delete") val photoCommentDelete: BaseBoolInt, - @SerializedName(value="photo_comment_edit") + @SerializedName("photo_comment_edit") val photoCommentEdit: BaseBoolInt, - @SerializedName(value="photo_comment_new") + @SerializedName("photo_comment_new") val photoCommentNew: BaseBoolInt, - @SerializedName(value="photo_comment_restore") + @SerializedName("photo_comment_restore") val photoCommentRestore: BaseBoolInt, - @SerializedName(value="photo_new") + @SerializedName("photo_new") val photoNew: BaseBoolInt, - @SerializedName(value="poll_vote_new") + @SerializedName("poll_vote_new") val pollVoteNew: BaseBoolInt, - @SerializedName(value="user_block") + @SerializedName("user_block") val userBlock: BaseBoolInt, - @SerializedName(value="user_unblock") + @SerializedName("user_unblock") val userUnblock: BaseBoolInt, - @SerializedName(value="video_comment_delete") + @SerializedName("video_comment_delete") val videoCommentDelete: BaseBoolInt, - @SerializedName(value="video_comment_edit") + @SerializedName("video_comment_edit") val videoCommentEdit: BaseBoolInt, - @SerializedName(value="video_comment_new") + @SerializedName("video_comment_new") val videoCommentNew: BaseBoolInt, - @SerializedName(value="video_comment_restore") + @SerializedName("video_comment_restore") val videoCommentRestore: BaseBoolInt, - @SerializedName(value="video_new") + @SerializedName("video_new") val videoNew: BaseBoolInt, - @SerializedName(value="wall_post_new") + @SerializedName("wall_post_new") val wallPostNew: BaseBoolInt, - @SerializedName(value="wall_reply_delete") + @SerializedName("wall_reply_delete") val wallReplyDelete: BaseBoolInt, - @SerializedName(value="wall_reply_edit") + @SerializedName("wall_reply_edit") val wallReplyEdit: BaseBoolInt, - @SerializedName(value="wall_reply_new") + @SerializedName("wall_reply_new") val wallReplyNew: BaseBoolInt, - @SerializedName(value="wall_reply_restore") + @SerializedName("wall_reply_restore") val wallReplyRestore: BaseBoolInt, - @SerializedName(value="wall_repost") + @SerializedName("wall_repost") val wallRepost: BaseBoolInt, - @SerializedName(value="lead_forms_new") + @SerializedName("lead_forms_new") val leadFormsNew: BaseBoolInt? = null, - @SerializedName(value="market_order_new") + @SerializedName("market_order_new") val marketOrderNew: BaseBoolInt? = null, - @SerializedName(value="market_order_edit") + @SerializedName("market_order_edit") val marketOrderEdit: BaseBoolInt? = null, - @SerializedName(value="donut_subscription_create") + @SerializedName("donut_subscription_create") val donutSubscriptionCreate: BaseBoolInt? = null, - @SerializedName(value="donut_subscription_prolonged") + @SerializedName("donut_subscription_prolonged") val donutSubscriptionProlonged: BaseBoolInt? = null, - @SerializedName(value="donut_subscription_cancelled") + @SerializedName("donut_subscription_cancelled") val donutSubscriptionCancelled: BaseBoolInt? = null, - @SerializedName(value="donut_subscription_expired") + @SerializedName("donut_subscription_expired") val donutSubscriptionExpired: BaseBoolInt? = null, - @SerializedName(value="donut_subscription_price_changed") + @SerializedName("donut_subscription_price_changed") val donutSubscriptionPriceChanged: BaseBoolInt? = null, - @SerializedName(value="donut_money_withdraw") + @SerializedName("donut_money_withdraw") val donutMoneyWithdraw: BaseBoolInt? = null, - @SerializedName(value="donut_money_withdraw_error") + @SerializedName("donut_money_withdraw_error") val donutMoneyWithdrawError: BaseBoolInt? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollServer.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollServer.kt index c05f30caaf..8da3736c8f 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollServer.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollServer.kt @@ -31,15 +31,15 @@ import com.google.gson.annotations.SerializedName import kotlin.String /** - * @param key Long Poll key - * @param server Long Poll server address - * @param ts Number of the last event + * @param key - Long Poll key + * @param server - Long Poll server address + * @param ts - Number of the last event */ data class GroupsLongPollServer( - @SerializedName(value="key") + @SerializedName("key") val key: String, - @SerializedName(value="server") + @SerializedName("server") val server: String, - @SerializedName(value="ts") + @SerializedName("ts") val ts: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollSettings.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollSettings.kt index 63ee055b01..f4ec3f8dc1 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollSettings.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLongPollSettings.kt @@ -32,15 +32,15 @@ import kotlin.Boolean import kotlin.String /** - * @param events no description - * @param isEnabled Shows whether Long Poll is enabled - * @param apiVersion API version used for the events + * @param events + * @param isEnabled - Shows whether Long Poll is enabled + * @param apiVersion - API version used for the events */ data class GroupsLongPollSettings( - @SerializedName(value="events") + @SerializedName("events") val events: GroupsLongPollEvents, - @SerializedName(value="is_enabled") + @SerializedName("is_enabled") val isEnabled: Boolean, - @SerializedName(value="api_version") + @SerializedName("api_version") val apiVersion: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsMarketInfo.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsMarketInfo.kt index c420813500..7bd2945fa9 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsMarketInfo.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsMarketInfo.kt @@ -34,27 +34,27 @@ import kotlin.Int import kotlin.String /** - * @param contactId Contact person ID - * @param currency no description - * @param currencyText Currency name - * @param enabled Information whether the market is enabled - * @param mainAlbumId Main market album ID - * @param priceMax Maximum price - * @param priceMin Minimum price + * @param contactId - Contact person ID + * @param currency + * @param currencyText - Currency name + * @param enabled - Information whether the market is enabled + * @param mainAlbumId - Main market album ID + * @param priceMax - Maximum price + * @param priceMin - Minimum price */ data class GroupsMarketInfo( - @SerializedName(value="contact_id") + @SerializedName("contact_id") val contactId: Int? = null, - @SerializedName(value="currency") + @SerializedName("currency") val currency: MarketCurrency? = null, - @SerializedName(value="currency_text") + @SerializedName("currency_text") val currencyText: String? = null, - @SerializedName(value="enabled") + @SerializedName("enabled") val enabled: BaseBoolInt? = null, - @SerializedName(value="main_album_id") + @SerializedName("main_album_id") val mainAlbumId: Int? = null, - @SerializedName(value="price_max") + @SerializedName("price_max") val priceMax: String? = null, - @SerializedName(value="price_min") + @SerializedName("price_min") val priceMin: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOnlineStatus.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOnlineStatus.kt index 9973d6c7b0..3e033c7dae 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOnlineStatus.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOnlineStatus.kt @@ -31,12 +31,13 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param status no description - * @param minutes Estimated time of answer (for status = answer_mark) + * Online status of group + * @param status + * @param minutes - Estimated time of answer (for status = answer_mark) */ data class GroupsOnlineStatus( - @SerializedName(value="status") + @SerializedName("status") val status: GroupsOnlineStatusType, - @SerializedName(value="minutes") + @SerializedName("minutes") val minutes: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOnlineStatusType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOnlineStatusType.kt index d4e2c0611e..e35eefb3d7 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOnlineStatusType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOnlineStatusType.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class GroupsOnlineStatusType( val value: String ) { + @SerializedName("none") NONE("none"), + @SerializedName("online") ONLINE("online"), + @SerializedName("answer_mark") ANSWER_MARK("answer_mark"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: GroupsOnlineStatusType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsOnlineStatusType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOwnerXtrBanInfoType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOwnerXtrBanInfoType.kt index 2277c98a90..eac49489c9 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOwnerXtrBanInfoType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsOwnerXtrBanInfoType.kt @@ -27,41 +27,15 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class GroupsOwnerXtrBanInfoType( val value: String ) { + @SerializedName("group") GROUP("group"), + @SerializedName("profile") PROFILE("profile"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: GroupsOwnerXtrBanInfoType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsOwnerXtrBanInfoType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsProfileItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsProfileItem.kt index be0d40293a..4235f4e9f7 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsProfileItem.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsProfileItem.kt @@ -32,18 +32,18 @@ import kotlin.Int import kotlin.String /** - * @param id User id - * @param photo50 Url for user photo - * @param photo100 Url for user photo - * @param firstName User first name + * @param id - User id + * @param photo50 - Url for user photo + * @param photo100 - Url for user photo + * @param firstName - User first name */ data class GroupsProfileItem( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="photo_50") + @SerializedName("photo_50") val photo50: String, - @SerializedName(value="photo_100") + @SerializedName("photo_100") val photo100: String, - @SerializedName(value="first_name") + @SerializedName("first_name") val firstName: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsRoleOptions.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsRoleOptions.kt index 0a5226c56d..64303f4e69 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsRoleOptions.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsRoleOptions.kt @@ -27,44 +27,21 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class GroupsRoleOptions( val value: String ) { + @SerializedName("moderator") MODERATOR("moderator"), + @SerializedName("editor") EDITOR("editor"), + @SerializedName("administrator") ADMINISTRATOR("administrator"), + @SerializedName("creator") CREATOR("creator"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: GroupsRoleOptions?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): GroupsRoleOptions { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchResponse.kt new file mode 100644 index 0000000000..6c1f973688 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total communities number + * @param items + */ +data class GroupsSearchResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSectionsListItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSectionsListItem.kt new file mode 100644 index 0000000000..8ec33aa309 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSectionsListItem.kt @@ -0,0 +1,43 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param id - Object ID + * @param title - Object title + */ +data class GroupsSectionsListItem( + @SerializedName("id") + val id: Int? = null, + @SerializedName("title") + val title: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSettingsTwitter.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSettingsTwitter.kt index 43f15c42a6..13e598ec75 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSettingsTwitter.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSettingsTwitter.kt @@ -27,52 +27,26 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.String /** - * @param status no description - * @param name no description + * @param status + * @param name */ data class GroupsSettingsTwitter( - @SerializedName(value="status") - val status: Status, - @SerializedName(value="name") + @SerializedName("status") + val status: GroupsSettingsTwitter.Status, + @SerializedName("name") val name: String? = null ) { enum class Status( val value: String ) { + @SerializedName("loading") LOADING("loading"), + @SerializedName("sync") SYNC("sync"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Status?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Status { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSubjectItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSubjectItem.kt index 1e3459f8ab..fbd3fa0d89 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSubjectItem.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSubjectItem.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param id Subject ID - * @param name Subject title + * @param id - Subject ID + * @param name - Subject title */ data class GroupsSubjectItem( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSuggestion.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSuggestion.kt new file mode 100644 index 0000000000..6813fde48b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSuggestion.kt @@ -0,0 +1,59 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * Item of a suggestions block + * @param group + * @param trackCode - Track code about a group in a suggestions block + * @param description - Category of a group + * @param reason - Reason of group stand in a suggestions block + */ +data class GroupsSuggestion( + @SerializedName("group") + val group: GroupsGroupFull, + @SerializedName("track_code") + val trackCode: String, + @SerializedName("description") + val description: String, + @SerializedName("reason") + val reason: GroupsSuggestion.Reason? = null +) { + enum class Reason( + val value: String + ) { + @SerializedName("similar") + SIMILAR("similar"), + + @SerializedName("ads") + ADS("ads"); + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTokenPermissionSetting.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTokenPermissionSetting.kt index a64c6d16a6..ca242c2090 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTokenPermissionSetting.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTokenPermissionSetting.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.String /** - * @param name no description - * @param setting no description + * @param name + * @param setting */ data class GroupsTokenPermissionSetting( - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="setting") + @SerializedName("setting") val setting: Int ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsUserXtrRole.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsUserXtrRole.kt index eabd166f4f..9b2e7d26a6 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsUserXtrRole.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/GroupsUserXtrRole.kt @@ -27,14 +27,6 @@ // ********************************************************************* package com.vk.sdk.api.groups.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName import com.vk.sdk.api.audio.dto.AudioAudio import com.vk.sdk.api.base.dto.BaseBoolInt @@ -61,7 +53,6 @@ import com.vk.sdk.api.users.dto.UsersUserMin import com.vk.sdk.api.users.dto.UsersUserRelation import com.vk.sdk.api.users.dto.UsersUserType import com.vk.sdk.api.video.dto.VideoLiveInfo -import java.lang.reflect.Type import kotlin.Boolean import kotlin.Float import kotlin.Int @@ -69,433 +60,425 @@ import kotlin.String import kotlin.collections.List /** - * @param role no description - * @param firstNameNom User's first name in nominative case - * @param firstNameGen User's first name in genitive case - * @param firstNameDat User's first name in dative case - * @param firstNameAcc User's first name in accusative case - * @param firstNameIns User's first name in instrumental case - * @param firstNameAbl User's first name in prepositional case - * @param lastNameNom User's last name in nominative case - * @param lastNameGen User's last name in genitive case - * @param lastNameDat User's last name in dative case - * @param lastNameAcc User's last name in accusative case - * @param lastNameIns User's last name in instrumental case - * @param lastNameAbl User's last name in prepositional case - * @param nickname User nickname - * @param maidenName User maiden name - * @param contactName User contact name - * @param domain Domain name of the user's page - * @param bdate User's date of birth - * @param city no description - * @param country no description - * @param timezone User's timezone - * @param ownerState no description - * @param photo200 URL of square photo of the user with 200 pixels in width - * @param photoMax URL of square photo of the user with maximum width - * @param photo200Orig URL of user's photo with 200 pixels in width - * @param photo400Orig URL of user's photo with 400 pixels in width - * @param photoMaxOrig URL of user's photo of maximum size - * @param photoId ID of the user's main photo - * @param hasPhoto Information whether the user has main photo - * @param hasMobile Information whether the user specified his phone number - * @param isFriend Information whether the user is a friend of current user - * @param wallComments Information whether current user can comment wall posts - * @param canPost Information whether current user can post on the user's wall - * @param canSeeAllPosts Information whether current user can see other users' audio on the wall - * @param canSeeAudio Information whether current user can see the user's audio - * @param type no description - * @param email no description - * @param skype no description - * @param facebook no description - * @param facebookName no description - * @param twitter no description - * @param livejournal no description - * @param instagram no description - * @param test no description - * @param videoLive no description - * @param isVideoLiveNotificationsBlocked no description - * @param isService no description - * @param serviceDescription no description - * @param photo no description - * @param photoBig no description - * @param photo400 no description - * @param photoMaxSize no description - * @param language no description - * @param storiesArchiveCount no description - * @param wallDefault no description - * @param canCall Information whether current user can call - * @param canSeeWishes Information whether current user can see the user's wishes - * @param canSeeGifts Information whether current user can see the user's gifts - * @param interests no description - * @param books no description - * @param tv no description - * @param quotes no description - * @param about no description - * @param games no description - * @param movies no description - * @param activities no description - * @param music no description - * @param canWritePrivateMessage Information whether current user can write private message - * @param canSendFriendRequest Information whether current user can send a friend request - * @param canBeInvitedGroup Information whether current user can be invited to the community - * @param mobilePhone User's mobile phone number - * @param homePhone User's additional phone number - * @param site User's website - * @param statusAudio no description - * @param status User's status - * @param activity User's status - * @param lastSeen no description - * @param exports no description - * @param cropPhoto no description - * @param followersCount Number of user's followers - * @param videoLiveLevel User level in live streams achievements - * @param videoLiveCount Number of user's live streams - * @param clipsCount Number of user's clips - * @param blacklisted Information whether current user is in the requested user's blacklist. - * @param blacklistedByMe Information whether the requested user is in current user's blacklist - * @param isFavorite Information whether the requested user is in faves of current user - * @param isHiddenFromFeed Information whether the requested user is hidden from current user's + * @param role + * @param firstNameNom - User's first name in nominative case + * @param firstNameGen - User's first name in genitive case + * @param firstNameDat - User's first name in dative case + * @param firstNameAcc - User's first name in accusative case + * @param firstNameIns - User's first name in instrumental case + * @param firstNameAbl - User's first name in prepositional case + * @param lastNameNom - User's last name in nominative case + * @param lastNameGen - User's last name in genitive case + * @param lastNameDat - User's last name in dative case + * @param lastNameAcc - User's last name in accusative case + * @param lastNameIns - User's last name in instrumental case + * @param lastNameAbl - User's last name in prepositional case + * @param nickname - User nickname + * @param maidenName - User maiden name + * @param contactName - User contact name + * @param domain - Domain name of the user's page + * @param bdate - User's date of birth + * @param city + * @param country + * @param timezone - User's timezone + * @param ownerState + * @param photo200 - URL of square photo of the user with 200 pixels in width + * @param photoMax - URL of square photo of the user with maximum width + * @param photo200Orig - URL of user's photo with 200 pixels in width + * @param photo400Orig - URL of user's photo with 400 pixels in width + * @param photoMaxOrig - URL of user's photo of maximum size + * @param photoId - ID of the user's main photo + * @param hasPhoto - Information whether the user has main photo + * @param hasMobile - Information whether the user specified his phone number + * @param isFriend - Information whether the user is a friend of current user + * @param wallComments - Information whether current user can comment wall posts + * @param canPost - Information whether current user can post on the user's wall + * @param canSeeAllPosts - Information whether current user can see other users' audio on the wall + * @param canSeeAudio - Information whether current user can see the user's audio + * @param type + * @param email + * @param skype + * @param facebook + * @param facebookName + * @param twitter + * @param livejournal + * @param instagram + * @param test + * @param videoLive + * @param isVideoLiveNotificationsBlocked + * @param isService + * @param serviceDescription + * @param photoRec + * @param photoMedium + * @param photoMediumRec + * @param photo + * @param photoBig + * @param photo400 + * @param photoMaxSize + * @param language + * @param storiesArchiveCount + * @param wallDefault + * @param canCall - Information whether current user can call + * @param canSeeWishes - Information whether current user can see the user's wishes + * @param canSeeGifts - Information whether current user can see the user's gifts + * @param interests + * @param books + * @param tv + * @param quotes + * @param about + * @param games + * @param movies + * @param activities + * @param music + * @param canWritePrivateMessage - Information whether current user can write private message + * @param canSendFriendRequest - Information whether current user can send a friend request + * @param canBeInvitedGroup - Information whether current user can be invited to the community + * @param mobilePhone - User's mobile phone number + * @param homePhone - User's additional phone number + * @param site - User's website + * @param statusAudio + * @param status - User's status + * @param activity - User's status + * @param lastSeen + * @param exports + * @param cropPhoto + * @param followersCount - Number of user's followers + * @param videoLiveLevel - User level in live streams achievements + * @param videoLiveCount - Number of user's live streams + * @param clipsCount - Number of user's clips + * @param blacklisted - Information whether current user is in the requested user's blacklist. + * @param blacklistedByMe - Information whether the requested user is in current user's blacklist + * @param isFavorite - Information whether the requested user is in faves of current user + * @param isHiddenFromFeed - Information whether the requested user is hidden from current user's * newsfeed - * @param commonCount Number of common friends with current user - * @param occupation no description - * @param career no description - * @param military no description - * @param university University ID - * @param universityName University name - * @param universityGroupId no description - * @param faculty Faculty ID - * @param facultyName Faculty name - * @param graduation Graduation year - * @param educationForm Education form - * @param educationStatus User's education status - * @param homeTown User hometown - * @param relation User relationship status - * @param relationPartner no description - * @param personal no description - * @param universities no description - * @param schools no description - * @param relatives no description - * @param isSubscribedPodcasts Information whether current user is subscribed to podcasts - * @param canSubscribePodcasts Owner in whitelist or not - * @param canSubscribePosts Can subscribe to wall - * @param counters no description - * @param accessKey no description - * @param canUploadDoc no description - * @param hash no description - * @param hasEmail no description - * @param sex User sex - * @param screenName Domain name of the user's page - * @param photo50 URL of square photo of the user with 50 pixels in width - * @param photo100 URL of square photo of the user with 100 pixels in width - * @param onlineInfo no description - * @param online Information whether the user is online - * @param onlineMobile Information whether the user is online in mobile site or application - * @param onlineApp Application ID - * @param verified Information whether the user is verified - * @param trending Information whether the user has a "fire" pictogram. - * @param friendStatus no description - * @param mutual no description - * @param deactivated Returns if a profile is deleted or blocked - * @param firstName User first name - * @param hidden Returns if a profile is hidden. - * @param id User ID - * @param lastName User last name - * @param canAccessClosed no description - * @param isClosed no description + * @param commonCount - Number of common friends with current user + * @param occupation + * @param career + * @param military + * @param university - University ID + * @param universityName - University name + * @param universityGroupId + * @param faculty - Faculty ID + * @param facultyName - Faculty name + * @param graduation - Graduation year + * @param educationForm - Education form + * @param educationStatus - User's education status + * @param homeTown - User hometown + * @param relation - User relationship status + * @param relationPartner + * @param personal + * @param universities + * @param schools + * @param relatives + * @param isSubscribedPodcasts - Information whether current user is subscribed to podcasts + * @param canSubscribePodcasts - Owner in whitelist or not + * @param canSubscribePosts - Can subscribe to wall + * @param counters + * @param accessKey + * @param canUploadDoc + * @param hash + * @param hasEmail + * @param sex - User sex + * @param screenName - Domain name of the user's page + * @param photo50 - URL of square photo of the user with 50 pixels in width + * @param photo100 - URL of square photo of the user with 100 pixels in width + * @param onlineInfo + * @param online - Information whether the user is online + * @param onlineMobile - Information whether the user is online in mobile site or application + * @param onlineApp - Application ID + * @param verified - Information whether the user is verified + * @param trending - Information whether the user has a "fire" pictogram. + * @param friendStatus + * @param mutual + * @param deactivated - Returns if a profile is deleted or blocked + * @param firstName - User first name + * @param hidden - Returns if a profile is hidden. + * @param id - User ID + * @param lastName - User last name + * @param canAccessClosed + * @param isClosed */ data class GroupsUserXtrRole( - @SerializedName(value="role") + @SerializedName("role") val role: GroupsRoleOptions? = null, - @SerializedName(value="first_name_nom") + @SerializedName("first_name_nom") val firstNameNom: String? = null, - @SerializedName(value="first_name_gen") + @SerializedName("first_name_gen") val firstNameGen: String? = null, - @SerializedName(value="first_name_dat") + @SerializedName("first_name_dat") val firstNameDat: String? = null, - @SerializedName(value="first_name_acc") + @SerializedName("first_name_acc") val firstNameAcc: String? = null, - @SerializedName(value="first_name_ins") + @SerializedName("first_name_ins") val firstNameIns: String? = null, - @SerializedName(value="first_name_abl") + @SerializedName("first_name_abl") val firstNameAbl: String? = null, - @SerializedName(value="last_name_nom") + @SerializedName("last_name_nom") val lastNameNom: String? = null, - @SerializedName(value="last_name_gen") + @SerializedName("last_name_gen") val lastNameGen: String? = null, - @SerializedName(value="last_name_dat") + @SerializedName("last_name_dat") val lastNameDat: String? = null, - @SerializedName(value="last_name_acc") + @SerializedName("last_name_acc") val lastNameAcc: String? = null, - @SerializedName(value="last_name_ins") + @SerializedName("last_name_ins") val lastNameIns: String? = null, - @SerializedName(value="last_name_abl") + @SerializedName("last_name_abl") val lastNameAbl: String? = null, - @SerializedName(value="nickname") + @SerializedName("nickname") val nickname: String? = null, - @SerializedName(value="maiden_name") + @SerializedName("maiden_name") val maidenName: String? = null, - @SerializedName(value="contact_name") + @SerializedName("contact_name") val contactName: String? = null, - @SerializedName(value="domain") + @SerializedName("domain") val domain: String? = null, - @SerializedName(value="bdate") + @SerializedName("bdate") val bdate: String? = null, - @SerializedName(value="city") + @SerializedName("city") val city: BaseCity? = null, - @SerializedName(value="country") + @SerializedName("country") val country: BaseCountry? = null, - @SerializedName(value="timezone") + @SerializedName("timezone") val timezone: Float? = null, - @SerializedName(value="owner_state") + @SerializedName("owner_state") val ownerState: OwnerState? = null, - @SerializedName(value="photo_200") + @SerializedName("photo_200") val photo200: String? = null, - @SerializedName(value="photo_max") + @SerializedName("photo_max") val photoMax: String? = null, - @SerializedName(value="photo_200_orig") + @SerializedName("photo_200_orig") val photo200Orig: String? = null, - @SerializedName(value="photo_400_orig") + @SerializedName("photo_400_orig") val photo400Orig: String? = null, - @SerializedName(value="photo_max_orig") + @SerializedName("photo_max_orig") val photoMaxOrig: String? = null, - @SerializedName(value="photo_id") + @SerializedName("photo_id") val photoId: String? = null, - @SerializedName(value="has_photo") + @SerializedName("has_photo") val hasPhoto: BaseBoolInt? = null, - @SerializedName(value="has_mobile") + @SerializedName("has_mobile") val hasMobile: BaseBoolInt? = null, - @SerializedName(value="is_friend") + @SerializedName("is_friend") val isFriend: BaseBoolInt? = null, - @SerializedName(value="wall_comments") + @SerializedName("wall_comments") val wallComments: BaseBoolInt? = null, - @SerializedName(value="can_post") + @SerializedName("can_post") val canPost: BaseBoolInt? = null, - @SerializedName(value="can_see_all_posts") + @SerializedName("can_see_all_posts") val canSeeAllPosts: BaseBoolInt? = null, - @SerializedName(value="can_see_audio") + @SerializedName("can_see_audio") val canSeeAudio: BaseBoolInt? = null, - @SerializedName(value="type") + @SerializedName("type") val type: UsersUserType? = null, - @SerializedName(value="email") + @SerializedName("email") val email: String? = null, - @SerializedName(value="skype") + @SerializedName("skype") val skype: String? = null, - @SerializedName(value="facebook") + @SerializedName("facebook") val facebook: String? = null, - @SerializedName(value="facebook_name") + @SerializedName("facebook_name") val facebookName: String? = null, - @SerializedName(value="twitter") + @SerializedName("twitter") val twitter: String? = null, - @SerializedName(value="livejournal") + @SerializedName("livejournal") val livejournal: String? = null, - @SerializedName(value="instagram") + @SerializedName("instagram") val instagram: String? = null, - @SerializedName(value="test") + @SerializedName("test") val test: BaseBoolInt? = null, - @SerializedName(value="video_live") + @SerializedName("video_live") val videoLive: VideoLiveInfo? = null, - @SerializedName(value="is_video_live_notifications_blocked") + @SerializedName("is_video_live_notifications_blocked") val isVideoLiveNotificationsBlocked: BaseBoolInt? = null, - @SerializedName(value="is_service") + @SerializedName("is_service") val isService: Boolean? = null, - @SerializedName(value="service_description") + @SerializedName("service_description") val serviceDescription: String? = null, - @SerializedName(value="photo") + @SerializedName("photo_rec") + val photoRec: String? = null, + @SerializedName("photo_medium") + val photoMedium: String? = null, + @SerializedName("photo_medium_rec") + val photoMediumRec: String? = null, + @SerializedName("photo") val photo: String? = null, - @SerializedName(value="photo_big") + @SerializedName("photo_big") val photoBig: String? = null, - @SerializedName(value="photo_400") + @SerializedName("photo_400") val photo400: String? = null, - @SerializedName(value="photo_max_size") + @SerializedName("photo_max_size") val photoMaxSize: PhotosPhoto? = null, - @SerializedName(value="language") + @SerializedName("language") val language: String? = null, - @SerializedName(value="stories_archive_count") + @SerializedName("stories_archive_count") val storiesArchiveCount: Int? = null, - @SerializedName(value="wall_default") - val wallDefault: WallDefault? = null, - @SerializedName(value="can_call") + @SerializedName("wall_default") + val wallDefault: GroupsUserXtrRole.WallDefault? = null, + @SerializedName("can_call") val canCall: Boolean? = null, - @SerializedName(value="can_see_wishes") + @SerializedName("can_see_wishes") val canSeeWishes: Boolean? = null, - @SerializedName(value="can_see_gifts") + @SerializedName("can_see_gifts") val canSeeGifts: BaseBoolInt? = null, - @SerializedName(value="interests") + @SerializedName("interests") val interests: String? = null, - @SerializedName(value="books") + @SerializedName("books") val books: String? = null, - @SerializedName(value="tv") + @SerializedName("tv") val tv: String? = null, - @SerializedName(value="quotes") + @SerializedName("quotes") val quotes: String? = null, - @SerializedName(value="about") + @SerializedName("about") val about: String? = null, - @SerializedName(value="games") + @SerializedName("games") val games: String? = null, - @SerializedName(value="movies") + @SerializedName("movies") val movies: String? = null, - @SerializedName(value="activities") + @SerializedName("activities") val activities: String? = null, - @SerializedName(value="music") + @SerializedName("music") val music: String? = null, - @SerializedName(value="can_write_private_message") + @SerializedName("can_write_private_message") val canWritePrivateMessage: BaseBoolInt? = null, - @SerializedName(value="can_send_friend_request") + @SerializedName("can_send_friend_request") val canSendFriendRequest: BaseBoolInt? = null, - @SerializedName(value="can_be_invited_group") + @SerializedName("can_be_invited_group") val canBeInvitedGroup: Boolean? = null, - @SerializedName(value="mobile_phone") + @SerializedName("mobile_phone") val mobilePhone: String? = null, - @SerializedName(value="home_phone") + @SerializedName("home_phone") val homePhone: String? = null, - @SerializedName(value="site") + @SerializedName("site") val site: String? = null, - @SerializedName(value="status_audio") + @SerializedName("status_audio") val statusAudio: AudioAudio? = null, - @SerializedName(value="status") + @SerializedName("status") val status: String? = null, - @SerializedName(value="activity") + @SerializedName("activity") val activity: String? = null, - @SerializedName(value="last_seen") + @SerializedName("last_seen") val lastSeen: UsersLastSeen? = null, - @SerializedName(value="exports") + @SerializedName("exports") val exports: UsersExports? = null, - @SerializedName(value="crop_photo") + @SerializedName("crop_photo") val cropPhoto: BaseCropPhoto? = null, - @SerializedName(value="followers_count") + @SerializedName("followers_count") val followersCount: Int? = null, - @SerializedName(value="video_live_level") + @SerializedName("video_live_level") val videoLiveLevel: Int? = null, - @SerializedName(value="video_live_count") + @SerializedName("video_live_count") val videoLiveCount: Int? = null, - @SerializedName(value="clips_count") + @SerializedName("clips_count") val clipsCount: Int? = null, - @SerializedName(value="blacklisted") + @SerializedName("blacklisted") val blacklisted: BaseBoolInt? = null, - @SerializedName(value="blacklisted_by_me") + @SerializedName("blacklisted_by_me") val blacklistedByMe: BaseBoolInt? = null, - @SerializedName(value="is_favorite") + @SerializedName("is_favorite") val isFavorite: BaseBoolInt? = null, - @SerializedName(value="is_hidden_from_feed") + @SerializedName("is_hidden_from_feed") val isHiddenFromFeed: BaseBoolInt? = null, - @SerializedName(value="common_count") + @SerializedName("common_count") val commonCount: Int? = null, - @SerializedName(value="occupation") + @SerializedName("occupation") val occupation: UsersOccupation? = null, - @SerializedName(value="career") + @SerializedName("career") val career: List? = null, - @SerializedName(value="military") + @SerializedName("military") val military: List? = null, - @SerializedName(value="university") + @SerializedName("university") val university: Int? = null, - @SerializedName(value="university_name") + @SerializedName("university_name") val universityName: String? = null, - @SerializedName(value="university_group_id") + @SerializedName("university_group_id") val universityGroupId: Int? = null, - @SerializedName(value="faculty") + @SerializedName("faculty") val faculty: Int? = null, - @SerializedName(value="faculty_name") + @SerializedName("faculty_name") val facultyName: String? = null, - @SerializedName(value="graduation") + @SerializedName("graduation") val graduation: Int? = null, - @SerializedName(value="education_form") + @SerializedName("education_form") val educationForm: String? = null, - @SerializedName(value="education_status") + @SerializedName("education_status") val educationStatus: String? = null, - @SerializedName(value="home_town") + @SerializedName("home_town") val homeTown: String? = null, - @SerializedName(value="relation") + @SerializedName("relation") val relation: UsersUserRelation? = null, - @SerializedName(value="relation_partner") + @SerializedName("relation_partner") val relationPartner: UsersUserMin? = null, - @SerializedName(value="personal") + @SerializedName("personal") val personal: UsersPersonal? = null, - @SerializedName(value="universities") + @SerializedName("universities") val universities: List? = null, - @SerializedName(value="schools") + @SerializedName("schools") val schools: List? = null, - @SerializedName(value="relatives") + @SerializedName("relatives") val relatives: List? = null, - @SerializedName(value="is_subscribed_podcasts") + @SerializedName("is_subscribed_podcasts") val isSubscribedPodcasts: Boolean? = null, - @SerializedName(value="can_subscribe_podcasts") + @SerializedName("can_subscribe_podcasts") val canSubscribePodcasts: Boolean? = null, - @SerializedName(value="can_subscribe_posts") + @SerializedName("can_subscribe_posts") val canSubscribePosts: Boolean? = null, - @SerializedName(value="counters") + @SerializedName("counters") val counters: UsersUserCounters? = null, - @SerializedName(value="access_key") + @SerializedName("access_key") val accessKey: String? = null, - @SerializedName(value="can_upload_doc") + @SerializedName("can_upload_doc") val canUploadDoc: BaseBoolInt? = null, - @SerializedName(value="hash") + @SerializedName("hash") val hash: String? = null, - @SerializedName(value="has_email") + @SerializedName("has_email") val hasEmail: Boolean? = null, - @SerializedName(value="sex") + @SerializedName("sex") val sex: BaseSex? = null, - @SerializedName(value="screen_name") + @SerializedName("screen_name") val screenName: String? = null, - @SerializedName(value="photo_50") + @SerializedName("photo_50") val photo50: String? = null, - @SerializedName(value="photo_100") + @SerializedName("photo_100") val photo100: String? = null, - @SerializedName(value="online_info") + @SerializedName("online_info") val onlineInfo: UsersOnlineInfo? = null, - @SerializedName(value="online") + @SerializedName("online") val online: BaseBoolInt? = null, - @SerializedName(value="online_mobile") + @SerializedName("online_mobile") val onlineMobile: BaseBoolInt? = null, - @SerializedName(value="online_app") + @SerializedName("online_app") val onlineApp: Int? = null, - @SerializedName(value="verified") + @SerializedName("verified") val verified: BaseBoolInt? = null, - @SerializedName(value="trending") + @SerializedName("trending") val trending: BaseBoolInt? = null, - @SerializedName(value="friend_status") + @SerializedName("friend_status") val friendStatus: FriendsFriendStatusStatus? = null, - @SerializedName(value="mutual") + @SerializedName("mutual") val mutual: FriendsRequestsMutual? = null, - @SerializedName(value="deactivated") + @SerializedName("deactivated") val deactivated: String? = null, - @SerializedName(value="first_name") + @SerializedName("first_name") val firstName: String? = null, - @SerializedName(value="hidden") + @SerializedName("hidden") val hidden: Int? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="last_name") + @SerializedName("last_name") val lastName: String? = null, - @SerializedName(value="can_access_closed") + @SerializedName("can_access_closed") val canAccessClosed: Boolean? = null, - @SerializedName(value="is_closed") + @SerializedName("is_closed") val isClosed: Boolean? = null ) { enum class WallDefault( val value: String ) { + @SerializedName("owner") OWNER("owner"), + @SerializedName("all") ALL("all"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: WallDefault?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): WallDefault { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/NameCaseParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/NameCaseParam.kt new file mode 100644 index 0000000000..7fd4941471 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/NameCaseParam.kt @@ -0,0 +1,53 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class NameCaseParam( + val value: String +) { + @SerializedName("nom") + NOMINATIVE("nom"), + + @SerializedName("gen") + GENITIVE("gen"), + + @SerializedName("dat") + DATIVE("dat"), + + @SerializedName("acc") + ACCUSATIVE("acc"), + + @SerializedName("ins") + INSTRUMENTAL("ins"), + + @SerializedName("abl") + PREPOSITIONAL("abl"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/SortParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/SortParam.kt new file mode 100644 index 0000000000..5a82c7e758 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/SortParam.kt @@ -0,0 +1,47 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class SortParam( + val value: String +) { + @SerializedName("id_asc") + ID_ASC("id_asc"), + + @SerializedName("id_desc") + ID_DESC("id_desc"), + + @SerializedName("time_asc") + TIME_ASC("time_asc"), + + @SerializedName("time_desc") + TIME_DESC("time_desc"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/StateParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/StateParam.kt new file mode 100644 index 0000000000..1642b474f8 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/StateParam.kt @@ -0,0 +1,44 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class StateParam( + val value: String +) { + @SerializedName("advanced") + ADVANCED("advanced"), + + @SerializedName("basic") + BASIC("basic"), + + @SerializedName("none") + NONE("none"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/SubtypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/SubtypeParam.kt new file mode 100644 index 0000000000..42601c8260 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/SubtypeParam.kt @@ -0,0 +1,47 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class SubtypeParam( + val value: Int +) { + @SerializedName("1") + PLACE_OR_BUSINESS(1), + + @SerializedName("2") + COMPANY_OR_WEBSITE(2), + + @SerializedName("3") + PERSON_OR_GROUP(3), + + @SerializedName("4") + PRODUCT_OR_ART(4); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/TagColorParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/TagColorParam.kt new file mode 100644 index 0000000000..533bd91785 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/TagColorParam.kt @@ -0,0 +1,95 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class TagColorParam( + val value: String +) { + @SerializedName("454647") + FORTY_FIVE_4647("454647"), + + @SerializedName("45678f") + FORTY_FIVE_678F("45678f"), + + @SerializedName("4bb34b") + FOUR_BB34B("4bb34b"), + + @SerializedName("5181b8") + FIFTY_ONE_81B8("5181b8"), + + @SerializedName("539b9c") + FIFTY_THREE_9B9C("539b9c"), + + @SerializedName("5c9ce6") + FIVE_C9CE6("5c9ce6"), + + @SerializedName("63b9ba") + SIXTY_THREE_B9BA("63b9ba"), + + @SerializedName("6bc76b") + SIX_BC76B("6bc76b"), + + @SerializedName("76787a") + SEVENTY_SIX_787A("76787a"), + + @SerializedName("792ec0") + SEVENTY_NINE_2EC0("792ec0"), + + @SerializedName("7a6c4f") + SEVEN_A6C4F("7a6c4f"), + + @SerializedName("7ececf") + SEVEN_ECECF("7ececf"), + + @SerializedName("9e8d6b") + NINE_E8D6B("9e8d6b"), + + @SerializedName("a162de") + A162DE("a162de"), + + @SerializedName("aaaeb3") + AAAEB3("aaaeb3"), + + @SerializedName("bbaa84") + BBAA84("bbaa84"), + + @SerializedName("e64646") + E64646("e64646"), + + @SerializedName("ff5c5c") + FF5C5C("ff5c5c"), + + @SerializedName("ffa000") + FFA000("ffa000"), + + @SerializedName("ffc107") + FFC107("ffc107"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/TypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/TypeParam.kt new file mode 100644 index 0000000000..63a0b6adee --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/TypeParam.kt @@ -0,0 +1,44 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class TypeParam( + val value: String +) { + @SerializedName("event") + EVENT("event"), + + @SerializedName("group") + GROUP("group"), + + @SerializedName("public") + PUBLIC("public"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/WorkInfoStatusParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/WorkInfoStatusParam.kt new file mode 100644 index 0000000000..da63d5f8ab --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/groups/dto/WorkInfoStatusParam.kt @@ -0,0 +1,50 @@ +/** + * 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.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class WorkInfoStatusParam( + val value: String +) { + @SerializedName("always_opened") + ALWAYS_OPENED("always_opened"), + + @SerializedName("forever_closed") + FOREVER_CLOSED("forever_closed"), + + @SerializedName("no_information") + NO_INFORMATION("no_information"), + + @SerializedName("temporarily_closed") + TEMPORARILY_CLOSED("temporarily_closed"), + + @SerializedName("timetable") + TIMETABLE("timetable"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/leadForms/LeadFormsService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/leadForms/LeadFormsService.kt new file mode 100644 index 0000000000..2e585e4ba0 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/leadForms/LeadFormsService.kt @@ -0,0 +1,205 @@ +/** + * 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.leadForms + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.NewApiRequest +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.Unit +import kotlin.collections.List + +class LeadFormsService { + /** + * @param groupId + * @param name + * @param title + * @param description + * @param questions + * @param policyLinkUrl + * @param photo + * @param confirmation + * @param siteLinkUrl + * @param active + * @param oncePerUser + * @param pixelCode + * @param notifyAdmins + * @param notifyEmails + * @return [VKRequest] with [Unit] + */ + fun leadFormsCreate( + groupId: Int, + name: String, + title: String, + description: String, + questions: String, + policyLinkUrl: String, + photo: String? = null, + confirmation: String? = null, + siteLinkUrl: String? = null, + active: Boolean? = null, + oncePerUser: Boolean? = null, + pixelCode: String? = null, + notifyAdmins: List? = null, + notifyEmails: List? = null + ): VKRequest = NewApiRequest("leadForms.create") { + } + .apply { + addParam("group_id", groupId) + addParam("name", name) + addParam("title", title) + addParam("description", description) + addParam("questions", questions) + addParam("policy_link_url", policyLinkUrl) + photo?.let { addParam("photo", it) } + confirmation?.let { addParam("confirmation", it) } + siteLinkUrl?.let { addParam("site_link_url", it) } + active?.let { addParam("active", it) } + oncePerUser?.let { addParam("once_per_user", it) } + pixelCode?.let { addParam("pixel_code", it) } + notifyAdmins?.let { addParam("notify_admins", it) } + notifyEmails?.let { addParam("notify_emails", it) } + } + + /** + * @param groupId + * @param formId + * @return [VKRequest] with [Unit] + */ + fun leadFormsDelete(groupId: Int, formId: Int): VKRequest = + NewApiRequest("leadForms.delete") { + } + .apply { + addParam("group_id", groupId) + addParam("form_id", formId) + } + + /** + * @param groupId + * @param formId + * @return [VKRequest] with [Unit] + */ + fun leadFormsGet(groupId: Int, formId: Int): VKRequest = NewApiRequest("leadForms.get") { + } + .apply { + addParam("group_id", groupId) + addParam("form_id", formId) + } + + /** + * @param groupId + * @param formId + * @param limit + * @param nextPageToken + * @return [VKRequest] with [Unit] + */ + fun leadFormsGetLeads( + groupId: Int, + formId: Int, + limit: Int? = null, + nextPageToken: String? = null + ): VKRequest = NewApiRequest("leadForms.getLeads") { + } + .apply { + addParam("group_id", groupId) + addParam("form_id", formId) + limit?.let { addParam("limit", it) } + nextPageToken?.let { addParam("next_page_token", it) } + } + + /** + * @return [VKRequest] with [Unit] + */ + fun leadFormsGetUploadURL(): VKRequest = NewApiRequest("leadForms.getUploadURL") { + } + + /** + * @param groupId + * @return [VKRequest] with [Unit] + */ + fun leadFormsList(groupId: Int): VKRequest = NewApiRequest("leadForms.list") { + } + .apply { + addParam("group_id", groupId) + } + + /** + * @param groupId + * @param formId + * @param name + * @param title + * @param description + * @param questions + * @param policyLinkUrl + * @param photo + * @param confirmation + * @param siteLinkUrl + * @param active + * @param oncePerUser + * @param pixelCode + * @param notifyAdmins + * @param notifyEmails + * @return [VKRequest] with [Unit] + */ + fun leadFormsUpdate( + groupId: Int, + formId: Int, + name: String, + title: String, + description: String, + questions: String, + policyLinkUrl: String, + photo: String? = null, + confirmation: String? = null, + siteLinkUrl: String? = null, + active: Boolean? = null, + oncePerUser: Boolean? = null, + pixelCode: String? = null, + notifyAdmins: List? = null, + notifyEmails: List? = null + ): VKRequest = NewApiRequest("leadForms.update") { + } + .apply { + addParam("group_id", groupId) + addParam("form_id", formId) + addParam("name", name) + addParam("title", title) + addParam("description", description) + addParam("questions", questions) + addParam("policy_link_url", policyLinkUrl) + photo?.let { addParam("photo", it) } + confirmation?.let { addParam("confirmation", it) } + siteLinkUrl?.let { addParam("site_link_url", it) } + active?.let { addParam("active", it) } + oncePerUser?.let { addParam("once_per_user", it) } + pixelCode?.let { addParam("pixel_code", it) } + notifyAdmins?.let { addParam("notify_admins", it) } + notifyEmails?.let { addParam("notify_emails", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/LikesService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/LikesService.kt new file mode 100644 index 0000000000..a30c3dee24 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/LikesService.kt @@ -0,0 +1,230 @@ +/** + * 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.likes + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.likes.dto.FilterParam +import com.vk.sdk.api.likes.dto.FriendsOnlyParam +import com.vk.sdk.api.likes.dto.LikesAddResponse +import com.vk.sdk.api.likes.dto.LikesDeleteResponse +import com.vk.sdk.api.likes.dto.LikesGetListExtendedResponse +import com.vk.sdk.api.likes.dto.LikesGetListResponse +import com.vk.sdk.api.likes.dto.LikesIsLikedResponse +import kotlin.Boolean +import kotlin.Int +import kotlin.String + +class LikesService { + /** + * Adds the specified object to the 'Likes' list of the current user. + * + * @param type - Object type: 'post' - post on user or community wall, 'comment' - comment on a + * wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - + * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the + * discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed + * @param itemId - Object ID. + * @param ownerId - ID of the user or community that owns the object. + * @param accessKey - Access key required for an object owned by a private entity. + * @return [VKRequest] with [LikesAddResponse] + */ + fun likesAdd( + type: String, + itemId: Int, + ownerId: Int? = null, + accessKey: String? = null + ): VKRequest = NewApiRequest("likes.add") { + GsonHolder.gson.fromJson(it, LikesAddResponse::class.java) + } + .apply { + addParam("type", type) + addParam("item_id", itemId) + ownerId?.let { addParam("owner_id", it) } + accessKey?.let { addParam("access_key", it) } + } + + /** + * Deletes the specified object from the 'Likes' list of the current user. + * + * @param type - Object type: 'post' - post on user or community wall, 'comment' - comment on a + * wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - + * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the + * discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed + * @param itemId - Object ID. + * @param ownerId - ID of the user or community that owns the object. + * @param accessKey - Access key required for an object owned by a private entity. + * @return [VKRequest] with [LikesDeleteResponse] + */ + fun likesDelete( + type: String, + itemId: Int, + ownerId: Int? = null, + accessKey: String? = null + ): VKRequest = NewApiRequest("likes.delete") { + GsonHolder.gson.fromJson(it, LikesDeleteResponse::class.java) + } + .apply { + addParam("type", type) + addParam("item_id", itemId) + ownerId?.let { addParam("owner_id", it) } + accessKey?.let { addParam("access_key", it) } + } + + /** + * Returns a list of IDs of users who added the specified object to their 'Likes' list. + * + * @param type - , Object type: 'post' - post on user or community wall, 'comment' - comment on + * a wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - + * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the + * discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed + * @param ownerId - ID of the user, community, or application that owns the object. If the + * 'type' parameter is set as 'sitepage', the application ID is passed as 'owner_id'. Use negative + * value for a community id. If the 'type' parameter is not set, the 'owner_id' is assumed to be + * either the current user or the same application ID as if the 'type' parameter was set to + * 'sitepage'. + * @param itemId - Object ID. If 'type' is set as 'sitepage', 'item_id' can include the + * 'page_id' parameter value used during initialization of the [vk.com/dev/Like|Like widget]. + * @param pageUrl - URL of the page where the [vk.com/dev/Like|Like widget] is installed. Used + * instead of the 'item_id' parameter. + * @param filter - Filters to apply: 'likes' - returns information about all users who liked the + * object (default), 'copies' - returns information only about users who told their friends about + * the object + * @param friendsOnly - Specifies which users are returned: '1' - to return only the current + * user's friends, '0' - to return all users (default) + * @param offset - Offset needed to select a specific subset of users. + * @param count - Number of user IDs to return (maximum '1000'). Default is '100' if + * 'friends_only' is set to '0', otherwise, the default is '10' if 'friends_only' is set to '1'. + * @param skipOwn + * @return [VKRequest] with [LikesGetListResponse] + */ + fun likesGetList( + type: String, + ownerId: Int? = null, + itemId: Int? = null, + pageUrl: String? = null, + filter: FilterParam? = null, + friendsOnly: FriendsOnlyParam? = null, + offset: Int? = null, + count: Int? = null, + skipOwn: Boolean? = null + ): VKRequest = NewApiRequest("likes.getList") { + GsonHolder.gson.fromJson(it, LikesGetListResponse::class.java) + } + .apply { + addParam("type", type) + ownerId?.let { addParam("owner_id", it) } + itemId?.let { addParam("item_id", it) } + pageUrl?.let { addParam("page_url", it) } + filter?.let { addParam("filter", it.value) } + friendsOnly?.let { addParam("friends_only", it.value) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + skipOwn?.let { addParam("skip_own", it) } + } + + /** + * Returns a list of IDs of users who added the specified object to their 'Likes' list. + * + * @param type - , Object type: 'post' - post on user or community wall, 'comment' - comment on + * a wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - + * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the + * discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed + * @param ownerId - ID of the user, community, or application that owns the object. If the + * 'type' parameter is set as 'sitepage', the application ID is passed as 'owner_id'. Use negative + * value for a community id. If the 'type' parameter is not set, the 'owner_id' is assumed to be + * either the current user or the same application ID as if the 'type' parameter was set to + * 'sitepage'. + * @param itemId - Object ID. If 'type' is set as 'sitepage', 'item_id' can include the + * 'page_id' parameter value used during initialization of the [vk.com/dev/Like|Like widget]. + * @param pageUrl - URL of the page where the [vk.com/dev/Like|Like widget] is installed. Used + * instead of the 'item_id' parameter. + * @param filter - Filters to apply: 'likes' - returns information about all users who liked the + * object (default), 'copies' - returns information only about users who told their friends about + * the object + * @param friendsOnly - Specifies which users are returned: '1' - to return only the current + * user's friends, '0' - to return all users (default) + * @param offset - Offset needed to select a specific subset of users. + * @param count - Number of user IDs to return (maximum '1000'). Default is '100' if + * 'friends_only' is set to '0', otherwise, the default is '10' if 'friends_only' is set to '1'. + * @param skipOwn + * @return [VKRequest] with [LikesGetListExtendedResponse] + */ + fun likesGetListExtended( + type: String, + ownerId: Int? = null, + itemId: Int? = null, + pageUrl: String? = null, + filter: FilterParam? = null, + friendsOnly: FriendsOnlyParam? = null, + offset: Int? = null, + count: Int? = null, + skipOwn: Boolean? = null + ): VKRequest = NewApiRequest("likes.getList") { + GsonHolder.gson.fromJson(it, LikesGetListExtendedResponse::class.java) + } + .apply { + addParam("type", type) + ownerId?.let { addParam("owner_id", it) } + itemId?.let { addParam("item_id", it) } + pageUrl?.let { addParam("page_url", it) } + filter?.let { addParam("filter", it.value) } + friendsOnly?.let { addParam("friends_only", it.value) } + addParam("extended", true) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + skipOwn?.let { addParam("skip_own", it) } + } + + /** + * Checks for the object in the 'Likes' list of the specified user. + * + * @param type - Object type: 'post' - post on user or community wall, 'comment' - comment on a + * wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - + * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the + * discussion + * @param itemId - Object ID. + * @param userId - User ID. + * @param ownerId - ID of the user or community that owns the object. + * @return [VKRequest] with [LikesIsLikedResponse] + */ + fun likesIsLiked( + type: String, + itemId: Int, + userId: Int? = null, + ownerId: Int? = null + ): VKRequest = NewApiRequest("likes.isLiked") { + GsonHolder.gson.fromJson(it, LikesIsLikedResponse::class.java) + } + .apply { + addParam("type", type) + addParam("item_id", itemId) + userId?.let { addParam("user_id", it) } + ownerId?.let { addParam("owner_id", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/FilterParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/FilterParam.kt new file mode 100644 index 0000000000..41517f5d23 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/FilterParam.kt @@ -0,0 +1,41 @@ +/** + * 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.likes.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FilterParam( + val value: String +) { + @SerializedName("likes") + LIKES("likes"), + + @SerializedName("copies") + COPIES("copies"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/FriendsOnlyParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/FriendsOnlyParam.kt new file mode 100644 index 0000000000..9d4e3222c5 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/FriendsOnlyParam.kt @@ -0,0 +1,47 @@ +/** + * 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.likes.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class FriendsOnlyParam( + val value: Int +) { + @SerializedName("0") + ZERO_(0), + + @SerializedName("1") + ONE_(1), + + @SerializedName("2") + TWO_(2), + + @SerializedName("3") + THREE_(3); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesAddResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesAddResponse.kt new file mode 100644 index 0000000000..490ad74d5c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesAddResponse.kt @@ -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.likes.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param likes - Total likes number + */ +data class LikesAddResponse( + @SerializedName("likes") + val likes: Int +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesDeleteResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesDeleteResponse.kt new file mode 100644 index 0000000000..70685c1d6c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesDeleteResponse.kt @@ -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.likes.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param likes - Total likes number + */ +data class LikesDeleteResponse( + @SerializedName("likes") + val likes: Int +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedResponse.kt new file mode 100644 index 0000000000..42b3e9c6a5 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.likes.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserMin +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class LikesGetListExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListResponse.kt new file mode 100644 index 0000000000..5e6c810e1b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.likes.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class LikesGetListResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesIsLikedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesIsLikedResponse.kt new file mode 100644 index 0000000000..8bfbbaad79 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/likes/dto/LikesIsLikedResponse.kt @@ -0,0 +1,42 @@ +/** + * 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.likes.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseBoolInt + +/** + * @param liked - Information whether user liked the object + * @param copied - Information whether user reposted the object + */ +data class LikesIsLikedResponse( + @SerializedName("liked") + val liked: BaseBoolInt, + @SerializedName("copied") + val copied: BaseBoolInt +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/link/dto/LinkTargetObject.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/link/dto/LinkTargetObject.kt index 1a47484e54..0326856d22 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/link/dto/LinkTargetObject.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/link/dto/LinkTargetObject.kt @@ -32,15 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param type Object type - * @param ownerId Owner ID - * @param itemId Item ID + * @param type - Object type + * @param ownerId - Owner ID + * @param itemId - Item ID */ data class LinkTargetObject( - @SerializedName(value="type") + @SerializedName("type") val type: String? = null, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int? = null, - @SerializedName(value="item_id") + @SerializedName("item_id") val itemId: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/MarketService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/MarketService.kt new file mode 100644 index 0000000000..164eb0af65 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/MarketService.kt @@ -0,0 +1,909 @@ +/** + * 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.market + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.base.dto.BaseBoolInt +import com.vk.sdk.api.base.dto.BaseOkResponse +import com.vk.sdk.api.market.dto.MarketAddAlbumResponse +import com.vk.sdk.api.market.dto.MarketAddResponse +import com.vk.sdk.api.market.dto.MarketGetAlbumByIdResponse +import com.vk.sdk.api.market.dto.MarketGetAlbumsResponse +import com.vk.sdk.api.market.dto.MarketGetByIdExtendedResponse +import com.vk.sdk.api.market.dto.MarketGetByIdResponse +import com.vk.sdk.api.market.dto.MarketGetCategoriesNewResponse +import com.vk.sdk.api.market.dto.MarketGetCommentsResponse +import com.vk.sdk.api.market.dto.MarketGetExtendedResponse +import com.vk.sdk.api.market.dto.MarketGetGroupOrdersResponse +import com.vk.sdk.api.market.dto.MarketGetOrderByIdResponse +import com.vk.sdk.api.market.dto.MarketGetOrderItemsResponse +import com.vk.sdk.api.market.dto.MarketGetOrdersExtendedResponse +import com.vk.sdk.api.market.dto.MarketGetOrdersResponse +import com.vk.sdk.api.market.dto.MarketGetResponse +import com.vk.sdk.api.market.dto.MarketSearchExtendedResponse +import com.vk.sdk.api.market.dto.MarketSearchResponse +import com.vk.sdk.api.market.dto.PaymentStatusParam +import com.vk.sdk.api.market.dto.ReasonParam +import com.vk.sdk.api.market.dto.RevParam +import com.vk.sdk.api.market.dto.SortParam +import com.vk.sdk.api.market.dto.StatusParam +import com.vk.sdk.api.users.dto.UsersFields +import kotlin.Boolean +import kotlin.Float +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class MarketService { + /** + * Ads a new item to the market. + * + * @param ownerId - ID of an item owner community. + * @param name - Item name. + * @param description - Item description. + * @param categoryId - Item category ID. + * @param price - Item price. + * @param oldPrice + * @param deleted - Item status ('1' - deleted, '0' - not deleted). + * @param mainPhotoId - Cover photo ID. + * @param photoIds - IDs of additional photos. + * @param url - Url for button in market item. + * @param dimensionWidth + * @param dimensionHeight + * @param dimensionLength + * @param weight + * @param sku + * @return [VKRequest] with [MarketAddResponse] + */ + fun marketAdd( + ownerId: Int, + name: String, + description: String, + categoryId: Int, + price: Float? = null, + oldPrice: Float? = null, + deleted: Boolean? = null, + mainPhotoId: Int? = null, + photoIds: List? = null, + url: String? = null, + dimensionWidth: Int? = null, + dimensionHeight: Int? = null, + dimensionLength: Int? = null, + weight: Int? = null, + sku: String? = null + ): VKRequest = NewApiRequest("market.add") { + GsonHolder.gson.fromJson(it, MarketAddResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("name", name) + addParam("description", description) + addParam("category_id", categoryId) + price?.let { addParam("price", it) } + oldPrice?.let { addParam("old_price", it) } + deleted?.let { addParam("deleted", it) } + mainPhotoId?.let { addParam("main_photo_id", it) } + photoIds?.let { addParam("photo_ids", it) } + url?.let { addParam("url", it) } + dimensionWidth?.let { addParam("dimension_width", it) } + dimensionHeight?.let { addParam("dimension_height", it) } + dimensionLength?.let { addParam("dimension_length", it) } + weight?.let { addParam("weight", it) } + sku?.let { addParam("sku", it) } + } + + /** + * Creates new collection of items + * + * @param ownerId - ID of an item owner community. + * @param title - Collection title. + * @param photoId - Cover photo ID. + * @param mainAlbum - Set as main ('1' - set, '0' - no). + * @return [VKRequest] with [MarketAddAlbumResponse] + */ + fun marketAddAlbum( + ownerId: Int, + title: String, + photoId: Int? = null, + mainAlbum: Boolean? = null + ): VKRequest = NewApiRequest("market.addAlbum") { + GsonHolder.gson.fromJson(it, MarketAddAlbumResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("title", title) + photoId?.let { addParam("photo_id", it) } + mainAlbum?.let { addParam("main_album", it) } + } + + /** + * Adds an item to one or multiple collections. + * + * @param ownerId - ID of an item owner community. + * @param itemId - Item ID. + * @param albumIds - Collections IDs to add item to. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketAddToAlbum( + ownerId: Int, + itemId: Int, + albumIds: List + ): VKRequest = NewApiRequest("market.addToAlbum") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("item_id", itemId) + addParam("album_ids", albumIds) + } + + /** + * Creates a new comment for an item. + * + * @param ownerId - ID of an item owner community. + * @param itemId - Item ID. + * @param message - Comment text (required if 'attachments' parameter is not specified) + * @param attachments - Comma-separated list of objects attached to a comment. The field is + * submitted the following way: , "'_,_'", , '' - media + * attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , + * '' - media owner id, '' - media attachment id, , For example: + * "photo100172_166443618,photo66748_265827614", + * @param fromGroup - '1' - comment will be published on behalf of a community, '0' - on behalf + * of a user (by default). + * @param replyToComment - ID of a comment to reply with current comment to. + * @param stickerId - Sticker ID. + * @param guid - Random value to avoid resending one comment. + * @return [VKRequest] with [Int] + */ + fun marketCreateComment( + ownerId: Int, + itemId: Int, + message: String? = null, + attachments: List? = null, + fromGroup: Boolean? = null, + replyToComment: Int? = null, + stickerId: Int? = null, + guid: String? = null + ): VKRequest = NewApiRequest("market.createComment") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("item_id", itemId) + message?.let { addParam("message", it) } + attachments?.let { addParam("attachments", it) } + fromGroup?.let { addParam("from_group", it) } + replyToComment?.let { addParam("reply_to_comment", it) } + stickerId?.let { addParam("sticker_id", it) } + guid?.let { addParam("guid", it) } + } + + /** + * Deletes an item. + * + * @param ownerId - ID of an item owner community. + * @param itemId - Item ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketDelete(ownerId: Int, itemId: Int): VKRequest = + NewApiRequest("market.delete") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("item_id", itemId) + } + + /** + * Deletes a collection of items. + * + * @param ownerId - ID of an collection owner community. + * @param albumId - Collection ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketDeleteAlbum(ownerId: Int, albumId: Int): VKRequest = + NewApiRequest("market.deleteAlbum") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("album_id", albumId) + } + + /** + * Deletes an item's comment + * + * @param ownerId - identifier of an item owner community, "Note that community id in the + * 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the + * [vk.com/apiclub|VK API] community " + * @param commentId - comment id + * @return [VKRequest] with [BaseBoolInt] + */ + fun marketDeleteComment(ownerId: Int, commentId: Int): VKRequest = + NewApiRequest("market.deleteComment") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("comment_id", commentId) + } + + /** + * Edits an item. + * + * @param ownerId - ID of an item owner community. + * @param itemId - Item ID. + * @param name - Item name. + * @param description - Item description. + * @param categoryId - Item category ID. + * @param mainPhotoId - Cover photo ID. + * @param price - Item price. + * @param deleted - Item status ('1' - deleted, '0' - not deleted). + * @param photoIds - IDs of additional photos. + * @param url - Url for button in market item. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketEdit( + ownerId: Int, + itemId: Int, + name: String, + description: String, + categoryId: Int, + mainPhotoId: Int, + price: Float? = null, + deleted: Boolean? = null, + photoIds: List? = null, + url: String? = null + ): VKRequest = NewApiRequest("market.edit") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("item_id", itemId) + addParam("name", name) + addParam("description", description) + addParam("category_id", categoryId) + addParam("main_photo_id", mainPhotoId) + price?.let { addParam("price", it) } + deleted?.let { addParam("deleted", it) } + photoIds?.let { addParam("photo_ids", it) } + url?.let { addParam("url", it) } + } + + /** + * Edits a collection of items + * + * @param ownerId - ID of an collection owner community. + * @param albumId - Collection ID. + * @param title - Collection title. + * @param photoId - Cover photo id + * @param mainAlbum - Set as main ('1' - set, '0' - no). + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketEditAlbum( + ownerId: Int, + albumId: Int, + title: String, + photoId: Int? = null, + mainAlbum: Boolean? = null + ): VKRequest = NewApiRequest("market.editAlbum") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("album_id", albumId) + addParam("title", title) + photoId?.let { addParam("photo_id", it) } + mainAlbum?.let { addParam("main_album", it) } + } + + /** + * Chages item comment's text + * + * @param ownerId - ID of an item owner community. + * @param commentId - Comment ID. + * @param message - New comment text (required if 'attachments' are not specified), , 2048 + * symbols maximum. + * @param attachments - Comma-separated list of objects attached to a comment. The field is + * submitted the following way: , "'_,_'", , '' - media + * attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , + * '' - media owner id, '' - media attachment id, , For example: + * "photo100172_166443618,photo66748_265827614", + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketEditComment( + ownerId: Int, + commentId: Int, + message: String? = null, + attachments: List? = null + ): VKRequest = NewApiRequest("market.editComment") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("comment_id", commentId) + message?.let { addParam("message", it) } + attachments?.let { addParam("attachments", it) } + } + + /** + * Edit order + * + * @param userId + * @param orderId + * @param merchantComment + * @param status + * @param trackNumber + * @param paymentStatus + * @param deliveryPrice + * @param width + * @param length + * @param height + * @param weight + * @param commentForUser + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketEditOrder( + userId: Int, + orderId: Int, + merchantComment: String? = null, + status: Int? = null, + trackNumber: String? = null, + paymentStatus: PaymentStatusParam? = null, + deliveryPrice: Int? = null, + width: Int? = null, + length: Int? = null, + height: Int? = null, + weight: Int? = null, + commentForUser: String? = null + ): VKRequest = NewApiRequest("market.editOrder") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("user_id", userId) + addParam("order_id", orderId) + merchantComment?.let { addParam("merchant_comment", it) } + status?.let { addParam("status", it) } + trackNumber?.let { addParam("track_number", it) } + paymentStatus?.let { addParam("payment_status", it.value) } + deliveryPrice?.let { addParam("delivery_price", it) } + width?.let { addParam("width", it) } + length?.let { addParam("length", it) } + height?.let { addParam("height", it) } + weight?.let { addParam("weight", it) } + commentForUser?.let { addParam("comment_for_user", it) } + } + + /** + * Returns items list for a community. + * + * @param ownerId - ID of an item owner community, "Note that community id in the 'owner_id' + * parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK + * API] community " + * @param albumId + * @param count - Number of items to return. + * @param offset - Offset needed to return a specific subset of results. + * @return [VKRequest] with [MarketGetResponse] + */ + fun marketGet( + ownerId: Int, + albumId: Int? = null, + count: Int? = null, + offset: Int? = null + ): VKRequest = NewApiRequest("market.get") { + GsonHolder.gson.fromJson(it, MarketGetResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + albumId?.let { addParam("album_id", it) } + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + } + + /** + * Returns items list for a community. + * + * @param ownerId - ID of an item owner community, "Note that community id in the 'owner_id' + * parameter should be negative number. For example 'owner_id'=-1 matches the [vk.com/apiclub|VK + * API] community " + * @param albumId + * @param count - Number of items to return. + * @param offset - Offset needed to return a specific subset of results. + * @return [VKRequest] with [MarketGetExtendedResponse] + */ + fun marketGetExtended( + ownerId: Int, + albumId: Int? = null, + count: Int? = null, + offset: Int? = null + ): VKRequest = NewApiRequest("market.get") { + GsonHolder.gson.fromJson(it, MarketGetExtendedResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + albumId?.let { addParam("album_id", it) } + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + addParam("extended", true) + } + + /** + * Returns items album's data + * + * @param ownerId - identifier of an album owner community, "Note that community id in the + * 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the + * [vk.com/apiclub|VK API] community " + * @param albumIds - collections identifiers to obtain data from + * @return [VKRequest] with [MarketGetAlbumByIdResponse] + */ + fun marketGetAlbumById(ownerId: Int, albumIds: List): VKRequest + = NewApiRequest("market.getAlbumById") { + GsonHolder.gson.fromJson(it, MarketGetAlbumByIdResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("album_ids", albumIds) + } + + /** + * Returns community's market collections list. + * + * @param ownerId - ID of an items owner community. + * @param offset - Offset needed to return a specific subset of results. + * @param count - Number of items to return. + * @return [VKRequest] with [MarketGetAlbumsResponse] + */ + fun marketGetAlbums( + ownerId: Int, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("market.getAlbums") { + GsonHolder.gson.fromJson(it, MarketGetAlbumsResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Returns information about market items by their ids. + * + * @param itemIds - Comma-separated ids list: {user id}_{item id}. If an item belongs to a + * community -{community id} is used. " 'Videos' value example: , + * '-4363_136089719,13245770_137352259'" + * @return [VKRequest] with [MarketGetByIdResponse] + */ + fun marketGetById(itemIds: List): VKRequest = + NewApiRequest("market.getById") { + GsonHolder.gson.fromJson(it, MarketGetByIdResponse::class.java) + } + .apply { + addParam("item_ids", itemIds) + } + + /** + * Returns information about market items by their ids. + * + * @param itemIds - Comma-separated ids list: {user id}_{item id}. If an item belongs to a + * community -{community id} is used. " 'Videos' value example: , + * '-4363_136089719,13245770_137352259'" + * @return [VKRequest] with [MarketGetByIdExtendedResponse] + */ + fun marketGetByIdExtended(itemIds: List): VKRequest = + NewApiRequest("market.getById") { + GsonHolder.gson.fromJson(it, MarketGetByIdExtendedResponse::class.java) + } + .apply { + addParam("item_ids", itemIds) + addParam("extended", true) + } + + /** + * Returns a list of market categories. + * + * @param count - Number of results to return. + * @param offset - Offset needed to return a specific subset of results. + * @return [VKRequest] with [MarketGetCategoriesNewResponse] + */ + fun marketGetCategories(count: Int? = null, offset: Int? = null): + VKRequest = NewApiRequest("market.getCategories") { + GsonHolder.gson.fromJson(it, MarketGetCategoriesNewResponse::class.java) + } + .apply { + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + } + + /** + * Returns comments list for an item. + * + * @param ownerId - ID of an item owner community + * @param itemId - Item ID. + * @param needLikes - '1' - to return likes info. + * @param startCommentId - ID of a comment to start a list from (details below). + * @param offset + * @param count - Number of results to return. + * @param sort - Sort order ('asc' - from old to new, 'desc' - from new to old) + * @param fields - List of additional profile fields to return. See the + * [vk.com/dev/fields|details] + * @return [VKRequest] with [MarketGetCommentsResponse] + */ + fun marketGetComments( + ownerId: Int, + itemId: Int, + needLikes: Boolean? = null, + startCommentId: Int? = null, + offset: Int? = null, + count: Int? = null, + sort: SortParam? = null, + fields: List? = null + ): VKRequest = NewApiRequest("market.getComments") { + GsonHolder.gson.fromJson(it, MarketGetCommentsResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("item_id", itemId) + needLikes?.let { addParam("need_likes", it) } + startCommentId?.let { addParam("start_comment_id", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + sort?.let { addParam("sort", it.value) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Get market orders + * + * @param groupId + * @param offset + * @param count + * @return [VKRequest] with [MarketGetGroupOrdersResponse] + */ + fun marketGetGroupOrders( + groupId: Int, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("market.getGroupOrders") { + GsonHolder.gson.fromJson(it, MarketGetGroupOrdersResponse::class.java) + } + .apply { + addParam("group_id", groupId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * Get order + * + * @param orderId + * @param userId + * @return [VKRequest] with [MarketGetOrderByIdResponse] + */ + fun marketGetOrderById(orderId: Int, userId: Int? = null): VKRequest + = NewApiRequest("market.getOrderById") { + GsonHolder.gson.fromJson(it, MarketGetOrderByIdResponse::class.java) + } + .apply { + addParam("order_id", orderId) + userId?.let { addParam("user_id", it) } + } + + /** + * Get market items in the order + * + * @param orderId + * @param userId + * @param offset + * @param count + * @return [VKRequest] with [MarketGetOrderItemsResponse] + */ + fun marketGetOrderItems( + orderId: Int, + userId: Int? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("market.getOrderItems") { + GsonHolder.gson.fromJson(it, MarketGetOrderItemsResponse::class.java) + } + .apply { + addParam("order_id", orderId) + userId?.let { addParam("user_id", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * @param offset + * @param count + * @return [VKRequest] with [MarketGetOrdersResponse] + */ + fun marketGetOrders(offset: Int? = null, count: Int? = null): VKRequest + = NewApiRequest("market.getOrders") { + GsonHolder.gson.fromJson(it, MarketGetOrdersResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * @param offset + * @param count + * @return [VKRequest] with [MarketGetOrdersExtendedResponse] + */ + fun marketGetOrdersExtended(offset: Int? = null, count: Int? = null): + VKRequest = NewApiRequest("market.getOrders") { + GsonHolder.gson.fromJson(it, MarketGetOrdersExtendedResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + addParam("extended", true) + } + + /** + * Removes an item from one or multiple collections. + * + * @param ownerId - ID of an item owner community. + * @param itemId - Item ID. + * @param albumIds - Collections IDs to remove item from. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketRemoveFromAlbum( + ownerId: Int, + itemId: Int, + albumIds: List + ): VKRequest = NewApiRequest("market.removeFromAlbum") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("item_id", itemId) + addParam("album_ids", albumIds) + } + + /** + * Reorders the collections list. + * + * @param ownerId - ID of an item owner community. + * @param albumId - Collection ID. + * @param before - ID of a collection to place current collection before it. + * @param after - ID of a collection to place current collection after it. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketReorderAlbums( + ownerId: Int, + albumId: Int, + before: Int? = null, + after: Int? = null + ): VKRequest = NewApiRequest("market.reorderAlbums") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("album_id", albumId) + before?.let { addParam("before", it) } + after?.let { addParam("after", it) } + } + + /** + * Changes item place in a collection. + * + * @param ownerId - ID of an item owner community. + * @param itemId - Item ID. + * @param albumId - ID of a collection to reorder items in. Set 0 to reorder full items list. + * @param before - ID of an item to place current item before it. + * @param after - ID of an item to place current item after it. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketReorderItems( + ownerId: Int, + itemId: Int, + albumId: Int? = null, + before: Int? = null, + after: Int? = null + ): VKRequest = NewApiRequest("market.reorderItems") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("item_id", itemId) + albumId?.let { addParam("album_id", it) } + before?.let { addParam("before", it) } + after?.let { addParam("after", it) } + } + + /** + * Sends a complaint to the item. + * + * @param ownerId - ID of an item owner community. + * @param itemId - Item ID. + * @param reason - Complaint reason. Possible values: *'0' - spam,, *'1' - child porn,, *'2' - + * extremism,, *'3' - violence,, *'4' - drugs propaganda,, *'5' - adult materials,, *'6' - insult. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketReport( + ownerId: Int, + itemId: Int, + reason: ReasonParam? = null + ): VKRequest = NewApiRequest("market.report") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("item_id", itemId) + reason?.let { addParam("reason", it.value) } + } + + /** + * Sends a complaint to the item's comment. + * + * @param ownerId - ID of an item owner community. + * @param commentId - Comment ID. + * @param reason - Complaint reason. Possible values: *'0' - spam,, *'1' - child porn,, *'2' - + * extremism,, *'3' - violence,, *'4' - drugs propaganda,, *'5' - adult materials,, *'6' - insult. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketReportComment( + ownerId: Int, + commentId: Int, + reason: ReasonParam + ): VKRequest = NewApiRequest("market.reportComment") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("comment_id", commentId) + addParam("reason", reason.value) + } + + /** + * Restores recently deleted item + * + * @param ownerId - ID of an item owner community. + * @param itemId - Deleted item ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun marketRestore(ownerId: Int, itemId: Int): VKRequest = + NewApiRequest("market.restore") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("item_id", itemId) + } + + /** + * Restores a recently deleted comment + * + * @param ownerId - identifier of an item owner community, "Note that community id in the + * 'owner_id' parameter should be negative number. For example 'owner_id'=-1 matches the + * [vk.com/apiclub|VK API] community " + * @param commentId - deleted comment id + * @return [VKRequest] with [BaseBoolInt] + */ + fun marketRestoreComment(ownerId: Int, commentId: Int): VKRequest = + NewApiRequest("market.restoreComment") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("owner_id", ownerId) + addParam("comment_id", commentId) + } + + /** + * Searches market items in a community's catalog + * + * @param ownerId - ID of an items owner community. + * @param albumId + * @param q - Search query, for example "pink slippers". + * @param priceFrom - Minimum item price value. + * @param priceTo - Maximum item price value. + * @param sort + * @param rev - '0' - do not use reverse order, '1' - use reverse order + * @param offset - Offset needed to return a specific subset of results. + * @param count - Number of items to return. + * @param status + * @return [VKRequest] with [MarketSearchResponse] + */ + fun marketSearch( + ownerId: Int, + albumId: Int? = null, + q: String? = null, + priceFrom: Int? = null, + priceTo: Int? = null, + sort: SortParam? = null, + rev: RevParam? = null, + offset: Int? = null, + count: Int? = null, + status: StatusParam? = null + ): VKRequest = NewApiRequest("market.search") { + GsonHolder.gson.fromJson(it, MarketSearchResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + albumId?.let { addParam("album_id", it) } + q?.let { addParam("q", it) } + priceFrom?.let { addParam("price_from", it) } + priceTo?.let { addParam("price_to", it) } + sort?.let { addParam("sort", it.value) } + rev?.let { addParam("rev", it.value) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + status?.let { addParam("status", it.value) } + } + + /** + * Searches market items in a community's catalog + * + * @param ownerId - ID of an items owner community. + * @param albumId + * @param q - Search query, for example "pink slippers". + * @param priceFrom - Minimum item price value. + * @param priceTo - Maximum item price value. + * @param sort + * @param rev - '0' - do not use reverse order, '1' - use reverse order + * @param offset - Offset needed to return a specific subset of results. + * @param count - Number of items to return. + * @param status + * @return [VKRequest] with [MarketSearchExtendedResponse] + */ + fun marketSearchExtended( + ownerId: Int, + albumId: Int? = null, + q: String? = null, + priceFrom: Int? = null, + priceTo: Int? = null, + sort: SortParam? = null, + rev: RevParam? = null, + offset: Int? = null, + count: Int? = null, + status: StatusParam? = null + ): VKRequest = NewApiRequest("market.search") { + GsonHolder.gson.fromJson(it, MarketSearchExtendedResponse::class.java) + } + .apply { + addParam("owner_id", ownerId) + albumId?.let { addParam("album_id", it) } + q?.let { addParam("q", it) } + priceFrom?.let { addParam("price_from", it) } + priceTo?.let { addParam("price_to", it) } + sort?.let { addParam("sort", it.value) } + rev?.let { addParam("rev", it.value) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + addParam("extended", true) + status?.let { addParam("status", it.value) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketAddAlbumResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketAddAlbumResponse.kt new file mode 100644 index 0000000000..cad49582c2 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketAddAlbumResponse.kt @@ -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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param marketAlbumId - Album ID + */ +data class MarketAddAlbumResponse( + @SerializedName("market_album_id") + val marketAlbumId: Int? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketAddResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketAddResponse.kt new file mode 100644 index 0000000000..228b2dccb7 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketAddResponse.kt @@ -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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param marketItemId - Item ID + */ +data class MarketAddResponse( + @SerializedName("market_item_id") + val marketItemId: Int +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketCurrency.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketCurrency.kt index 48e19fc6d7..e812b07486 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketCurrency.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketCurrency.kt @@ -32,12 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param id Currency ID - * @param name Currency sign + * @param id - Currency ID + * @param name - Currency sign + * @param title - Currency title */ data class MarketCurrency( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") - val name: String + @SerializedName("name") + val name: String, + @SerializedName("title") + val title: String ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetAlbumByIdResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetAlbumByIdResponse.kt new file mode 100644 index 0000000000..9aef669452 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetAlbumByIdResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetAlbumByIdResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetAlbumsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetAlbumsResponse.kt new file mode 100644 index 0000000000..fe2d55e39f --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetAlbumsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetAlbumsResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetByIdExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetByIdExtendedResponse.kt new file mode 100644 index 0000000000..c8751d12cb --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetByIdExtendedResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetByIdExtendedResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetByIdResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetByIdResponse.kt new file mode 100644 index 0000000000..2ee25c14cd --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetByIdResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetByIdResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetCategoriesNewResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetCategoriesNewResponse.kt new file mode 100644 index 0000000000..fe23290969 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetCategoriesNewResponse.kt @@ -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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.collections.List + +/** + * @param items + */ +data class MarketGetCategoriesNewResponse( + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetCommentsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetCommentsResponse.kt new file mode 100644 index 0000000000..c86483d933 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetCommentsResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.wall.dto.WallWallComment +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetCommentsResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetExtendedResponse.kt new file mode 100644 index 0000000000..a10d779040 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetExtendedResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetExtendedResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetGroupOrdersResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetGroupOrdersResponse.kt new file mode 100644 index 0000000000..3c748ee3e1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetGroupOrdersResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetGroupOrdersResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrderByIdResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrderByIdResponse.kt new file mode 100644 index 0000000000..766c173a34 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrderByIdResponse.kt @@ -0,0 +1,38 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName + +/** + * @param order + */ +data class MarketGetOrderByIdResponse( + @SerializedName("order") + val order: MarketOrder? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrderItemsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrderItemsResponse.kt new file mode 100644 index 0000000000..9abc01dd35 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrderItemsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetOrderItemsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrdersExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrdersExtendedResponse.kt new file mode 100644 index 0000000000..457d37e1de --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrdersExtendedResponse.kt @@ -0,0 +1,47 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param groups + */ +data class MarketGetOrdersExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrdersResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrdersResponse.kt new file mode 100644 index 0000000000..f1948b799b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetOrdersResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetOrdersResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetResponse.kt new file mode 100644 index 0000000000..dd62565aa1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketGetResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MarketGetResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketAlbum.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketAlbum.kt index 684cd255d1..6334d96a2b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketAlbum.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketAlbum.kt @@ -33,24 +33,24 @@ import kotlin.Int import kotlin.String /** - * @param count Items number - * @param id Market album ID - * @param ownerId Market album owner's ID - * @param title Market album title - * @param updatedTime Date when album has been updated last time in Unixtime - * @param photo no description + * @param count - Items number + * @param id - Market album ID + * @param ownerId - Market album owner's ID + * @param title - Market album title + * @param updatedTime - Date when album has been updated last time in Unixtime + * @param photo */ data class MarketMarketAlbum( - @SerializedName(value="count") + @SerializedName("count") val count: Int, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="updated_time") + @SerializedName("updated_time") val updatedTime: Int, - @SerializedName(value="photo") + @SerializedName("photo") val photo: PhotosPhoto? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategory.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategory.kt index 4e85c3d226..6392cbc082 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategory.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategory.kt @@ -32,15 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param id Category ID - * @param name Category name - * @param section no description + * @param id - Category ID + * @param name - Category name + * @param parent */ data class MarketMarketCategory( - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="name") + @SerializedName("name") val name: String? = null, - @SerializedName(value="section") - val section: MarketSection? = null + @SerializedName("parent") + val parent: MarketMarketCategoryNested? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategoryNested.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategoryNested.kt index 1a9924c82d..c6e5c9e7d6 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategoryNested.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategoryNested.kt @@ -32,15 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param id Category ID - * @param name Category name - * @param parent no description + * @param id - Category ID + * @param name - Category name + * @param parent */ data class MarketMarketCategoryNested( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="parent") + @SerializedName("parent") val parent: MarketMarketCategoryNested? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategoryTree.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategoryTree.kt index d5379e961e..9e233678d8 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategoryTree.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategoryTree.kt @@ -33,15 +33,15 @@ import kotlin.String import kotlin.collections.List /** - * @param id Category ID - * @param name Category name - * @param children no description + * @param id - Category ID + * @param name - Category name + * @param children */ data class MarketMarketCategoryTree( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="name") + @SerializedName("name") val name: String, - @SerializedName(value="children") + @SerializedName("children") val children: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItem.kt index ea582550e4..213f879b11 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItem.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItem.kt @@ -33,54 +33,60 @@ import kotlin.Int import kotlin.String /** - * @param availability no description - * @param category no description - * @param description Item description - * @param id Item ID - * @param ownerId Item owner's ID - * @param price no description - * @param title Item title - * @param accessKey Access key for the market item - * @param buttonTitle Title for button for url - * @param date Date when the item has been created in Unixtime - * @param externalId no description - * @param isFavorite no description - * @param thumbPhoto URL of the preview image - * @param url URL to item - * @param variantsGroupingId no description - * @param isMainVariant no description + * @param availability + * @param category + * @param description - Item description + * @param id - Item ID + * @param ownerId - Item owner's ID + * @param price + * @param title - Item title + * @param accessKey - Access key for the market item + * @param buttonTitle - Title for button for url + * @param date - Date when the item has been created in Unixtime + * @param externalId + * @param isFavorite + * @param thumbPhoto - URL of the preview image + * @param url - URL to item + * @param variantsGroupingId + * @param isMainVariant + * @param sku + * @param stockAmount - Inventory balances */ data class MarketMarketItem( - @SerializedName(value="availability") + @SerializedName("availability") val availability: MarketMarketItemAvailability, - @SerializedName(value="category") + @SerializedName("category") val category: MarketMarketCategory, - @SerializedName(value="description") + @SerializedName("description") val description: String, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="price") + @SerializedName("price") val price: MarketPrice, - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="access_key") + @SerializedName("access_key") val accessKey: String? = null, - @SerializedName(value="button_title") + @SerializedName("button_title") val buttonTitle: String? = null, - @SerializedName(value="date") + @SerializedName("date") val date: Int? = null, - @SerializedName(value="external_id") + @SerializedName("external_id") val externalId: String? = null, - @SerializedName(value="is_favorite") + @SerializedName("is_favorite") val isFavorite: Boolean? = null, - @SerializedName(value="thumb_photo") + @SerializedName("thumb_photo") val thumbPhoto: String? = null, - @SerializedName(value="url") + @SerializedName("url") val url: String? = null, - @SerializedName(value="variants_grouping_id") + @SerializedName("variants_grouping_id") val variantsGroupingId: Int? = null, - @SerializedName(value="is_main_variant") - val isMainVariant: Boolean? = null + @SerializedName("is_main_variant") + val isMainVariant: Boolean? = null, + @SerializedName("sku") + val sku: String? = null, + @SerializedName("stock_amount") + val stockAmount: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemAvailability.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemAvailability.kt index e596d7dc2f..fa099cb431 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemAvailability.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemAvailability.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.market.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.Int enum class MarketMarketItemAvailability( val value: Int ) { + @SerializedName("0") AVAILABLE(0), + @SerializedName("1") REMOVED(1), + @SerializedName("2") UNAVAILABLE(2); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: MarketMarketItemAvailability?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): MarketMarketItemAvailability { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemFull.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemFull.kt index b7cf391217..5f5c8b58a4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemFull.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemFull.kt @@ -34,89 +34,102 @@ import com.vk.sdk.api.base.dto.BaseLink import com.vk.sdk.api.base.dto.BaseRepostsInfo import com.vk.sdk.api.photos.dto.PhotosPhoto import kotlin.Boolean +import kotlin.Float import kotlin.Int import kotlin.String import kotlin.collections.List /** - * @param albumsIds no description - * @param photos no description - * @param canComment Information whether current use can comment the item - * @param canRepost Information whether current use can repost the item - * @param likes no description - * @param reposts no description - * @param viewsCount Views number - * @param wishlistItemId Object identifier in wishlist of viewer - * @param cancelInfo Information for cancel and revert order - * @param userAgreementInfo User agreement info - * @param accessKey Access key for the market item - * @param availability no description - * @param buttonTitle Title for button for url - * @param category no description - * @param date Date when the item has been created in Unixtime - * @param description Item description - * @param externalId no description - * @param id Item ID - * @param isFavorite no description - * @param ownerId Item owner's ID - * @param price no description - * @param thumbPhoto URL of the preview image - * @param title Item title - * @param url URL to item - * @param variantsGroupingId no description - * @param isMainVariant no description + * @param albumsIds + * @param photos + * @param canComment - Information whether current use can comment the item + * @param canRepost - Information whether current use can repost the item + * @param likes + * @param reposts + * @param viewsCount - Views number + * @param wishlistItemId - Object identifier in wishlist of viewer + * @param rating - Rating of product + * @param ordersCount - Count of product orders + * @param cancelInfo - Information for cancel and revert order + * @param userAgreementInfo - User agreement info + * @param accessKey - Access key for the market item + * @param availability + * @param buttonTitle - Title for button for url + * @param category + * @param date - Date when the item has been created in Unixtime + * @param description - Item description + * @param externalId + * @param id - Item ID + * @param isFavorite + * @param ownerId - Item owner's ID + * @param price + * @param thumbPhoto - URL of the preview image + * @param title - Item title + * @param url - URL to item + * @param variantsGroupingId + * @param isMainVariant + * @param sku + * @param stockAmount - Inventory balances */ data class MarketMarketItemFull( - @SerializedName(value="albums_ids") + @SerializedName("albums_ids") val albumsIds: List? = null, - @SerializedName(value="photos") + @SerializedName("photos") val photos: List? = null, - @SerializedName(value="can_comment") + @SerializedName("can_comment") val canComment: BaseBoolInt? = null, - @SerializedName(value="can_repost") + @SerializedName("can_repost") val canRepost: BaseBoolInt? = null, - @SerializedName(value="likes") + @SerializedName("likes") val likes: BaseLikes? = null, - @SerializedName(value="reposts") + @SerializedName("reposts") val reposts: BaseRepostsInfo? = null, - @SerializedName(value="views_count") + @SerializedName("views_count") val viewsCount: Int? = null, - @SerializedName(value="wishlist_item_id") + @SerializedName("wishlist_item_id") val wishlistItemId: Int? = null, - @SerializedName(value="cancel_info") + @SerializedName("rating") + val rating: Float? = null, + @SerializedName("orders_count") + val ordersCount: Int? = null, + @SerializedName("cancel_info") val cancelInfo: BaseLink? = null, - @SerializedName(value="user_agreement_info") + @SerializedName("user_agreement_info") val userAgreementInfo: String? = null, - @SerializedName(value="access_key") + @SerializedName("access_key") val accessKey: String? = null, - @SerializedName(value="availability") + @SerializedName("availability") val availability: MarketMarketItemAvailability? = null, - @SerializedName(value="button_title") + @SerializedName("button_title") val buttonTitle: String? = null, - @SerializedName(value="category") + @SerializedName("category") val category: MarketMarketCategory? = null, - @SerializedName(value="date") + @SerializedName("date") val date: Int? = null, - @SerializedName(value="description") + @SerializedName("description") val description: String? = null, - @SerializedName(value="external_id") + @SerializedName("external_id") val externalId: String? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="is_favorite") + @SerializedName("is_favorite") val isFavorite: Boolean? = null, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int? = null, - @SerializedName(value="price") + @SerializedName("price") val price: MarketPrice? = null, - @SerializedName(value="thumb_photo") + @SerializedName("thumb_photo") val thumbPhoto: String? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="url") + @SerializedName("url") val url: String? = null, - @SerializedName(value="variants_grouping_id") + @SerializedName("variants_grouping_id") val variantsGroupingId: Int? = null, - @SerializedName(value="is_main_variant") - val isMainVariant: Boolean? = null + @SerializedName("is_main_variant") + val isMainVariant: Boolean? = null, + @SerializedName("sku") + val sku: String? = null, + @SerializedName("stock_amount") + val stockAmount: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketOrder.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketOrder.kt index fca436c937..0682e7634a 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketOrder.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketOrder.kt @@ -29,59 +29,72 @@ package com.vk.sdk.api.market.dto import com.google.gson.annotations.SerializedName import com.vk.sdk.api.base.dto.BaseLink +import kotlin.Boolean import kotlin.Int import kotlin.String import kotlin.collections.List /** - * @param id no description - * @param groupId no description - * @param userId no description - * @param date no description - * @param status no description - * @param itemsCount no description - * @param totalPrice no description - * @param displayOrderId no description - * @param trackNumber no description - * @param trackLink no description - * @param comment no description - * @param address no description - * @param merchantComment no description - * @param weight no description - * @param previewOrderItems Several order items for preview - * @param cancelInfo Information for cancel and revert order + * @param id + * @param groupId + * @param userId + * @param date + * @param status + * @param itemsCount + * @param totalPrice + * @param displayOrderId + * @param trackNumber + * @param trackLink + * @param comment + * @param address + * @param merchantComment + * @param weight + * @param discount + * @param previewOrderItems - Several order items for preview + * @param cancelInfo - Information for cancel and revert order + * @param commentForUser - Seller comment for user + * @param isViewedByAdmin + * @param dateViewed */ data class MarketOrder( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="group_id") + @SerializedName("group_id") val groupId: Int, - @SerializedName(value="user_id") + @SerializedName("user_id") val userId: Int, - @SerializedName(value="date") + @SerializedName("date") val date: Int, - @SerializedName(value="status") + @SerializedName("status") val status: Int, - @SerializedName(value="items_count") + @SerializedName("items_count") val itemsCount: Int, - @SerializedName(value="total_price") + @SerializedName("total_price") val totalPrice: MarketPrice, - @SerializedName(value="display_order_id") + @SerializedName("display_order_id") val displayOrderId: String? = null, - @SerializedName(value="track_number") + @SerializedName("track_number") val trackNumber: String? = null, - @SerializedName(value="track_link") + @SerializedName("track_link") val trackLink: String? = null, - @SerializedName(value="comment") + @SerializedName("comment") val comment: String? = null, - @SerializedName(value="address") + @SerializedName("address") val address: String? = null, - @SerializedName(value="merchant_comment") + @SerializedName("merchant_comment") val merchantComment: String? = null, - @SerializedName(value="weight") + @SerializedName("weight") val weight: Int? = null, - @SerializedName(value="preview_order_items") + @SerializedName("discount") + val discount: MarketPrice? = null, + @SerializedName("preview_order_items") val previewOrderItems: List? = null, - @SerializedName(value="cancel_info") - val cancelInfo: BaseLink? = null + @SerializedName("cancel_info") + val cancelInfo: BaseLink? = null, + @SerializedName("comment_for_user") + val commentForUser: String? = null, + @SerializedName("is_viewed_by_admin") + val isViewedByAdmin: Boolean? = null, + @SerializedName("date_viewed") + val dateViewed: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketOrderItem.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketOrderItem.kt index d8f805f7e1..a5aabb166c 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketOrderItem.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketOrderItem.kt @@ -34,30 +34,30 @@ import kotlin.String import kotlin.collections.List /** - * @param ownerId no description - * @param itemId no description - * @param price no description - * @param quantity no description - * @param item no description - * @param title no description - * @param photo no description - * @param variants no description + * @param ownerId + * @param itemId + * @param price + * @param quantity + * @param item + * @param title + * @param photo + * @param variants */ data class MarketOrderItem( - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="item_id") + @SerializedName("item_id") val itemId: Int, - @SerializedName(value="price") + @SerializedName("price") val price: MarketPrice, - @SerializedName(value="quantity") + @SerializedName("quantity") val quantity: Int, - @SerializedName(value="item") + @SerializedName("item") val item: MarketMarketItem, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="photo") + @SerializedName("photo") val photo: PhotosPhoto? = null, - @SerializedName(value="variants") + @SerializedName("variants") val variants: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketPrice.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketPrice.kt index 6bd7d78787..c3330b40e4 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketPrice.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketPrice.kt @@ -32,24 +32,62 @@ import kotlin.Int import kotlin.String /** - * @param amount Amount - * @param currency no description - * @param text Text - * @param discountRate no description - * @param oldAmount no description - * @param oldAmountText Textual representation of old price + * @param amount - Amount + * @param currency + * @param text - Text + * @param amountTo - Amount to for price_type=2 + * @param priceType + * @param priceUnit + * @param discountRate + * @param oldAmount + * @param oldAmountText - Textual representation of old price */ data class MarketPrice( - @SerializedName(value="amount") + @SerializedName("amount") val amount: String, - @SerializedName(value="currency") + @SerializedName("currency") val currency: MarketCurrency, - @SerializedName(value="text") + @SerializedName("text") val text: String, - @SerializedName(value="discount_rate") + @SerializedName("amount_to") + val amountTo: String? = null, + @SerializedName("price_type") + val priceType: MarketPrice.PriceType? = null, + @SerializedName("price_unit") + val priceUnit: MarketPrice.PriceUnit? = null, + @SerializedName("discount_rate") val discountRate: Int? = null, - @SerializedName(value="old_amount") + @SerializedName("old_amount") val oldAmount: String? = null, - @SerializedName(value="old_amount_text") + @SerializedName("old_amount_text") val oldAmountText: String? = null -) +) { + enum class PriceType( + val value: Int + ) { + @SerializedName("0") + EXACT(0), + + @SerializedName("2") + RANGE(2), + + @SerializedName("3") + BY_AGREEMENT(3); + } + + enum class PriceUnit( + val value: Int + ) { + @SerializedName("0") + ITEM(0), + + @SerializedName("2") + HOUR(2), + + @SerializedName("3") + M2(3), + + @SerializedName("4") + M3(4); + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedResponse.kt new file mode 100644 index 0000000000..68a6c2ac6e --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedResponse.kt @@ -0,0 +1,46 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param viewType + * @param items + */ +data class MarketSearchExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("view_type") + val viewType: MarketServicesViewType, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchResponse.kt new file mode 100644 index 0000000000..416e54e68a --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchResponse.kt @@ -0,0 +1,46 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param viewType + * @param items + */ +data class MarketSearchResponse( + @SerializedName("count") + val count: Int, + @SerializedName("view_type") + val viewType: MarketServicesViewType, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketServicesViewType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketServicesViewType.kt new file mode 100644 index 0000000000..0196e31c24 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/MarketServicesViewType.kt @@ -0,0 +1,41 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class MarketServicesViewType( + val value: Int +) { + @SerializedName("1") + CARDS(1), + + @SerializedName("2") + ROWS(2); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/PaymentStatusParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/PaymentStatusParam.kt new file mode 100644 index 0000000000..74fa5059dc --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/PaymentStatusParam.kt @@ -0,0 +1,44 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class PaymentStatusParam( + val value: String +) { + @SerializedName("not_paid") + NOT_PAID("not_paid"), + + @SerializedName("paid") + PAID("paid"), + + @SerializedName("returned") + RETURNED("returned"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/ReasonParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/ReasonParam.kt new file mode 100644 index 0000000000..ab18579e10 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/ReasonParam.kt @@ -0,0 +1,56 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class ReasonParam( + val value: Int +) { + @SerializedName("0") + SPAM(0), + + @SerializedName("1") + CHILD_PORNOGRAPHY(1), + + @SerializedName("2") + EXTREMISM(2), + + @SerializedName("3") + VIOLENCE(3), + + @SerializedName("4") + DRUG_PROPAGANDA(4), + + @SerializedName("5") + ADULT_MATERIAL(5), + + @SerializedName("6") + INSULT_ABUSE(6); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/RevParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/RevParam.kt new file mode 100644 index 0000000000..11b403b726 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/RevParam.kt @@ -0,0 +1,41 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class RevParam( + val value: Int +) { + @SerializedName("0") + NORMAL(0), + + @SerializedName("1") + REVERSE(1); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/SortParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/SortParam.kt new file mode 100644 index 0000000000..1244a8b8cf --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/SortParam.kt @@ -0,0 +1,41 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class SortParam( + val value: String +) { + @SerializedName("asc") + OLD_TO_NEW("asc"), + + @SerializedName("desc") + NEW_TO_OLD("desc"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/StatusParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/StatusParam.kt new file mode 100644 index 0000000000..3a75c2daee --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/market/dto/StatusParam.kt @@ -0,0 +1,41 @@ +/** + * 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.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class StatusParam( + val value: Int +) { + @SerializedName("0") + ACTIVE(0), + + @SerializedName("2") + DISABLED(2); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/media/dto/MediaPopup.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/media/dto/MediaPopup.kt new file mode 100644 index 0000000000..1a1159b94d --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/media/dto/MediaPopup.kt @@ -0,0 +1,76 @@ +/** + * 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.media.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseImage +import com.vk.sdk.api.base.dto.BaseLinkButton +import kotlin.String +import kotlin.collections.List + +/** + * @param title - Restriction title + * @param id - Popup id + * @param button - Restriction button + * @param buttons - Restriction button + * @param icons - Restriction icon + * @param musicSubscriptionEvent - Stats param + * @param text - Restriction text + * @param imageMode + */ +data class MediaPopup( + @SerializedName("title") + val title: String, + @SerializedName("id") + val id: String? = null, + @SerializedName("button") + val button: BaseLinkButton? = null, + @SerializedName("buttons") + val buttons: List? = null, + @SerializedName("icons") + val icons: List? = null, + @SerializedName("music_subscription_event") + val musicSubscriptionEvent: String? = null, + @SerializedName("text") + val text: String? = null, + @SerializedName("image_mode") + val imageMode: MediaPopup.ImageMode? = null +) { + enum class ImageMode( + val value: String + ) { + @SerializedName("round") + ROUND("round"), + + @SerializedName("small") + SMALL("small"), + + @SerializedName("big") + BIG("big"); + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/media/dto/MediaRestriction.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/media/dto/MediaRestriction.kt index de9dde51cf..f8cd6fe005 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/media/dto/MediaRestriction.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/media/dto/MediaRestriction.kt @@ -35,33 +35,34 @@ import kotlin.String import kotlin.collections.List /** - * @param title no description - * @param text no description - * @param button no description - * @param alwaysShown Need show restriction always or not - * @param blur Need blur current video or not - * @param canPlay Can play video or not - * @param canPreview Can preview video or not - * @param cardIcon no description - * @param listIcon no description + * Media restrictions + * @param title + * @param text + * @param button + * @param alwaysShown - Need show restriction always or not + * @param blur - Need blur current video or not + * @param canPlay - Can play video or not + * @param canPreview - Can preview video or not + * @param cardIcon + * @param listIcon */ data class MediaRestriction( - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="text") + @SerializedName("text") val text: String? = null, - @SerializedName(value="button") + @SerializedName("button") val button: VideoRestrictionButton? = null, - @SerializedName(value="always_shown") + @SerializedName("always_shown") val alwaysShown: BaseBoolInt? = null, - @SerializedName(value="blur") + @SerializedName("blur") val blur: BaseBoolInt? = null, - @SerializedName(value="can_play") + @SerializedName("can_play") val canPlay: BaseBoolInt? = null, - @SerializedName(value="can_preview") + @SerializedName("can_preview") val canPreview: BaseBoolInt? = null, - @SerializedName(value="card_icon") + @SerializedName("card_icon") val cardIcon: List? = null, - @SerializedName(value="list_icon") + @SerializedName("list_icon") val listIcon: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/MessagesService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/MessagesService.kt new file mode 100644 index 0000000000..206f6c5f98 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/MessagesService.kt @@ -0,0 +1,1329 @@ +/** + * 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.messages + +import com.google.gson.reflect.TypeToken +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.base.dto.BaseBoolInt +import com.vk.sdk.api.base.dto.BaseOkResponse +import com.vk.sdk.api.base.dto.BaseUserGroupFields +import com.vk.sdk.api.messages.dto.FilterParam +import com.vk.sdk.api.messages.dto.IntentParam +import com.vk.sdk.api.messages.dto.MediaTypeParam +import com.vk.sdk.api.messages.dto.MessagesDeleteChatPhotoResponse +import com.vk.sdk.api.messages.dto.MessagesDeleteConversationResponse +import com.vk.sdk.api.messages.dto.MessagesGetByConversationMessageIdResponse +import com.vk.sdk.api.messages.dto.MessagesGetByIdExtendedResponse +import com.vk.sdk.api.messages.dto.MessagesGetByIdResponse +import com.vk.sdk.api.messages.dto.MessagesGetChatPreviewResponse +import com.vk.sdk.api.messages.dto.MessagesGetConversationMembersResponse +import com.vk.sdk.api.messages.dto.MessagesGetConversationsByIdExtendedResponse +import com.vk.sdk.api.messages.dto.MessagesGetConversationsByIdResponse +import com.vk.sdk.api.messages.dto.MessagesGetConversationsResponse +import com.vk.sdk.api.messages.dto.MessagesGetHistoryAttachmentsResponse +import com.vk.sdk.api.messages.dto.MessagesGetHistoryExtendedResponse +import com.vk.sdk.api.messages.dto.MessagesGetHistoryResponse +import com.vk.sdk.api.messages.dto.MessagesGetImportantMessagesExtendedResponse +import com.vk.sdk.api.messages.dto.MessagesGetImportantMessagesResponse +import com.vk.sdk.api.messages.dto.MessagesGetIntentUsersResponse +import com.vk.sdk.api.messages.dto.MessagesGetInviteLinkResponse +import com.vk.sdk.api.messages.dto.MessagesGetLongPollHistoryResponse +import com.vk.sdk.api.messages.dto.MessagesIsMessagesFromGroupAllowedResponse +import com.vk.sdk.api.messages.dto.MessagesJoinChatByInviteLinkResponse +import com.vk.sdk.api.messages.dto.MessagesLastActivity +import com.vk.sdk.api.messages.dto.MessagesLongpollParams +import com.vk.sdk.api.messages.dto.MessagesPinnedMessage +import com.vk.sdk.api.messages.dto.MessagesSearchConversationsExtendedResponse +import com.vk.sdk.api.messages.dto.MessagesSearchConversationsResponse +import com.vk.sdk.api.messages.dto.MessagesSearchExtendedResponse +import com.vk.sdk.api.messages.dto.MessagesSearchResponse +import com.vk.sdk.api.messages.dto.MessagesSetChatPhotoResponse +import com.vk.sdk.api.messages.dto.RevParam +import com.vk.sdk.api.messages.dto.TypeParam +import com.vk.sdk.api.users.dto.UsersFields +import kotlin.Any +import kotlin.Boolean +import kotlin.Float +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class MessagesService { + /** + * Adds a new user to a chat. + * + * @param chatId - Chat ID. + * @param userId - ID of the user to be added to the chat. + * @param visibleMessagesCount + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesAddChatUser( + chatId: Int, + userId: Int? = null, + visibleMessagesCount: Int? = null + ): VKRequest = NewApiRequest("messages.addChatUser") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("chat_id", chatId) + userId?.let { addParam("user_id", it) } + visibleMessagesCount?.let { addParam("visible_messages_count", it) } + } + + /** + * Allows sending messages from community to the current user. + * + * @param groupId - Group ID. + * @param key + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesAllowMessagesFromGroup(groupId: Int, key: String? = null): VKRequest + = NewApiRequest("messages.allowMessagesFromGroup") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + key?.let { addParam("key", it) } + } + + /** + * Creates a chat with several participants. + * + * @param userIds - IDs of the users to be added to the chat. + * @param title - Chat title. + * @param groupId + * @return [VKRequest] with [Int] + */ + fun messagesCreateChat( + userIds: List? = null, + title: String? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.createChat") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + userIds?.let { addParam("user_ids", it) } + title?.let { addParam("title", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Deletes one or more messages. + * + * @param messageIds - Message IDs. + * @param spam - '1' - to mark message as spam. + * @param groupId - Group ID (for group messages with user access token) + * @param deleteForAll - '1' - delete message for for all. + * @return [VKRequest] with [Any] + */ + fun messagesDelete( + messageIds: List? = null, + spam: Boolean? = null, + groupId: Int? = null, + deleteForAll: Boolean? = null + ): VKRequest = NewApiRequest("messages.delete") { + GsonHolder.gson.fromJson(it, Any::class.java) + } + .apply { + messageIds?.let { addParam("message_ids", it) } + spam?.let { addParam("spam", it) } + groupId?.let { addParam("group_id", it) } + deleteForAll?.let { addParam("delete_for_all", it) } + } + + /** + * Deletes a chat's cover picture. + * + * @param chatId - Chat ID. + * @param groupId + * @return [VKRequest] with [MessagesDeleteChatPhotoResponse] + */ + fun messagesDeleteChatPhoto(chatId: Int, groupId: Int? = null): + VKRequest = NewApiRequest("messages.deleteChatPhoto") { + GsonHolder.gson.fromJson(it, MessagesDeleteChatPhotoResponse::class.java) + } + .apply { + addParam("chat_id", chatId) + groupId?.let { addParam("group_id", it) } + } + + /** + * Deletes all private messages in a conversation. + * + * @param userId - User ID. To clear a chat history use 'chat_id' + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param groupId - Group ID (for group messages with user access token) + * @return [VKRequest] with [MessagesDeleteConversationResponse] + */ + fun messagesDeleteConversation( + userId: Int? = null, + peerId: Int? = null, + groupId: Int? = null + ): VKRequest = + NewApiRequest("messages.deleteConversation") { + GsonHolder.gson.fromJson(it, MessagesDeleteConversationResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + peerId?.let { addParam("peer_id", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Denies sending message from community to the current user. + * + * @param groupId - Group ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesDenyMessagesFromGroup(groupId: Int): VKRequest = + NewApiRequest("messages.denyMessagesFromGroup") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("group_id", groupId) + } + + /** + * Edits the message. + * + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param message - (Required if 'attachments' is not set.) Text of the message. + * @param lat - Geographical latitude of a check-in, in degrees (from -90 to 90). + * @param long - Geographical longitude of a check-in, in degrees (from -180 to 180). + * @param attachment - (Required if 'message' is not set.) List of objects attached to the + * message, separated by commas, in the following format: "_", '' - Type of + * media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'wall' - + * wall post, '' - ID of the media attachment owner. '' - media attachment ID. + * Example: "photo100172_166443618" + * @param keepForwardMessages - '1' - to keep forwarded, messages. + * @param keepSnippets - '1' - to keep attached snippets. + * @param groupId - Group ID (for group messages with user access token) + * @param dontParseLinks + * @param messageId + * @param conversationMessageId + * @param template + * @param keyboard + * @return [VKRequest] with [BaseBoolInt] + */ + fun messagesEdit( + peerId: Int, + message: String? = null, + lat: Float? = null, + long: Float? = null, + attachment: String? = null, + keepForwardMessages: Boolean? = null, + keepSnippets: Boolean? = null, + groupId: Int? = null, + dontParseLinks: Boolean? = null, + messageId: Int? = null, + conversationMessageId: Int? = null, + template: String? = null, + keyboard: String? = null + ): VKRequest = NewApiRequest("messages.edit") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) + } + .apply { + addParam("peer_id", peerId) + message?.let { addParam("message", it) } + lat?.let { addParam("lat", it) } + long?.let { addParam("long", it) } + attachment?.let { addParam("attachment", it) } + keepForwardMessages?.let { addParam("keep_forward_messages", it) } + keepSnippets?.let { addParam("keep_snippets", it) } + groupId?.let { addParam("group_id", it) } + dontParseLinks?.let { addParam("dont_parse_links", it) } + messageId?.let { addParam("message_id", it) } + conversationMessageId?.let { addParam("conversation_message_id", it) } + template?.let { addParam("template", it) } + keyboard?.let { addParam("keyboard", it) } + } + + /** + * Edits the title of a chat. + * + * @param chatId - Chat ID. + * @param title - New title of the chat. + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesEditChat(chatId: Int, title: String? = null): VKRequest = + NewApiRequest("messages.editChat") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("chat_id", chatId) + title?.let { addParam("title", it) } + } + + /** + * Returns messages by their IDs within the conversation. + * + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param conversationMessageIds - Conversation message IDs. + * @param fields - Profile fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetByConversationMessageIdResponse] + */ + fun messagesGetByConversationMessageId( + peerId: Int, + conversationMessageIds: List, + fields: List? = null, + groupId: Int? = null + ): VKRequest = + NewApiRequest("messages.getByConversationMessageId") { + GsonHolder.gson.fromJson(it, MessagesGetByConversationMessageIdResponse::class.java) + } + .apply { + addParam("peer_id", peerId) + addParam("conversation_message_ids", conversationMessageIds) + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns messages by their IDs. + * + * @param messageIds - Message IDs. + * @param previewLength - Number of characters after which to truncate a previewed message. To + * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * are truncated by words." + * @param fields - Profile fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetByIdResponse] + */ + fun messagesGetById( + messageIds: List, + previewLength: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.getById") { + GsonHolder.gson.fromJson(it, MessagesGetByIdResponse::class.java) + } + .apply { + addParam("message_ids", messageIds) + previewLength?.let { addParam("preview_length", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns messages by their IDs. + * + * @param messageIds - Message IDs. + * @param previewLength - Number of characters after which to truncate a previewed message. To + * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * are truncated by words." + * @param fields - Profile fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetByIdExtendedResponse] + */ + fun messagesGetByIdExtended( + messageIds: List, + previewLength: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.getById") { + GsonHolder.gson.fromJson(it, MessagesGetByIdExtendedResponse::class.java) + } + .apply { + addParam("message_ids", messageIds) + previewLength?.let { addParam("preview_length", it) } + addParam("extended", true) + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * @param peerId + * @param link - Invitation link. + * @param fields - Profile fields to return. + * @return [VKRequest] with [MessagesGetChatPreviewResponse] + */ + fun messagesGetChatPreview( + peerId: Int? = null, + link: String? = null, + fields: List? = null + ): VKRequest = NewApiRequest("messages.getChatPreview") { + GsonHolder.gson.fromJson(it, MessagesGetChatPreviewResponse::class.java) + } + .apply { + peerId?.let { addParam("peer_id", it) } + link?.let { addParam("link", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns a list of IDs of users participating in a chat. + * + * @param peerId - Peer ID. + * @param offset - Offset + * @param count - Count + * @param fields - Profile fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetConversationMembersResponse] + */ + fun messagesGetConversationMembers( + peerId: Int, + offset: Int? = null, + count: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = + NewApiRequest("messages.getConversationMembers") { + GsonHolder.gson.fromJson(it, MessagesGetConversationMembersResponse::class.java) + } + .apply { + addParam("peer_id", peerId) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns a list of the current user's conversations. + * + * @param offset - Offset needed to return a specific subset of conversations. + * @param count - Number of conversations to return. + * @param filter - Filter to apply: 'all' - all conversations, 'unread' - conversations with + * unread messages, 'important' - conversations, marked as important (only for community messages), + * 'unanswered' - conversations, marked as unanswered (only for community messages) + * @param startMessageId - ID of the message from what to return dialogs. + * @param fields - Profile and communities fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetConversationsResponse] + */ + fun messagesGetConversations( + offset: Int? = null, + count: Int? = null, + filter: FilterParam? = null, + startMessageId: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.getConversations") { + GsonHolder.gson.fromJson(it, MessagesGetConversationsResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + filter?.let { addParam("filter", it.value) } + startMessageId?.let { addParam("start_message_id", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns conversations by their IDs + * + * @param peerIds - Destination IDs. "For user: 'User ID', e.g. '12345'. For chat: + * '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param fields - Profile and communities fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetConversationsByIdResponse] + */ + fun messagesGetConversationsById( + peerIds: List, + fields: List? = null, + groupId: Int? = null + ): VKRequest = + NewApiRequest("messages.getConversationsById") { + GsonHolder.gson.fromJson(it, MessagesGetConversationsByIdResponse::class.java) + } + .apply { + addParam("peer_ids", peerIds) + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns conversations by their IDs + * + * @param peerIds - Destination IDs. "For user: 'User ID', e.g. '12345'. For chat: + * '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param fields - Profile and communities fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetConversationsByIdExtendedResponse] + */ + fun messagesGetConversationsByIdExtended( + peerIds: List, + fields: List? = null, + groupId: Int? = null + ): VKRequest = + NewApiRequest("messages.getConversationsById") { + GsonHolder.gson.fromJson(it, MessagesGetConversationsByIdExtendedResponse::class.java) + } + .apply { + addParam("peer_ids", peerIds) + addParam("extended", true) + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns message history for the specified user or group chat. + * + * @param offset - Offset needed to return a specific subset of messages. + * @param count - Number of messages to return. + * @param userId - ID of the user whose message history you want to return. + * @param peerId + * @param startMessageId - Starting message ID from which to return history. + * @param rev - Sort order: '1' - return messages in chronological order. '0' - return messages + * in reverse chronological order. + * @param fields - Profile fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetHistoryResponse] + */ + fun messagesGetHistory( + offset: Int? = null, + count: Int? = null, + userId: Int? = null, + peerId: Int? = null, + startMessageId: Int? = null, + rev: RevParam? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.getHistory") { + GsonHolder.gson.fromJson(it, MessagesGetHistoryResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + userId?.let { addParam("user_id", it) } + peerId?.let { addParam("peer_id", it) } + startMessageId?.let { addParam("start_message_id", it) } + rev?.let { addParam("rev", it.value) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns message history for the specified user or group chat. + * + * @param offset - Offset needed to return a specific subset of messages. + * @param count - Number of messages to return. + * @param userId - ID of the user whose message history you want to return. + * @param peerId + * @param startMessageId - Starting message ID from which to return history. + * @param rev - Sort order: '1' - return messages in chronological order. '0' - return messages + * in reverse chronological order. + * @param fields - Profile fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetHistoryExtendedResponse] + */ + fun messagesGetHistoryExtended( + offset: Int? = null, + count: Int? = null, + userId: Int? = null, + peerId: Int? = null, + startMessageId: Int? = null, + rev: RevParam? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.getHistory") { + GsonHolder.gson.fromJson(it, MessagesGetHistoryExtendedResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + userId?.let { addParam("user_id", it) } + peerId?.let { addParam("peer_id", it) } + startMessageId?.let { addParam("start_message_id", it) } + rev?.let { addParam("rev", it.value) } + addParam("extended", true) + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns media files from the dialog or group chat. + * + * @param peerId - Peer ID. ", For group chat: '2000000000 + chat ID' , , For community: + * '-community ID'" + * @param mediaType - Type of media files to return: *'photo',, *'video',, *'audio',, *'doc',, + * *'link'.,*'market'.,*'wall'.,*'share' + * @param startFrom - Message ID to start return results from. + * @param count - Number of objects to return. + * @param photoSizes - '1' - to return photo sizes in a + * @param fields - Additional profile [vk.com/dev/fields|fields] to return. + * @param groupId - Group ID (for group messages with group access token) + * @param preserveOrder + * @param maxForwardsLevel + * @return [VKRequest] with [MessagesGetHistoryAttachmentsResponse] + */ + fun messagesGetHistoryAttachments( + peerId: Int, + mediaType: MediaTypeParam? = null, + startFrom: String? = null, + count: Int? = null, + photoSizes: Boolean? = null, + fields: List? = null, + groupId: Int? = null, + preserveOrder: Boolean? = null, + maxForwardsLevel: Int? = null + ): VKRequest = + NewApiRequest("messages.getHistoryAttachments") { + GsonHolder.gson.fromJson(it, MessagesGetHistoryAttachmentsResponse::class.java) + } + .apply { + addParam("peer_id", peerId) + mediaType?.let { addParam("media_type", it.value) } + startFrom?.let { addParam("start_from", it) } + count?.let { addParam("count", it) } + photoSizes?.let { addParam("photo_sizes", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + preserveOrder?.let { addParam("preserve_order", it) } + maxForwardsLevel?.let { addParam("max_forwards_level", it) } + } + + /** + * Returns a list of user's important messages. + * + * @param count - Amount of needed important messages. + * @param offset + * @param startMessageId + * @param previewLength - Maximum length of messages body. + * @param fields - Actors fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetImportantMessagesResponse] + */ + fun messagesGetImportantMessages( + count: Int? = null, + offset: Int? = null, + startMessageId: Int? = null, + previewLength: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = + NewApiRequest("messages.getImportantMessages") { + GsonHolder.gson.fromJson(it, MessagesGetImportantMessagesResponse::class.java) + } + .apply { + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + startMessageId?.let { addParam("start_message_id", it) } + previewLength?.let { addParam("preview_length", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns a list of user's important messages. + * + * @param count - Amount of needed important messages. + * @param offset + * @param startMessageId + * @param previewLength - Maximum length of messages body. + * @param fields - Actors fields to return. + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesGetImportantMessagesExtendedResponse] + */ + fun messagesGetImportantMessagesExtended( + count: Int? = null, + offset: Int? = null, + startMessageId: Int? = null, + previewLength: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = + NewApiRequest("messages.getImportantMessages") { + GsonHolder.gson.fromJson(it, MessagesGetImportantMessagesExtendedResponse::class.java) + } + .apply { + count?.let { addParam("count", it) } + offset?.let { addParam("offset", it) } + startMessageId?.let { addParam("start_message_id", it) } + previewLength?.let { addParam("preview_length", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + addParam("extended", true) + groupId?.let { addParam("group_id", it) } + } + + /** + * @param intent + * @param subscribeId + * @param offset + * @param count + * @param nameCase + * @param fields + * @return [VKRequest] with [MessagesGetIntentUsersResponse] + */ + fun messagesGetIntentUsers( + intent: IntentParam, + subscribeId: Int? = null, + offset: Int? = null, + count: Int? = null, + nameCase: List? = null, + fields: List? = null + ): VKRequest = NewApiRequest("messages.getIntentUsers") { + GsonHolder.gson.fromJson(it, MessagesGetIntentUsersResponse::class.java) + } + .apply { + addParam("intent", intent.value) + subscribeId?.let { addParam("subscribe_id", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + nameCase?.let { addParam("name_case", it) } + fields?.let { addParam("fields", it) } + } + + /** + * @param peerId - Destination ID. + * @param reset - 1 - to generate new link (revoke previous), 0 - to return previous link. + * @param groupId - Group ID + * @return [VKRequest] with [MessagesGetInviteLinkResponse] + */ + fun messagesGetInviteLink( + peerId: Int, + reset: Boolean? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.getInviteLink") { + GsonHolder.gson.fromJson(it, MessagesGetInviteLinkResponse::class.java) + } + .apply { + addParam("peer_id", peerId) + reset?.let { addParam("reset", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns a user's current status and date of last activity. + * + * @param userId - User ID. + * @return [VKRequest] with [MessagesLastActivity] + */ + fun messagesGetLastActivity(userId: Int): VKRequest = + NewApiRequest("messages.getLastActivity") { + GsonHolder.gson.fromJson(it, MessagesLastActivity::class.java) + } + .apply { + addParam("user_id", userId) + } + + /** + * Returns updates in user's private messages. + * + * @param ts - Last value of the 'ts' parameter returned from the Long Poll server or by using + * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. + * @param pts - Lsat value of 'pts' parameter returned from the Long Poll server or by using + * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. + * @param previewLength - Number of characters after which to truncate a previewed message. To + * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * are truncated by words." + * @param onlines - '1' - to return history with online users only. + * @param fields - Additional profile [vk.com/dev/fields|fields] to return. + * @param eventsLimit - Maximum number of events to return. + * @param msgsLimit - Maximum number of messages to return. + * @param maxMsgId - Maximum ID of the message among existing ones in the local copy. Both + * messages received with API methods (for example, , ), and data received from a Long Poll server + * (events with code 4) are taken into account. + * @param groupId - Group ID (for group messages with user access token) + * @param lpVersion + * @param lastN + * @param credentials + * @return [VKRequest] with [MessagesGetLongPollHistoryResponse] + */ + fun messagesGetLongPollHistory( + ts: Int? = null, + pts: Int? = null, + previewLength: Int? = null, + onlines: Boolean? = null, + fields: List? = null, + eventsLimit: Int? = null, + msgsLimit: Int? = null, + maxMsgId: Int? = null, + groupId: Int? = null, + lpVersion: Int? = null, + lastN: Int? = null, + credentials: Boolean? = null + ): VKRequest = + NewApiRequest("messages.getLongPollHistory") { + GsonHolder.gson.fromJson(it, MessagesGetLongPollHistoryResponse::class.java) + } + .apply { + ts?.let { addParam("ts", it) } + pts?.let { addParam("pts", it) } + previewLength?.let { addParam("preview_length", it) } + onlines?.let { addParam("onlines", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + eventsLimit?.let { addParam("events_limit", it) } + msgsLimit?.let { addParam("msgs_limit", it) } + maxMsgId?.let { addParam("max_msg_id", it) } + groupId?.let { addParam("group_id", it) } + lpVersion?.let { addParam("lp_version", it) } + lastN?.let { addParam("last_n", it) } + credentials?.let { addParam("credentials", it) } + } + + /** + * Returns data required for connection to a Long Poll server. + * + * @param needPts - '1' - to return the 'pts' field, needed for the + * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. + * @param groupId - Group ID (for group messages with user access token) + * @param lpVersion - Long poll version + * @return [VKRequest] with [MessagesLongpollParams] + */ + fun messagesGetLongPollServer( + needPts: Boolean? = null, + groupId: Int? = null, + lpVersion: Int? = null + ): VKRequest = NewApiRequest("messages.getLongPollServer") { + GsonHolder.gson.fromJson(it, MessagesLongpollParams::class.java) + } + .apply { + needPts?.let { addParam("need_pts", it) } + groupId?.let { addParam("group_id", it) } + lpVersion?.let { addParam("lp_version", it) } + } + + /** + * Returns information whether sending messages from the community to current user is allowed. + * + * @param groupId - Group ID. + * @param userId - User ID. + * @return [VKRequest] with [MessagesIsMessagesFromGroupAllowedResponse] + */ + fun messagesIsMessagesFromGroupAllowed(groupId: Int, userId: Int): + VKRequest = + NewApiRequest("messages.isMessagesFromGroupAllowed") { + GsonHolder.gson.fromJson(it, MessagesIsMessagesFromGroupAllowedResponse::class.java) + } + .apply { + addParam("group_id", groupId) + addParam("user_id", userId) + } + + /** + * @param link - Invitation link. + * @return [VKRequest] with [MessagesJoinChatByInviteLinkResponse] + */ + fun messagesJoinChatByInviteLink(link: String): VKRequest + = NewApiRequest("messages.joinChatByInviteLink") { + GsonHolder.gson.fromJson(it, MessagesJoinChatByInviteLinkResponse::class.java) + } + .apply { + addParam("link", link) + } + + /** + * Marks and unmarks conversations as unanswered. + * + * @param peerId - ID of conversation to mark as important. + * @param answered - '1' - to mark as answered, '0' - to remove the mark + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesMarkAsAnsweredConversation( + peerId: Int, + answered: Boolean? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.markAsAnsweredConversation") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("peer_id", peerId) + answered?.let { addParam("answered", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Marks and unmarks messages as important (starred). + * + * @param messageIds - IDs of messages to mark as important. + * @param important - '1' - to add a star (mark as important), '0' - to remove the star + * @return [VKRequest] with [Unit] + */ + fun messagesMarkAsImportant(messageIds: List? = null, important: Int? = null): + VKRequest> = NewApiRequest("messages.markAsImportant") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) + } + .apply { + messageIds?.let { addParam("message_ids", it) } + important?.let { addParam("important", it) } + } + + /** + * Marks and unmarks conversations as important. + * + * @param peerId - ID of conversation to mark as important. + * @param important - '1' - to add a star (mark as important), '0' - to remove the star + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesMarkAsImportantConversation( + peerId: Int, + important: Boolean? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.markAsImportantConversation") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("peer_id", peerId) + important?.let { addParam("important", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Marks messages as read. + * + * @param messageIds - IDs of messages to mark as read. + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param startMessageId - Message ID to start from. + * @param groupId - Group ID (for group messages with user access token) + * @param markConversationAsRead + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesMarkAsRead( + messageIds: List? = null, + peerId: Int? = null, + startMessageId: Int? = null, + groupId: Int? = null, + markConversationAsRead: Boolean? = null + ): VKRequest = NewApiRequest("messages.markAsRead") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + messageIds?.let { addParam("message_ids", it) } + peerId?.let { addParam("peer_id", it) } + startMessageId?.let { addParam("start_message_id", it) } + groupId?.let { addParam("group_id", it) } + markConversationAsRead?.let { addParam("mark_conversation_as_read", it) } + } + + /** + * Pin a message. + * + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * @param messageId - Message ID + * @param conversationMessageId - Conversation message ID + * @return [VKRequest] with [MessagesPinnedMessage] + */ + fun messagesPin( + peerId: Int, + messageId: Int? = null, + conversationMessageId: Int? = null + ): VKRequest = NewApiRequest("messages.pin") { + GsonHolder.gson.fromJson(it, MessagesPinnedMessage::class.java) + } + .apply { + addParam("peer_id", peerId) + messageId?.let { addParam("message_id", it) } + conversationMessageId?.let { addParam("conversation_message_id", it) } + } + + /** + * Allows the current user to leave a chat or, if the current user started the chat, allows the + * user to remove another user from the chat. + * + * @param chatId - Chat ID. + * @param userId - ID of the user to be removed from the chat. + * @param memberId + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesRemoveChatUser( + chatId: Int, + userId: Int? = null, + memberId: Int? = null + ): VKRequest = NewApiRequest("messages.removeChatUser") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("chat_id", chatId) + userId?.let { addParam("user_id", it) } + memberId?.let { addParam("member_id", it) } + } + + /** + * Restores a deleted message. + * + * @param messageId - ID of a previously-deleted message to restore. + * @param groupId - Group ID (for group messages with user access token) + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesRestore(messageId: Int, groupId: Int? = null): VKRequest = + NewApiRequest("messages.restore") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("message_id", messageId) + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns a list of the current user's private messages that match search criteria. + * + * @param q - Search query string. + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param date - Date to search message before in Unixtime. + * @param previewLength - Number of characters after which to truncate a previewed message. To + * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * are truncated by words." + * @param offset - Offset needed to return a specific subset of messages. + * @param count - Number of messages to return. + * @param fields + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesSearchResponse] + */ + fun messagesSearch( + q: String? = null, + peerId: Int? = null, + date: Int? = null, + previewLength: Int? = null, + offset: Int? = null, + count: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.search") { + GsonHolder.gson.fromJson(it, MessagesSearchResponse::class.java) + } + .apply { + q?.let { addParam("q", it) } + peerId?.let { addParam("peer_id", it) } + date?.let { addParam("date", it) } + previewLength?.let { addParam("preview_length", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + fields?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns a list of the current user's private messages that match search criteria. + * + * @param q - Search query string. + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param date - Date to search message before in Unixtime. + * @param previewLength - Number of characters after which to truncate a previewed message. To + * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * are truncated by words." + * @param offset - Offset needed to return a specific subset of messages. + * @param count - Number of messages to return. + * @param fields + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [MessagesSearchExtendedResponse] + */ + fun messagesSearchExtended( + q: String? = null, + peerId: Int? = null, + date: Int? = null, + previewLength: Int? = null, + offset: Int? = null, + count: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.search") { + GsonHolder.gson.fromJson(it, MessagesSearchExtendedResponse::class.java) + } + .apply { + q?.let { addParam("q", it) } + peerId?.let { addParam("peer_id", it) } + date?.let { addParam("date", it) } + previewLength?.let { addParam("preview_length", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + addParam("extended", true) + fields?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns a list of the current user's conversations that match search criteria. + * + * @param q - Search query string. + * @param count - Maximum number of results. + * @param fields - Profile fields to return. + * @param groupId - Group ID (for group messages with user access token) + * @return [VKRequest] with [MessagesSearchConversationsResponse] + */ + fun messagesSearchConversations( + q: String? = null, + count: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = + NewApiRequest("messages.searchConversations") { + GsonHolder.gson.fromJson(it, MessagesSearchConversationsResponse::class.java) + } + .apply { + q?.let { addParam("q", it) } + count?.let { addParam("count", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Returns a list of the current user's conversations that match search criteria. + * + * @param q - Search query string. + * @param count - Maximum number of results. + * @param fields - Profile fields to return. + * @param groupId - Group ID (for group messages with user access token) + * @return [VKRequest] with [MessagesSearchConversationsExtendedResponse] + */ + fun messagesSearchConversationsExtended( + q: String? = null, + count: Int? = null, + fields: List? = null, + groupId: Int? = null + ): VKRequest = + NewApiRequest("messages.searchConversations") { + GsonHolder.gson.fromJson(it, MessagesSearchConversationsExtendedResponse::class.java) + } + .apply { + q?.let { addParam("q", it) } + count?.let { addParam("count", it) } + addParam("extended", true) + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Sends a message. + * + * @param userId - User ID (by default - current user). + * @param randomId - Unique identifier to avoid resending the message. + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerIds - IDs of message recipients. (See peer_id) + * @param domain - User's short address (for example, 'illarionov'). + * @param chatId - ID of conversation the message will relate to. + * @param userIds - IDs of message recipients (if new conversation shall be started). + * @param message - (Required if 'attachments' is not set.) Text of the message. + * @param lat - Geographical latitude of a check-in, in degrees (from -90 to 90). + * @param long - Geographical longitude of a check-in, in degrees (from -180 to 180). + * @param attachment - (Required if 'message' is not set.) List of objects attached to the + * message, separated by commas, in the following format: "_", '' - Type of + * media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'wall' - + * wall post, '' - ID of the media attachment owner. '' - media attachment ID. + * Example: "photo100172_166443618" + * @param replyTo + * @param forwardMessages - ID of forwarded messages, separated with a comma. Listed messages of + * the sender will be shown in the message body at the recipient's. Example: "123,431,544" + * @param forward - JSON describing the forwarded message or reply + * @param stickerId - Sticker id. + * @param groupId - Group ID (for group messages with group access token) + * @param keyboard + * @param template + * @param payload + * @param contentSource - JSON describing the content source in the message + * @param dontParseLinks + * @param disableMentions + * @param intent + * @param subscribeId + * @return [VKRequest] with [Int] + */ + fun messagesSend( + userId: Int? = null, + randomId: Int? = null, + peerId: Int? = null, + peerIds: List? = null, + domain: String? = null, + chatId: Int? = null, + userIds: List? = null, + message: String? = null, + lat: Float? = null, + long: Float? = null, + attachment: String? = null, + replyTo: Int? = null, + forwardMessages: List? = null, + forward: String? = null, + stickerId: Int? = null, + groupId: Int? = null, + keyboard: String? = null, + template: String? = null, + payload: String? = null, + contentSource: String? = null, + dontParseLinks: Boolean? = null, + disableMentions: Boolean? = null, + intent: IntentParam? = null, + subscribeId: Int? = null + ): VKRequest = NewApiRequest("messages.send") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + randomId?.let { addParam("random_id", it) } + peerId?.let { addParam("peer_id", it) } + peerIds?.let { addParam("peer_ids", it) } + domain?.let { addParam("domain", it) } + chatId?.let { addParam("chat_id", it) } + userIds?.let { addParam("user_ids", it) } + message?.let { addParam("message", it) } + lat?.let { addParam("lat", it) } + long?.let { addParam("long", it) } + attachment?.let { addParam("attachment", it) } + replyTo?.let { addParam("reply_to", it) } + forwardMessages?.let { addParam("forward_messages", it) } + forward?.let { addParam("forward", it) } + stickerId?.let { addParam("sticker_id", it) } + groupId?.let { addParam("group_id", it) } + keyboard?.let { addParam("keyboard", it) } + template?.let { addParam("template", it) } + payload?.let { addParam("payload", it) } + contentSource?.let { addParam("content_source", it) } + dontParseLinks?.let { addParam("dont_parse_links", it) } + disableMentions?.let { addParam("disable_mentions", it) } + intent?.let { addParam("intent", it.value) } + subscribeId?.let { addParam("subscribe_id", it) } + } + + /** + * @param eventId + * @param userId + * @param peerId + * @param eventData + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesSendMessageEventAnswer( + eventId: String, + userId: Int, + peerId: Int, + eventData: String? = null + ): VKRequest = NewApiRequest("messages.sendMessageEventAnswer") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("event_id", eventId) + addParam("user_id", userId) + addParam("peer_id", peerId) + eventData?.let { addParam("event_data", it) } + } + + /** + * Changes the status of a user as typing in a conversation. + * + * @param userId - User ID. + * @param type - 'typing' - user has started to type. + * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + + * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param groupId - Group ID (for group messages with group access token) + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesSetActivity( + userId: Int? = null, + type: TypeParam? = null, + peerId: Int? = null, + groupId: Int? = null + ): VKRequest = NewApiRequest("messages.setActivity") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + userId?.let { addParam("user_id", it) } + type?.let { addParam("type", it.value) } + peerId?.let { addParam("peer_id", it) } + groupId?.let { addParam("group_id", it) } + } + + /** + * Sets a previously-uploaded picture as the cover picture of a chat. + * + * @param file - Upload URL from the 'response' field returned by the + * [vk.com/dev/photos.getChatUploadServer|photos.getChatUploadServer] method upon successfully + * uploading an image. + * @return [VKRequest] with [MessagesSetChatPhotoResponse] + */ + fun messagesSetChatPhoto(file: String): VKRequest = + NewApiRequest("messages.setChatPhoto") { + GsonHolder.gson.fromJson(it, MessagesSetChatPhotoResponse::class.java) + } + .apply { + addParam("file", file) + } + + /** + * @param peerId + * @param groupId + * @return [VKRequest] with [BaseOkResponse] + */ + fun messagesUnpin(peerId: Int, groupId: Int? = null): VKRequest = + NewApiRequest("messages.unpin") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("peer_id", peerId) + groupId?.let { addParam("group_id", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/FilterParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/FilterParam.kt new file mode 100644 index 0000000000..f0811a2b2b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/FilterParam.kt @@ -0,0 +1,56 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FilterParam( + val value: String +) { + @SerializedName("all") + ALL("all"), + + @SerializedName("business_notify") + BUSINESS_NOTIFY("business_notify"), + + @SerializedName("chats") + CHATS("chats"), + + @SerializedName("important") + IMPORTANT("important"), + + @SerializedName("message_request") + MESSAGE_REQUEST("message_request"), + + @SerializedName("unanswered") + UNANSWERED("unanswered"), + + @SerializedName("unread") + UNREAD("unread"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/IntentParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/IntentParam.kt new file mode 100644 index 0000000000..deac747fd2 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/IntentParam.kt @@ -0,0 +1,44 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class IntentParam( + val value: String +) { + @SerializedName("confirmed_notification") + CONFIRMED_NOTIFICATION("confirmed_notification"), + + @SerializedName("non_promo_newsletter") + NON_PROMO_NEWSLETTER("non_promo_newsletter"), + + @SerializedName("promo_newsletter") + PROMO_NEWSLETTER("promo_newsletter"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MediaTypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MediaTypeParam.kt new file mode 100644 index 0000000000..9a9012b825 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MediaTypeParam.kt @@ -0,0 +1,65 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class MediaTypeParam( + val value: String +) { + @SerializedName("audio") + AUDIO("audio"), + + @SerializedName("audio_message") + AUDIO_MESSAGE("audio_message"), + + @SerializedName("doc") + DOC("doc"), + + @SerializedName("graffiti") + GRAFFITI("graffiti"), + + @SerializedName("link") + LINK("link"), + + @SerializedName("market") + MARKET("market"), + + @SerializedName("photo") + PHOTO("photo"), + + @SerializedName("share") + SHARE("share"), + + @SerializedName("video") + VIDEO("video"), + + @SerializedName("wall") + WALL("wall"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesAudioMessage.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesAudioMessage.kt index d7d2814dcc..953b98da1b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesAudioMessage.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesAudioMessage.kt @@ -33,30 +33,30 @@ import kotlin.String import kotlin.collections.List /** - * @param duration Audio message duration in seconds - * @param id Audio message ID - * @param linkMp3 MP3 file URL - * @param linkOgg OGG file URL - * @param ownerId Audio message owner ID - * @param waveform no description - * @param accessKey Access key for audio message - * @param transcriptError no description + * @param duration - Audio message duration in seconds + * @param id - Audio message ID + * @param linkMp3 - MP3 file URL + * @param linkOgg - OGG file URL + * @param ownerId - Audio message owner ID + * @param waveform + * @param accessKey - Access key for audio message + * @param transcriptError */ data class MessagesAudioMessage( - @SerializedName(value="duration") + @SerializedName("duration") val duration: Int, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="link_mp3") + @SerializedName("link_mp3") val linkMp3: String, - @SerializedName(value="link_ogg") + @SerializedName("link_ogg") val linkOgg: String, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="waveform") + @SerializedName("waveform") val waveform: List, - @SerializedName(value="access_key") + @SerializedName("access_key") val accessKey: String? = null, - @SerializedName(value="transcript_error") + @SerializedName("transcript_error") val transcriptError: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChat.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChat.kt index 7677dfadab..f07227b5a0 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChat.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChat.kt @@ -35,42 +35,42 @@ import kotlin.String import kotlin.collections.List /** - * @param adminId Chat creator ID - * @param id Chat ID - * @param type Chat type - * @param users no description - * @param kicked Shows that user has been kicked from the chat - * @param left Shows that user has been left the chat - * @param photo100 URL of the preview image with 100 px in width - * @param photo200 URL of the preview image with 200 px in width - * @param photo50 URL of the preview image with 50 px in width - * @param pushSettings no description - * @param title Chat title - * @param isDefaultPhoto If provided photo is default + * @param adminId - Chat creator ID + * @param id - Chat ID + * @param type - Chat type + * @param users + * @param kicked - Shows that user has been kicked from the chat + * @param left - Shows that user has been left the chat + * @param photo100 - URL of the preview image with 100 px in width + * @param photo200 - URL of the preview image with 200 px in width + * @param photo50 - URL of the preview image with 50 px in width + * @param pushSettings + * @param title - Chat title + * @param isDefaultPhoto - If provided photo is default */ data class MessagesChat( - @SerializedName(value="admin_id") + @SerializedName("admin_id") val adminId: Int, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="type") + @SerializedName("type") val type: String, - @SerializedName(value="users") + @SerializedName("users") val users: List, - @SerializedName(value="kicked") + @SerializedName("kicked") val kicked: BaseBoolInt? = null, - @SerializedName(value="left") + @SerializedName("left") val left: BaseBoolInt? = null, - @SerializedName(value="photo_100") + @SerializedName("photo_100") val photo100: String? = null, - @SerializedName(value="photo_200") + @SerializedName("photo_200") val photo200: String? = null, - @SerializedName(value="photo_50") + @SerializedName("photo_50") val photo50: String? = null, - @SerializedName(value="push_settings") + @SerializedName("push_settings") val pushSettings: MessagesChatPushSettings? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="is_default_photo") + @SerializedName("is_default_photo") val isDefaultPhoto: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPreview.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPreview.kt index e45ea476d4..45664b0d2e 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPreview.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPreview.kt @@ -34,27 +34,27 @@ import kotlin.String import kotlin.collections.List /** - * @param adminId no description - * @param joined no description - * @param localId no description - * @param members no description - * @param membersCount no description - * @param title no description - * @param isMember no description + * @param adminId + * @param joined + * @param localId + * @param members + * @param membersCount + * @param title + * @param isMember */ data class MessagesChatPreview( - @SerializedName(value="admin_id") + @SerializedName("admin_id") val adminId: Int? = null, - @SerializedName(value="joined") + @SerializedName("joined") val joined: Boolean? = null, - @SerializedName(value="local_id") + @SerializedName("local_id") val localId: Int? = null, - @SerializedName(value="members") + @SerializedName("members") val members: List? = null, - @SerializedName(value="members_count") + @SerializedName("members_count") val membersCount: Int? = null, - @SerializedName(value="title") + @SerializedName("title") val title: String? = null, - @SerializedName(value="is_member") + @SerializedName("is_member") val isMember: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPushSettings.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPushSettings.kt index 0b6c416ab3..b4dcadbe75 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPushSettings.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPushSettings.kt @@ -32,12 +32,12 @@ import com.vk.sdk.api.base.dto.BaseBoolInt import kotlin.Int /** - * @param disabledUntil Time until that notifications are disabled - * @param sound Information whether the sound is on + * @param disabledUntil - Time until that notifications are disabled + * @param sound - Information whether the sound is on */ data class MessagesChatPushSettings( - @SerializedName(value="disabled_until") + @SerializedName("disabled_until") val disabledUntil: Int? = null, - @SerializedName(value="sound") + @SerializedName("sound") val sound: BaseBoolInt? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatRestrictions.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatRestrictions.kt index ff7331e22f..187723713d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatRestrictions.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatRestrictions.kt @@ -31,21 +31,21 @@ import com.google.gson.annotations.SerializedName import kotlin.Boolean /** - * @param adminsPromoteUsers Only admins can promote users to admins - * @param onlyAdminsEditInfo Only admins can change chat info - * @param onlyAdminsEditPin Only admins can edit pinned message - * @param onlyAdminsInvite Only admins can invite users to this chat - * @param onlyAdminsKick Only admins can kick users from this chat + * @param adminsPromoteUsers - Only admins can promote users to admins + * @param onlyAdminsEditInfo - Only admins can change chat info + * @param onlyAdminsEditPin - Only admins can edit pinned message + * @param onlyAdminsInvite - Only admins can invite users to this chat + * @param onlyAdminsKick - Only admins can kick users from this chat */ data class MessagesChatRestrictions( - @SerializedName(value="admins_promote_users") + @SerializedName("admins_promote_users") val adminsPromoteUsers: Boolean? = null, - @SerializedName(value="only_admins_edit_info") + @SerializedName("only_admins_edit_info") val onlyAdminsEditInfo: Boolean? = null, - @SerializedName(value="only_admins_edit_pin") + @SerializedName("only_admins_edit_pin") val onlyAdminsEditPin: Boolean? = null, - @SerializedName(value="only_admins_invite") + @SerializedName("only_admins_invite") val onlyAdminsInvite: Boolean? = null, - @SerializedName(value="only_admins_kick") + @SerializedName("only_admins_kick") val onlyAdminsKick: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettings.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettings.kt index 855038d830..47f59c2b35 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettings.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettings.kt @@ -34,54 +34,54 @@ import kotlin.String import kotlin.collections.List /** - * @param ownerId no description - * @param title Chat title - * @param state no description - * @param activeIds no description - * @param acl no description - * @param membersCount no description - * @param friendsCount no description - * @param pinnedMessage no description - * @param photo no description - * @param adminIds Ids of chat admins - * @param isGroupChannel no description - * @param permissions no description - * @param isDisappearing no description - * @param theme no description - * @param disappearingChatLink no description - * @param isService no description + * @param ownerId + * @param title - Chat title + * @param state + * @param activeIds + * @param acl + * @param membersCount + * @param friendsCount + * @param pinnedMessage + * @param photo + * @param adminIds - Ids of chat admins + * @param isGroupChannel + * @param permissions + * @param isDisappearing + * @param theme + * @param disappearingChatLink + * @param isService */ data class MessagesChatSettings( - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="state") + @SerializedName("state") val state: MessagesChatSettingsState, - @SerializedName(value="active_ids") + @SerializedName("active_ids") val activeIds: List, - @SerializedName(value="acl") + @SerializedName("acl") val acl: MessagesChatSettingsAcl, - @SerializedName(value="members_count") + @SerializedName("members_count") val membersCount: Int? = null, - @SerializedName(value="friends_count") + @SerializedName("friends_count") val friendsCount: Int? = null, - @SerializedName(value="pinned_message") + @SerializedName("pinned_message") val pinnedMessage: MessagesPinnedMessage? = null, - @SerializedName(value="photo") + @SerializedName("photo") val photo: MessagesChatSettingsPhoto? = null, - @SerializedName(value="admin_ids") + @SerializedName("admin_ids") val adminIds: List? = null, - @SerializedName(value="is_group_channel") + @SerializedName("is_group_channel") val isGroupChannel: Boolean? = null, - @SerializedName(value="permissions") + @SerializedName("permissions") val permissions: MessagesChatSettingsPermissions? = null, - @SerializedName(value="is_disappearing") + @SerializedName("is_disappearing") val isDisappearing: Boolean? = null, - @SerializedName(value="theme") + @SerializedName("theme") val theme: String? = null, - @SerializedName(value="disappearing_chat_link") + @SerializedName("disappearing_chat_link") val disappearingChatLink: String? = null, - @SerializedName(value="is_service") + @SerializedName("is_service") val isService: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsAcl.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsAcl.kt index e7d500f5e3..831dd76800 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsAcl.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsAcl.kt @@ -31,39 +31,39 @@ import com.google.gson.annotations.SerializedName import kotlin.Boolean /** - * @param canChangeInfo Can you change photo, description and name - * @param canChangeInviteLink Can you change invite link for this chat - * @param canChangePin Can you pin/unpin message for this chat - * @param canInvite Can you invite other peers in chat - * @param canPromoteUsers Can you promote simple users to chat admins - * @param canSeeInviteLink Can you see invite link for this chat - * @param canModerate Can you moderate (delete) other users' messages - * @param canCopyChat Can you copy chat - * @param canCall Can you init group call in the chat - * @param canUseMassMentions Can you use mass mentions - * @param canChangeServiceType Can you change chat service type + * @param canChangeInfo - Can you change photo, description and name + * @param canChangeInviteLink - Can you change invite link for this chat + * @param canChangePin - Can you pin/unpin message for this chat + * @param canInvite - Can you invite other peers in chat + * @param canPromoteUsers - Can you promote simple users to chat admins + * @param canSeeInviteLink - Can you see invite link for this chat + * @param canModerate - Can you moderate (delete) other users' messages + * @param canCopyChat - Can you copy chat + * @param canCall - Can you init group call in the chat + * @param canUseMassMentions - Can you use mass mentions + * @param canChangeServiceType - Can you change chat service type */ data class MessagesChatSettingsAcl( - @SerializedName(value="can_change_info") + @SerializedName("can_change_info") val canChangeInfo: Boolean, - @SerializedName(value="can_change_invite_link") + @SerializedName("can_change_invite_link") val canChangeInviteLink: Boolean, - @SerializedName(value="can_change_pin") + @SerializedName("can_change_pin") val canChangePin: Boolean, - @SerializedName(value="can_invite") + @SerializedName("can_invite") val canInvite: Boolean, - @SerializedName(value="can_promote_users") + @SerializedName("can_promote_users") val canPromoteUsers: Boolean, - @SerializedName(value="can_see_invite_link") + @SerializedName("can_see_invite_link") val canSeeInviteLink: Boolean, - @SerializedName(value="can_moderate") + @SerializedName("can_moderate") val canModerate: Boolean, - @SerializedName(value="can_copy_chat") + @SerializedName("can_copy_chat") val canCopyChat: Boolean, - @SerializedName(value="can_call") + @SerializedName("can_call") val canCall: Boolean, - @SerializedName(value="can_use_mass_mentions") + @SerializedName("can_use_mass_mentions") val canUseMassMentions: Boolean, - @SerializedName(value="can_change_service_type") + @SerializedName("can_change_service_type") val canChangeServiceType: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPermissions.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPermissions.kt index f8560aa155..121c3c3925 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPermissions.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPermissions.kt @@ -27,241 +27,119 @@ // ********************************************************************* package com.vk.sdk.api.messages.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.String /** - * @param invite Who can invite users to chat - * @param changeInfo Who can change chat info - * @param changePin Who can change pinned message - * @param useMassMentions Who can use mass mentions - * @param seeInviteLink Who can see invite link - * @param call Who can make calls - * @param changeAdmins Who can change admins + * @param invite - Who can invite users to chat + * @param changeInfo - Who can change chat info + * @param changePin - Who can change pinned message + * @param useMassMentions - Who can use mass mentions + * @param seeInviteLink - Who can see invite link + * @param call - Who can make calls + * @param changeAdmins - Who can change admins */ data class MessagesChatSettingsPermissions( - @SerializedName(value="invite") - val invite: Invite? = null, - @SerializedName(value="change_info") - val changeInfo: ChangeInfo? = null, - @SerializedName(value="change_pin") - val changePin: ChangePin? = null, - @SerializedName(value="use_mass_mentions") - val useMassMentions: UseMassMentions? = null, - @SerializedName(value="see_invite_link") - val seeInviteLink: SeeInviteLink? = null, - @SerializedName(value="call") - val call: Call? = null, - @SerializedName(value="change_admins") - val changeAdmins: ChangeAdmins? = null + @SerializedName("invite") + val invite: MessagesChatSettingsPermissions.Invite? = null, + @SerializedName("change_info") + val changeInfo: MessagesChatSettingsPermissions.ChangeInfo? = null, + @SerializedName("change_pin") + val changePin: MessagesChatSettingsPermissions.ChangePin? = null, + @SerializedName("use_mass_mentions") + val useMassMentions: MessagesChatSettingsPermissions.UseMassMentions? = null, + @SerializedName("see_invite_link") + val seeInviteLink: MessagesChatSettingsPermissions.SeeInviteLink? = null, + @SerializedName("call") + val call: MessagesChatSettingsPermissions.Call? = null, + @SerializedName("change_admins") + val changeAdmins: MessagesChatSettingsPermissions.ChangeAdmins? = null ) { - enum class ChangeInfo( + enum class Invite( val value: String ) { + @SerializedName("owner") OWNER("owner"), + @SerializedName("owner_and_admins") OWNER_AND_ADMINS("owner_and_admins"), + @SerializedName("all") ALL("all"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: ChangeInfo?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): ChangeInfo { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } - enum class Call( + enum class ChangeInfo( val value: String ) { + @SerializedName("owner") OWNER("owner"), + @SerializedName("owner_and_admins") OWNER_AND_ADMINS("owner_and_admins"), + @SerializedName("all") ALL("all"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Call?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Call { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } - enum class UseMassMentions( + enum class ChangePin( val value: String ) { + @SerializedName("owner") OWNER("owner"), + @SerializedName("owner_and_admins") OWNER_AND_ADMINS("owner_and_admins"), + @SerializedName("all") ALL("all"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: UseMassMentions?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): UseMassMentions { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } - enum class ChangePin( + enum class UseMassMentions( val value: String ) { + @SerializedName("owner") OWNER("owner"), + @SerializedName("owner_and_admins") OWNER_AND_ADMINS("owner_and_admins"), + @SerializedName("all") ALL("all"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: ChangePin?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): ChangePin { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } - enum class ChangeAdmins( + enum class SeeInviteLink( val value: String ) { + @SerializedName("owner") OWNER("owner"), - OWNER_AND_ADMINS("owner_and_admins"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: ChangeAdmins?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE + @SerializedName("owner_and_admins") + OWNER_AND_ADMINS("owner_and_admins"), - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): ChangeAdmins { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } + @SerializedName("all") + ALL("all"); } - enum class Invite( + enum class Call( val value: String ) { + @SerializedName("owner") OWNER("owner"), + @SerializedName("owner_and_admins") OWNER_AND_ADMINS("owner_and_admins"), + @SerializedName("all") ALL("all"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Invite?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Invite { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } - enum class SeeInviteLink( + enum class ChangeAdmins( val value: String ) { + @SerializedName("owner") OWNER("owner"), - OWNER_AND_ADMINS("owner_and_admins"), - - ALL("all"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: SeeInviteLink?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): SeeInviteLink { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } + @SerializedName("owner_and_admins") + OWNER_AND_ADMINS("owner_and_admins"); } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPhoto.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPhoto.kt index 821f5d67d9..6de2f4ca74 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPhoto.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPhoto.kt @@ -32,18 +32,18 @@ import kotlin.Boolean import kotlin.String /** - * @param photo50 URL of the preview image with 50px in width - * @param photo100 URL of the preview image with 100px in width - * @param photo200 URL of the preview image with 200px in width - * @param isDefaultPhoto If provided photo is default + * @param photo50 - URL of the preview image with 50px in width + * @param photo100 - URL of the preview image with 100px in width + * @param photo200 - URL of the preview image with 200px in width + * @param isDefaultPhoto - If provided photo is default */ data class MessagesChatSettingsPhoto( - @SerializedName(value="photo_50") + @SerializedName("photo_50") val photo50: String? = null, - @SerializedName(value="photo_100") + @SerializedName("photo_100") val photo100: String? = null, - @SerializedName(value="photo_200") + @SerializedName("photo_200") val photo200: String? = null, - @SerializedName(value="is_default_photo") + @SerializedName("is_default_photo") val isDefaultPhoto: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsState.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsState.kt index c74677e662..02500cba42 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsState.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsState.kt @@ -27,43 +27,18 @@ // ********************************************************************* package com.vk.sdk.api.messages.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class MessagesChatSettingsState( val value: String ) { + @SerializedName("in") IN("in"), + @SerializedName("kicked") KICKED("kicked"), + @SerializedName("left") LEFT("left"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: MessagesChatSettingsState?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): MessagesChatSettingsState { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversation.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversation.kt index 4d087cf377..67f418aa14 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversation.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversation.kt @@ -27,108 +27,83 @@ // ********************************************************************* package com.vk.sdk.api.messages.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.Boolean import kotlin.Int import kotlin.String import kotlin.collections.List /** - * @param peer no description - * @param lastMessageId ID of the last message in conversation - * @param inRead Last message user have read - * @param outRead Last outcoming message have been read by the opponent - * @param sortId no description - * @param unreadCount Unread messages number - * @param isMarkedUnread Is this conversation uread - * @param outReadBy no description - * @param important no description - * @param unanswered no description - * @param specialServiceType no description - * @param messageRequestData no description - * @param mentions Ids of messages with mentions - * @param expireMessages Ids of messages with expiration time - * @param currentKeyboard no description - * @param pushSettings no description - * @param canWrite no description - * @param canSendMoney no description - * @param canReceiveMoney no description - * @param chatSettings no description + * @param peer + * @param lastMessageId - ID of the last message in conversation + * @param inRead - Last message user have read + * @param outRead - Last outcoming message have been read by the opponent + * @param sortId + * @param unreadCount - Unread messages number + * @param isMarkedUnread - Is this conversation uread + * @param outReadBy + * @param important + * @param unanswered + * @param specialServiceType + * @param messageRequestData + * @param mentions - Ids of messages with mentions + * @param expireMessages - Ids of messages with expiration time + * @param currentKeyboard + * @param pushSettings + * @param canWrite + * @param canSendMoney + * @param canReceiveMoney + * @param chatSettings + * @param spamExpiration */ data class MessagesConversation( - @SerializedName(value="peer") + @SerializedName("peer") val peer: MessagesConversationPeer, - @SerializedName(value="last_message_id") + @SerializedName("last_message_id") val lastMessageId: Int, - @SerializedName(value="in_read") + @SerializedName("in_read") val inRead: Int, - @SerializedName(value="out_read") + @SerializedName("out_read") val outRead: Int, - @SerializedName(value="sort_id") + @SerializedName("sort_id") val sortId: MessagesConversationSortId? = null, - @SerializedName(value="unread_count") + @SerializedName("unread_count") val unreadCount: Int? = null, - @SerializedName(value="is_marked_unread") + @SerializedName("is_marked_unread") val isMarkedUnread: Boolean? = null, - @SerializedName(value="out_read_by") + @SerializedName("out_read_by") val outReadBy: MessagesOutReadBy? = null, - @SerializedName(value="important") + @SerializedName("important") val important: Boolean? = null, - @SerializedName(value="unanswered") + @SerializedName("unanswered") val unanswered: Boolean? = null, - @SerializedName(value="special_service_type") - val specialServiceType: SpecialServiceType? = null, - @SerializedName(value="message_request_data") + @SerializedName("special_service_type") + val specialServiceType: MessagesConversation.SpecialServiceType? = null, + @SerializedName("message_request_data") val messageRequestData: MessagesMessageRequestData? = null, - @SerializedName(value="mentions") + @SerializedName("mentions") val mentions: List? = null, - @SerializedName(value="expire_messages") + @SerializedName("expire_messages") val expireMessages: List? = null, - @SerializedName(value="current_keyboard") + @SerializedName("current_keyboard") val currentKeyboard: MessagesKeyboard? = null, - @SerializedName(value="push_settings") + @SerializedName("push_settings") val pushSettings: MessagesPushSettings? = null, - @SerializedName(value="can_write") + @SerializedName("can_write") val canWrite: MessagesConversationCanWrite? = null, - @SerializedName(value="can_send_money") + @SerializedName("can_send_money") val canSendMoney: Boolean? = null, - @SerializedName(value="can_receive_money") + @SerializedName("can_receive_money") val canReceiveMoney: Boolean? = null, - @SerializedName(value="chat_settings") - val chatSettings: MessagesChatSettings? = null + @SerializedName("chat_settings") + val chatSettings: MessagesChatSettings? = null, + @SerializedName("spam_expiration") + val spamExpiration: Int? = null ) { enum class SpecialServiceType( val value: String ) { + @SerializedName("business_notify") BUSINESS_NOTIFY("business_notify"); - - class Serializer : JsonSerializer, JsonDeserializer - { - override fun serialize( - src: SpecialServiceType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): SpecialServiceType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationCanWrite.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationCanWrite.kt index 55d5651238..c8339e34a7 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationCanWrite.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationCanWrite.kt @@ -32,12 +32,12 @@ import kotlin.Boolean import kotlin.Int /** - * @param allowed no description - * @param reason no description + * @param allowed + * @param reason */ data class MessagesConversationCanWrite( - @SerializedName(value="allowed") + @SerializedName("allowed") val allowed: Boolean, - @SerializedName(value="reason") + @SerializedName("reason") val reason: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationMember.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationMember.kt index 82af50515b..277f5d8d19 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationMember.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationMember.kt @@ -32,30 +32,30 @@ import kotlin.Boolean import kotlin.Int /** - * @param memberId no description - * @param canKick Is it possible for user to kick this member - * @param invitedBy no description - * @param isAdmin no description - * @param isOwner no description - * @param isMessageRequest no description - * @param joinDate no description - * @param requestDate Message request date + * @param memberId + * @param canKick - Is it possible for user to kick this member + * @param invitedBy + * @param isAdmin + * @param isOwner + * @param isMessageRequest + * @param joinDate + * @param requestDate - Message request date */ data class MessagesConversationMember( - @SerializedName(value="member_id") + @SerializedName("member_id") val memberId: Int, - @SerializedName(value="can_kick") + @SerializedName("can_kick") val canKick: Boolean? = null, - @SerializedName(value="invited_by") + @SerializedName("invited_by") val invitedBy: Int? = null, - @SerializedName(value="is_admin") + @SerializedName("is_admin") val isAdmin: Boolean? = null, - @SerializedName(value="is_owner") + @SerializedName("is_owner") val isOwner: Boolean? = null, - @SerializedName(value="is_message_request") + @SerializedName("is_message_request") val isMessageRequest: Boolean? = null, - @SerializedName(value="join_date") + @SerializedName("join_date") val joinDate: Int? = null, - @SerializedName(value="request_date") + @SerializedName("request_date") val requestDate: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationPeer.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationPeer.kt index 0f53d35922..d851b90c9d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationPeer.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationPeer.kt @@ -31,15 +31,15 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param id no description - * @param type no description - * @param localId no description + * @param id + * @param type + * @param localId */ data class MessagesConversationPeer( - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="type") + @SerializedName("type") val type: MessagesConversationPeerType, - @SerializedName(value="local_id") + @SerializedName("local_id") val localId: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationPeerType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationPeerType.kt index 22dd8b5248..9ba6dda5dd 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationPeerType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationPeerType.kt @@ -27,47 +27,24 @@ // ********************************************************************* package com.vk.sdk.api.messages.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class MessagesConversationPeerType( val value: String ) { + @SerializedName("chat") CHAT("chat"), + @SerializedName("email") EMAIL("email"), + @SerializedName("user") USER("user"), + @SerializedName("group") GROUP("group"), + @SerializedName("contact") CONTACT("contact"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: MessagesConversationPeerType?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): MessagesConversationPeerType { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationSortId.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationSortId.kt index 2a7dbe3469..b472e28dee 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationSortId.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationSortId.kt @@ -31,12 +31,12 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param majorId Major id for sorting conversations - * @param minorId Minor id for sorting conversations + * @param majorId - Major id for sorting conversations + * @param minorId - Minor id for sorting conversations */ data class MessagesConversationSortId( - @SerializedName(value="major_id") + @SerializedName("major_id") val majorId: Int, - @SerializedName(value="minor_id") + @SerializedName("minor_id") val minorId: Int ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationWithMessage.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationWithMessage.kt index e259e3fe0f..b3078a5ab3 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationWithMessage.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationWithMessage.kt @@ -30,12 +30,12 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName /** - * @param conversation no description - * @param lastMessage no description + * @param conversation + * @param lastMessage */ data class MessagesConversationWithMessage( - @SerializedName(value="conversation") + @SerializedName("conversation") val conversation: MessagesConversation, - @SerializedName(value="last_message") + @SerializedName("last_message") val lastMessage: MessagesMessage? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesDeleteChatPhotoResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesDeleteChatPhotoResponse.kt new file mode 100644 index 0000000000..64503c77c7 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesDeleteChatPhotoResponse.kt @@ -0,0 +1,42 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param messageId - Service message ID + * @param chat + */ +data class MessagesDeleteChatPhotoResponse( + @SerializedName("message_id") + val messageId: Int? = null, + @SerializedName("chat") + val chat: MessagesChat? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesDeleteConversationResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesDeleteConversationResponse.kt new file mode 100644 index 0000000000..37de6e9ae9 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesDeleteConversationResponse.kt @@ -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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param lastDeletedId - Id of the last message, that was deleted + */ +data class MessagesDeleteConversationResponse( + @SerializedName("last_deleted_id") + val lastDeletedId: Int +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesForeignMessage.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesForeignMessage.kt index 00a86b556d..86f099a87f 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesForeignMessage.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesForeignMessage.kt @@ -35,45 +35,45 @@ import kotlin.String import kotlin.collections.List /** - * @param date Date when the message was created - * @param fromId Message author's ID - * @param text Message text - * @param attachments no description - * @param conversationMessageId Conversation message ID - * @param fwdMessages no description - * @param geo no description - * @param id Message ID - * @param peerId Peer ID - * @param replyMessage no description - * @param updateTime Date when the message has been updated in Unixtime - * @param wasListened Was the audio message inside already listened by you - * @param payload Additional data sent along with message for developer convenience + * @param date - Date when the message was created + * @param fromId - Message author's ID + * @param text - Message text + * @param attachments + * @param conversationMessageId - Conversation message ID + * @param fwdMessages + * @param geo + * @param id - Message ID + * @param peerId - Peer ID + * @param replyMessage + * @param updateTime - Date when the message has been updated in Unixtime + * @param wasListened - Was the audio message inside already listened by you + * @param payload - Additional data sent along with message for developer convenience */ data class MessagesForeignMessage( - @SerializedName(value="date") + @SerializedName("date") val date: Int, - @SerializedName(value="from_id") + @SerializedName("from_id") val fromId: Int, - @SerializedName(value="text") + @SerializedName("text") val text: String, - @SerializedName(value="attachments") + @SerializedName("attachments") val attachments: List? = null, - @SerializedName(value="conversation_message_id") + @SerializedName("conversation_message_id") val conversationMessageId: Int? = null, - @SerializedName(value="fwd_messages") + @SerializedName("fwd_messages") val fwdMessages: List? = null, - @SerializedName(value="geo") + @SerializedName("geo") val geo: BaseGeo? = null, - @SerializedName(value="id") + @SerializedName("id") val id: Int? = null, - @SerializedName(value="peer_id") + @SerializedName("peer_id") val peerId: Int? = null, - @SerializedName(value="reply_message") + @SerializedName("reply_message") val replyMessage: MessagesForeignMessage? = null, - @SerializedName(value="update_time") + @SerializedName("update_time") val updateTime: Int? = null, - @SerializedName(value="was_listened") + @SerializedName("was_listened") val wasListened: Boolean? = null, - @SerializedName(value="payload") + @SerializedName("payload") val payload: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByConversationMessageIdResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByConversationMessageIdResponse.kt new file mode 100644 index 0000000000..2dacb904b8 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByConversationMessageIdResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MessagesGetByConversationMessageIdResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByIdExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByIdExtendedResponse.kt new file mode 100644 index 0000000000..e644724a9a --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByIdExtendedResponse.kt @@ -0,0 +1,51 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param profiles + * @param groups + */ +data class MessagesGetByIdExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByIdResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByIdResponse.kt new file mode 100644 index 0000000000..79e725d18d --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByIdResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MessagesGetByIdResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetChatPreviewResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetChatPreviewResponse.kt new file mode 100644 index 0000000000..d9475fc48b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetChatPreviewResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.collections.List + +/** + * @param preview + * @param profiles + */ +data class MessagesGetChatPreviewResponse( + @SerializedName("preview") + val preview: MessagesChatPreview? = null, + @SerializedName("profiles") + val profiles: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationMembersResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationMembersResponse.kt new file mode 100644 index 0000000000..397723f48a --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationMembersResponse.kt @@ -0,0 +1,54 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Chat members count + * @param items + * @param chatRestrictions + * @param profiles + * @param groups + */ +data class MessagesGetConversationMembersResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("chat_restrictions") + val chatRestrictions: MessagesChatRestrictions? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsByIdExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsByIdExtendedResponse.kt new file mode 100644 index 0000000000..189b34d334 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsByIdExtendedResponse.kt @@ -0,0 +1,51 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param profiles + * @param groups + */ +data class MessagesGetConversationsByIdExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsByIdResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsByIdResponse.kt new file mode 100644 index 0000000000..6f22b644e4 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsByIdResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MessagesGetConversationsByIdResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsResponse.kt new file mode 100644 index 0000000000..d7ee613805 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsResponse.kt @@ -0,0 +1,54 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param unreadCount - Unread dialogs number + * @param profiles + * @param groups + */ +data class MessagesGetConversationsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("unread_count") + val unreadCount: Int? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsResponse.kt new file mode 100644 index 0000000000..45b9ba7c2e --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String +import kotlin.collections.List + +/** + * @param items + * @param nextFrom - Value for pagination + */ +data class MessagesGetHistoryAttachmentsResponse( + @SerializedName("items") + val items: List? = null, + @SerializedName("next_from") + val nextFrom: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryExtendedResponse.kt new file mode 100644 index 0000000000..5e806b5fea --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryExtendedResponse.kt @@ -0,0 +1,54 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param profiles + * @param groups + * @param conversations + */ +data class MessagesGetHistoryExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null, + @SerializedName("conversations") + val conversations: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryResponse.kt new file mode 100644 index 0000000000..341d5ba295 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MessagesGetHistoryResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesExtendedResponse.kt new file mode 100644 index 0000000000..6e2ab7f52d --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesExtendedResponse.kt @@ -0,0 +1,50 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroup +import com.vk.sdk.api.users.dto.UsersUser +import kotlin.collections.List + +/** + * @param messages + * @param profiles + * @param groups + * @param conversations + */ +data class MessagesGetImportantMessagesExtendedResponse( + @SerializedName("messages") + val messages: MessagesMessagesArray, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null, + @SerializedName("conversations") + val conversations: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesResponse.kt new file mode 100644 index 0000000000..c34de4fac1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesResponse.kt @@ -0,0 +1,50 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroup +import com.vk.sdk.api.users.dto.UsersUser +import kotlin.collections.List + +/** + * @param messages + * @param profiles + * @param groups + * @param conversations + */ +data class MessagesGetImportantMessagesResponse( + @SerializedName("messages") + val messages: MessagesMessagesArray, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null, + @SerializedName("conversations") + val conversations: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersResponse.kt new file mode 100644 index 0000000000..ae71e5bf4d --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersResponse.kt @@ -0,0 +1,47 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count + * @param items + * @param profiles + */ +data class MessagesGetIntentUsersResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetInviteLinkResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetInviteLinkResponse.kt new file mode 100644 index 0000000000..6d15787bc1 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetInviteLinkResponse.kt @@ -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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param link + */ +data class MessagesGetInviteLinkResponse( + @SerializedName("link") + val link: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetLongPollHistoryResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetLongPollHistoryResponse.kt new file mode 100644 index 0000000000..c6f2c6bbfb --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetLongPollHistoryResponse.kt @@ -0,0 +1,70 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroup +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Boolean +import kotlin.Int +import kotlin.collections.List + +/** + * @param history + * @param messages + * @param credentials + * @param profiles + * @param groups + * @param chats + * @param newPts - Persistence timestamp + * @param fromPts + * @param more - Has more + * @param conversations + */ +data class MessagesGetLongPollHistoryResponse( + @SerializedName("history") + val history: List>? = null, + @SerializedName("messages") + val messages: MessagesLongpollMessages? = null, + @SerializedName("credentials") + val credentials: MessagesLongpollParams? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null, + @SerializedName("chats") + val chats: List? = null, + @SerializedName("new_pts") + val newPts: Int? = null, + @SerializedName("from_pts") + val fromPts: Int? = null, + @SerializedName("more") + val more: Boolean? = null, + @SerializedName("conversations") + val conversations: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGraffiti.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGraffiti.kt index d140174f4a..04a2f47992 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGraffiti.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGraffiti.kt @@ -32,24 +32,24 @@ import kotlin.Int import kotlin.String /** - * @param height Graffiti height - * @param id Graffiti ID - * @param ownerId Graffiti owner ID - * @param url Graffiti URL - * @param width Graffiti width - * @param accessKey Access key for graffiti + * @param height - Graffiti height + * @param id - Graffiti ID + * @param ownerId - Graffiti owner ID + * @param url - Graffiti URL + * @param width - Graffiti width + * @param accessKey - Access key for graffiti */ data class MessagesGraffiti( - @SerializedName(value="height") + @SerializedName("height") val height: Int, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int, - @SerializedName(value="url") + @SerializedName("url") val url: String, - @SerializedName(value="width") + @SerializedName("width") val width: Int, - @SerializedName(value="access_key") + @SerializedName("access_key") val accessKey: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryAttachment.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryAttachment.kt index 07a6973bc0..e63f554bc0 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryAttachment.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryAttachment.kt @@ -31,18 +31,18 @@ import com.google.gson.annotations.SerializedName import kotlin.Int /** - * @param attachment no description - * @param messageId Message ID - * @param fromId Message author's ID - * @param forwardLevel Forward level (optional) + * @param attachment + * @param messageId - Message ID + * @param fromId - Message author's ID + * @param forwardLevel - Forward level (optional) */ data class MessagesHistoryAttachment( - @SerializedName(value="attachment") + @SerializedName("attachment") val attachment: MessagesHistoryMessageAttachment, - @SerializedName(value="message_id") + @SerializedName("message_id") val messageId: Int, - @SerializedName(value="from_id") + @SerializedName("from_id") val fromId: Int, - @SerializedName(value="forward_level") + @SerializedName("forward_level") val forwardLevel: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachment.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachment.kt index e112619189..bcf17c9b7d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachment.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachment.kt @@ -35,39 +35,39 @@ import com.vk.sdk.api.photos.dto.PhotosPhoto import com.vk.sdk.api.video.dto.VideoVideo /** - * @param type no description - * @param audio no description - * @param audioMessage no description - * @param doc no description - * @param graffiti no description - * @param link no description - * @param market no description - * @param photo no description - * @param share no description - * @param video no description - * @param wall no description + * @param type + * @param audio + * @param audioMessage + * @param doc + * @param graffiti + * @param link + * @param market + * @param photo + * @param share + * @param video + * @param wall */ data class MessagesHistoryMessageAttachment( - @SerializedName(value="type") + @SerializedName("type") val type: MessagesHistoryMessageAttachmentType, - @SerializedName(value="audio") + @SerializedName("audio") val audio: AudioAudio? = null, - @SerializedName(value="audio_message") + @SerializedName("audio_message") val audioMessage: MessagesAudioMessage? = null, - @SerializedName(value="doc") + @SerializedName("doc") val doc: DocsDoc? = null, - @SerializedName(value="graffiti") + @SerializedName("graffiti") val graffiti: MessagesGraffiti? = null, - @SerializedName(value="link") + @SerializedName("link") val link: BaseLink? = null, - @SerializedName(value="market") + @SerializedName("market") val market: BaseLink? = null, - @SerializedName(value="photo") + @SerializedName("photo") val photo: PhotosPhoto? = null, - @SerializedName(value="share") + @SerializedName("share") val share: BaseLink? = null, - @SerializedName(value="video") + @SerializedName("video") val video: VideoVideo? = null, - @SerializedName(value="wall") + @SerializedName("wall") val wall: BaseLink? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachmentType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachmentType.kt index d1d25da64a..443fe58704 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachmentType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachmentType.kt @@ -28,11 +28,14 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import kotlin.String -enum class MessagesHistoryMessageAttachmentType { - @SerializedName(value="graffiti") - GRAFFITI, +enum class MessagesHistoryMessageAttachmentType( + val value: String +) { + @SerializedName("graffiti") + GRAFFITI("graffiti"), - @SerializedName(value="audio_message") - AUDIO_MESSAGE + @SerializedName("audio_message") + AUDIO_MESSAGE("audio_message"); } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesIsMessagesFromGroupAllowedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesIsMessagesFromGroupAllowedResponse.kt new file mode 100644 index 0000000000..30ff346821 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesIsMessagesFromGroupAllowedResponse.kt @@ -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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseBoolInt + +/** + * @param isAllowed + */ +data class MessagesIsMessagesFromGroupAllowedResponse( + @SerializedName("is_allowed") + val isAllowed: BaseBoolInt? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesJoinChatByInviteLinkResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesJoinChatByInviteLinkResponse.kt new file mode 100644 index 0000000000..fd356884e7 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesJoinChatByInviteLinkResponse.kt @@ -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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param chatId + */ +data class MessagesJoinChatByInviteLinkResponse( + @SerializedName("chat_id") + val chatId: Int? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboard.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboard.kt index 1bc6cb35fe..ee73961bd1 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboard.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboard.kt @@ -33,18 +33,18 @@ import kotlin.Int import kotlin.collections.List /** - * @param buttons no description - * @param oneTime Should this keyboard disappear on first use - * @param authorId Community or bot, which set this keyboard - * @param inline no description + * @param buttons + * @param oneTime - Should this keyboard disappear on first use + * @param authorId - Community or bot, which set this keyboard + * @param inline */ data class MessagesKeyboard( - @SerializedName(value="buttons") + @SerializedName("buttons") val buttons: List>, - @SerializedName(value="one_time") + @SerializedName("one_time") val oneTime: Boolean, - @SerializedName(value="author_id") + @SerializedName("author_id") val authorId: Int? = null, - @SerializedName(value="inline") + @SerializedName("inline") val inline: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButton.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButton.kt index b4d0059699..6ed769cd7d 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButton.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButton.kt @@ -27,56 +27,32 @@ // ********************************************************************* package com.vk.sdk.api.messages.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.String /** - * @param action no description - * @param color Button color + * @param action + * @param color - Button color */ data class MessagesKeyboardButton( - @SerializedName(value="action") + @SerializedName("action") val action: MessagesKeyboardButtonAction, - @SerializedName(value="color") - val color: Color? = null + @SerializedName("color") + val color: MessagesKeyboardButton.Color? = null ) { enum class Color( val value: String ) { + @SerializedName("default") DEFAULT("default"), + @SerializedName("positive") POSITIVE("positive"), + @SerializedName("negative") NEGATIVE("negative"), + @SerializedName("primary") PRIMARY("primary"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: Color?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): Color { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButtonAction.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButtonAction.kt index 3982cfe736..8689d090cd 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButtonAction.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButtonAction.kt @@ -32,27 +32,28 @@ import kotlin.Int import kotlin.String /** - * @param type Button type - * @param appId Fragment value in app link like vk.com/app{app_id}_-654321#hash - * @param hash Fragment value in app link like vk.com/app123456_-654321#{hash} - * @param label Label for button - * @param link link for button - * @param ownerId Fragment value in app link like vk.com/app123456_{owner_id}#hash - * @param payload Additional data sent along with message for developer convenience + * Description of the action, that should be performed on button click + * @param type - Button type + * @param appId - Fragment value in app link like vk.com/app{app_id}_-654321#hash + * @param hash - Fragment value in app link like vk.com/app123456_-654321#{hash} + * @param label - Label for button + * @param link - link for button + * @param ownerId - Fragment value in app link like vk.com/app123456_{owner_id}#hash + * @param payload - Additional data sent along with message for developer convenience */ data class MessagesKeyboardButtonAction( - @SerializedName(value="type") + @SerializedName("type") val type: MessagesTemplateActionTypeNames, - @SerializedName(value="app_id") + @SerializedName("app_id") val appId: Int? = null, - @SerializedName(value="hash") + @SerializedName("hash") val hash: String? = null, - @SerializedName(value="label") + @SerializedName("label") val label: String? = null, - @SerializedName(value="link") + @SerializedName("link") val link: String? = null, - @SerializedName(value="owner_id") + @SerializedName("owner_id") val ownerId: Int? = null, - @SerializedName(value="payload") + @SerializedName("payload") val payload: String? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLastActivity.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLastActivity.kt index 1e6dd342e9..d0ebc1d246 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLastActivity.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLastActivity.kt @@ -32,12 +32,12 @@ import com.vk.sdk.api.base.dto.BaseBoolInt import kotlin.Int /** - * @param online Information whether user is online - * @param time Time when user was online in Unixtime + * @param online - Information whether user is online + * @param time - Time when user was online in Unixtime */ data class MessagesLastActivity( - @SerializedName(value="online") + @SerializedName("online") val online: BaseBoolInt, - @SerializedName(value="time") + @SerializedName("time") val time: Int ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLongpollMessages.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLongpollMessages.kt index 21f00678b1..181cd1423f 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLongpollMessages.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLongpollMessages.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param count Total number - * @param items no description + * @param count - Total number + * @param items */ data class MessagesLongpollMessages( - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null, - @SerializedName(value="items") + @SerializedName("items") val items: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLongpollParams.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLongpollParams.kt index b5973057ff..2d2a81f874 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLongpollParams.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesLongpollParams.kt @@ -32,18 +32,18 @@ import kotlin.Int import kotlin.String /** - * @param server Server URL - * @param key Key - * @param ts Timestamp - * @param pts Persistent timestamp + * @param server - Server URL + * @param key - Key + * @param ts - Timestamp + * @param pts - Persistent timestamp */ data class MessagesLongpollParams( - @SerializedName(value="server") + @SerializedName("server") val server: String, - @SerializedName(value="key") + @SerializedName("key") val key: String, - @SerializedName(value="ts") + @SerializedName("ts") val ts: Int, - @SerializedName(value="pts") + @SerializedName("pts") val pts: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessage.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessage.kt index 9af12f0774..05f00ffa83 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessage.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessage.kt @@ -30,91 +30,92 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName import com.vk.sdk.api.base.dto.BaseBoolInt import com.vk.sdk.api.base.dto.BaseGeo +import kotlin.Any import kotlin.Boolean import kotlin.Int import kotlin.String import kotlin.collections.List /** - * @param date Date when the message has been sent in Unixtime - * @param fromId Message author's ID - * @param id Message ID - * @param out Information whether the message is outcoming - * @param peerId Peer ID - * @param text Message text - * @param action no description - * @param adminAuthorId Only for messages from community. Contains user ID of community admin, who + * @param date - Date when the message has been sent in Unixtime + * @param fromId - Message author's ID + * @param id - Message ID + * @param out - Information whether the message is outcoming + * @param peerId - Peer ID + * @param text - Message text + * @param action + * @param adminAuthorId - Only for messages from community. Contains user ID of community admin, who * sent this message. - * @param attachments no description - * @param conversationMessageId Unique auto-incremented number for all messages with this peer - * @param deleted Is it an deleted message - * @param fwdMessages Forwarded messages - * @param geo no description - * @param important Is it an important message - * @param isHidden no description - * @param isCropped this message is cropped for bot - * @param keyboard no description - * @param membersCount Members number - * @param payload no description - * @param randomId ID used for sending messages. It returned only for outgoing messages - * @param ref no description - * @param refSource no description - * @param replyMessage no description - * @param updateTime Date when the message has been updated in Unixtime - * @param wasListened Was the audio message inside already listened by you - * @param pinnedAt Date when the message has been pinned in Unixtime + * @param attachments + * @param conversationMessageId - Unique auto-incremented number for all messages with this peer + * @param deleted - Is it an deleted message + * @param fwdMessages + * @param geo + * @param important - Is it an important message + * @param isHidden + * @param isCropped - this message is cropped for bot + * @param keyboard + * @param membersCount - Members number + * @param payload + * @param randomId - ID used for sending messages. It returned only for outgoing messages + * @param ref + * @param refSource + * @param replyMessage + * @param updateTime - Date when the message has been updated in Unixtime + * @param wasListened - Was the audio message inside already listened by you + * @param pinnedAt - Date when the message has been pinned in Unixtime */ data class MessagesMessage( - @SerializedName(value="date") + @SerializedName("date") val date: Int, - @SerializedName(value="from_id") + @SerializedName("from_id") val fromId: Int, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="out") + @SerializedName("out") val out: BaseBoolInt, - @SerializedName(value="peer_id") + @SerializedName("peer_id") val peerId: Int, - @SerializedName(value="text") + @SerializedName("text") val text: String, - @SerializedName(value="action") - val action: MessagesMessageAction? = null, - @SerializedName(value="admin_author_id") + @SerializedName("action") + val action: Any? = null, + @SerializedName("admin_author_id") val adminAuthorId: Int? = null, - @SerializedName(value="attachments") + @SerializedName("attachments") val attachments: List? = null, - @SerializedName(value="conversation_message_id") + @SerializedName("conversation_message_id") val conversationMessageId: Int? = null, - @SerializedName(value="deleted") + @SerializedName("deleted") val deleted: BaseBoolInt? = null, - @SerializedName(value="fwd_messages") - val fwdMessages: List? = null, - @SerializedName(value="geo") + @SerializedName("fwd_messages") + val fwdMessages: Any? = null, + @SerializedName("geo") val geo: BaseGeo? = null, - @SerializedName(value="important") + @SerializedName("important") val important: Boolean? = null, - @SerializedName(value="is_hidden") + @SerializedName("is_hidden") val isHidden: Boolean? = null, - @SerializedName(value="is_cropped") + @SerializedName("is_cropped") val isCropped: Boolean? = null, - @SerializedName(value="keyboard") + @SerializedName("keyboard") val keyboard: MessagesKeyboard? = null, - @SerializedName(value="members_count") + @SerializedName("members_count") val membersCount: Int? = null, - @SerializedName(value="payload") + @SerializedName("payload") val payload: String? = null, - @SerializedName(value="random_id") + @SerializedName("random_id") val randomId: Int? = null, - @SerializedName(value="ref") + @SerializedName("ref") val ref: String? = null, - @SerializedName(value="ref_source") + @SerializedName("ref_source") val refSource: String? = null, - @SerializedName(value="reply_message") + @SerializedName("reply_message") val replyMessage: MessagesForeignMessage? = null, - @SerializedName(value="update_time") + @SerializedName("update_time") val updateTime: Int? = null, - @SerializedName(value="was_listened") + @SerializedName("was_listened") val wasListened: Boolean? = null, - @SerializedName(value="pinned_at") + @SerializedName("pinned_at") val pinnedAt: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachment.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachment.kt index 1f8b78fb45..74f706a56b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachment.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachment.kt @@ -44,57 +44,57 @@ import com.vk.sdk.api.wall.dto.WallWallComment import com.vk.sdk.api.wall.dto.WallWallpostFull /** - * @param type no description - * @param audio no description - * @param audioMessage no description - * @param call no description - * @param doc no description - * @param gift no description - * @param graffiti no description - * @param link no description - * @param market no description - * @param marketMarketAlbum no description - * @param photo no description - * @param sticker no description - * @param story no description - * @param video no description - * @param wall no description - * @param wallReply no description - * @param poll no description + * @param type + * @param audio + * @param audioMessage + * @param call + * @param doc + * @param gift + * @param graffiti + * @param link + * @param market + * @param marketMarketAlbum + * @param photo + * @param sticker + * @param story + * @param video + * @param wall + * @param wallReply + * @param poll */ data class MessagesMessageAttachment( - @SerializedName(value="type") + @SerializedName("type") val type: MessagesMessageAttachmentType, - @SerializedName(value="audio") + @SerializedName("audio") val audio: AudioAudio? = null, - @SerializedName(value="audio_message") + @SerializedName("audio_message") val audioMessage: MessagesAudioMessage? = null, - @SerializedName(value="call") + @SerializedName("call") val call: CallsCall? = null, - @SerializedName(value="doc") + @SerializedName("doc") val doc: DocsDoc? = null, - @SerializedName(value="gift") + @SerializedName("gift") val gift: GiftsLayout? = null, - @SerializedName(value="graffiti") + @SerializedName("graffiti") val graffiti: MessagesGraffiti? = null, - @SerializedName(value="link") + @SerializedName("link") val link: BaseLink? = null, - @SerializedName(value="market") + @SerializedName("market") val market: MarketMarketItem? = null, - @SerializedName(value="market_market_album") + @SerializedName("market_market_album") val marketMarketAlbum: MarketMarketAlbum? = null, - @SerializedName(value="photo") + @SerializedName("photo") val photo: PhotosPhoto? = null, - @SerializedName(value="sticker") + @SerializedName("sticker") val sticker: BaseSticker? = null, - @SerializedName(value="story") + @SerializedName("story") val story: StoriesStory? = null, - @SerializedName(value="video") + @SerializedName("video") val video: VideoVideo? = null, - @SerializedName(value="wall") + @SerializedName("wall") val wall: WallWallpostFull? = null, - @SerializedName(value="wall_reply") + @SerializedName("wall_reply") val wallReply: WallWallComment? = null, - @SerializedName(value="poll") + @SerializedName("poll") val poll: PollsPoll? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachmentType.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachmentType.kt index b82548dde0..6f9c9d8b74 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachmentType.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachmentType.kt @@ -28,8 +28,11 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import kotlin.String -enum class MessagesMessageAttachmentType { - @SerializedName(value="call") - CALL +enum class MessagesMessageAttachmentType( + val value: String +) { + @SerializedName("mini_app") + MINI_APP("mini_app"); } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageRequestData.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageRequestData.kt index 13864b6552..3a857dc6f2 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageRequestData.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageRequestData.kt @@ -32,15 +32,15 @@ import kotlin.Int import kotlin.String /** - * @param status Status of message request - * @param inviterId Message request sender id - * @param requestDate Message request date + * @param status - Status of message request + * @param inviterId - Message request sender id + * @param requestDate - Message request date */ data class MessagesMessageRequestData( - @SerializedName(value="status") + @SerializedName("status") val status: String? = null, - @SerializedName(value="inviter_id") + @SerializedName("inviter_id") val inviterId: Int? = null, - @SerializedName(value="request_date") + @SerializedName("request_date") val requestDate: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessagesArray.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessagesArray.kt index 6322bceff3..95f0b48fbf 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessagesArray.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessagesArray.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param count no description - * @param items no description + * @param count + * @param items */ data class MessagesMessagesArray( - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null, - @SerializedName(value="items") + @SerializedName("items") val items: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesOutReadBy.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesOutReadBy.kt index d59ba1698f..4464470b36 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesOutReadBy.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesOutReadBy.kt @@ -32,12 +32,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param count no description - * @param memberIds no description + * @param count + * @param memberIds */ data class MessagesOutReadBy( - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null, - @SerializedName(value="member_ids") + @SerializedName("member_ids") val memberIds: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPinnedMessage.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPinnedMessage.kt index 4f7aab87b7..348bda6089 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPinnedMessage.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPinnedMessage.kt @@ -34,39 +34,39 @@ import kotlin.String import kotlin.collections.List /** - * @param date Date when the message has been sent in Unixtime - * @param fromId Message author's ID - * @param id Message ID - * @param peerId Peer ID - * @param text Message text - * @param attachments no description - * @param conversationMessageId Unique auto-incremented number for all messages with this peer - * @param fwdMessages Forwarded messages - * @param geo no description - * @param replyMessage no description - * @param keyboard no description + * @param date - Date when the message has been sent in Unixtime + * @param fromId - Message author's ID + * @param id - Message ID + * @param peerId - Peer ID + * @param text - Message text + * @param attachments + * @param conversationMessageId - Unique auto-incremented number for all messages with this peer + * @param fwdMessages - Forwarded messages + * @param geo + * @param replyMessage + * @param keyboard */ data class MessagesPinnedMessage( - @SerializedName(value="date") + @SerializedName("date") val date: Int, - @SerializedName(value="from_id") + @SerializedName("from_id") val fromId: Int, - @SerializedName(value="id") + @SerializedName("id") val id: Int, - @SerializedName(value="peer_id") + @SerializedName("peer_id") val peerId: Int, - @SerializedName(value="text") + @SerializedName("text") val text: String, - @SerializedName(value="attachments") + @SerializedName("attachments") val attachments: List? = null, - @SerializedName(value="conversation_message_id") + @SerializedName("conversation_message_id") val conversationMessageId: Int? = null, - @SerializedName(value="fwd_messages") + @SerializedName("fwd_messages") val fwdMessages: List? = null, - @SerializedName(value="geo") + @SerializedName("geo") val geo: BaseGeo? = null, - @SerializedName(value="reply_message") + @SerializedName("reply_message") val replyMessage: MessagesForeignMessage? = null, - @SerializedName(value="keyboard") + @SerializedName("keyboard") val keyboard: MessagesKeyboard? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPushSettings.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPushSettings.kt index e6d0903d90..c5eba22676 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPushSettings.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPushSettings.kt @@ -32,22 +32,22 @@ import kotlin.Boolean import kotlin.Int /** - * @param disabledForever Information whether push notifications are disabled forever - * @param noSound Information whether the sound is on - * @param disabledUntil Time until what notifications are disabled - * @param disabledMentions Information whether the mentions are disabled - * @param disabledMassMentions Information whether the mass mentions (like '@all', '@online') are + * @param disabledForever - Information whether push notifications are disabled forever + * @param noSound - Information whether the sound is on + * @param disabledUntil - Time until what notifications are disabled + * @param disabledMentions - Information whether the mentions are disabled + * @param disabledMassMentions - Information whether the mass mentions (like '@all', '@online') are * disabled */ data class MessagesPushSettings( - @SerializedName(value="disabled_forever") + @SerializedName("disabled_forever") val disabledForever: Boolean, - @SerializedName(value="no_sound") + @SerializedName("no_sound") val noSound: Boolean, - @SerializedName(value="disabled_until") + @SerializedName("disabled_until") val disabledUntil: Int? = null, - @SerializedName(value="disabled_mentions") + @SerializedName("disabled_mentions") val disabledMentions: Boolean? = null, - @SerializedName(value="disabled_mass_mentions") + @SerializedName("disabled_mass_mentions") val disabledMassMentions: Boolean? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchConversationsExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchConversationsExtendedResponse.kt new file mode 100644 index 0000000000..a10cf43a8b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchConversationsExtendedResponse.kt @@ -0,0 +1,51 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total results number + * @param items + * @param profiles + * @param groups + */ +data class MessagesSearchConversationsExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchConversationsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchConversationsResponse.kt new file mode 100644 index 0000000000..26636a89ec --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchConversationsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total results number + * @param items + */ +data class MessagesSearchConversationsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchExtendedResponse.kt new file mode 100644 index 0000000000..0f748ffa38 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchExtendedResponse.kt @@ -0,0 +1,54 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + * @param profiles + * @param groups + * @param conversations + */ +data class MessagesSearchExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null, + @SerializedName("conversations") + val conversations: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchResponse.kt new file mode 100644 index 0000000000..58383e6bdd --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSearchResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class MessagesSearchResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSetChatPhotoResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSetChatPhotoResponse.kt new file mode 100644 index 0000000000..555b5942fc --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSetChatPhotoResponse.kt @@ -0,0 +1,42 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param messageId - Service message ID + * @param chat + */ +data class MessagesSetChatPhotoResponse( + @SerializedName("message_id") + val messageId: Int? = null, + @SerializedName("chat") + val chat: MessagesChat? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesTemplateActionTypeNames.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesTemplateActionTypeNames.kt index 73d66cfaed..0ff224eb46 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesTemplateActionTypeNames.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/MessagesTemplateActionTypeNames.kt @@ -27,57 +27,39 @@ // ********************************************************************* package com.vk.sdk.api.messages.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class MessagesTemplateActionTypeNames( val value: String ) { + @SerializedName("text") TEXT("text"), + @SerializedName("start") START("start"), + @SerializedName("location") LOCATION("location"), + @SerializedName("vkpay") VKPAY("vkpay"), + @SerializedName("open_app") OPEN_APP("open_app"), + @SerializedName("open_photo") OPEN_PHOTO("open_photo"), + @SerializedName("open_link") OPEN_LINK("open_link"), + @SerializedName("callback") CALLBACK("callback"), + @SerializedName("intent_subscribe") INTENT_SUBSCRIBE("intent_subscribe"), + @SerializedName("intent_unsubscribe") INTENT_UNSUBSCRIBE("intent_unsubscribe"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: MessagesTemplateActionTypeNames?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): MessagesTemplateActionTypeNames { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/RevParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/RevParam.kt new file mode 100644 index 0000000000..120626d011 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/RevParam.kt @@ -0,0 +1,41 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class RevParam( + val value: Int +) { + @SerializedName("1") + CHRONOLOGICAL(1), + + @SerializedName("0") + REVERSE_CHRONOLOGICAL(0); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/TypeParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/TypeParam.kt new file mode 100644 index 0000000000..27438ae499 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/messages/dto/TypeParam.kt @@ -0,0 +1,50 @@ +/** + * 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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class TypeParam( + val value: String +) { + @SerializedName("audiomessage") + AUDIOMESSAGE("audiomessage"), + + @SerializedName("file") + FILE("file"), + + @SerializedName("photo") + PHOTO("photo"), + + @SerializedName("typing") + TYPING("typing"), + + @SerializedName("video") + VIDEO("video"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/NewsfeedService.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/NewsfeedService.kt new file mode 100644 index 0000000000..d6484c1ec7 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/NewsfeedService.kt @@ -0,0 +1,561 @@ +/** + * 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.newsfeed + +import com.vk.api.sdk.requests.VKRequest +import com.vk.sdk.api.GsonHolder +import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.base.dto.BaseOkResponse +import com.vk.sdk.api.base.dto.BaseUserGroupFields +import com.vk.sdk.api.newsfeed.dto.NameCaseParam +import com.vk.sdk.api.newsfeed.dto.NewsfeedCommentsFilters +import com.vk.sdk.api.newsfeed.dto.NewsfeedFilters +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedExtendedResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetCommentsResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetListsExtendedResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetListsResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetMentionsResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetRecommendedResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetSuggestedSourcesResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedSearchExtendedResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedSearchResponse +import com.vk.sdk.api.newsfeed.dto.TypeParam +import com.vk.sdk.api.users.dto.UsersFields +import kotlin.Boolean +import kotlin.Float +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +class NewsfeedService { + /** + * Prevents news from specified users and communities from appearing in the current user's + * newsfeed. + * + * @param userIds + * @param groupIds + * @return [VKRequest] with [BaseOkResponse] + */ + fun newsfeedAddBan(userIds: List? = null, groupIds: List? = null): + VKRequest = NewApiRequest("newsfeed.addBan") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + userIds?.let { addParam("user_ids", it) } + groupIds?.let { addParam("group_ids", it) } + } + + /** + * Allows news from previously banned users and communities to be shown in the current user's + * newsfeed. + * + * @param userIds + * @param groupIds + * @return [VKRequest] with [BaseOkResponse] + */ + fun newsfeedDeleteBan(userIds: List? = null, groupIds: List? = null): + VKRequest = NewApiRequest("newsfeed.deleteBan") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + userIds?.let { addParam("user_ids", it) } + groupIds?.let { addParam("group_ids", it) } + } + + /** + * @param listId + * @return [VKRequest] with [BaseOkResponse] + */ + fun newsfeedDeleteList(listId: Int): VKRequest = + NewApiRequest("newsfeed.deleteList") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("list_id", listId) + } + + /** + * Returns data required to show newsfeed for the current user. + * + * @param filters - Filters to apply: 'post' - new wall posts, 'photo' - new photos, + * 'photo_tag' - new photo tags, 'wall_photo' - new wall photos, 'friend' - new friends + * @param returnBanned - '1' - to return news items from banned sources + * @param startTime - Earliest timestamp (in Unix time) of a news item to return. By default, 24 + * hours ago. + * @param endTime - Latest timestamp (in Unix time) of a news item to return. By default, the + * current time. + * @param maxPhotos - Maximum number of photos to return. By default, '5'. + * @param sourceIds - Sources to obtain news from, separated by commas. User IDs can be + * specified in formats '' or 'u' , where '' is the user's friend ID. Community IDs can be + * specified in formats '-' or 'g' , where '' is the community ID. If the parameter is not set, all + * of the user's friends and communities are returned, except for banned sources, which can be + * obtained with the [vk.com/dev/newsfeed.getBanned|newsfeed.getBanned] method. + * @param startFrom - identifier required to get the next page of results. Value for this + * parameter is returned in 'next_from' field in a reply. + * @param count - Number of news items to return (default 50, maximum 100). For auto feed, you + * can use the 'new_offset' parameter returned by this method. + * @param fields - Additional fields of [vk.com/dev/fields|profiles] and + * [vk.com/dev/fields_groups|communities] to return. + * @param section + * @return [VKRequest] with [NewsfeedGetResponse] + */ + fun newsfeedGet( + filters: List? = null, + returnBanned: Boolean? = null, + startTime: Int? = null, + endTime: Int? = null, + maxPhotos: Int? = null, + sourceIds: String? = null, + startFrom: String? = null, + count: Int? = null, + fields: List? = null, + section: String? = null + ): VKRequest = NewApiRequest("newsfeed.get") { + GsonHolder.gson.fromJson(it, NewsfeedGetResponse::class.java) + } + .apply { + val filtersJsonConverted = filters?.map { + it.value + } + filtersJsonConverted?.let { addParam("filters", it) } + returnBanned?.let { addParam("return_banned", it) } + startTime?.let { addParam("start_time", it) } + endTime?.let { addParam("end_time", it) } + maxPhotos?.let { addParam("max_photos", it) } + sourceIds?.let { addParam("source_ids", it) } + startFrom?.let { addParam("start_from", it) } + count?.let { addParam("count", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + section?.let { addParam("section", it) } + } + + /** + * Returns a list of users and communities banned from the current user's newsfeed. + * + * @param fields - Profile fields to return. + * @param nameCase - Case for declension of user name and surname: 'nom' - nominative (default), + * 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - + * prepositional + * @return [VKRequest] with [NewsfeedGetBannedResponse] + */ + fun newsfeedGetBanned(fields: List? = null, nameCase: NameCaseParam? = null): + VKRequest = NewApiRequest("newsfeed.getBanned") { + GsonHolder.gson.fromJson(it, NewsfeedGetBannedResponse::class.java) + } + .apply { + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + nameCase?.let { addParam("name_case", it.value) } + } + + /** + * Returns a list of users and communities banned from the current user's newsfeed. + * + * @param fields - Profile fields to return. + * @param nameCase - Case for declension of user name and surname: 'nom' - nominative (default), + * 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - + * prepositional + * @return [VKRequest] with [NewsfeedGetBannedExtendedResponse] + */ + fun newsfeedGetBannedExtended(fields: List? = null, nameCase: NameCaseParam? = + null): VKRequest = + NewApiRequest("newsfeed.getBanned") { + GsonHolder.gson.fromJson(it, NewsfeedGetBannedExtendedResponse::class.java) + } + .apply { + addParam("extended", true) + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + nameCase?.let { addParam("name_case", it.value) } + } + + /** + * Returns a list of comments in the current user's newsfeed. + * + * @param count - Number of comments to return. For auto feed, you can use the 'new_offset' + * parameter returned by this method. + * @param filters - Filters to apply: 'post' - new comments on wall posts, 'photo' - new + * comments on photos, 'video' - new comments on videos, 'topic' - new comments on discussions, + * 'note' - new comments on notes, + * @param reposts - Object ID, comments on repost of which shall be returned, e.g. + * 'wall1_45486'. (If the parameter is set, the 'filters' parameter is optional.), + * @param startTime - Earliest timestamp (in Unix time) of a comment to return. By default, 24 + * hours ago. + * @param endTime - Latest timestamp (in Unix time) of a comment to return. By default, the + * current time. + * @param lastCommentsCount + * @param startFrom - Identificator needed to return the next page with results. Value for this + * parameter returns in 'next_from' field. + * @param fields - Additional fields of [vk.com/dev/fields|profiles] and + * [vk.com/dev/fields_groups|communities] to return. + * @return [VKRequest] with [NewsfeedGetCommentsResponse] + */ + fun newsfeedGetComments( + count: Int? = null, + filters: List? = null, + reposts: String? = null, + startTime: Int? = null, + endTime: Int? = null, + lastCommentsCount: Int? = null, + startFrom: String? = null, + fields: List? = null + ): VKRequest = NewApiRequest("newsfeed.getComments") { + GsonHolder.gson.fromJson(it, NewsfeedGetCommentsResponse::class.java) + } + .apply { + count?.let { addParam("count", it) } + val filtersJsonConverted = filters?.map { + it.value + } + filtersJsonConverted?.let { addParam("filters", it) } + reposts?.let { addParam("reposts", it) } + startTime?.let { addParam("start_time", it) } + endTime?.let { addParam("end_time", it) } + lastCommentsCount?.let { addParam("last_comments_count", it) } + startFrom?.let { addParam("start_from", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns a list of newsfeeds followed by the current user. + * + * @param listIds - numeric list identifiers. + * @return [VKRequest] with [NewsfeedGetListsResponse] + */ + fun newsfeedGetLists(listIds: List? = null): VKRequest = + NewApiRequest("newsfeed.getLists") { + GsonHolder.gson.fromJson(it, NewsfeedGetListsResponse::class.java) + } + .apply { + listIds?.let { addParam("list_ids", it) } + } + + /** + * Returns a list of newsfeeds followed by the current user. + * + * @param listIds - numeric list identifiers. + * @return [VKRequest] with [NewsfeedGetListsExtendedResponse] + */ + fun newsfeedGetListsExtended(listIds: List? = null): + VKRequest = NewApiRequest("newsfeed.getLists") { + GsonHolder.gson.fromJson(it, NewsfeedGetListsExtendedResponse::class.java) + } + .apply { + listIds?.let { addParam("list_ids", it) } + addParam("extended", true) + } + + /** + * Returns a list of posts on user walls in which the current user is mentioned. + * + * @param ownerId - Owner ID. + * @param startTime - Earliest timestamp (in Unix time) of a post to return. By default, 24 + * hours ago. + * @param endTime - Latest timestamp (in Unix time) of a post to return. By default, the current + * time. + * @param offset - Offset needed to return a specific subset of posts. + * @param count - Number of posts to return. + * @return [VKRequest] with [NewsfeedGetMentionsResponse] + */ + fun newsfeedGetMentions( + ownerId: Int? = null, + startTime: Int? = null, + endTime: Int? = null, + offset: Int? = null, + count: Int? = null + ): VKRequest = NewApiRequest("newsfeed.getMentions") { + GsonHolder.gson.fromJson(it, NewsfeedGetMentionsResponse::class.java) + } + .apply { + ownerId?.let { addParam("owner_id", it) } + startTime?.let { addParam("start_time", it) } + endTime?.let { addParam("end_time", it) } + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + } + + /** + * , Returns a list of newsfeeds recommended to the current user. + * + * @param startTime - Earliest timestamp (in Unix time) of a news item to return. By default, 24 + * hours ago. + * @param endTime - Latest timestamp (in Unix time) of a news item to return. By default, the + * current time. + * @param maxPhotos - Maximum number of photos to return. By default, '5'. + * @param startFrom - 'new_from' value obtained in previous call. + * @param count - Number of news items to return. + * @param fields - Additional fields of [vk.com/dev/fields|profiles] and + * [vk.com/dev/fields_groups|communities] to return. + * @return [VKRequest] with [NewsfeedGetRecommendedResponse] + */ + fun newsfeedGetRecommended( + startTime: Int? = null, + endTime: Int? = null, + maxPhotos: Int? = null, + startFrom: String? = null, + count: Int? = null, + fields: List? = null + ): VKRequest = NewApiRequest("newsfeed.getRecommended") { + GsonHolder.gson.fromJson(it, NewsfeedGetRecommendedResponse::class.java) + } + .apply { + startTime?.let { addParam("start_time", it) } + endTime?.let { addParam("end_time", it) } + maxPhotos?.let { addParam("max_photos", it) } + startFrom?.let { addParam("start_from", it) } + count?.let { addParam("count", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns communities and users that current user is suggested to follow. + * + * @param offset - offset required to choose a particular subset of communities or users. + * @param count - amount of communities or users to return. + * @param shuffle - shuffle the returned list or not. + * @param fields - list of extra fields to be returned. See available fields for + * [vk.com/dev/fields|users] and [vk.com/dev/fields_groups|communities]. + * @return [VKRequest] with [NewsfeedGetSuggestedSourcesResponse] + */ + fun newsfeedGetSuggestedSources( + offset: Int? = null, + count: Int? = null, + shuffle: Boolean? = null, + fields: List? = null + ): VKRequest = + NewApiRequest("newsfeed.getSuggestedSources") { + GsonHolder.gson.fromJson(it, NewsfeedGetSuggestedSourcesResponse::class.java) + } + .apply { + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it) } + shuffle?.let { addParam("shuffle", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Hides an item from the newsfeed. + * + * @param type - Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a + * photo,, *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. + * @param ownerId - Item owner's identifier (user or community), "Note that community id must be + * negative. 'owner_id=1' - user , 'owner_id=-1' - community " + * @param itemId - Item identifier + * @return [VKRequest] with [BaseOkResponse] + */ + fun newsfeedIgnoreItem( + type: String, + ownerId: Int? = null, + itemId: Int? = null + ): VKRequest = NewApiRequest("newsfeed.ignoreItem") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("type", type) + ownerId?.let { addParam("owner_id", it) } + itemId?.let { addParam("item_id", it) } + } + + /** + * Creates and edits user newsfeed lists + * + * @param title - list name. + * @param listId - numeric list identifier (if not sent, will be set automatically). + * @param sourceIds - users and communities identifiers to be added to the list. Community + * identifiers must be negative numbers. + * @param noReposts - reposts display on and off ('1' is for off). + * @return [VKRequest] with [Int] + */ + fun newsfeedSaveList( + title: String, + listId: Int? = null, + sourceIds: List? = null, + noReposts: Boolean? = null + ): VKRequest = NewApiRequest("newsfeed.saveList") { + GsonHolder.gson.fromJson(it, Int::class.java) + } + .apply { + addParam("title", title) + listId?.let { addParam("list_id", it) } + sourceIds?.let { addParam("source_ids", it) } + noReposts?.let { addParam("no_reposts", it) } + } + + /** + * Returns search results by statuses. + * + * @param q - Search query string (e.g., 'New Year'). + * @param count - Number of posts to return. + * @param latitude - Geographical latitude point (in degrees, -90 to 90) within which to search. + * @param longitude - Geographical longitude point (in degrees, -180 to 180) within which to + * search. + * @param startTime - Earliest timestamp (in Unix time) of a news item to return. By default, 24 + * hours ago. + * @param endTime - Latest timestamp (in Unix time) of a news item to return. By default, the + * current time. + * @param startFrom + * @param fields - Additional fields of [vk.com/dev/fields|profiles] and + * [vk.com/dev/fields_groups|communities] to return. + * @return [VKRequest] with [NewsfeedSearchResponse] + */ + fun newsfeedSearch( + q: String? = null, + count: Int? = null, + latitude: Float? = null, + longitude: Float? = null, + startTime: Int? = null, + endTime: Int? = null, + startFrom: String? = null, + fields: List? = null + ): VKRequest = NewApiRequest("newsfeed.search") { + GsonHolder.gson.fromJson(it, NewsfeedSearchResponse::class.java) + } + .apply { + q?.let { addParam("q", it) } + count?.let { addParam("count", it) } + latitude?.let { addParam("latitude", it) } + longitude?.let { addParam("longitude", it) } + startTime?.let { addParam("start_time", it) } + endTime?.let { addParam("end_time", it) } + startFrom?.let { addParam("start_from", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns search results by statuses. + * + * @param q - Search query string (e.g., 'New Year'). + * @param count - Number of posts to return. + * @param latitude - Geographical latitude point (in degrees, -90 to 90) within which to search. + * @param longitude - Geographical longitude point (in degrees, -180 to 180) within which to + * search. + * @param startTime - Earliest timestamp (in Unix time) of a news item to return. By default, 24 + * hours ago. + * @param endTime - Latest timestamp (in Unix time) of a news item to return. By default, the + * current time. + * @param startFrom + * @param fields - Additional fields of [vk.com/dev/fields|profiles] and + * [vk.com/dev/fields_groups|communities] to return. + * @return [VKRequest] with [NewsfeedSearchExtendedResponse] + */ + fun newsfeedSearchExtended( + q: String? = null, + count: Int? = null, + latitude: Float? = null, + longitude: Float? = null, + startTime: Int? = null, + endTime: Int? = null, + startFrom: String? = null, + fields: List? = null + ): VKRequest = NewApiRequest("newsfeed.search") { + GsonHolder.gson.fromJson(it, NewsfeedSearchExtendedResponse::class.java) + } + .apply { + q?.let { addParam("q", it) } + addParam("extended", true) + count?.let { addParam("count", it) } + latitude?.let { addParam("latitude", it) } + longitude?.let { addParam("longitude", it) } + startTime?.let { addParam("start_time", it) } + endTime?.let { addParam("end_time", it) } + startFrom?.let { addParam("start_from", it) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * Returns a hidden item to the newsfeed. + * + * @param type - Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a + * photo,, *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. + * @param ownerId - Item owner's identifier (user or community), "Note that community id must be + * negative. 'owner_id=1' - user , 'owner_id=-1' - community " + * @param itemId - Item identifier + * @param trackCode - Track code of unignored item + * @return [VKRequest] with [BaseOkResponse] + */ + fun newsfeedUnignoreItem( + type: String, + ownerId: Int, + itemId: Int, + trackCode: String? = null + ): VKRequest = NewApiRequest("newsfeed.unignoreItem") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("type", type) + addParam("owner_id", ownerId) + addParam("item_id", itemId) + trackCode?.let { addParam("track_code", it) } + } + + /** + * Unsubscribes the current user from specified newsfeeds. + * + * @param type - Type of object from which to unsubscribe: 'note' - note, 'photo' - photo, + * 'post' - post on user wall or community wall, 'topic' - topic, 'video' - video + * @param itemId - Object ID. + * @param ownerId - Object owner ID. + * @return [VKRequest] with [BaseOkResponse] + */ + fun newsfeedUnsubscribe( + type: TypeParam, + itemId: Int, + ownerId: Int? = null + ): VKRequest = NewApiRequest("newsfeed.unsubscribe") { + GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + } + .apply { + addParam("type", type.value) + addParam("item_id", itemId) + ownerId?.let { addParam("owner_id", it) } + } +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NameCaseParam.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NameCaseParam.kt new file mode 100644 index 0000000000..730497c499 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NameCaseParam.kt @@ -0,0 +1,53 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class NameCaseParam( + val value: String +) { + @SerializedName("nom") + NOMINATIVE("nom"), + + @SerializedName("gen") + GENITIVE("gen"), + + @SerializedName("dat") + DATIVE("dat"), + + @SerializedName("acc") + ACCUSATIVE("acc"), + + @SerializedName("ins") + INSTRUMENTAL("ins"), + + @SerializedName("abl") + PREPOSITIONAL("abl"); +} diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedCommentsFilters.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedCommentsFilters.kt index 5c0e0fc55d..51a9c1474b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedCommentsFilters.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedCommentsFilters.kt @@ -27,47 +27,24 @@ // ********************************************************************* package com.vk.sdk.api.newsfeed.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class NewsfeedCommentsFilters( val value: String ) { + @SerializedName("post") POST("post"), + @SerializedName("photo") PHOTO("photo"), + @SerializedName("video") VIDEO("video"), + @SerializedName("topic") TOPIC("topic"), + @SerializedName("note") NOTE("note"); - - class Serializer : JsonSerializer, - JsonDeserializer { - override fun serialize( - src: NewsfeedCommentsFilters?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): NewsfeedCommentsFilters { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedEventActivity.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedEventActivity.kt index b655a09b96..911fcd9843 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedEventActivity.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedEventActivity.kt @@ -34,24 +34,24 @@ import kotlin.String import kotlin.collections.List /** - * @param buttonText text of attach - * @param friends array of friends ids - * @param memberStatus Current user's member status - * @param text text of attach - * @param address address of event - * @param time event start time + * @param buttonText - text of attach + * @param friends - array of friends ids + * @param memberStatus - Current user's member status + * @param text - text of attach + * @param address - address of event + * @param time - event start time */ data class NewsfeedEventActivity( - @SerializedName(value="button_text") + @SerializedName("button_text") val buttonText: String, - @SerializedName(value="friends") + @SerializedName("friends") val friends: List, - @SerializedName(value="member_status") + @SerializedName("member_status") val memberStatus: GroupsGroupFullMemberStatus, - @SerializedName(value="text") + @SerializedName("text") val text: String, - @SerializedName(value="address") + @SerializedName("address") val address: String? = null, - @SerializedName(value="time") + @SerializedName("time") val time: Int? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedExpertCardWidget.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedExpertCardWidget.kt new file mode 100644 index 0000000000..660e236222 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedExpertCardWidget.kt @@ -0,0 +1,49 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseLinkButtonAction +import kotlin.String + +/** + * @param rating + * @param title + * @param subtitle + * @param action + */ +data class NewsfeedExpertCardWidget( + @SerializedName("rating") + val rating: NewsfeedExpertCardWidgetRating? = null, + @SerializedName("title") + val title: String? = null, + @SerializedName("subtitle") + val subtitle: String? = null, + @SerializedName("action") + val action: BaseLinkButtonAction? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedExpertCardWidgetRating.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedExpertCardWidgetRating.kt new file mode 100644 index 0000000000..53944e4bed --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedExpertCardWidgetRating.kt @@ -0,0 +1,43 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Boolean +import kotlin.Float + +/** + * @param value + * @param highlighted + */ +data class NewsfeedExpertCardWidgetRating( + @SerializedName("value") + val value: Float? = null, + @SerializedName("highlighted") + val highlighted: Boolean? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedFilters.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedFilters.kt index 73f466fef5..306697a22c 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedFilters.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedFilters.kt @@ -27,62 +27,48 @@ // ********************************************************************* package com.vk.sdk.api.newsfeed.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer -import java.lang.reflect.Type +import com.google.gson.annotations.SerializedName import kotlin.String enum class NewsfeedFilters( val value: String ) { + @SerializedName("post") POST("post"), + @SerializedName("photo") PHOTO("photo"), + @SerializedName("photo_tag") PHOTO_TAG("photo_tag"), + @SerializedName("wall_photo") WALL_PHOTO("wall_photo"), + @SerializedName("friend") FRIEND("friend"), + @SerializedName("recommended_groups") RECOMMENDED_GROUPS("recommended_groups"), + @SerializedName("note") NOTE("note"), + @SerializedName("audio") AUDIO("audio"), + @SerializedName("video") VIDEO("video"), + @SerializedName("audio_playlist") AUDIO_PLAYLIST("audio_playlist"), + @SerializedName("games_carousel") GAMES_CAROUSEL("games_carousel"), + @SerializedName("clip") CLIP("clip"), + @SerializedName("recommended_game") RECOMMENDED_GAME("recommended_game"); - - class Serializer : JsonSerializer, JsonDeserializer { - override fun serialize( - src: NewsfeedFilters?, - typeOfSrc: Type?, - context: JsonSerializationContext? - ): JsonElement = src?.let { JsonPrimitive(src.value) } ?: JsonNull.INSTANCE - - override fun deserialize( - json: JsonElement?, - typeOfT: Type?, - context: JsonDeserializationContext? - ): NewsfeedFilters { - val value = values().firstOrNull { - it.value.toString() == json?.asJsonPrimitive?.asString - } - return value ?: throw JsonParseException(json.toString()) - } - } } diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedExtendedResponse.kt new file mode 100644 index 0000000000..013fa69314 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedExtendedResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.collections.List + +/** + * @param groups + * @param profiles + */ +data class NewsfeedGetBannedExtendedResponse( + @SerializedName("groups") + val groups: List? = null, + @SerializedName("profiles") + val profiles: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedResponse.kt new file mode 100644 index 0000000000..20424f7b0f --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param groups + * @param members + */ +data class NewsfeedGetBannedResponse( + @SerializedName("groups") + val groups: List? = null, + @SerializedName("members") + val members: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetCommentsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetCommentsResponse.kt new file mode 100644 index 0000000000..d4bbcf7191 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetCommentsResponse.kt @@ -0,0 +1,51 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.String +import kotlin.collections.List + +/** + * @param items + * @param profiles + * @param groups + * @param nextFrom - Next from value + */ +data class NewsfeedGetCommentsResponse( + @SerializedName("items") + val items: List, + @SerializedName("profiles") + val profiles: List, + @SerializedName("groups") + val groups: List, + @SerializedName("next_from") + val nextFrom: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetListsExtendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetListsExtendedResponse.kt new file mode 100644 index 0000000000..6dee69117b --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetListsExtendedResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class NewsfeedGetListsExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetListsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetListsResponse.kt new file mode 100644 index 0000000000..9bbd78b815 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetListsResponse.kt @@ -0,0 +1,43 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class NewsfeedGetListsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetMentionsResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetMentionsResponse.kt new file mode 100644 index 0000000000..a34a155216 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetMentionsResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.wall.dto.WallWallpostToId +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class NewsfeedGetMentionsResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetRecommendedResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetRecommendedResponse.kt new file mode 100644 index 0000000000..9e4897cb9c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetRecommendedResponse.kt @@ -0,0 +1,51 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.String +import kotlin.collections.List + +/** + * @param items + * @param profiles + * @param groups + * @param nextFrom - Next from value + */ +data class NewsfeedGetRecommendedResponse( + @SerializedName("items") + val items: List? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null, + @SerializedName("next_from") + val nextFrom: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetResponse.kt new file mode 100644 index 0000000000..0207966c58 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetResponse.kt @@ -0,0 +1,51 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull +import kotlin.String +import kotlin.collections.List + +/** + * @param items + * @param profiles + * @param groups + * @param nextFrom - New from value + */ +data class NewsfeedGetResponse( + @SerializedName("items") + val items: List? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null, + @SerializedName("next_from") + val nextFrom: String? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetSuggestedSourcesResponse.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetSuggestedSourcesResponse.kt new file mode 100644 index 0000000000..459de9cc4c --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetSuggestedSourcesResponse.kt @@ -0,0 +1,44 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.users.dto.UsersSubscriptionsItem +import kotlin.Int +import kotlin.collections.List + +/** + * @param count - Total number + * @param items + */ +data class NewsfeedGetSuggestedSourcesResponse( + @SerializedName("count") + val count: Int? = null, + @SerializedName("items") + val items: List? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemAnimatedBlockAnimation.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemAnimatedBlockAnimation.kt new file mode 100644 index 0000000000..29c3080ea5 --- /dev/null +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemAnimatedBlockAnimation.kt @@ -0,0 +1,50 @@ +/** + * 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.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Float +import kotlin.Int +import kotlin.String + +/** + * @param url + * @param width + * @param height + * @param playCount - 0 = infinity + */ +data class NewsfeedItemAnimatedBlockAnimation( + @SerializedName("url") + val url: String? = null, + @SerializedName("width") + val width: Float? = null, + @SerializedName("height") + val height: Float? = null, + @SerializedName("play_count") + val playCount: Int? = null +) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemAudioAudio.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemAudioAudio.kt index 7a1e76bcb7..4407db572b 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemAudioAudio.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemAudioAudio.kt @@ -33,12 +33,12 @@ import kotlin.Int import kotlin.collections.List /** - * @param count Audios number - * @param items no description + * @param count - Audios number + * @param items */ data class NewsfeedItemAudioAudio( - @SerializedName(value="count") + @SerializedName("count") val count: Int? = null, - @SerializedName(value="items") + @SerializedName("items") val items: List? = null ) diff --git a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemDigestButton.kt b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemDigestButton.kt index c548ab467a..ef56a45c6f 100644 --- a/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemDigestButton.kt +++ b/vk-sdk-api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemDigestButton.kt @@ -27,50 +27,23 @@ // ********************************************************************* package com.vk.sdk.api.newsfeed.dto -import com.google.gson.JsonDeserializationContext -import com.google.gson.JsonDeserializer -import com.google.gson.JsonElement -import com.google.gson.JsonNull -import com.google.gson.JsonParseException -import com.google.gson.JsonPrimitive -import com.google.gson.JsonSerializationContext -import com.google.gson.JsonSerializer import com.google.gson.annotations.SerializedName -import java.lang.reflect.Type import kotlin.String /** - * @param title no description - * @param style no description + * @param title + * @param style */ data class NewsfeedItemDigestButton( - @SerializedName(value="title") + @SerializedName("title") val title: String, - @SerializedName(value="style") - val style: Style? = null + @SerializedName("style") + val style: NewsfeedItemDigestButton.Style? = null ) { enum class Style( val value: String ) { + @SerializedName("primary") PRIMARY("primary"); - - class Serializer : JsonSerializer