From 6c7ed502aa971c7556c94e9e2483b53202cd603b Mon Sep 17 00:00:00 2001 From: "a.mochalov" Date: Fri, 4 Feb 2022 18:43:05 +0300 Subject: [PATCH] version 3.5.0 --- README.md | 34 +- api/build.gradle | 15 +- api/consumer-proguard-rules.pro | 18 + .../main/java/com/vk/sdk/api/GsonHolder.kt | 38 +- .../main/java/com/vk/sdk/api/NewApiRequest.kt | 86 +++ .../com/vk/sdk/api/account/AccountService.kt | 48 +- .../account/dto/AccountGetBannedResponse.kt | 3 +- .../dto/AccountSaveProfileInfoResponse.kt | 2 +- .../sdk/api/account/dto/AccountSetInfoName.kt | 122 +++ .../api/account/dto/AccountUserSettings.kt | 18 +- .../java/com/vk/sdk/api/ads/AdsService.kt | 52 +- .../vk/sdk/api/ads/dto/AdsAccessRolePublic.kt | 41 + .../com/vk/sdk/api/ads/dto/AdsAdLayout.kt | 2 +- .../com/vk/sdk/api/ads/dto/AdsCategory.kt | 3 +- .../vk/sdk/api/ads/dto/AdsCreateAdStatus.kt | 49 ++ .../api/ads/dto/AdsCreateCampaignStatus.kt | 46 ++ .../sdk/api/ads/dto/AdsUserSpecification.kt | 54 ++ .../api/ads/dto/AdsUserSpecificationCutted.kt | 50 ++ .../aliexpress/dto/AliexpressCarouselItem.kt | 14 +- .../api/aliexpress/dto/AliexpressPromoCard.kt | 54 ++ .../aliexpress/dto/AliexpressSocialFooter.kt | 58 ++ .../sdk/api/appWidgets/AppWidgetsService.kt | 10 +- .../java/com/vk/sdk/api/apps/AppsService.kt | 59 +- .../java/com/vk/sdk/api/apps/dto/AppsApp.kt | 18 +- .../dto/AppsGetFriendsListExtendedResponse.kt | 44 ++ .../dto/AppsGetFriendsListExtendedType.kt | 41 + .../apps/dto/AppsGetFriendsListResponse.kt | 6 +- .../dto/AppsGetLeaderboardExtendedResponse.kt | 4 +- .../com/vk/sdk/api/audio/dto/AudioArtist.kt | 7 +- .../vk/sdk/api/base/dto/BaseCommentsInfo.kt | 6 + .../java/com/vk/sdk/api/base/dto/BaseError.kt | 2 +- .../java/com/vk/sdk/api/base/dto/BaseImage.kt | 6 +- .../api/base/dto/BaseLinkButtonActionType.kt | 41 +- .../com/vk/sdk/api/base/dto/BaseLinkChat.kt | 66 ++ .../java/com/vk/sdk/api/board/BoardService.kt | 82 +- .../vk/sdk/api/calls/dto/CallsParticipants.kt | 3 +- .../dto/ClassifiedsWorkiCarouselItem.kt | 59 ++ .../dto/ClassifiedsYoulaCarouselBlockGroup.kt | 6 +- .../dto/ClassifiedsYoulaGroupsBlock.kt | 39 + .../dto/ClassifiedsYoulaGroupsBlockItem.kt | 76 ++ .../dto/ClassifiedsYoulaGroupsBlockProduct.kt | 43 ++ .../dto/ClassifiedsYoulaItemActionButton.kt | 85 +++ .../ClassifiedsYoulaItemActionProperties.kt | 60 ++ .../dto/ClassifiedsYoulaItemAttribute.kt | 48 ++ .../dto/ClassifiedsYoulaItemExtended.kt | 107 ++- .../dto/ClassifiedsYoulaItemStatusInfo.kt | 42 ++ .../dto/ClassifiedsYoulaItemVkAuthor.kt | 11 +- .../vk/sdk/api/comment/dto/CommentThread.kt | 14 +- .../vk/sdk/api/database/DatabaseService.kt | 60 +- .../vk/sdk/api/database/dto/DatabaseCity.kt | 14 +- .../sdk/api/database/dto/DatabaseCityById.kt | 43 ++ .../database/dto/DatabaseGetChairsResponse.kt | 4 +- .../database/dto/DatabaseGetCitiesResponse.kt | 4 +- .../dto/DatabaseGetCountriesResponse.kt | 4 +- .../dto/DatabaseGetFacultiesResponse.kt | 4 +- .../dto/DatabaseGetMetroStationsResponse.kt | 4 +- .../dto/DatabaseGetRegionsResponse.kt | 4 +- .../dto/DatabaseGetSchoolsResponse.kt | 4 +- .../dto/DatabaseGetUniversitiesResponse.kt | 4 +- .../java/com/vk/sdk/api/docs/DocsService.kt | 24 +- .../java/com/vk/sdk/api/donut/DonutService.kt | 8 +- .../downloadedGames/DownloadedGamesService.kt | 2 +- .../java/com/vk/sdk/api/fave/FaveService.kt | 32 +- .../com/vk/sdk/api/friends/FriendsService.kt | 94 +-- .../dto/FriendsFriendExtendedStatus.kt | 14 +- .../friends/dto/FriendsGetRequestsResponse.kt | 3 +- .../api/friends/dto/FriendsUserXtrPhone.kt | 6 +- .../java/com/vk/sdk/api/gifts/GiftsService.kt | 6 +- .../com/vk/sdk/api/groups/GroupsService.kt | 282 +++---- .../com/vk/sdk/api/groups/dto/GroupsFields.kt | 11 +- .../sdk/api/groups/dto/GroupsGetResponse.kt | 3 +- .../groups/dto/GroupsGetSettingsResponse.kt | 6 + .../com/vk/sdk/api/groups/dto/GroupsGroup.kt | 6 +- .../vk/sdk/api/groups/dto/GroupsGroupFull.kt | 9 +- .../api/groups/dto/GroupsGroupFullSection.kt | 110 ++- .../sdk/api/groups/dto/GroupsGroupsArray.kt | 3 +- .../sdk/api/groups/dto/GroupsUserXtrRole.kt | 6 +- .../vk/sdk/api/leadForms/LeadFormsService.kt | 69 +- .../sdk/api/leadForms/dto/LeadFormsAnswer.kt | 42 ++ .../api/leadForms/dto/LeadFormsAnswerItem.kt | 42 ++ .../leadForms/dto/LeadFormsCreateResponse.kt | 43 ++ .../leadForms/dto/LeadFormsDeleteResponse.kt | 39 + .../vk/sdk/api/leadForms/dto/LeadFormsForm.kt | 91 +++ .../dto/LeadFormsGetLeadsResponse.kt | 43 ++ .../vk/sdk/api/leadForms/dto/LeadFormsLead.kt | 53 ++ .../leadForms/dto/LeadFormsQuestionItem.kt | 68 ++ .../dto/LeadFormsQuestionItemOption.kt | 42 ++ .../java/com/vk/sdk/api/likes/LikesService.kt | 16 +- .../sdk/api/likes/dto/LikesGetListResponse.kt | 3 +- .../com/vk/sdk/api/market/MarketService.kt | 244 +++--- .../api/market/dto/MarketAddAlbumResponse.kt | 5 +- .../api/market/dto/MarketMarketCategory.kt | 6 +- .../api/market/dto/MarketMarketItemFull.kt | 45 +- .../api/market/dto/MarketSearchItemsSortBy.kt | 44 ++ .../dto/MarketSearchItemsSortDirection.kt | 41 + .../api/market/dto/MarketSearchResponse.kt | 6 +- .../vk/sdk/api/messages/MessagesService.kt | 266 ++++--- .../vk/sdk/api/messages/dto/MessagesChat.kt | 13 +- .../api/messages/dto/MessagesChatPreview.kt | 20 +- .../api/messages/dto/MessagesChatSettings.kt | 4 +- .../messages/dto/MessagesChatSettingsPhoto.kt | 5 +- .../messages/dto/MessagesChatSuggestion.kt | 44 ++ .../api/messages/dto/MessagesConversation.kt | 5 +- .../dto/MessagesConversationMember.kt | 5 +- .../messages/dto/MessagesForeignMessage.kt | 3 +- ...ByConversationMessageIdExtendedResponse.kt | 51 ++ .../dto/MessagesGetChatPreviewResponse.kt | 6 +- .../MessagesGetConversationByIdExtended.kt | 51 ++ .../dto/MessagesGetConversationMembers.kt | 54 ++ .../dto/MessagesGetConversationsFilter.kt | 3 + .../MessagesGetHistoryAttachmentsResponse.kt | 10 +- ...gesGetImportantMessagesExtendedResponse.kt | 8 +- .../MessagesGetImportantMessagesResponse.kt | 4 +- .../dto/MessagesGetIntentUsersResponse.kt | 2 +- .../dto/MessagesGetLongPollHistoryResponse.kt | 4 +- .../sdk/api/messages/dto/MessagesGraffiti.kt | 6 +- .../messages/dto/MessagesHistoryAttachment.kt | 9 +- .../dto/MessagesHistoryMessageAttachment.kt | 9 +- .../sdk/api/messages/dto/MessagesKeyboard.kt | 10 +- .../messages/dto/MessagesKeyboardButton.kt | 2 +- .../MessagesKeyboardButtonPropertyAction.kt | 52 ++ .../sdk/api/messages/dto/MessagesMessage.kt | 10 +- .../api/messages/dto/MessagesMessageAction.kt | 59 ++ .../dto/MessagesMessageActionPhoto.kt | 45 ++ .../dto/MessagesMessageActionStatus.kt | 38 + .../messages/dto/MessagesMessageAttachment.kt | 12 +- .../dto/MessagesMessageAttachmentType.kt | 4 +- .../dto/MessagesMessageRequestData.kt | 3 +- .../sdk/api/messages/dto/MessagesOutReadBy.kt | 3 +- .../api/messages/dto/MessagesPinnedMessage.kt | 9 +- .../vk/sdk/api/newsfeed/NewsfeedService.kt | 64 +- .../newsfeed/dto/NewsfeedItemDigestItem.kt | 8 +- .../sdk/api/newsfeed/dto/NewsfeedListFull.kt | 15 +- .../api/newsfeed/dto/NewsfeedNewsfeedItem.kt | 702 ++++++++++++------ .../newsfeed/dto/NewsfeedNewsfeedItemType.kt | 32 +- .../api/newsfeed/dto/NewsfeedNewsfeedPhoto.kt | 32 +- .../java/com/vk/sdk/api/notes/NotesService.kt | 42 +- .../com/vk/sdk/api/notes/dto/NotesNote.kt | 9 +- .../api/notifications/NotificationsService.kt | 8 +- .../dto/NotificationsNotification.kt | 52 ++ .../dto/NotificationsNotificationItem.kt | 2 +- .../com/vk/sdk/api/orders/OrdersService.kt | 28 +- .../com/vk/sdk/api/orders/dto/OrdersOrder.kt | 54 +- .../java/com/vk/sdk/api/pages/PagesService.kt | 2 +- .../com/vk/sdk/api/photos/PhotosService.kt | 140 ++-- .../dto/PhotosGetAllCommentsResponse.kt | 3 +- .../api/photos/dto/PhotosPhotoAlbumFull.kt | 4 + .../dto/PhotosSaveOwnerCoverPhotoResponse.kt | 40 + .../vk/sdk/api/podcasts/PodcastsService.kt | 4 +- .../java/com/vk/sdk/api/polls/PollsService.kt | 26 +- .../vk/sdk/api/polls/dto/PollsVotersUsers.kt | 3 +- .../sdk/api/prettyCards/PrettyCardsService.kt | 30 +- .../prettyCards/dto/PrettyCardsPrettyCard.kt | 3 +- .../dto/PrettyCardsPrettyCardOrError.kt | 54 ++ .../com/vk/sdk/api/search/SearchService.kt | 6 +- .../com/vk/sdk/api/secure/SecureService.kt | 55 +- .../java/com/vk/sdk/api/stats/StatsService.kt | 10 +- .../com/vk/sdk/api/stats/dto/StatsCity.kt | 46 ++ .../com/vk/sdk/api/stats/dto/StatsCountry.kt | 49 ++ .../com/vk/sdk/api/stats/dto/StatsPeriod.kt | 10 +- .../com/vk/sdk/api/stats/dto/StatsReach.kt | 62 ++ .../com/vk/sdk/api/stats/dto/StatsViews.kt | 62 ++ .../com/vk/sdk/api/status/StatusService.kt | 4 +- .../com/vk/sdk/api/storage/StorageService.kt | 14 +- .../com/vk/sdk/api/store/dto/StoreProduct.kt | 5 +- .../com/vk/sdk/api/stories/StoriesService.kt | 68 +- .../api/stories/dto/StoriesClickableArea.kt | 4 +- .../stories/dto/StoriesGetBannedResponse.kt | 3 +- .../StoriesGetViewersExtendedV5115Response.kt | 5 +- .../vk/sdk/api/stories/dto/StoriesStory.kt | 3 - .../sdk/api/stories/dto/StoriesStoryLink.kt | 5 +- .../vk/sdk/api/streaming/StreamingService.kt | 4 +- .../java/com/vk/sdk/api/users/UsersService.kt | 70 +- .../com/vk/sdk/api/users/dto/UsersFields.kt | 24 + .../com/vk/sdk/api/users/dto/UsersRelative.kt | 4 +- .../sdk/api/users/dto/UsersSearchResponse.kt | 4 +- .../api/users/dto/UsersSubscriptionsItem.kt | 15 +- .../com/vk/sdk/api/users/dto/UsersUser.kt | 6 +- .../vk/sdk/api/users/dto/UsersUserCounters.kt | 3 + .../com/vk/sdk/api/users/dto/UsersUserFull.kt | 6 +- .../com/vk/sdk/api/users/dto/UsersUserMin.kt | 12 +- .../com/vk/sdk/api/users/dto/UsersUserType.kt | 5 +- .../vk/sdk/api/users/dto/UsersUsersArray.kt | 3 +- .../java/com/vk/sdk/api/utils/UtilsService.kt | 8 +- .../java/com/vk/sdk/api/video/VideoService.kt | 124 ++-- .../dto/VideoGetCommentsExtendedResponse.kt | 4 +- .../vk/sdk/api/video/dto/VideoGetResponse.kt | 4 +- .../com/vk/sdk/api/video/dto/VideoLiveInfo.kt | 2 +- .../sdk/api/video/dto/VideoVideoAlbumFull.kt | 26 +- .../vk/sdk/api/video/dto/VideoVideoFull.kt | 3 + .../vk/sdk/api/video/dto/VideoVideoImage.kt | 20 +- .../java/com/vk/sdk/api/wall/WallService.kt | 104 +-- .../java/com/vk/sdk/api/wall/dto/WallGeo.kt | 14 +- .../dto/WallGetCommentsExtendedResponse.kt | 14 +- .../api/wall/dto/WallGetCommentsResponse.kt | 11 +- .../com/vk/sdk/api/wall/dto/WallGraffiti.kt | 14 +- .../vk/sdk/api/wall/dto/WallPostCopyright.kt | 4 +- .../com/vk/sdk/api/wall/dto/WallPostSource.kt | 6 +- .../com/vk/sdk/api/wall/dto/WallPostType.kt | 11 +- .../vk/sdk/api/wall/dto/WallWallComment.kt | 51 +- .../api/wall/dto/WallWallpostAttachment.kt | 11 +- .../wall/dto/WallWallpostAttachmentType.kt | 36 +- .../vk/sdk/api/wall/dto/WallWallpostFull.kt | 12 +- .../vk/sdk/api/wall/dto/WallWallpostToId.kt | 9 +- .../com/vk/sdk/api/widgets/WidgetsService.kt | 8 +- build.gradle | 7 +- core/build.gradle | 29 + core/gradle.properties | 25 - core/src/main/AndroidManifest.xml | 27 + core/src/main/java/com/vk/api/sdk/VK.kt | 64 +- .../java/com/vk/api/sdk/VKApiCallListener.kt | 27 + .../main/java/com/vk/api/sdk/VKApiCallback.kt | 27 + .../main/java/com/vk/api/sdk/VKApiConfig.kt | 39 +- .../java/com/vk/api/sdk/VKApiCredentials.kt | 27 + .../sdk/VKApiIllegalCredentialsListener.kt | 27 + .../main/java/com/vk/api/sdk/VKApiManager.kt | 32 +- .../com/vk/api/sdk/VKApiProgressListener.kt | 27 + .../com/vk/api/sdk/VKApiResponseParser.java | 27 + .../com/vk/api/sdk/VKApiResponseValidator.kt | 27 + .../com/vk/api/sdk/VKApiValidationHandler.kt | 27 + .../vk/api/sdk/VKDefaultValidationHandler.kt | 27 + .../java/com/vk/api/sdk/VKHttpPostCall.kt | 27 + .../java/com/vk/api/sdk/VKKeyValueStorage.kt | 27 + .../main/java/com/vk/api/sdk/VKMethodCall.kt | 27 + .../java/com/vk/api/sdk/VKOkHttpProvider.kt | 27 + .../api/sdk/VKPreferencesKeyValueStorage.kt | 27 + .../main/java/com/vk/api/sdk/VKScheduler.kt | 27 + .../com/vk/api/sdk/VKTokenExpiredHandler.kt | 27 + core/src/main/java/com/vk/api/sdk/VkResult.kt | 27 + .../java/com/vk/api/sdk/auth/VKAccessToken.kt | 35 +- .../vk/api/sdk/auth/VKAccessTokenProvider.kt | 8 + .../com/vk/api/sdk/auth/VKAuthCallback.kt | 27 + .../java/com/vk/api/sdk/auth/VKAuthManager.kt | 81 +- .../java/com/vk/api/sdk/auth/VKAuthParams.kt | 27 + .../java/com/vk/api/sdk/auth/VKAuthResult.kt | 31 + .../vk/api/sdk/auth/VKAuthResultContract.kt | 68 ++ .../vk/api/sdk/auth/VKAuthenticationResult.kt | 47 ++ .../main/java/com/vk/api/sdk/auth/VKScope.kt | 27 + .../vk/api/sdk/browser/BrowserDescriptor.java | 27 + .../vk/api/sdk/browser/BrowserMatcher.java | 27 + .../vk/api/sdk/browser/BrowserSelector.java | 27 + .../java/com/vk/api/sdk/browser/Browsers.java | 27 + .../vk/api/sdk/browser/DelimitedVersion.java | 27 + .../com/vk/api/sdk/browser/VersionRange.java | 27 + .../sdk/browser/VersionedBrowserMatcher.java | 27 + .../sdk/browser/WhiteListedBrowserHelper.java | 27 + .../sdk/chain/ApiMethodPriorityChainCall.kt | 27 + .../java/com/vk/api/sdk/chain/ChainArgs.kt | 27 + .../java/com/vk/api/sdk/chain/ChainCall.kt | 27 + .../com/vk/api/sdk/chain/HttpPostChainCall.kt | 27 + .../sdk/chain/InternalErrorRetryChainCall.kt | 27 + .../InvalidCredentialsObserverChainCall.kt | 27 + .../com/vk/api/sdk/chain/MethodChainCall.kt | 29 +- .../sdk/chain/RateLimitReachedChainCall.kt | 27 + .../com/vk/api/sdk/chain/RetryChainCall.kt | 27 + .../sdk/chain/TooManyRequestRetryChainCall.kt | 27 + .../sdk/chain/ValidationHandlerChainCall.kt | 27 + .../exceptions/IgnoredAccessTokenException.kt | 27 + .../exceptions/RateLimitReachedException.kt | 27 + .../com/vk/api/sdk/exceptions/VKApiCodes.kt | 39 +- .../vk/api/sdk/exceptions/VKApiException.kt | 27 + .../sdk/exceptions/VKApiExecutionException.kt | 27 + .../VKApiIllegalResponseException.kt | 27 + .../vk/api/sdk/exceptions/VKAuthException.kt | 27 + .../VKInternalServerErrorException.kt | 27 + .../sdk/exceptions/VKLargeEntityException.kt | 27 + .../api/sdk/exceptions/VKLocalIOException.kt | 27 + .../com/vk/api/sdk/extensions/ContextExt.kt | 27 + .../com/vk/api/sdk/internal/ApiCommand.kt | 27 + .../vk/api/sdk/internal/HttpMultipartEntry.kt | 27 + .../com/vk/api/sdk/internal/HttpStatus.kt | 27 + .../java/com/vk/api/sdk/internal/JsonUtils.kt | 27 + .../api/sdk/internal/QueryStringGenerator.kt | 27 + .../com/vk/api/sdk/internal/VKErrorUtils.kt | 27 + .../com/vk/api/sdk/internal/VKInitProvider.kt | 27 + .../com/vk/api/sdk/internal/Validation.kt | 27 + .../api/sdk/okhttp/DefaultLoggingPrefixer.kt | 14 + .../vk/api/sdk/okhttp/FileFullRequestBody.kt | 27 + .../vk/api/sdk/okhttp/LogLevelRequestTag.kt | 27 + .../vk/api/sdk/okhttp/LoggingInterceptor.kt | 119 ++- .../com/vk/api/sdk/okhttp/LoggingPrefixer.kt | 10 + .../com/vk/api/sdk/okhttp/OkHttpExecutor.kt | 50 +- .../vk/api/sdk/okhttp/OkHttpExecutorConfig.kt | 29 + .../com/vk/api/sdk/okhttp/OkHttpMethodCall.kt | 32 + .../com/vk/api/sdk/okhttp/OkHttpPostCall.kt | 27 + .../vk/api/sdk/okhttp/ProgressRequestBody.kt | 27 + .../java/com/vk/api/sdk/okhttp/RequestTag.kt | 29 +- .../vk/api/sdk/okhttp/UserAgentInterceptor.kt | 27 + .../vk/api/sdk/requests/VKBooleanRequest.kt | 27 + .../java/com/vk/api/sdk/requests/VKRequest.kt | 27 + .../com/vk/api/sdk/ui/VKBaseAuthActivity.kt | 27 + .../com/vk/api/sdk/ui/VKCaptchaActivity.kt | 29 +- .../vk/api/sdk/ui/VKConfirmationActivity.kt | 27 + .../vk/api/sdk/ui/VKWebViewAuthActivity.kt | 71 +- .../main/java/com/vk/api/sdk/utils/ApiExt.kt | 33 +- .../api/sdk/utils/ApiMethodPriorityBackoff.kt | 27 + .../com/vk/api/sdk/utils/DefaultUserAgent.kt | 27 + .../vk/api/sdk/utils/ExponentialBackoff.kt | 27 + .../vk/api/sdk/utils/RateLimitTokenBackoff.kt | 27 + .../StartUpMethodPriorityBackoffBaseImpl.kt | 27 + .../vk/api/sdk/utils/ThreadLocalDelegate.kt | 27 + .../com/vk/api/sdk/utils/UserAgentProvider.kt | 27 + .../java/com/vk/api/sdk/utils/VKLoader.kt | 27 + .../com/vk/api/sdk/utils/VKUrlResolver.kt | 27 + .../main/java/com/vk/api/sdk/utils/VKUtils.kt | 33 +- .../vk/api/sdk/utils/VKValidationLocker.kt | 27 + .../vk/api/sdk/utils/log/DefaultApiLogger.kt | 27 + .../java/com/vk/api/sdk/utils/log/Logger.kt | 44 +- .../utils/tmr/TooManyRequestBackoffEmpty.kt | 27 + .../utils/tmr/TooManyRequestBackoffGlobal.kt | 27 + .../utils/tmr/TooManyRequestLimitBackoff.kt | 27 + .../res/layout/vk_webview_auth_dialog.xml | 27 + core/src/main/res/values-ru/string.xml | 27 + core/src/main/res/values/booleans.xml | 27 + core/src/main/res/values/strings.xml | 27 + core/src/main/res/values/styles.xml | 27 + ...tartUpMethodPriorityBackoffBaseImplTest.kt | 27 + dependencies.gradle | 23 +- gradle/wrapper/gradle-wrapper.properties | 2 +- id/build.gradle | 40 +- id/consumer-proguard-rules.pro | 2 + id/src/main/AndroidManifest.xml | 27 + id/src/main/java/com/vk/sdk/id/UserId.kt | 77 +- .../com/vk/sdk/id/UserIdGsonSerializerTest.kt | 27 + publish.gradle | 117 +-- samples/app/build.gradle | 10 +- .../com/vk/sdk/sample/SampleApplication.kt | 1 - .../java/com/vk/sdk/sample/WelcomeActivity.kt | 64 +- .../res/drawable-hdpi/user_placeholder.png | Bin 1979 -> 561 bytes .../res/drawable-mdpi/user_placeholder.png | Bin 1626 -> 382 bytes .../res/drawable-xhdpi/user_placeholder.png | Bin 2331 -> 737 bytes .../res/drawable-xxhdpi/user_placeholder.png | Bin 2352 -> 1064 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 7060 -> 5553 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 3816 -> 3149 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 10987 -> 8140 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 21250 -> 14782 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 33032 -> 21625 bytes .../main/res/mipmap-xxxhdpi/mp_launcher.png | Bin 20877 -> 20327 bytes .../app/src/main/res/values-es/strings.xml | 10 + .../app/src/main/res/values-kk/strings.xml | 10 + .../app/src/main/res/values-pt/strings.xml | 10 + .../app/src/main/res/values-ru/strings.xml | 11 + .../app/src/main/res/values-uk/strings.xml | 10 + samples/app/src/main/res/values/strings.xml | 5 +- 344 files changed, 8660 insertions(+), 1892 deletions(-) create mode 100644 api/consumer-proguard-rules.pro create mode 100644 api/src/main/java/com/vk/sdk/api/account/dto/AccountSetInfoName.kt create mode 100644 api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRolePublic.kt create mode 100644 api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateAdStatus.kt create mode 100644 api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateCampaignStatus.kt create mode 100644 api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecification.kt create mode 100644 api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecificationCutted.kt create mode 100644 api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressPromoCard.kt create mode 100644 api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressSocialFooter.kt create mode 100644 api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListExtendedResponse.kt create mode 100644 api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListExtendedType.kt create mode 100644 api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkChat.kt create mode 100644 api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsWorkiCarouselItem.kt create mode 100644 api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlock.kt create mode 100644 api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlockItem.kt create mode 100644 api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlockProduct.kt create mode 100644 api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemActionButton.kt create mode 100644 api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemActionProperties.kt create mode 100644 api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemAttribute.kt create mode 100644 api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemStatusInfo.kt create mode 100644 api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCityById.kt create mode 100644 api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsAnswer.kt create mode 100644 api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsAnswerItem.kt create mode 100644 api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsCreateResponse.kt create mode 100644 api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsDeleteResponse.kt create mode 100644 api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsForm.kt create mode 100644 api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsGetLeadsResponse.kt create mode 100644 api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsLead.kt create mode 100644 api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsQuestionItem.kt create mode 100644 api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsQuestionItemOption.kt create mode 100644 api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchItemsSortBy.kt create mode 100644 api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchItemsSortDirection.kt create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSuggestion.kt create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByConversationMessageIdExtendedResponse.kt create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationByIdExtended.kt create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationMembers.kt create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButtonPropertyAction.kt create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAction.kt create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageActionPhoto.kt create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageActionStatus.kt create mode 100644 api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsNotification.kt create mode 100644 api/src/main/java/com/vk/sdk/api/photos/dto/PhotosSaveOwnerCoverPhotoResponse.kt create mode 100644 api/src/main/java/com/vk/sdk/api/prettyCards/dto/PrettyCardsPrettyCardOrError.kt create mode 100644 api/src/main/java/com/vk/sdk/api/stats/dto/StatsCity.kt create mode 100644 api/src/main/java/com/vk/sdk/api/stats/dto/StatsCountry.kt create mode 100644 api/src/main/java/com/vk/sdk/api/stats/dto/StatsReach.kt create mode 100644 api/src/main/java/com/vk/sdk/api/stats/dto/StatsViews.kt delete mode 100644 core/gradle.properties create mode 100644 core/src/main/java/com/vk/api/sdk/auth/VKAccessTokenProvider.kt create mode 100644 core/src/main/java/com/vk/api/sdk/auth/VKAuthResultContract.kt create mode 100644 core/src/main/java/com/vk/api/sdk/auth/VKAuthenticationResult.kt create mode 100644 core/src/main/java/com/vk/api/sdk/okhttp/DefaultLoggingPrefixer.kt create mode 100644 core/src/main/java/com/vk/api/sdk/okhttp/LoggingPrefixer.kt create mode 100644 id/consumer-proguard-rules.pro create mode 100644 samples/app/src/main/res/values-es/strings.xml create mode 100644 samples/app/src/main/res/values-kk/strings.xml create mode 100644 samples/app/src/main/res/values-pt/strings.xml create mode 100644 samples/app/src/main/res/values-ru/strings.xml create mode 100644 samples/app/src/main/res/values-uk/strings.xml diff --git a/README.md b/README.md index 7be47dbb6f..231049da10 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,8 @@ The available library modules are listed below. For example, your `app/build.gradle` script will contains such dependencies: ``` dependencies { - implementation 'com.vk:android-sdk-core:3.x.x - implementation 'com.vk:android-sdk-api:3.x.x // generated models and api methods + implementation 'com.vk:android-sdk-core:3.x.x' + implementation 'com.vk:android-sdk-api:3.x.x' // generated models and api methods } ``` @@ -93,28 +93,24 @@ SDK Initialization User Authorization ---------- -Use VK.login method: +Create authorization launcher: ```kotlin -VK.login(activity, arrayListOf(VKScope.WALL, VKScope.PHOTOS)) -``` -Override onActivityResult: - -```kotlin - override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { - val callback = object: VKAuthCallback { - override fun onLogin(token: VKAccessToken) { - // User passed authorization - } - - override fun onLoginFailed(errorCode: Int) { - // User didn't pass authorization - } +val authLauncher = VK.login(activity) { result : VKAuthenticationResult -> + when (result) { + is VKAuthenticationResult.Success -> { + // User passed authorization } - if (data == null || !VK.onActivityResult(requestCode, resultCode, data, callback)) { - super.onActivityResult(requestCode, resultCode, data) + is VKAuthenticationResult.Failed -> { + // User didn't pass authorization } } +} +``` +In appropriate place call a created launcher: + +```kotlin +authLauncher.launch(arrayListOf(VKScope.WALL, VKScope.PHOTOS)) ``` Handling token authorization diff --git a/api/build.gradle b/api/build.gradle index 30c9f976a8..7104d9c6b0 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -7,15 +7,15 @@ 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 +sdkPublish.POM_ARTIFACT_DESCRIPTION = sdkPublish.POM_API_DESCRIPTION android { compileSdkVersion "$sdkVersions.compileSdk".toInteger() buildToolsVersion "$sdkVersions.buildTools" compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { @@ -33,11 +33,18 @@ android { exclude("autoTest/**") exclude("META-INF/spring.*") exclude("META-INF/notice.txt") + exclude("META-INF/resources/**") exclude("mockito-extensions/org.mockito.plugins.MockMaker") } + buildTypes { + release { + consumerProguardFile("${projectDir}/consumer-proguard-rules.pro") + } + } + kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_11.toString() } } diff --git a/api/consumer-proguard-rules.pro b/api/consumer-proguard-rules.pro new file mode 100644 index 0000000000..b3c3b04180 --- /dev/null +++ b/api/consumer-proguard-rules.pro @@ -0,0 +1,18 @@ +# Application classes that will be serialized/deserialized over Gson +-keep class com.google.gson.examples.android.model.** { *; } + +# Prevent proguard from stripping interface information from TypeAdapterFactory, +# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer + + +# Prevent R8 from leaving Data object members always null +-keepclassmembers,allowobfuscation class * { + @com.google.gson.annotations.SerializedName ; +} + +# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher. +-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken +-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken \ No newline at end of file diff --git a/api/src/main/java/com/vk/sdk/api/GsonHolder.kt b/api/src/main/java/com/vk/sdk/api/GsonHolder.kt index 6c21006b19..7b72628fad 100644 --- a/api/src/main/java/com/vk/sdk/api/GsonHolder.kt +++ b/api/src/main/java/com/vk/sdk/api/GsonHolder.kt @@ -29,9 +29,18 @@ package com.vk.sdk.api import com.google.gson.Gson import com.google.gson.GsonBuilder +import com.google.gson.JsonDeserializationContext +import com.google.gson.JsonDeserializer +import com.google.gson.JsonElement +import com.google.gson.JsonPrimitive +import com.google.gson.JsonSerializationContext +import com.google.gson.JsonSerializer import com.vk.dto.common.id.UserId +import com.vk.dto.common.id.UserId.GsonSerializer import com.vk.sdk.api.newsfeed.dto.NewsfeedNewsfeedItem import com.vk.sdk.api.users.dto.UsersSubscriptionsItem +import java.lang.reflect.Type +import kotlin.Boolean object GsonHolder { val gson: Gson by lazy { @@ -39,8 +48,33 @@ object GsonHolder { .registerTypeAdapter(UsersSubscriptionsItem::class.java, UsersSubscriptionsItem.Deserializer()) .registerTypeAdapter(NewsfeedNewsfeedItem::class.java, NewsfeedNewsfeedItem.Deserializer()) - .registerTypeAdapter(UserId::class.java, UserId.GsonSerializer()) - .create() + .registerTypeAdapter(UserId::class.java, UserId.GsonSerializer(false)) + .registerTypeAdapter(Boolean::class.javaObjectType, + BooleanGsonSerializer()).registerTypeAdapter(Boolean::class.javaPrimitiveType, + BooleanGsonSerializer()).create() } + + class BooleanGsonSerializer : JsonDeserializer, JsonSerializer { + override fun serialize( + src: Boolean?, + typeOfSrc: Type?, + context: JsonSerializationContext? + ): JsonElement { + val asInt = if (src == true) 1 else 0 + return JsonPrimitive(asInt) + } + + override fun deserialize( + json: JsonElement?, + typeOfT: Type?, + context: JsonDeserializationContext? + ): Boolean? { + if (json !is JsonPrimitive) { + return null + } + val asStr = json.asString + return asStr == "1" || asStr == "true" + } + } } diff --git a/api/src/main/java/com/vk/sdk/api/NewApiRequest.kt b/api/src/main/java/com/vk/sdk/api/NewApiRequest.kt index 5f7e4a5cb3..c924ecb1ae 100644 --- a/api/src/main/java/com/vk/sdk/api/NewApiRequest.kt +++ b/api/src/main/java/com/vk/sdk/api/NewApiRequest.kt @@ -29,7 +29,14 @@ package com.vk.sdk.api import com.google.gson.JsonParser import com.vk.api.sdk.requests.VKRequest +import com.vk.dto.common.id.UserId +import java.lang.IllegalArgumentException +import kotlin.Double +import kotlin.Float +import kotlin.Int +import kotlin.Long import kotlin.String +import kotlin.collections.List internal class NewApiRequest internal constructor( methodName: String, @@ -39,4 +46,83 @@ internal class NewApiRequest internal constructor( val responseJson = JsonParser.parseString(response).asJsonObject.get("response") return parseResponse(responseJson) } + + fun addParam( + name: String, + value: String?, + minLength: Int = 0, + maxLength: Int = Int.MAX_VALUE + ) { + if (value != null) { + if (value.length !in minLength..maxLength) { + throw IllegalArgumentException("Param $name not in $minLength..$maxLength") + } + params[name] = value + } + } + + fun addParam( + name: String, + value: Int, + min: Int = Int.MIN_VALUE, + max: Int = Int.MAX_VALUE + ) { + if (value !in min..max) { + throw IllegalArgumentException("Param $name not in $min..$max") + } + params[name] = value.toString() + } + + fun addParam( + name: String, + value: Long, + min: Long = Long.MIN_VALUE, + max: Long = Long.MAX_VALUE + ) { + if (value !in min..max) { + throw IllegalArgumentException("Param $name not in $min..$max") + } + params[name] = value.toString() + } + + fun addParam( + name: String, + value: Float, + min: Double = Double.MIN_VALUE, + max: Double = Double.MAX_VALUE + ) { + if (value !in min..max) { + throw IllegalArgumentException("Param $name not in $min..$max") + } + params[name] = value.toString() + } + + fun addParam( + name: String, + value: UserId?, + min: Long = Long.MIN_VALUE, + max: Long = Long.MAX_VALUE + ) { + if (value != null) { + if (value.value !in min..max) { + throw IllegalArgumentException("Param $name not in $min..$max") + } + params[name] = value.value.toString() + } + } + + fun addParam( + name: String, + values: List, + min: Long = Long.MIN_VALUE, + max: Long = Long.MAX_VALUE + ) { + addParam(name, values.joinToString(",", transform = { + if (it.value !in min..max) { + throw IllegalArgumentException("Param $name not in $min..$max") + } + it.value.toString() + } + )) + } } diff --git a/api/src/main/java/com/vk/sdk/api/account/AccountService.kt b/api/src/main/java/com/vk/sdk/api/account/AccountService.kt index 4a4ff2c1a4..e443ad41b6 100644 --- a/api/src/main/java/com/vk/sdk/api/account/AccountService.kt +++ b/api/src/main/java/com/vk/sdk/api/account/AccountService.kt @@ -43,6 +43,7 @@ import com.vk.sdk.api.account.dto.AccountSaveProfileInfoBdateVisibility import com.vk.sdk.api.account.dto.AccountSaveProfileInfoRelation import com.vk.sdk.api.account.dto.AccountSaveProfileInfoResponse import com.vk.sdk.api.account.dto.AccountSaveProfileInfoSex +import com.vk.sdk.api.account.dto.AccountSetInfoName import com.vk.sdk.api.account.dto.AccountUserSettings import com.vk.sdk.api.base.dto.BaseOkResponse import kotlin.Boolean @@ -84,7 +85,7 @@ class AccountService { GsonHolder.gson.fromJson(it, AccountChangePasswordResponse::class.java) } .apply { - addParam("new_password", newPassword) + addParam("new_password", newPassword, minLength = 6) restoreSid?.let { addParam("restore_sid", it) } changePasswordHash?.let { addParam("change_password_hash", it) } oldPassword?.let { addParam("old_password", it) } @@ -103,8 +104,8 @@ class AccountService { GsonHolder.gson.fromJson(it, AccountGetActiveOffersResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } } /** @@ -118,7 +119,7 @@ class AccountService { GsonHolder.gson.fromJson(it, Int::class.java) } .apply { - addParam("user_id", userId) + addParam("user_id", userId, min = 1) } /** @@ -133,8 +134,8 @@ class AccountService { GsonHolder.gson.fromJson(it, AccountGetBannedResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } } /** @@ -153,7 +154,7 @@ class AccountService { it.value } filterJsonConverted?.let { addParam("filter", it) } - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } } /** @@ -265,7 +266,7 @@ class AccountService { cancelRequestId: Int? = null, sex: AccountSaveProfileInfoSex? = null, relation: AccountSaveProfileInfoRelation? = null, - relationPartnerId: Int? = null, + relationPartnerId: UserId? = null, bdate: String? = null, bdateVisibility: AccountSaveProfileInfoBdateVisibility? = null, homeTown: String? = null, @@ -280,15 +281,15 @@ class AccountService { 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) } + cancelRequestId?.let { addParam("cancel_request_id", it, min = 0) } sex?.let { addParam("sex", it.value) } relation?.let { addParam("relation", it.value) } - relationPartnerId?.let { addParam("relation_partner_id", it) } + relationPartnerId?.let { addParam("relation_partner_id", it, min = 0) } 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) } + countryId?.let { addParam("country_id", it, min = 0) } + cityId?.let { addParam("city_id", it, min = 0) } status?.let { addParam("status", it) } } @@ -299,32 +300,15 @@ class AccountService { * @param value - Setting value. * @return [VKRequest] with [BaseOkResponse] */ - fun accountSetInfo(name: String? = null, value: String? = null): VKRequest = - NewApiRequest("account.setInfo") { + fun accountSetInfo(name: AccountSetInfoName? = null, value: String? = null): + VKRequest = NewApiRequest("account.setInfo") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - name?.let { addParam("name", it) } + name?.let { addParam("name", it.value) } 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: UserId, 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. * diff --git a/api/src/main/java/com/vk/sdk/api/account/dto/AccountGetBannedResponse.kt b/api/src/main/java/com/vk/sdk/api/account/dto/AccountGetBannedResponse.kt index 0193d119fb..98b8c15414 100644 --- a/api/src/main/java/com/vk/sdk/api/account/dto/AccountGetBannedResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/account/dto/AccountGetBannedResponse.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.account.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import com.vk.sdk.api.groups.dto.GroupsGroup import com.vk.sdk.api.users.dto.UsersUserFull import kotlin.Int @@ -43,7 +44,7 @@ data class AccountGetBannedResponse( @SerializedName("count") val count: Int, @SerializedName("items") - val items: List, + val items: List, @SerializedName("profiles") val profiles: List? = null, @SerializedName("groups") diff --git a/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoResponse.kt b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoResponse.kt index 8b534eca1c..d0e0d2d77e 100644 --- a/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoResponse.kt @@ -36,7 +36,7 @@ import com.vk.sdk.api.base.dto.BaseBoolInt */ data class AccountSaveProfileInfoResponse( @SerializedName("changed") - val changed: BaseBoolInt? = null, + val changed: BaseBoolInt, @SerializedName("name_request") val nameRequest: AccountNameRequest? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/account/dto/AccountSetInfoName.kt b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSetInfoName.kt new file mode 100644 index 0000000000..e7f727342f --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSetInfoName.kt @@ -0,0 +1,122 @@ +/** + * 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 AccountSetInfoName( + val value: String +) { + @SerializedName("community_comments") + COMMUNITY_COMMENTS("community_comments"), + + @SerializedName("fave_intro") + FAVE_INTRO("fave_intro"), + + @SerializedName("feed_type") + FEED_TYPE("feed_type"), + + @SerializedName("force_store_review") + FORCE_STORE_REVIEW("force_store_review"), + + @SerializedName("im_user_name_type") + IM_USER_NAME_TYPE("im_user_name_type"), + + @SerializedName("intro") + INTRO("intro"), + + @SerializedName("is_recognize_block_friends_photo_enabled") + IS_RECOGNIZE_BLOCK_FRIENDS_PHOTO_ENABLED("is_recognize_block_friends_photo_enabled"), + + @SerializedName("is_recognize_block_me_photo_enabled") + IS_RECOGNIZE_BLOCK_ME_PHOTO_ENABLED("is_recognize_block_me_photo_enabled"), + + @SerializedName("is_recognize_find_friends") + IS_RECOGNIZE_FIND_FRIENDS("is_recognize_find_friends"), + + @SerializedName("is_recognize_photo_me_enabled") + IS_RECOGNIZE_PHOTO_ME_ENABLED("is_recognize_photo_me_enabled"), + + @SerializedName("is_recognize_show_me_to_friends") + IS_RECOGNIZE_SHOW_ME_TO_FRIENDS("is_recognize_show_me_to_friends"), + + @SerializedName("market_albums_v2_intro") + MARKET_ALBUMS_V2_INTRO("market_albums_v2_intro"), + + @SerializedName("market_onboarding") + MARKET_ONBOARDING("market_onboarding"), + + @SerializedName("market_wishlist") + MARKET_WISHLIST("market_wishlist"), + + @SerializedName("menu_intro") + MENU_INTRO("menu_intro"), + + @SerializedName("messages_auto_unarchive") + MESSAGES_AUTO_UNARCHIVE("messages_auto_unarchive"), + + @SerializedName("messages_multiline_input") + MESSAGES_MULTILINE_INPUT("messages_multiline_input"), + + @SerializedName("messages_recommendation_list_hidden") + MESSAGES_RECOMMENDATION_LIST_HIDDEN("messages_recommendation_list_hidden"), + + @SerializedName("messages_transcript_auto_show") + MESSAGES_TRANSCRIPT_AUTO_SHOW("messages_transcript_auto_show"), + + @SerializedName("money_p2p_intro") + MONEY_P2P_INTRO("money_p2p_intro"), + + @SerializedName("music_intro") + MUSIC_INTRO("music_intro"), + + @SerializedName("no_wall_replies") + NO_WALL_REPLIES("no_wall_replies"), + + @SerializedName("own_posts_default") + OWN_POSTS_DEFAULT("own_posts_default"), + + @SerializedName("shopping_intro") + SHOPPING_INTRO("shopping_intro"), + + @SerializedName("show_only_not_muted_messages") + SHOW_ONLY_NOT_MUTED_MESSAGES("show_only_not_muted_messages"), + + @SerializedName("show_vk_apps_intro") + SHOW_VK_APPS_INTRO("show_vk_apps_intro"), + + @SerializedName("timezone") + TIMEZONE("timezone"), + + @SerializedName("visible_time") + VISIBLE_TIME("visible_time"), + + @SerializedName("wishlists_ae_promobanner") + WISHLISTS_AE_PROMOBANNER("wishlists_ae_promobanner"); +} diff --git a/api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettings.kt b/api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettings.kt index 060b8220c3..b48f8944d2 100644 --- a/api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettings.kt +++ b/api/src/main/java/com/vk/sdk/api/account/dto/AccountUserSettings.kt @@ -44,12 +44,14 @@ import kotlin.String import kotlin.collections.List /** + * @param id - User ID + * @param homeTown - User's hometown + * @param status - User status * @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 @@ -58,7 +60,6 @@ import kotlin.collections.List * @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 @@ -69,12 +70,17 @@ import kotlin.collections.List * @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("id") + val id: UserId, + @SerializedName("home_town") + val homeTown: String, + @SerializedName("status") + val status: String, @SerializedName("photo_200") val photo200: String? = null, @SerializedName("is_service_account") @@ -85,8 +91,6 @@ data class AccountUserSettings( val firstName: String? = null, @SerializedName("hidden") val hidden: Int? = null, - @SerializedName("id") - val id: UserId? = null, @SerializedName("last_name") val lastName: String? = null, @SerializedName("can_access_closed") @@ -103,8 +107,6 @@ data class AccountUserSettings( val city: BaseCity? = null, @SerializedName("country") val country: BaseCountry? = null, - @SerializedName("home_town") - val homeTown: String? = null, @SerializedName("maiden_name") val maidenName: String? = null, @SerializedName("name_request") @@ -125,8 +127,6 @@ data class AccountUserSettings( val screenName: String? = null, @SerializedName("sex") val sex: BaseSex? = null, - @SerializedName("status") - val status: String? = null, @SerializedName("status_audio") val statusAudio: AudioAudio? = null, @SerializedName("interests") diff --git a/api/src/main/java/com/vk/sdk/api/ads/AdsService.kt b/api/src/main/java/com/vk/sdk/api/ads/AdsService.kt index 3d3b6c7cf3..7fae503c15 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/AdsService.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/AdsService.kt @@ -37,6 +37,8 @@ import com.vk.sdk.api.ads.dto.AdsAdLayout import com.vk.sdk.api.ads.dto.AdsCampaign import com.vk.sdk.api.ads.dto.AdsCheckLinkLinkType import com.vk.sdk.api.ads.dto.AdsClient +import com.vk.sdk.api.ads.dto.AdsCreateAdStatus +import com.vk.sdk.api.ads.dto.AdsCreateCampaignStatus import com.vk.sdk.api.ads.dto.AdsCreateTargetGroupResponse import com.vk.sdk.api.ads.dto.AdsDemoStats import com.vk.sdk.api.ads.dto.AdsFloodStats @@ -63,6 +65,8 @@ 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.base.dto.BaseOkResponse import kotlin.Boolean @@ -80,13 +84,13 @@ class AdsService { * 'user_specification' objects see below. * @return [VKRequest] with [Boolean] */ - fun adsAddOfficeUsers(accountId: Int, data: String): VKRequest = - NewApiRequest("ads.addOfficeUsers") { + fun adsAddOfficeUsers(accountId: Int, data: List): + VKRequest = NewApiRequest("ads.addOfficeUsers") { GsonHolder.gson.fromJson(it, Boolean::class.java) } .apply { addParam("account_id", accountId) - addParam("data", data) + addParam("data", GsonHolder.gson.toJson(data)) } /** @@ -122,10 +126,10 @@ class AdsService { * 'ad_specification' objects see below. * @return [VKRequest] with [Unit] */ - fun adsCreateAds(accountId: Int, data: String): VKRequest> = + fun adsCreateAds(accountId: Int, data: String): VKRequest> = NewApiRequest("ads.createAds") { - val typeToken = object: TypeToken>() {}.type - GsonHolder.gson.fromJson>(it, typeToken) + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("account_id", accountId) @@ -140,10 +144,10 @@ class AdsService { * of 'campaign_specification' objects see below. * @return [VKRequest] with [Unit] */ - fun adsCreateCampaigns(accountId: Int, data: String): VKRequest> = + fun adsCreateCampaigns(accountId: Int, data: String): VKRequest> = NewApiRequest("ads.createCampaigns") { - val typeToken = object: TypeToken>() {}.type - GsonHolder.gson.fromJson>(it, typeToken) + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("account_id", accountId) @@ -216,7 +220,7 @@ class AdsService { .apply { addParam("account_id", accountId) addParam("name", name) - addParam("lifetime", lifetime) + addParam("lifetime", lifetime, min = 1, max = 720) clientId?.let { addParam("client_id", it) } targetPixelId?.let { addParam("target_pixel_id", it) } targetPixelRules?.let { addParam("target_pixel_rules", it) } @@ -268,11 +272,12 @@ class AdsService { * * @param accountId - Advertising account ID. * @param ids - Serialized JSON array with IDs of deleted campaigns. - * @return [VKRequest] with [Int] + * @return [VKRequest] with [Unit] */ - fun adsDeleteCampaigns(accountId: Int, ids: String): VKRequest = + fun adsDeleteCampaigns(accountId: Int, ids: String): VKRequest> = NewApiRequest("ads.deleteCampaigns") { - GsonHolder.gson.fromJson(it, Int::class.java) + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("account_id", accountId) @@ -284,11 +289,12 @@ class AdsService { * * @param accountId - Advertising account ID. * @param ids - Serialized JSON array with IDs of deleted clients. - * @return [VKRequest] with [Int] + * @return [VKRequest] with [Unit] */ - fun adsDeleteClients(accountId: Int, ids: String): VKRequest = + fun adsDeleteClients(accountId: Int, ids: String): VKRequest> = NewApiRequest("ads.deleteClients") { - GsonHolder.gson.fromJson(it, Int::class.java) + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("account_id", accountId) @@ -624,8 +630,8 @@ class AdsService { 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) } + offset?.let { addParam("offset", it, min = 0) } + limit?.let { addParam("limit", it, min = 0, max = 200) } sortBy?.let { addParam("sort_by", it) } } @@ -638,7 +644,7 @@ class AdsService { GsonHolder.gson.fromJson(it, AdsGetMusiciansResponse::class.java) } .apply { - addParam("artist_name", artistName) + addParam("artist_name", artistName, minLength = 3) } /** @@ -1078,14 +1084,14 @@ class AdsService { * 'user_specification' objects see below. * @return [VKRequest] with [Unit] */ - fun adsUpdateOfficeUsers(accountId: Int, data: String): + 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) - addParam("data", data) + addParam("account_id", accountId, min = 0) + addParam("data", GsonHolder.gson.toJson(data)) } /** @@ -1120,7 +1126,7 @@ class AdsService { addParam("account_id", accountId) addParam("target_group_id", targetGroupId) addParam("name", name) - addParam("lifetime", lifetime) + addParam("lifetime", lifetime, min = 1, max = 720) clientId?.let { addParam("client_id", it) } domain?.let { addParam("domain", it) } targetPixelId?.let { addParam("target_pixel_id", it) } diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRolePublic.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRolePublic.kt new file mode 100644 index 0000000000..415d47bcdb --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsAccessRolePublic.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 AdsAccessRolePublic( + val value: String +) { + @SerializedName("manager") + MANAGER("manager"), + + @SerializedName("reports") + REPORTS("reports"); +} diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdLayout.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdLayout.kt index 19ba946fda..de35ce52bf 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdLayout.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsAdLayout.kt @@ -68,7 +68,7 @@ data class AdsAdLayout( @SerializedName("link_domain") val linkDomain: String? = null, @SerializedName("preview_link") - val previewLink: Int? = null, + val previewLink: String? = null, @SerializedName("video") val video: BaseBoolInt? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCategory.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCategory.kt index a7331b1be9..714f0316dc 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCategory.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCategory.kt @@ -28,7 +28,6 @@ package com.vk.sdk.api.ads.dto import com.google.gson.annotations.SerializedName -import com.vk.sdk.api.base.dto.BaseObjectWithName import kotlin.Int import kotlin.String import kotlin.collections.List @@ -44,5 +43,5 @@ data class AdsCategory( @SerializedName("name") val name: String, @SerializedName("subcategories") - val subcategories: List? = null + val subcategories: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateAdStatus.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateAdStatus.kt new file mode 100644 index 0000000000..69876f1b91 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateAdStatus.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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param id - Ad ID + * @param postId - Stealth Post ID + * @param errorCode - Error code + * @param errorDesc - Error description + */ +data class AdsCreateAdStatus( + @SerializedName("id") + val id: Int, + @SerializedName("post_id") + val postId: Int? = null, + @SerializedName("error_code") + val errorCode: Int? = null, + @SerializedName("error_desc") + val errorDesc: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateCampaignStatus.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateCampaignStatus.kt new file mode 100644 index 0000000000..1d72a5f165 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCreateCampaignStatus.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.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param id - Campaign ID + * @param errorCode - Error code + * @param errorDesc - Error description + */ +data class AdsCreateCampaignStatus( + @SerializedName("id") + val id: Int, + @SerializedName("error_code") + val errorCode: Int? = null, + @SerializedName("error_desc") + val errorDesc: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecification.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecification.kt new file mode 100644 index 0000000000..d795001a38 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecification.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.ads.dto + +import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId +import kotlin.Boolean +import kotlin.Int +import kotlin.collections.List + +/** + * @param userId + * @param role + * @param grantAccessToAllClients + * @param clientIds + * @param viewBudget + */ +data class AdsUserSpecification( + @SerializedName("user_id") + val userId: UserId, + @SerializedName("role") + val role: AdsAccessRolePublic, + @SerializedName("grant_access_to_all_clients") + val grantAccessToAllClients: Boolean? = null, + @SerializedName("client_ids") + val clientIds: List? = null, + @SerializedName("view_budget") + val viewBudget: Boolean? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecificationCutted.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecificationCutted.kt new file mode 100644 index 0000000000..024b0f4b5d --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsUserSpecificationCutted.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 com.vk.dto.common.id.UserId +import kotlin.Boolean +import kotlin.Int + +/** + * @param userId + * @param role + * @param clientId + * @param viewBudget + */ +data class AdsUserSpecificationCutted( + @SerializedName("user_id") + val userId: UserId, + @SerializedName("role") + val role: AdsAccessRolePublic, + @SerializedName("client_id") + val clientId: Int? = null, + @SerializedName("view_budget") + val viewBudget: Boolean? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressCarouselItem.kt b/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressCarouselItem.kt index b126f50ead..5ff0f32895 100644 --- a/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressCarouselItem.kt +++ b/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressCarouselItem.kt @@ -32,18 +32,22 @@ import com.vk.sdk.api.base.dto.BaseLinkButton import com.vk.sdk.api.market.dto.MarketPrice import com.vk.sdk.api.photos.dto.PhotosPhoto import kotlin.Boolean +import kotlin.Float +import kotlin.Int import kotlin.String /** * @param id - Item id * @param title - Item title - * @param price - Aliexpress item price * @param isFavorite - Information whether the current item has been added to bookmarks * @param url - Base product url * @param detailsButton - Details action + * @param price - Aliexpress item price * @param discountText - Discount text * @param deliveryDateText - Delivery details text * @param label - Any text label for item + * @param rating - Item rating + * @param ordersCount - Item orders count * @param actionButton - Button action * @param photo */ @@ -52,20 +56,24 @@ data class AliexpressCarouselItem( val id: String, @SerializedName("title") val title: String, - @SerializedName("price") - val price: MarketPrice, @SerializedName("is_favorite") val isFavorite: Boolean, @SerializedName("url") val url: String, @SerializedName("details_button") val detailsButton: BaseLinkButton, + @SerializedName("price") + val price: MarketPrice? = null, @SerializedName("discount_text") val discountText: String? = null, @SerializedName("delivery_date_text") val deliveryDateText: String? = null, @SerializedName("label") val label: String? = null, + @SerializedName("rating") + val rating: Float? = null, + @SerializedName("orders_count") + val ordersCount: Int? = null, @SerializedName("action_button") val actionButton: BaseLinkButton? = null, @SerializedName("photo") diff --git a/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressPromoCard.kt b/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressPromoCard.kt new file mode 100644 index 0000000000..1cbd4e28a7 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressPromoCard.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.aliexpress.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseLinkButton +import com.vk.sdk.api.photos.dto.PhotosPhoto +import kotlin.Int +import kotlin.String + +/** + * @param icon - Card icon + * @param title - Card title + * @param subtitle - Card text + * @param cardPosition - Position of card in items set + * @param actionButton - Action button url + */ +data class AliexpressPromoCard( + @SerializedName("icon") + val icon: PhotosPhoto? = null, + @SerializedName("title") + val title: String? = null, + @SerializedName("subtitle") + val subtitle: String? = null, + @SerializedName("card_position") + val cardPosition: Int? = null, + @SerializedName("action_button") + val actionButton: BaseLinkButton? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressSocialFooter.kt b/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressSocialFooter.kt new file mode 100644 index 0000000000..a4bea01676 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/aliexpress/dto/AliexpressSocialFooter.kt @@ -0,0 +1,58 @@ +/** + * 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.aliexpress.dto + +import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId +import com.vk.sdk.api.base.dto.BaseLinkButtonAction +import kotlin.String +import kotlin.collections.List + +/** + * @param type + * @param action - Block action + * @param text + * @param userIds + */ +data class AliexpressSocialFooter( + @SerializedName("type") + val type: AliexpressSocialFooter.Type? = null, + @SerializedName("action") + val action: BaseLinkButtonAction? = null, + @SerializedName("text") + val text: String? = null, + @SerializedName("user_ids") + val userIds: List? = null +) { + enum class Type( + val value: String + ) { + @SerializedName("aliexpress_carousel") + ALIEXPRESS_CAROUSEL("aliexpress_carousel"); + } +} diff --git a/api/src/main/java/com/vk/sdk/api/appWidgets/AppWidgetsService.kt b/api/src/main/java/com/vk/sdk/api/appWidgets/AppWidgetsService.kt index 0a11a9b1a3..404118ce47 100644 --- a/api/src/main/java/com/vk/sdk/api/appWidgets/AppWidgetsService.kt +++ b/api/src/main/java/com/vk/sdk/api/appWidgets/AppWidgetsService.kt @@ -77,8 +77,8 @@ class AppWidgetsService { GsonHolder.gson.fromJson(it, AppWidgetsPhotos::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } imageType?.let { addParam("image_type", it.value) } } @@ -113,8 +113,8 @@ class AppWidgetsService { GsonHolder.gson.fromJson(it, AppWidgetsPhotos::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } imageType?.let { addParam("image_type", it.value) } } @@ -177,7 +177,7 @@ class AppWidgetsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("code", code) + addParam("code", code, maxLength = 100000) addParam("type", type.value) } } diff --git a/api/src/main/java/com/vk/sdk/api/apps/AppsService.kt b/api/src/main/java/com/vk/sdk/api/apps/AppsService.kt index 34f00c7dac..1bcf35b954 100644 --- a/api/src/main/java/com/vk/sdk/api/apps/AppsService.kt +++ b/api/src/main/java/com/vk/sdk/api/apps/AppsService.kt @@ -34,6 +34,8 @@ import com.vk.sdk.api.NewApiRequest import com.vk.sdk.api.apps.dto.AppsCatalogList import com.vk.sdk.api.apps.dto.AppsGetCatalogFilter import com.vk.sdk.api.apps.dto.AppsGetCatalogSort +import com.vk.sdk.api.apps.dto.AppsGetFriendsListExtendedResponse +import com.vk.sdk.api.apps.dto.AppsGetFriendsListExtendedType import com.vk.sdk.api.apps.dto.AppsGetFriendsListResponse import com.vk.sdk.api.apps.dto.AppsGetFriendsListType import com.vk.sdk.api.apps.dto.AppsGetLeaderboardExtendedResponse @@ -95,7 +97,7 @@ class AppsService { GsonHolder.gson.fromJson(it, AppsGetResponse::class.java) } .apply { - appId?.let { addParam("app_id", it) } + appId?.let { addParam("app_id", it, min = 0) } appIds?.let { addParam("app_ids", it) } platform?.let { addParam("platform", it.value) } returnFriends?.let { addParam("return_friends", it) } @@ -138,9 +140,9 @@ class AppsService { GsonHolder.gson.fromJson(it, AppsCatalogList::class.java) } .apply { - addParam("count", count) + addParam("count", count, min = 0) sort?.let { addParam("sort", it.value) } - offset?.let { addParam("offset", it) } + offset?.let { addParam("offset", it, min = 0) } platform?.let { addParam("platform", it) } returnFriends?.let { addParam("return_friends", it) } val fieldsJsonConverted = fields?.map { @@ -149,7 +151,7 @@ class AppsService { fieldsJsonConverted?.let { addParam("fields", it) } nameCase?.let { addParam("name_case", it) } q?.let { addParam("q", it) } - genreId?.let { addParam("genre_id", it) } + genreId?.let { addParam("genre_id", it, min = 0) } filter?.let { addParam("filter", it.value) } } @@ -172,8 +174,37 @@ class AppsService { GsonHolder.gson.fromJson(it, AppsGetFriendsListResponse::class.java) } .apply { - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0, max = 5000) } + offset?.let { addParam("offset", it, min = 0) } + type?.let { addParam("type", it.value) } + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + } + + /** + * 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 [AppsGetFriendsListExtendedResponse] + */ + fun appsGetFriendsListExtended( + count: Int? = null, + offset: Int? = null, + type: AppsGetFriendsListExtendedType? = null, + fields: List? = null + ): VKRequest = NewApiRequest("apps.getFriendsList") { + GsonHolder.gson.fromJson(it, AppsGetFriendsListExtendedResponse::class.java) + } + .apply { + addParam("extended", true) + count?.let { addParam("count", it, min = 0, max = 5000) } + offset?.let { addParam("offset", it, min = 0) } type?.let { addParam("type", it.value) } val fieldsJsonConverted = fields?.map { it.value @@ -229,7 +260,7 @@ class AppsService { GsonHolder.gson.fromJson(it, AppsGetMiniAppPoliciesResponse::class.java) } .apply { - addParam("app_id", appId) + addParam("app_id", appId, min = 0) } /** @@ -256,7 +287,7 @@ class AppsService { GsonHolder.gson.fromJson(it, Int::class.java) } .apply { - addParam("user_id", userId) + addParam("user_id", userId, min = 1) } /** @@ -269,8 +300,8 @@ class AppsService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("promo_id", promoId) - userId?.let { addParam("user_id", it) } + addParam("promo_id", promoId, min = 0) + userId?.let { addParam("user_id", it, min = 0) } } /** @@ -283,8 +314,8 @@ class AppsService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("promo_id", promoId) - userId?.let { addParam("user_id", it) } + addParam("promo_id", promoId, min = 0) + userId?.let { addParam("user_id", it, min = 0) } } /** @@ -310,10 +341,10 @@ class AppsService { GsonHolder.gson.fromJson(it, Int::class.java) } .apply { - addParam("user_id", userId) + addParam("user_id", userId, min = 1) text?.let { addParam("text", it) } type?.let { addParam("type", it.value) } - name?.let { addParam("name", it) } + name?.let { addParam("name", it, maxLength = 128) } key?.let { addParam("key", it) } separate?.let { addParam("separate", it) } } diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsApp.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsApp.kt index 6f0b95b692..a03c948c44 100644 --- a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsApp.kt +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsApp.kt @@ -35,6 +35,9 @@ import kotlin.String import kotlin.collections.List /** + * @param type + * @param id - Application ID + * @param title - Application title * @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 @@ -55,9 +58,6 @@ import kotlin.collections.List * @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 @@ -70,6 +70,12 @@ import kotlin.collections.List * @param openInExternalBrowser - Open in external browser */ data class AppsApp( + @SerializedName("type") + val type: AppsAppType, + @SerializedName("id") + val id: Int, + @SerializedName("title") + val title: String, @SerializedName("author_url") val authorUrl: String? = null, @SerializedName("banner_1120") @@ -110,12 +116,6 @@ data class AppsApp( val screenName: String? = null, @SerializedName("section") val section: String? = null, - @SerializedName("type") - val type: AppsAppType? = null, - @SerializedName("id") - val id: Int? = null, - @SerializedName("title") - val title: String? = null, @SerializedName("author_owner_id") val authorOwnerId: Int? = null, @SerializedName("is_installed") diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListExtendedResponse.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListExtendedResponse.kt new file mode 100644 index 0000000000..f0f436d2aa --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListExtendedResponse.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 AppsGetFriendsListExtendedResponse( + @SerializedName("count") + val count: Int, + @SerializedName("items") + val items: List? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListExtendedType.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListExtendedType.kt new file mode 100644 index 0000000000..c50719eac1 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListExtendedType.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 AppsGetFriendsListExtendedType( + val value: String +) { + @SerializedName("invite") + INVITE("invite"), + + @SerializedName("request") + REQUEST("request"); +} diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListResponse.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListResponse.kt index e12cbac325..8fa4aac215 100644 --- a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListResponse.kt @@ -28,7 +28,7 @@ package com.vk.sdk.api.apps.dto import com.google.gson.annotations.SerializedName -import com.vk.sdk.api.users.dto.UsersUserFull +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.collections.List @@ -38,7 +38,7 @@ import kotlin.collections.List */ data class AppsGetFriendsListResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedResponse.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedResponse.kt index 068e525126..7357e1fa19 100644 --- a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedResponse.kt @@ -28,7 +28,7 @@ package com.vk.sdk.api.apps.dto import com.google.gson.annotations.SerializedName -import com.vk.sdk.api.users.dto.UsersUserMin +import com.vk.sdk.api.users.dto.UsersUser import kotlin.Int import kotlin.collections.List @@ -43,5 +43,5 @@ data class AppsGetLeaderboardExtendedResponse( @SerializedName("items") val items: List? = null, @SerializedName("profiles") - val profiles: List? = null + val profiles: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/audio/dto/AudioArtist.kt b/api/src/main/java/com/vk/sdk/api/audio/dto/AudioArtist.kt index bc852907c3..b259de2a4a 100644 --- a/api/src/main/java/com/vk/sdk/api/audio/dto/AudioArtist.kt +++ b/api/src/main/java/com/vk/sdk/api/audio/dto/AudioArtist.kt @@ -30,7 +30,7 @@ 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 com.vk.sdk.api.users.dto.UsersUser import kotlin.Boolean import kotlin.Int import kotlin.String @@ -46,6 +46,7 @@ import kotlin.collections.List * @param photos - Artist photos by type * @param isFollowed - Is user follow this artist * @param canFollow - Can be this artist followed by user + * @param canPlay * @param genres - Artist genres * @param bio - Artist bio * @param pages - Artist pages @@ -69,6 +70,8 @@ data class AudioArtist( val isFollowed: Boolean? = null, @SerializedName("can_follow") val canFollow: Boolean? = null, + @SerializedName("can_play") + val canPlay: Boolean? = null, @SerializedName("genres") val genres: List? = null, @SerializedName("bio") @@ -76,7 +79,7 @@ data class AudioArtist( @SerializedName("pages") val pages: List? = null, @SerializedName("profiles") - val profiles: List? = null, + val profiles: List? = null, @SerializedName("groups") val groups: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/base/dto/BaseCommentsInfo.kt b/api/src/main/java/com/vk/sdk/api/base/dto/BaseCommentsInfo.kt index 3b3da83ca2..0427b89a1b 100644 --- a/api/src/main/java/com/vk/sdk/api/base/dto/BaseCommentsInfo.kt +++ b/api/src/main/java/com/vk/sdk/api/base/dto/BaseCommentsInfo.kt @@ -34,6 +34,8 @@ import kotlin.Int /** * @param canPost - Information whether current user can comment the post + * @param canOpen + * @param canClose * @param count - Comments number * @param groupsCanPost - Information whether groups can comment the post * @param donut @@ -41,6 +43,10 @@ import kotlin.Int data class BaseCommentsInfo( @SerializedName("can_post") val canPost: BaseBoolInt? = null, + @SerializedName("can_open") + val canOpen: BaseBoolInt? = null, + @SerializedName("can_close") + val canClose: BaseBoolInt? = null, @SerializedName("count") val count: Int? = null, @SerializedName("groups_can_post") diff --git a/api/src/main/java/com/vk/sdk/api/base/dto/BaseError.kt b/api/src/main/java/com/vk/sdk/api/base/dto/BaseError.kt index 0954b98672..7952b94498 100644 --- a/api/src/main/java/com/vk/sdk/api/base/dto/BaseError.kt +++ b/api/src/main/java/com/vk/sdk/api/base/dto/BaseError.kt @@ -41,7 +41,7 @@ import kotlin.collections.List */ data class BaseError( @SerializedName("error_code") - val errorCode: Int? = null, + val errorCode: Int, @SerializedName("error_subcode") val errorSubcode: Int? = null, @SerializedName("error_msg") diff --git a/api/src/main/java/com/vk/sdk/api/base/dto/BaseImage.kt b/api/src/main/java/com/vk/sdk/api/base/dto/BaseImage.kt index 2bdee1b2b0..0ad125cd19 100644 --- a/api/src/main/java/com/vk/sdk/api/base/dto/BaseImage.kt +++ b/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 height - Image height * @param id */ data class BaseImage( - @SerializedName("height") - val height: Int, @SerializedName("url") val url: String, @SerializedName("width") val width: Int, + @SerializedName("height") + val height: Int, @SerializedName("id") val id: String? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonActionType.kt b/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonActionType.kt index 65f248ed55..711015579c 100644 --- a/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonActionType.kt +++ b/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButtonActionType.kt @@ -129,6 +129,9 @@ enum class BaseLinkButtonActionType( @SerializedName("unfollow_curator") UNFOLLOW_CURATOR("unfollow_curator"), + @SerializedName("unfollow_music_owner") + UNFOLLOW_MUSIC_OWNER("unfollow_music_owner"), + @SerializedName("reorder_items") REORDER_ITEMS("reorder_items"), @@ -153,6 +156,42 @@ enum class BaseLinkButtonActionType( @SerializedName("live_categories") LIVE_CATEGORIES("live_categories"), + @SerializedName("movie_categories") + MOVIE_CATEGORIES("movie_categories"), + @SerializedName("toggle_video_album_subscription") - TOGGLE_VIDEO_ALBUM_SUBSCRIPTION("toggle_video_album_subscription"); + TOGGLE_VIDEO_ALBUM_SUBSCRIPTION("toggle_video_album_subscription"), + + @SerializedName("clear_video_history") + CLEAR_VIDEO_HISTORY("clear_video_history"), + + @SerializedName("help_hint") + HELP_HINT("help_hint"), + + @SerializedName("show_recommendations_for_post") + SHOW_RECOMMENDATIONS_FOR_POST("show_recommendations_for_post"), + + @SerializedName("show_full_post") + SHOW_FULL_POST("show_full_post"), + + @SerializedName("open_vkapp") + OPEN_VKAPP("open_vkapp"), + + @SerializedName("open_game") + OPEN_GAME("open_game"), + + @SerializedName("open_internal_vkui") + OPEN_INTERNAL_VKUI("open_internal_vkui"), + + @SerializedName("specials_perform_action") + SPECIALS_PERFORM_ACTION("specials_perform_action"), + + @SerializedName("open_birthday_modal") + OPEN_BIRTHDAY_MODAL("open_birthday_modal"), + + @SerializedName("share") + SHARE("share"), + + @SerializedName("perform_action_with_url") + PERFORM_ACTION_WITH_URL("perform_action_with_url"); } diff --git a/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkChat.kt b/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkChat.kt new file mode 100644 index 0000000000..ea7a2ed085 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkChat.kt @@ -0,0 +1,66 @@ +/** + * 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.photos.dto.PhotosPhoto +import kotlin.Int +import kotlin.String + +/** + * @param title - Chat title + * @param inviteLink - Chat invite link + * @param type - Chat type + * @param membersCount - Count members in a chat + * @param photo + * @param description - Chat description + */ +data class BaseLinkChat( + @SerializedName("title") + val title: String, + @SerializedName("invite_link") + val inviteLink: String, + @SerializedName("type") + val type: BaseLinkChat.Type, + @SerializedName("members_count") + val membersCount: Int, + @SerializedName("photo") + val photo: PhotosPhoto? = null, + @SerializedName("description") + val description: String? = null +) { + enum class Type( + val value: Int + ) { + @SerializedName("0") + CHAT(0), + + @SerializedName("17") + GROUP(17); + } +} diff --git a/api/src/main/java/com/vk/sdk/api/board/BoardService.kt b/api/src/main/java/com/vk/sdk/api/board/BoardService.kt index f0060ac611..506803ba67 100644 --- a/api/src/main/java/com/vk/sdk/api/board/BoardService.kt +++ b/api/src/main/java/com/vk/sdk/api/board/BoardService.kt @@ -73,7 +73,7 @@ class BoardService { GsonHolder.gson.fromJson(it, Int::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) addParam("title", title) text?.let { addParam("text", it) } fromGroup?.let { addParam("from_group", it) } @@ -92,8 +92,8 @@ class BoardService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) + addParam("group_id", groupId, min = 0) + addParam("topic_id", topicId, min = 0) } /** @@ -124,12 +124,12 @@ class BoardService { GsonHolder.gson.fromJson(it, Int::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) + addParam("group_id", groupId, min = 1) + addParam("topic_id", topicId, min = 0) message?.let { addParam("message", it) } attachments?.let { addParam("attachments", it) } fromGroup?.let { addParam("from_group", it) } - stickerId?.let { addParam("sticker_id", it) } + stickerId?.let { addParam("sticker_id", it, min = 0) } guid?.let { addParam("guid", it) } } @@ -149,9 +149,9 @@ class BoardService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) - addParam("comment_id", commentId) + addParam("group_id", groupId, min = 1) + addParam("topic_id", topicId, min = 1) + addParam("comment_id", commentId, min = 1) } /** @@ -166,8 +166,8 @@ class BoardService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) + addParam("group_id", groupId, min = 1) + addParam("topic_id", topicId, min = 0) } /** @@ -194,9 +194,9 @@ class BoardService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) - addParam("comment_id", commentId) + addParam("group_id", groupId, min = 1) + addParam("topic_id", topicId, min = 0) + addParam("comment_id", commentId, min = 0) message?.let { addParam("message", it) } attachments?.let { addParam("attachments", it) } } @@ -217,8 +217,8 @@ class BoardService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) + addParam("group_id", groupId, min = 1) + addParam("topic_id", topicId, min = 0) addParam("title", title) } @@ -234,8 +234,8 @@ class BoardService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) + addParam("group_id", groupId, min = 0) + addParam("topic_id", topicId, min = 0) } /** @@ -264,12 +264,12 @@ class BoardService { GsonHolder.gson.fromJson(it, BoardGetCommentsResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) + addParam("group_id", groupId, min = 1) + addParam("topic_id", topicId, min = 0) needLikes?.let { addParam("need_likes", it) } - startCommentId?.let { addParam("start_comment_id", it) } + startCommentId?.let { addParam("start_comment_id", it, min = 0) } offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 100) } sort?.let { addParam("sort", it.value) } } @@ -299,12 +299,12 @@ class BoardService { GsonHolder.gson.fromJson(it, BoardGetCommentsExtendedResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) + addParam("group_id", groupId, min = 1) + addParam("topic_id", topicId, min = 0) needLikes?.let { addParam("need_likes", it) } - startCommentId?.let { addParam("start_comment_id", it) } + startCommentId?.let { addParam("start_comment_id", it, min = 0) } offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 100) } addParam("extended", true) sort?.let { addParam("sort", it.value) } } @@ -340,13 +340,13 @@ class BoardService { GsonHolder.gson.fromJson(it, BoardGetTopicsResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) topicIds?.let { addParam("topic_ids", it) } order?.let { addParam("order", it.value) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } preview?.let { addParam("preview", it.value) } - previewLength?.let { addParam("preview_length", it) } + previewLength?.let { addParam("preview_length", it, min = 0) } } /** @@ -380,14 +380,14 @@ class BoardService { GsonHolder.gson.fromJson(it, BoardGetTopicsExtendedResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) topicIds?.let { addParam("topic_ids", it) } order?.let { addParam("order", it.value) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } addParam("extended", true) preview?.let { addParam("preview", it.value) } - previewLength?.let { addParam("preview_length", it) } + previewLength?.let { addParam("preview_length", it, min = 0) } } /** @@ -402,8 +402,8 @@ class BoardService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) + addParam("group_id", groupId, min = 0) + addParam("topic_id", topicId, min = 0) } /** @@ -422,9 +422,9 @@ class BoardService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) - addParam("comment_id", commentId) + addParam("group_id", groupId, min = 1) + addParam("topic_id", topicId, min = 0) + addParam("comment_id", commentId, min = 0) } /** @@ -439,7 +439,7 @@ class BoardService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("topic_id", topicId) + addParam("group_id", groupId, min = 0) + addParam("topic_id", topicId, min = 0) } } diff --git a/api/src/main/java/com/vk/sdk/api/calls/dto/CallsParticipants.kt b/api/src/main/java/com/vk/sdk/api/calls/dto/CallsParticipants.kt index 3ebeb786ed..3c71a09b7b 100644 --- a/api/src/main/java/com/vk/sdk/api/calls/dto/CallsParticipants.kt +++ b/api/src/main/java/com/vk/sdk/api/calls/dto/CallsParticipants.kt @@ -29,6 +29,7 @@ package com.vk.sdk.api.calls.dto import com.google.gson.annotations.SerializedName import kotlin.Int +import kotlin.Long import kotlin.collections.List /** @@ -37,7 +38,7 @@ import kotlin.collections.List */ data class CallsParticipants( @SerializedName("list") - val list: List? = null, + val list: List? = null, @SerializedName("count") val count: Int? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsWorkiCarouselItem.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsWorkiCarouselItem.kt new file mode 100644 index 0000000000..7dcf063c53 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsWorkiCarouselItem.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.classifieds.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseLinkButton +import kotlin.Int +import kotlin.String + +/** + * @param id + * @param company + * @param profession + * @param salary + * @param distance + * @param categoryId + * @param actionButton - Button action + */ +data class ClassifiedsWorkiCarouselItem( + @SerializedName("id") + val id: String, + @SerializedName("company") + val company: String, + @SerializedName("profession") + val profession: String, + @SerializedName("salary") + val salary: String, + @SerializedName("distance") + val distance: String? = null, + @SerializedName("category_id") + val categoryId: Int? = null, + @SerializedName("action_button") + val actionButton: BaseLinkButton? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaCarouselBlockGroup.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaCarouselBlockGroup.kt index 5578d5d12b..ae7c278faf 100644 --- a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaCarouselBlockGroup.kt +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaCarouselBlockGroup.kt @@ -28,11 +28,11 @@ package com.vk.sdk.api.classifieds.dto import com.google.gson.annotations.SerializedName -import kotlin.Int +import com.vk.dto.common.id.UserId import kotlin.String /** - * @param id - Community id + * @param id - Community ID * @param name - Community name * @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 @@ -41,7 +41,7 @@ import kotlin.String */ data class ClassifiedsYoulaCarouselBlockGroup( @SerializedName("id") - val id: Int, + val id: UserId, @SerializedName("name") val name: String, @SerializedName("photo_50") diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlock.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlock.kt new file mode 100644 index 0000000000..000c4e719c --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlock.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.classifieds.dto + +import com.google.gson.annotations.SerializedName +import kotlin.collections.List + +/** + * @param items + */ +data class ClassifiedsYoulaGroupsBlock( + @SerializedName("items") + val items: List +) diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlockItem.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlockItem.kt new file mode 100644 index 0000000000..ca2c1e12e5 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlockItem.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.classifieds.dto + +import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId +import kotlin.Boolean +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +/** + * @param groupId - Group ID + * @param title - Item title + * @param subtitle - Item subtitle + * @param url - Community url + * @param products + * @param hasNew - Group has new products + * @param newCount - Count of new products + * @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 isSubscribed - Is user subscribed to group? + * @param lastPhotoText - Last photo overlay text + */ +data class ClassifiedsYoulaGroupsBlockItem( + @SerializedName("group_id") + val groupId: UserId, + @SerializedName("title") + val title: String, + @SerializedName("subtitle") + val subtitle: String, + @SerializedName("url") + val url: String, + @SerializedName("products") + val products: List, + @SerializedName("has_new") + val hasNew: Boolean, + @SerializedName("new_count") + val newCount: Int, + @SerializedName("photo_50") + val photo50: String, + @SerializedName("photo_100") + val photo100: String, + @SerializedName("photo_200") + val photo200: String, + @SerializedName("is_subscribed") + val isSubscribed: Boolean, + @SerializedName("last_photo_text") + val lastPhotoText: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlockProduct.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlockProduct.kt new file mode 100644 index 0000000000..69433cc714 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaGroupsBlockProduct.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.classifieds.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.photos.dto.PhotosPhoto +import kotlin.String + +/** + * @param id - Youla item id + * @param photo + */ +data class ClassifiedsYoulaGroupsBlockProduct( + @SerializedName("id") + val id: String, + @SerializedName("photo") + val photo: PhotosPhoto? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemActionButton.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemActionButton.kt new file mode 100644 index 0000000000..eacfb4e64d --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemActionButton.kt @@ -0,0 +1,85 @@ +/** + * 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.classifieds.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param type - Action button type + * @param url - Action url + */ +data class ClassifiedsYoulaItemActionButton( + @SerializedName("type") + val type: ClassifiedsYoulaItemActionButton.Type, + @SerializedName("url") + val url: String? = null +) { + enum class Type( + val value: String + ) { + @SerializedName("menu_edit") + MENU_EDIT("menu_edit"), + + @SerializedName("menu_support") + MENU_SUPPORT("menu_support"), + + @SerializedName("menu_delete") + MENU_DELETE("menu_delete"), + + @SerializedName("menu_share") + MENU_SHARE("menu_share"), + + @SerializedName("btn_main") + BTN_MAIN("btn_main"), + + @SerializedName("btn_create") + BTN_CREATE("btn_create"), + + @SerializedName("btn_delete") + BTN_DELETE("btn_delete"), + + @SerializedName("btn_support") + BTN_SUPPORT("btn_support"), + + @SerializedName("btn_edit") + BTN_EDIT("btn_edit"), + + @SerializedName("btn_republish") + BTN_REPUBLISH("btn_republish"), + + @SerializedName("btn_promotion") + BTN_PROMOTION("btn_promotion"), + + @SerializedName("btn_crossposting") + BTN_CROSSPOSTING("btn_crossposting"), + + @SerializedName("btn_stop_publish") + BTN_STOP_PUBLISH("btn_stop_publish"); + } +} diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemActionProperties.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemActionProperties.kt new file mode 100644 index 0000000000..cd49b6b49e --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemActionProperties.kt @@ -0,0 +1,60 @@ +/** + * 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.classifieds.dto + +import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId +import kotlin.Boolean +import kotlin.Int +import kotlin.String + +/** + * @param ownerId + * @param hash + * @param phoneEnabled - Phone calls enabled + * @param messageEnabled - Messaging enabled + * @param messageWallitemId - Wallitem id + * @param messageChatId - Chat id + * @param isIncomplete - Product is incomplete and should be completed by user + */ +data class ClassifiedsYoulaItemActionProperties( + @SerializedName("owner_id") + val ownerId: UserId, + @SerializedName("hash") + val hash: String, + @SerializedName("phone_enabled") + val phoneEnabled: Boolean, + @SerializedName("message_enabled") + val messageEnabled: Boolean, + @SerializedName("message_wallitem_id") + val messageWallitemId: String? = null, + @SerializedName("message_chat_id") + val messageChatId: Int? = null, + @SerializedName("is_incomplete") + val isIncomplete: Boolean? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemAttribute.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemAttribute.kt new file mode 100644 index 0000000000..a7a1b44f99 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemAttribute.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.classifieds.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param title - Attribute title + * @param slug - Attribute slug + * @param type - Attribute type + * @param value - Attribute value + */ +data class ClassifiedsYoulaItemAttribute( + @SerializedName("title") + val title: String, + @SerializedName("slug") + val slug: String, + @SerializedName("type") + val type: String, + @SerializedName("value") + val value: String +) diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemExtended.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemExtended.kt index a51dd10bf5..624015fbf3 100644 --- a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemExtended.kt +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemExtended.kt @@ -33,6 +33,7 @@ import com.vk.sdk.api.base.dto.BaseGeoCoordinates import com.vk.sdk.api.base.dto.BaseImage import com.vk.sdk.api.base.dto.BaseLinkButton import com.vk.sdk.api.base.dto.BaseLinkProductStatus +import com.vk.sdk.api.groups.dto.GroupsGroupFull import com.vk.sdk.api.market.dto.MarketPrice import com.vk.sdk.api.photos.dto.PhotosPhoto import kotlin.Boolean @@ -43,22 +44,44 @@ import kotlin.collections.List /** * @param internalOwnerId - Internal owner id * @param internalId - Internal id + * @param id - Youla item id + * @param ownerId - Youla item owner`s id + * @param price - Youla item price + * @param isOwner - If the current user is owner * @param description - Item description * @param geo + * @param locationText - Compiled item location text (for ex_ distance to item in kilometers) * @param distance - Distance to item location * @param city - Item city name * @param status + * @param blockMode - Classified blocking status * @param detailsUrl - Youla Item url for classifieds section block * @param actionUrl - Youla Item snippet url * @param photos - First 3 youla item photos * @param photoTotalCountDescription - How many photos are left in the original post * @param commercialProfileButton - Youla item author's profile - * @param id - Youla item id - * @param ownerId - Youla item owner`s id + * @param rootCategory - Youla item root category name + * @param category - Youla item category name + * @param subCategory - Youla item sub-category name + * @param publishedDate - Youla item published date + * @param group - Youla item group info + * @param attributes - Youla item attributes + * @param actionProperties - Youla item actions properties + * @param address - Youla item address + * @param radiusMeters - Item readius + * @param distanceText - Distance to classified + * @param statusInfo + * @param menuActions + * @param buttonActions + * @param isUserBlacklisted - User blacklisted flag + * @param favoriteCounter - Classified favorite counter + * @param views - Classified views + * @param blockTypeText - Decline reason text + * @param shareUrl - Classified share ur * @param author - Author * @param youlaOwnerName - Youla item owner`s name + * @param youlaUserId - Youla item owner`s id * @param title - Item title - * @param price - Youla item price * @param onClickOptions - On click options * @param isFavorite - Information whether the current item has been added to bookmarks * @param thumb @@ -66,19 +89,31 @@ import kotlin.collections.List */ data class ClassifiedsYoulaItemExtended( @SerializedName("internal_owner_id") - val internalOwnerId: Int? = null, + val internalOwnerId: Int, @SerializedName("internal_id") - val internalId: Int? = null, + val internalId: Int, + @SerializedName("id") + val id: String, + @SerializedName("owner_id") + val ownerId: UserId, + @SerializedName("price") + val price: MarketPrice, + @SerializedName("is_owner") + val isOwner: Boolean? = null, @SerializedName("description") val description: String? = null, @SerializedName("geo") val geo: BaseGeoCoordinates? = null, + @SerializedName("location_text") + val locationText: String? = null, @SerializedName("distance") val distance: Int? = null, @SerializedName("city") val city: String? = null, @SerializedName("status") val status: BaseLinkProductStatus? = null, + @SerializedName("block_mode") + val blockMode: ClassifiedsYoulaItemExtended.BlockMode? = null, @SerializedName("details_url") val detailsUrl: String? = null, @SerializedName("action_url") @@ -89,18 +124,50 @@ data class ClassifiedsYoulaItemExtended( val photoTotalCountDescription: String? = null, @SerializedName("commercial_profile_button") val commercialProfileButton: BaseLinkButton? = null, - @SerializedName("id") - val id: String? = null, - @SerializedName("owner_id") - val ownerId: UserId? = null, + @SerializedName("root_category") + val rootCategory: String? = null, + @SerializedName("category") + val category: String? = null, + @SerializedName("sub_category") + val subCategory: String? = null, + @SerializedName("published_date") + val publishedDate: Int? = null, + @SerializedName("group") + val group: GroupsGroupFull? = null, + @SerializedName("attributes") + val attributes: List? = null, + @SerializedName("action_properties") + val actionProperties: ClassifiedsYoulaItemActionProperties? = null, + @SerializedName("address") + val address: String? = null, + @SerializedName("radius_meters") + val radiusMeters: Int? = null, + @SerializedName("distance_text") + val distanceText: String? = null, + @SerializedName("status_info") + val statusInfo: ClassifiedsYoulaItemStatusInfo? = null, + @SerializedName("menu_actions") + val menuActions: List? = null, + @SerializedName("button_actions") + val buttonActions: List? = null, + @SerializedName("is_user_blacklisted") + val isUserBlacklisted: Boolean? = null, + @SerializedName("favorite_counter") + val favoriteCounter: Int? = null, + @SerializedName("views") + val views: Int? = null, + @SerializedName("block_type_text") + val blockTypeText: String? = null, + @SerializedName("share_url") + val shareUrl: String? = null, @SerializedName("author") val author: ClassifiedsYoulaItemVkAuthor? = null, @SerializedName("youla_owner_name") val youlaOwnerName: String? = null, + @SerializedName("youla_user_id") + val youlaUserId: String? = null, @SerializedName("title") val title: String? = null, - @SerializedName("price") - val price: MarketPrice? = null, @SerializedName("on_click_options") val onClickOptions: ClassifiedsYoulaItemOnClickOptions? = null, @SerializedName("is_favorite") @@ -109,4 +176,20 @@ data class ClassifiedsYoulaItemExtended( val thumb: List? = null, @SerializedName("photo") val photo: PhotosPhoto? = null -) +) { + enum class BlockMode( + val value: Int + ) { + @SerializedName("0") + NO_BLOCK(0), + + @SerializedName("1") + BLOCKED(1), + + @SerializedName("2") + REJECTED(2), + + @SerializedName("3") + VK_BLOCKED(3); + } +} diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemStatusInfo.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemStatusInfo.kt new file mode 100644 index 0000000000..d11b79040e --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemStatusInfo.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.classifieds.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param title - Status title + * @param description - Status description + */ +data class ClassifiedsYoulaItemStatusInfo( + @SerializedName("title") + val title: String, + @SerializedName("description") + val description: String +) diff --git a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemVkAuthor.kt b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemVkAuthor.kt index e639c3bc57..21c733391a 100644 --- a/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemVkAuthor.kt +++ b/api/src/main/java/com/vk/sdk/api/classifieds/dto/ClassifiedsYoulaItemVkAuthor.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.classifieds.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.String @@ -35,15 +36,21 @@ import kotlin.String * @param id - ID * @param name - Name * @param profileLink - Link to profile + * @param sellerProfileUrl - Link to seller profile in MiniApp * @param photoUrl - Photo + * @param activeItemsCount - Count of user active items */ data class ClassifiedsYoulaItemVkAuthor( @SerializedName("id") - val id: Int, + val id: UserId, @SerializedName("name") val name: String, @SerializedName("profile_link") val profileLink: String, + @SerializedName("seller_profile_url") + val sellerProfileUrl: String? = null, @SerializedName("photo_url") - val photoUrl: String? = null + val photoUrl: String? = null, + @SerializedName("active_items_count") + val activeItemsCount: Int? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/comment/dto/CommentThread.kt b/api/src/main/java/com/vk/sdk/api/comment/dto/CommentThread.kt index b039b5c374..d05f5b4d12 100644 --- a/api/src/main/java/com/vk/sdk/api/comment/dto/CommentThread.kt +++ b/api/src/main/java/com/vk/sdk/api/comment/dto/CommentThread.kt @@ -35,20 +35,20 @@ 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 + * @param canPost - Information whether current user can comment the post * @param showReplyButton - Information whether recommended to display reply button + * @param groupsCanPost - Information whether groups can comment the post */ data class CommentThread( @SerializedName("count") val count: Int, - @SerializedName("can_post") - val canPost: Boolean? = null, - @SerializedName("groups_can_post") - val groupsCanPost: Boolean? = null, @SerializedName("items") val items: List? = null, + @SerializedName("can_post") + val canPost: Boolean? = null, @SerializedName("show_reply_button") - val showReplyButton: Boolean? = null + val showReplyButton: Boolean? = null, + @SerializedName("groups_can_post") + val groupsCanPost: Boolean? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/database/DatabaseService.kt b/api/src/main/java/com/vk/sdk/api/database/DatabaseService.kt index 151f9f84a5..a816b77f92 100644 --- a/api/src/main/java/com/vk/sdk/api/database/DatabaseService.kt +++ b/api/src/main/java/com/vk/sdk/api/database/DatabaseService.kt @@ -32,7 +32,7 @@ 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.DatabaseCityById import com.vk.sdk.api.database.dto.DatabaseGetChairsResponse import com.vk.sdk.api.database.dto.DatabaseGetCitiesResponse import com.vk.sdk.api.database.dto.DatabaseGetCountriesResponse @@ -64,9 +64,9 @@ class DatabaseService { GsonHolder.gson.fromJson(it, DatabaseGetChairsResponse::class.java) } .apply { - addParam("faculty_id", facultyId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + addParam("faculty_id", facultyId, min = 0) + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 10000) } } /** @@ -92,12 +92,12 @@ class DatabaseService { GsonHolder.gson.fromJson(it, DatabaseGetCitiesResponse::class.java) } .apply { - addParam("country_id", countryId) - regionId?.let { addParam("region_id", it) } + addParam("country_id", countryId, min = 0) + regionId?.let { addParam("region_id", it, min = 0) } q?.let { addParam("q", it) } needAll?.let { addParam("need_all", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -106,10 +106,10 @@ class DatabaseService { * @param cityIds - City IDs. * @return [VKRequest] with [Unit] */ - fun databaseGetCitiesById(cityIds: List? = null): VKRequest> = + fun databaseGetCitiesById(cityIds: List? = null): VKRequest> = NewApiRequest("database.getCitiesById") { - val typeToken = object: TypeToken>() {}.type - GsonHolder.gson.fromJson>(it, typeToken) + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { cityIds?.let { addParam("city_ids", it) } @@ -136,8 +136,8 @@ class DatabaseService { .apply { needAll?.let { addParam("need_all", it) } code?.let { addParam("code", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -171,9 +171,9 @@ class DatabaseService { GsonHolder.gson.fromJson(it, DatabaseGetFacultiesResponse::class.java) } .apply { - addParam("university_id", universityId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + addParam("university_id", universityId, min = 0) + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 10000) } } /** @@ -192,9 +192,9 @@ class DatabaseService { GsonHolder.gson.fromJson(it, DatabaseGetMetroStationsResponse::class.java) } .apply { - addParam("city_id", cityId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + addParam("city_id", cityId, min = 0) + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 500) } } /** @@ -231,10 +231,10 @@ class DatabaseService { GsonHolder.gson.fromJson(it, DatabaseGetRegionsResponse::class.java) } .apply { - addParam("country_id", countryId) + addParam("country_id", countryId, min = 0) q?.let { addParam("q", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -249,7 +249,7 @@ class DatabaseService { GsonHolder.gson.fromJson>>(it, typeToken) } .apply { - countryId?.let { addParam("country_id", it) } + countryId?.let { addParam("country_id", it, min = 0) } } /** @@ -270,10 +270,10 @@ class DatabaseService { GsonHolder.gson.fromJson(it, DatabaseGetSchoolsResponse::class.java) } .apply { - addParam("city_id", cityId) + addParam("city_id", cityId, min = 0) q?.let { addParam("q", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 10000) } } /** @@ -297,9 +297,9 @@ class DatabaseService { } .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) } + countryId?.let { addParam("country_id", it, min = 0) } + cityId?.let { addParam("city_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 10000) } } } diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCity.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCity.kt index 1f1a0e1379..c3bb547376 100644 --- a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCity.kt +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCity.kt @@ -33,21 +33,21 @@ import kotlin.Int import kotlin.String /** + * @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("id") + val id: Int, + @SerializedName("title") + val title: String, @SerializedName("area") val area: String? = null, @SerializedName("region") val region: String? = null, @SerializedName("important") - val important: BaseBoolInt? = null, - @SerializedName("id") - val id: Int? = null, - @SerializedName("title") - val title: String? = null + val important: BaseBoolInt? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCityById.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCityById.kt new file mode 100644 index 0000000000..a6393dee18 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseCityById.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.String + +/** + * @param id - Object ID + * @param title - Object title + */ +data class DatabaseCityById( + @SerializedName("id") + val id: Int, + @SerializedName("title") + val title: String +) diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetChairsResponse.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetChairsResponse.kt index e23c3ddaf0..e4c0635158 100644 --- a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetChairsResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetChairsResponse.kt @@ -38,7 +38,7 @@ import kotlin.collections.List */ data class DatabaseGetChairsResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCitiesResponse.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCitiesResponse.kt index e1aa8839c1..a9dd5a52b9 100644 --- a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCitiesResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCitiesResponse.kt @@ -37,7 +37,7 @@ import kotlin.collections.List */ data class DatabaseGetCitiesResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCountriesResponse.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCountriesResponse.kt index ea86589fd6..bedce516b9 100644 --- a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCountriesResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetCountriesResponse.kt @@ -38,7 +38,7 @@ import kotlin.collections.List */ data class DatabaseGetCountriesResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetFacultiesResponse.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetFacultiesResponse.kt index 8d9c1f5698..994d4fe20b 100644 --- a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetFacultiesResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetFacultiesResponse.kt @@ -37,7 +37,7 @@ import kotlin.collections.List */ data class DatabaseGetFacultiesResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetMetroStationsResponse.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetMetroStationsResponse.kt index 11b021fee6..3ef048c230 100644 --- a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetMetroStationsResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetMetroStationsResponse.kt @@ -37,7 +37,7 @@ import kotlin.collections.List */ data class DatabaseGetMetroStationsResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetRegionsResponse.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetRegionsResponse.kt index 8db475d22b..0da220268c 100644 --- a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetRegionsResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetRegionsResponse.kt @@ -37,7 +37,7 @@ import kotlin.collections.List */ data class DatabaseGetRegionsResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetSchoolsResponse.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetSchoolsResponse.kt index fa0b5108c8..401e325613 100644 --- a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetSchoolsResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetSchoolsResponse.kt @@ -37,7 +37,7 @@ import kotlin.collections.List */ data class DatabaseGetSchoolsResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetUniversitiesResponse.kt b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetUniversitiesResponse.kt index fb07d1c9cd..42b8cc52ac 100644 --- a/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetUniversitiesResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/database/dto/DatabaseGetUniversitiesResponse.kt @@ -37,7 +37,7 @@ import kotlin.collections.List */ data class DatabaseGetUniversitiesResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/docs/DocsService.kt b/api/src/main/java/com/vk/sdk/api/docs/DocsService.kt index 56666991ba..667a30ad5d 100644 --- a/api/src/main/java/com/vk/sdk/api/docs/DocsService.kt +++ b/api/src/main/java/com/vk/sdk/api/docs/DocsService.kt @@ -66,7 +66,7 @@ class DocsService { } .apply { addParam("owner_id", ownerId) - addParam("doc_id", docId) + addParam("doc_id", docId, min = 0) accessKey?.let { addParam("access_key", it) } } @@ -84,7 +84,7 @@ class DocsService { } .apply { addParam("owner_id", ownerId) - addParam("doc_id", docId) + addParam("doc_id", docId, min = 0) } /** @@ -106,8 +106,8 @@ class DocsService { } .apply { addParam("owner_id", ownerId) - addParam("doc_id", docId) - addParam("title", title) + addParam("doc_id", docId, min = 0) + addParam("title", title, maxLength = 128) tags?.let { addParam("tags", it) } } @@ -132,8 +132,8 @@ class DocsService { GsonHolder.gson.fromJson(it, DocsGetResponse::class.java) } .apply { - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } type?.let { addParam("type", it.value) } ownerId?.let { addParam("owner_id", it) } returnTags?.let { addParam("return_tags", it) } @@ -199,7 +199,7 @@ class DocsService { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } .apply { - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -208,12 +208,12 @@ class DocsService { * @param groupId - Community ID (if the document will be uploaded to the community). * @return [VKRequest] with [BaseUploadServer] */ - fun docsGetWallUploadServer(groupId: Int? = null): VKRequest = + fun docsGetWallUploadServer(groupId: UserId? = null): VKRequest = NewApiRequest("docs.getWallUploadServer") { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } .apply { - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -261,10 +261,10 @@ class DocsService { GsonHolder.gson.fromJson(it, DocsSearchResponse::class.java) } .apply { - addParam("q", q) + addParam("q", q, maxLength = 512) searchOwn?.let { addParam("search_own", it) } - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } returnTags?.let { addParam("return_tags", it) } } } diff --git a/api/src/main/java/com/vk/sdk/api/donut/DonutService.kt b/api/src/main/java/com/vk/sdk/api/donut/DonutService.kt index 59312b8ca5..e3d4553b20 100644 --- a/api/src/main/java/com/vk/sdk/api/donut/DonutService.kt +++ b/api/src/main/java/com/vk/sdk/api/donut/DonutService.kt @@ -58,8 +58,8 @@ class DonutService { } .apply { addParam("owner_id", ownerId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } fields?.let { addParam("fields", it) } } @@ -95,8 +95,8 @@ class DonutService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } } /** diff --git a/api/src/main/java/com/vk/sdk/api/downloadedGames/DownloadedGamesService.kt b/api/src/main/java/com/vk/sdk/api/downloadedGames/DownloadedGamesService.kt index b4db9a35e2..47c549091f 100644 --- a/api/src/main/java/com/vk/sdk/api/downloadedGames/DownloadedGamesService.kt +++ b/api/src/main/java/com/vk/sdk/api/downloadedGames/DownloadedGamesService.kt @@ -44,6 +44,6 @@ class DownloadedGamesService { GsonHolder.gson.fromJson(it, DownloadedGamesPaidStatusResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } } } diff --git a/api/src/main/java/com/vk/sdk/api/fave/FaveService.kt b/api/src/main/java/com/vk/sdk/api/fave/FaveService.kt index e4a2e1ccea..fc96a80fba 100644 --- a/api/src/main/java/com/vk/sdk/api/fave/FaveService.kt +++ b/api/src/main/java/com/vk/sdk/api/fave/FaveService.kt @@ -84,8 +84,8 @@ class FaveService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } - groupId?.let { addParam("group_id", it) } + userId?.let { addParam("user_id", it, min = 0) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -136,7 +136,7 @@ class FaveService { GsonHolder.gson.fromJson(it, FaveTag::class.java) } .apply { - name?.let { addParam("name", it) } + name?.let { addParam("name", it, maxLength = 50) } position?.let { addParam("position", it.value) } } @@ -170,7 +170,7 @@ class FaveService { } .apply { addParam("id", id) - addParam("name", name) + addParam("name", name, maxLength = 50) } /** @@ -195,8 +195,8 @@ class FaveService { .apply { itemType?.let { addParam("item_type", it.value) } tagId?.let { addParam("tag_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 1, max = 100) } fields?.let { addParam("fields", it) } isFromSnackbar?.let { addParam("is_from_snackbar", it) } } @@ -224,8 +224,8 @@ class FaveService { 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) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 1, max = 100) } fields?.let { addParam("fields", it) } isFromSnackbar?.let { addParam("is_from_snackbar", it) } } @@ -248,8 +248,8 @@ class FaveService { GsonHolder.gson.fromJson(it, FaveGetPagesResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0, max = 10000) } + count?.let { addParam("count", it, min = 1, max = 500) } type?.let { addParam("type", it.value) } val fieldsJsonConverted = fields?.map { it.value @@ -283,7 +283,7 @@ class FaveService { } .apply { addParam("owner_id", ownerId) - addParam("article_id", articleId) + addParam("article_id", articleId, min = 0) } /** @@ -396,8 +396,8 @@ class FaveService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } - groupId?.let { addParam("group_id", it) } + userId?.let { addParam("user_id", it, min = 0) } + groupId?.let { addParam("group_id", it, min = 0) } tagIds?.let { addParam("tag_ids", it) } } @@ -412,7 +412,7 @@ class FaveService { */ fun faveSetTags( itemType: FaveSetTagsItemType? = null, - itemOwnerId: Int? = null, + itemOwnerId: UserId? = null, itemId: Int? = null, tagIds: List? = null, linkId: String? = null, @@ -439,7 +439,7 @@ class FaveService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } - groupId?.let { addParam("group_id", it) } + userId?.let { addParam("user_id", it, min = 0) } + groupId?.let { addParam("group_id", it, min = 0) } } } diff --git a/api/src/main/java/com/vk/sdk/api/friends/FriendsService.kt b/api/src/main/java/com/vk/sdk/api/friends/FriendsService.kt index d762661733..6a4e9c3b5b 100644 --- a/api/src/main/java/com/vk/sdk/api/friends/FriendsService.kt +++ b/api/src/main/java/com/vk/sdk/api/friends/FriendsService.kt @@ -74,7 +74,7 @@ class FriendsService { GsonHolder.gson.fromJson(it, FriendsAddResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } text?.let { addParam("text", it) } follow?.let { addParam("follow", it) } } @@ -86,8 +86,8 @@ class FriendsService { * @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") { + fun friendsAddList(name: String, userIds: List? = null): + VKRequest = NewApiRequest("friends.addList") { GsonHolder.gson.fromJson(it, FriendsAddListResponse::class.java) } .apply { @@ -104,7 +104,7 @@ class FriendsService { * 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): + fun friendsAreFriends(userIds: List, needSign: Boolean? = null): VKRequest> = NewApiRequest("friends.areFriends") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -123,7 +123,7 @@ class FriendsService { * 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): + fun friendsAreFriendsExtended(userIds: List, needSign: Boolean? = null): VKRequest> = NewApiRequest("friends.areFriends") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -146,7 +146,7 @@ class FriendsService { GsonHolder.gson.fromJson(it, FriendsDeleteResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } } /** @@ -170,7 +170,7 @@ class FriendsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("list_id", listId) + addParam("list_id", listId, min = 0, max = 24) } /** @@ -185,7 +185,7 @@ class FriendsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("user_id", userId) + addParam("user_id", userId, min = 1) listIds?.let { addParam("list_ids", it) } } @@ -204,14 +204,14 @@ class FriendsService { fun friendsEditList( listId: Int, name: String? = null, - userIds: List? = null, - addUserIds: List? = null, - deleteUserIds: List? = 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) + addParam("list_id", listId, min = 0) name?.let { addParam("name", it) } userIds?.let { addParam("user_ids", it) } addUserIds?.let { addParam("add_user_ids", it) } @@ -255,15 +255,15 @@ class FriendsService { .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) } + listId?.let { addParam("list_id", it, min = 0) } + count?.let { addParam("count", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } nameCase?.let { addParam("name_case", it.value) } - ref?.let { addParam("ref", it) } + ref?.let { addParam("ref", it, maxLength = 255) } } /** @@ -271,9 +271,9 @@ class FriendsService { * * @return [VKRequest] with [Unit] */ - fun friendsGetAppUsers(): VKRequest> = NewApiRequest("friends.getAppUsers") { - val typeToken = object: TypeToken>() {}.type - GsonHolder.gson.fromJson>(it, typeToken) + fun friendsGetAppUsers(): VKRequest> = NewApiRequest("friends.getAppUsers") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } /** @@ -312,7 +312,7 @@ class FriendsService { GsonHolder.gson.fromJson(it, FriendsGetListsResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } returnSystem?.let { addParam("return_system", it) } } @@ -331,23 +331,23 @@ class FriendsService { * @return [VKRequest] with [Unit] */ fun friendsGetMutual( - sourceUid: Int? = null, - targetUid: Int? = null, - targetUids: List? = null, + sourceUid: UserId? = null, + targetUid: UserId? = 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) + ): 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) } + sourceUid?.let { addParam("source_uid", it, min = 0) } + targetUid?.let { addParam("target_uid", it, min = 0) } targetUids?.let { addParam("target_uids", it) } order?.let { addParam("order", it) } - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } } /** @@ -369,17 +369,17 @@ class FriendsService { order: String? = null, count: Int? = null, offset: Int? = null - ): VKRequest> = NewApiRequest("friends.getOnline") { - val typeToken = object: TypeToken>() {}.type - GsonHolder.gson.fromJson>(it, typeToken) + ): 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) } + userId?.let { addParam("user_id", it, min = 0) } + listId?.let { addParam("list_id", it, min = 0) } onlineMobile?.let { addParam("online_mobile", it) } order?.let { addParam("order", it) } - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } } /** @@ -394,7 +394,7 @@ class FriendsService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -426,14 +426,14 @@ class FriendsService { GsonHolder.gson.fromJson(it, FriendsGetRequestsResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } 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) } + ref?.let { addParam("ref", it, maxLength = 255) } val fieldsJsonConverted = fields?.map { it.value } @@ -472,8 +472,8 @@ class FriendsService { it.value } filterJsonConverted?.let { addParam("filter", it) } - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0, max = 500) } + offset?.let { addParam("offset", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } @@ -497,7 +497,7 @@ class FriendsService { * @return [VKRequest] with [FriendsSearchResponse] */ fun friendsSearch( - userId: UserId, + userId: UserId? = null, q: String? = null, fields: List? = null, nameCase: FriendsSearchNameCase? = null, @@ -507,14 +507,14 @@ class FriendsService { GsonHolder.gson.fromJson(it, FriendsSearchResponse::class.java) } .apply { - addParam("user_id", userId) + userId?.let { addParam("user_id", it, min = 1) } 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) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } } diff --git a/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendExtendedStatus.kt b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendExtendedStatus.kt index 47e93fc295..4e3efb26e8 100644 --- a/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendExtendedStatus.kt +++ b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsFriendExtendedStatus.kt @@ -33,18 +33,18 @@ import kotlin.Boolean import kotlin.String /** - * @param isRequestUnread - Is friend request from other user unread * @param friendStatus - * @param sign - MD5 hash for the result validation * @param userId - User ID + * @param isRequestUnread - Is friend request from other user unread + * @param sign - MD5 hash for the result validation */ data class FriendsFriendExtendedStatus( + @SerializedName("friend_status") + val friendStatus: FriendsFriendStatusStatus, + @SerializedName("user_id") + val userId: UserId, @SerializedName("is_request_unread") val isRequestUnread: Boolean? = null, - @SerializedName("friend_status") - val friendStatus: FriendsFriendStatusStatus? = null, @SerializedName("sign") - val sign: String? = null, - @SerializedName("user_id") - val userId: UserId? = null + val sign: String? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsResponse.kt b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsResponse.kt index 33f0650db8..9afded64b0 100644 --- a/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsResponse.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.friends.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.collections.List @@ -40,7 +41,7 @@ data class FriendsGetRequestsResponse( @SerializedName("count") val count: Int? = null, @SerializedName("items") - val items: List? = null, + val items: List? = null, @SerializedName("count_unread") val countUnread: Int? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrPhone.kt b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrPhone.kt index abcc537d5e..6cc0dfc0af 100644 --- a/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrPhone.kt +++ b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsUserXtrPhone.kt @@ -59,6 +59,7 @@ import kotlin.String import kotlin.collections.List /** + * @param id - User ID * @param phone - User phone * @param firstNameNom - User's first name in nominative case * @param firstNameGen - User's first name in genitive case @@ -198,12 +199,13 @@ import kotlin.collections.List * @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("id") + val id: UserId, @SerializedName("phone") val phone: String? = null, @SerializedName("first_name_nom") @@ -480,8 +482,6 @@ data class FriendsUserXtrPhone( val firstName: String? = null, @SerializedName("hidden") val hidden: Int? = null, - @SerializedName("id") - val id: UserId? = null, @SerializedName("last_name") val lastName: String? = null, @SerializedName("can_access_closed") diff --git a/api/src/main/java/com/vk/sdk/api/gifts/GiftsService.kt b/api/src/main/java/com/vk/sdk/api/gifts/GiftsService.kt index 8f17d075d8..225d3b1f95 100644 --- a/api/src/main/java/com/vk/sdk/api/gifts/GiftsService.kt +++ b/api/src/main/java/com/vk/sdk/api/gifts/GiftsService.kt @@ -51,8 +51,8 @@ class GiftsService { GsonHolder.gson.fromJson(it, GiftsGetResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + userId?.let { addParam("user_id", it, min = 0) } + count?.let { addParam("count", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } } } diff --git a/api/src/main/java/com/vk/sdk/api/groups/GroupsService.kt b/api/src/main/java/com/vk/sdk/api/groups/GroupsService.kt index 5cde15296d..b9ab33e983 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/GroupsService.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/GroupsService.kt @@ -120,15 +120,15 @@ class GroupsService { 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) } + addParam("group_id", groupId, min = 1) + addParam("title", title, maxLength = 255) + addParam("address", address, maxLength = 255) + addParam("country_id", countryId, min = 1) + addParam("city_id", cityId, min = 1) + addParam("latitude", latitude, min = -90.0, max = 90.0) + addParam("longitude", longitude, min = -180.0, max = 180.0) + additionalAddress?.let { addParam("additional_address", it, maxLength = 400) } + metroId?.let { addParam("metro_id", it, min = 0) } phone?.let { addParam("phone", it) } workInfoStatus?.let { addParam("work_info_status", it.value) } timetable?.let { addParam("timetable", it) } @@ -151,10 +151,10 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsAddCallbackServerResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) addParam("url", url) - addParam("title", title) - secretKey?.let { addParam("secret_key", it) } + addParam("title", title, maxLength = 14) + secretKey?.let { addParam("secret_key", it, maxLength = 50) } } /** @@ -173,7 +173,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsLinksItem::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) addParam("link", link) text?.let { addParam("text", it) } } @@ -190,8 +190,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("user_id", userId) + addParam("group_id", groupId, min = 1) + addParam("user_id", userId, min = 1) } /** @@ -214,10 +214,10 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) ownerId?.let { addParam("owner_id", it) } - endDate?.let { addParam("end_date", it) } - reason?.let { addParam("reason", it) } + endDate?.let { addParam("end_date", it, min = 0) } + reason?.let { addParam("reason", it, min = 0) } comment?.let { addParam("comment", it) } commentVisible?.let { addParam("comment_visible", it) } } @@ -250,8 +250,8 @@ class GroupsService { addParam("title", title) description?.let { addParam("description", it) } type?.let { addParam("type", it.value) } - publicCategory?.let { addParam("public_category", it) } - publicSubcategory?.let { addParam("public_subcategory", it) } + publicCategory?.let { addParam("public_category", it, min = 0) } + publicSubcategory?.let { addParam("public_subcategory", it, min = 0) } subtype?.let { addParam("subtype", it.value) } } @@ -265,8 +265,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("address_id", addressId) + addParam("group_id", groupId, min = 1) + addParam("address_id", addressId, min = 0) } /** @@ -279,8 +279,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("server_id", serverId) + addParam("group_id", groupId, min = 1) + addParam("server_id", serverId, min = 0) } /** @@ -295,8 +295,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("link_id", linkId) + addParam("group_id", groupId, min = 1) + addParam("link_id", linkId, min = 0) } /** @@ -308,7 +308,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -441,33 +441,33 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) title?.let { addParam("title", it) } description?.let { addParam("description", it) } screenName?.let { addParam("screen_name", it) } - access?.let { addParam("access", it) } + access?.let { addParam("access", it, min = 0) } 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) } + eventStartDate?.let { addParam("event_start_date", it, min = 0) } + eventFinishDate?.let { addParam("event_finish_date", it, min = 0) } + eventGroupId?.let { addParam("event_group_id", it, min = 0) } + publicCategory?.let { addParam("public_category", it, min = 0) } + publicSubcategory?.let { addParam("public_subcategory", it, min = 0) } 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) } + wall?.let { addParam("wall", it, min = 0) } + topics?.let { addParam("topics", it, min = 0) } + photos?.let { addParam("photos", it, min = 0) } + video?.let { addParam("video", it, min = 0) } + audio?.let { addParam("audio", it, min = 0) } 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) } + docs?.let { addParam("docs", it, min = 0) } + wiki?.let { addParam("wiki", it, min = 0) } messages?.let { addParam("messages", it) } articles?.let { addParam("articles", it) } addresses?.let { addParam("addresses", it) } @@ -476,16 +476,16 @@ class GroupsService { 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) } + marketCurrency?.let { addParam("market_currency", it, min = 0) } + marketContact?.let { addParam("market_contact", it, min = 0) } + marketWiki?.let { addParam("market_wiki", it, min = 0) } 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) } + mainSection?.let { addParam("main_section", it, min = 0) } + secondarySection?.let { addParam("secondary_section", it, min = 0) } + country?.let { addParam("country", it, min = 0) } + city?.let { addParam("city", it, min = 0) } } /** @@ -524,16 +524,16 @@ class GroupsService { 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) } + addParam("group_id", groupId, min = 1) + addParam("address_id", addressId, min = 0) + title?.let { addParam("title", it, maxLength = 255) } + address?.let { addParam("address", it, maxLength = 255) } + additionalAddress?.let { addParam("additional_address", it, maxLength = 400) } + countryId?.let { addParam("country_id", it, min = 0) } + cityId?.let { addParam("city_id", it, min = 0) } + metroId?.let { addParam("metro_id", it, min = 0) } + latitude?.let { addParam("latitude", it, min = -90.0, max = 90.0) } + longitude?.let { addParam("longitude", it, min = -180.0, max = 180.0) } phone?.let { addParam("phone", it) } workInfoStatus?.let { addParam("work_info_status", it.value) } timetable?.let { addParam("timetable", it) } @@ -558,11 +558,11 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("server_id", serverId) + addParam("group_id", groupId, min = 1) + addParam("server_id", serverId, min = 0) addParam("url", url) - addParam("title", title) - secretKey?.let { addParam("secret_key", it) } + addParam("title", title, maxLength = 14) + secretKey?.let { addParam("secret_key", it, maxLength = 50) } } /** @@ -581,8 +581,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("link_id", linkId) + addParam("group_id", groupId, min = 1) + addParam("link_id", linkId, min = 0) text?.let { addParam("text", it) } } @@ -611,8 +611,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("user_id", userId) + addParam("group_id", groupId, min = 1) + addParam("user_id", userId, min = 1) role?.let { addParam("role", it) } isContact?.let { addParam("is_contact", it) } contactPosition?.let { addParam("contact_position", it) } @@ -629,7 +629,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -656,7 +656,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 1) } val filterJsonConverted = filter?.map { it.value } @@ -665,8 +665,8 @@ class GroupsService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -693,7 +693,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetObjectExtendedResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 1) } addParam("extended", true) val filterJsonConverted = filter?.map { it.value @@ -703,8 +703,8 @@ class GroupsService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -731,12 +731,12 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetAddressesResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) 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) } + latitude?.let { addParam("latitude", it, min = -90.0, max = 90.0) } + longitude?.let { addParam("longitude", it, min = -180.0, max = 180.0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } @@ -763,9 +763,9 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetBannedResponse::class.java) } .apply { - addParam("group_id", groupId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + addParam("group_id", groupId, min = 1) + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } val fieldsJsonConverted = fields?.map { it.value } @@ -782,8 +782,8 @@ class GroupsService { * @return [VKRequest] with [Unit] */ fun groupsGetById( - groupIds: List? = null, - groupId: String? = null, + groupIds: List? = null, + groupId: UserId? = null, fields: List? = null ): VKRequest> = NewApiRequest("groups.getById") { val typeToken = object: TypeToken>() {}.type @@ -810,7 +810,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetCallbackConfirmationCodeResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -824,7 +824,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetCallbackServersResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) serverIds?.let { addParam("server_ids", it) } } @@ -840,8 +840,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsCallbackSettings::class.java) } .apply { - addParam("group_id", groupId) - serverId?.let { addParam("server_id", it) } + addParam("group_id", groupId, min = 1) + serverId?.let { addParam("server_id", it, min = 0) } } /** @@ -858,8 +858,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetCatalogResponse::class.java) } .apply { - categoryId?.let { addParam("category_id", it) } - subcategoryId?.let { addParam("subcategory_id", it) } + categoryId?.let { addParam("category_id", it, min = 0) } + subcategoryId?.let { addParam("subcategory_id", it, min = 0, max = 99) } } /** @@ -918,9 +918,9 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetInvitedUsersResponse::class.java) } .apply { - addParam("group_id", groupId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + addParam("group_id", groupId, min = 1) + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } @@ -940,8 +940,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetInvitesResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } } /** @@ -956,15 +956,15 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetInvitesExtendedResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } addParam("extended", true) } /** * Returns the data needed to query a Long Poll server for events * - * @param groupId - Community ID + * @param groupId - Community ID. * @return [VKRequest] with [GroupsLongPollServer] */ fun groupsGetLongPollServer(groupId: UserId): VKRequest = @@ -972,7 +972,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsLongPollServer::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -986,7 +986,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsLongPollSettings::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -1020,8 +1020,8 @@ class GroupsService { .apply { groupId?.let { addParam("group_id", it) } sort?.let { addParam("sort", it.value) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } @@ -1037,7 +1037,7 @@ class GroupsService { NewApiRequest("groups.getOnlineStatus") { } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -1058,9 +1058,9 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetRequestsFieldsResponse::class.java) } .apply { - addParam("group_id", groupId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + addParam("group_id", groupId, min = 1) + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } val fieldsJsonConverted = fields?.map { it.value } @@ -1078,7 +1078,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, GroupsGetSettingsResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -1093,7 +1093,7 @@ class GroupsService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -1116,8 +1116,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("user_id", userId) + addParam("group_id", groupId, min = 1) + addParam("user_id", userId, min = 1) } /** @@ -1131,13 +1131,13 @@ class GroupsService { fun groupsIsMember( groupId: String, userId: UserId? = null, - userIds: List? = 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) } + userId?.let { addParam("user_id", it, min = 0) } userIds?.let { addParam("user_ids", it) } } @@ -1155,7 +1155,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 1) } notSure?.let { addParam("not_sure", it) } } @@ -1169,7 +1169,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -1184,8 +1184,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("user_id", userId) + addParam("group_id", groupId, min = 1) + addParam("user_id", userId, min = 1) } /** @@ -1204,9 +1204,9 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("link_id", linkId) - after?.let { addParam("after", it) } + addParam("group_id", groupId, min = 1) + addParam("link_id", linkId, min = 0) + after?.let { addParam("after", it, min = 0) } } /** @@ -1243,13 +1243,13 @@ class GroupsService { .apply { addParam("q", q) type?.let { addParam("type", it.value) } - countryId?.let { addParam("country_id", it) } - cityId?.let { addParam("city_id", it) } + countryId?.let { addParam("country_id", it, min = 0) } + cityId?.let { addParam("city_id", it, min = 0) } 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) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -1378,8 +1378,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - serverId?.let { addParam("server_id", it) } + addParam("group_id", groupId, min = 1) + serverId?.let { addParam("server_id", it, min = 0) } apiVersion?.let { addParam("api_version", it) } messageNew?.let { addParam("message_new", it) } messageReply?.let { addParam("message_reply", it) } @@ -1555,7 +1555,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) enabled?.let { addParam("enabled", it) } apiVersion?.let { addParam("api_version", it) } messageNew?.let { addParam("message_new", it) } @@ -1627,7 +1627,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) messages?.let { addParam("messages", it) } botsCapabilities?.let { addParam("bots_capabilities", it) } botsStartButton?.let { addParam("bots_start_button", it) } @@ -1650,9 +1650,9 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("group_id", groupId) - addParam("user_id", userId) - note?.let { addParam("note", it) } + addParam("group_id", groupId, min = 1) + addParam("user_id", userId, min = 1) + note?.let { addParam("note", it, maxLength = 96) } } /** @@ -1671,8 +1671,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("group_id", groupId) - addParam("tag_name", tagName) + addParam("group_id", groupId, min = 1) + addParam("tag_name", tagName, maxLength = 20) tagColor?.let { addParam("tag_color", it.value) } } @@ -1694,9 +1694,9 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("group_id", groupId) - addParam("tag_id", tagId) - addParam("user_id", userId) + addParam("group_id", groupId, min = 1) + addParam("tag_id", tagId, min = 0) + addParam("user_id", userId, min = 1, max = 2000000000) addParam("act", act.value) } @@ -1712,8 +1712,8 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("group_id", groupId) - addParam("tag_id", tagId) + addParam("group_id", groupId, min = 1) + addParam("tag_id", tagId, min = 0) } /** @@ -1732,9 +1732,9 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("group_id", groupId) - addParam("tag_id", tagId) - addParam("tag_name", tagName) + addParam("group_id", groupId, min = 1) + addParam("tag_id", tagId, min = 0) + addParam("tag_name", tagName, maxLength = 20) } /** @@ -1751,7 +1751,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) addParam("state", state.value) ref?.let { addParam("ref", it) } } @@ -1766,7 +1766,7 @@ class GroupsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) ownerId?.let { addParam("owner_id", it) } } } diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFields.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFields.kt index 67949ad2b5..a48a7a6c31 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFields.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsFields.kt @@ -279,6 +279,9 @@ enum class GroupsFields( @SerializedName("microlanding") MICROLANDING("microlanding"), + @SerializedName("tariffs") + TARIFFS("tariffs"), + @SerializedName("has_unseen_stories") HAS_UNSEEN_STORIES("has_unseen_stories"), @@ -300,6 +303,9 @@ enum class GroupsFields( @SerializedName("classifieds_antibaraholka_design_version") CLASSIFIEDS_ANTIBARAHOLKA_DESIGN_VERSION("classifieds_antibaraholka_design_version"), + @SerializedName("is_youla_posting_to_wall_allowed") + IS_YOULA_POSTING_TO_WALL_ALLOWED("is_youla_posting_to_wall_allowed"), + @SerializedName("worki_use_wallpost_redirect") WORKI_USE_WALLPOST_REDIRECT("worki_use_wallpost_redirect"), @@ -325,5 +331,8 @@ enum class GroupsFields( WORKI_ACTION_MENU_ITEM("worki_action_menu_item"), @SerializedName("youla_posting_method") - YOULA_POSTING_METHOD("youla_posting_method"); + YOULA_POSTING_METHOD("youla_posting_method"), + + @SerializedName("members_count_text") + MEMBERS_COUNT_TEXT("members_count_text"); } diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetResponse.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetResponse.kt index aea1a841e3..7e9acf5a1e 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetResponse.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.collections.List @@ -39,5 +40,5 @@ data class GroupsGetResponse( @SerializedName("count") val count: Int, @SerializedName("items") - val items: List + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetSettingsResponse.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetSettingsResponse.kt index 0dba24f4d7..2da961812d 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetSettingsResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetSettingsResponse.kt @@ -37,7 +37,9 @@ import kotlin.collections.List * @param audio - Audio settings * @param articles - Articles settings * @param cityId - City id of group + * @param cityName - City name of group * @param countryId - Country id of group + * @param countryName - Country name of group * @param description - Community description * @param docs - Docs settings * @param obsceneFilter - Information whether the obscene filter is enabled @@ -83,8 +85,12 @@ data class GroupsGetSettingsResponse( val articles: Int, @SerializedName("city_id") val cityId: Int, + @SerializedName("city_name") + val cityName: String, @SerializedName("country_id") val countryId: Int, + @SerializedName("country_name") + val countryName: String, @SerializedName("description") val description: String, @SerializedName("docs") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroup.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroup.kt index fb9882d303..a2bbe00f81 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroup.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroup.kt @@ -65,11 +65,11 @@ data class GroupsGroup( @SerializedName("id") val id: UserId, @SerializedName("name") - val name: String, + val name: String? = null, @SerializedName("screen_name") - val screenName: String, + val screenName: String? = null, @SerializedName("is_closed") - val isClosed: GroupsGroupIsClosed, + val isClosed: GroupsGroupIsClosed? = null, @SerializedName("type") val type: GroupsGroupType? = null, @SerializedName("is_admin") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFull.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFull.kt index e0838677ae..ccfee44a92 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFull.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFull.kt @@ -41,6 +41,7 @@ import kotlin.String import kotlin.collections.List /** + * @param id - Community ID * @param market * @param memberStatus - Current user's member status * @param isAdult - Information whether community is adult @@ -53,6 +54,7 @@ import kotlin.collections.List * @param description - Community description * @param wikiPage - Community's main wiki page title * @param membersCount - Community members number + * @param membersCountText - Info about number of users in group * @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 @@ -99,7 +101,6 @@ import kotlin.collections.List * @param liveCovers - Live covers state * @param storiesArchiveCount * @param hasUnseenStories - * @param id - Community ID * @param name - Community name * @param screenName - Domain of the community page * @param isClosed @@ -126,6 +127,8 @@ import kotlin.collections.List * @param videoLive */ data class GroupsGroupFull( + @SerializedName("id") + val id: UserId, @SerializedName("market") val market: GroupsMarketInfo? = null, @SerializedName("member_status") @@ -150,6 +153,8 @@ data class GroupsGroupFull( val wikiPage: String? = null, @SerializedName("members_count") val membersCount: Int? = null, + @SerializedName("members_count_text") + val membersCountText: String? = null, @SerializedName("requests_count") val requestsCount: Int? = null, @SerializedName("video_live_level") @@ -238,8 +243,6 @@ data class GroupsGroupFull( val storiesArchiveCount: Int? = null, @SerializedName("has_unseen_stories") val hasUnseenStories: Boolean? = null, - @SerializedName("id") - val id: UserId? = null, @SerializedName("name") val name: String? = null, @SerializedName("screen_name") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullSection.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullSection.kt index 71d1a94ccc..9b9c9fb284 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullSection.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupFullSection.kt @@ -34,7 +34,7 @@ enum class GroupsGroupFullSection( val value: Int ) { @SerializedName("0") - ABSENT(0), + NONE(0), @SerializedName("1") PHOTOS(1), @@ -43,26 +43,128 @@ enum class GroupsGroupFullSection( TOPICS(2), @SerializedName("3") - AUDIO(3), + AUDIOS(3), @SerializedName("4") - VIDEO(4), + VIDEOS(4), @SerializedName("5") MARKET(5), + @SerializedName("6") + STORIES(6), + + @SerializedName("7") + APPS(7), + + @SerializedName("8") + FOLLOWERS(8), + + @SerializedName("9") + LINKS(9), + @SerializedName("10") EVENTS(10), + @SerializedName("11") + PLACES(11), + + @SerializedName("12") + CONTACTS(12), + + @SerializedName("13") + APP_BTNS(13), + + @SerializedName("14") + DOCS(14), + + @SerializedName("15") + EVENT_COUNTERS(15), + + @SerializedName("16") + GROUP_MESSAGES(16), + + @SerializedName("24") + ALBUMS(24), + + @SerializedName("26") + CATEGORIES(26), + + @SerializedName("27") + ADMIN_HELP(27), + + @SerializedName("31") + APP_WIDGET(31), + + @SerializedName("32") + PUBLIC_HELP(32), + + @SerializedName("33") + HS_DONATION_APP(33), + + @SerializedName("34") + HS_MARKET_APP(34), + @SerializedName("35") ADDRESSES(35), + @SerializedName("36") + ARTIST_PAGE(36), + + @SerializedName("37") + PODCAST(37), + @SerializedName("39") ARTICLES(39), + @SerializedName("40") + ADMIN_TIPS(40), + + @SerializedName("41") + MENU(41), + + @SerializedName("42") + FIXED_POST(42), + @SerializedName("43") CHATS(43), + @SerializedName("44") + EVERGREEN_NOTICE(44), + + @SerializedName("45") + MUSICIANS(45), + + @SerializedName("46") + NARRATIVES(46), + + @SerializedName("47") + DONUT_DONATE(47), + + @SerializedName("48") + CLIPS(48), + + @SerializedName("49") + MARKET_CART(49), + + @SerializedName("50") + CURATORS(50), + @SerializedName("51") - MARKET_SERVICES(51); + MARKET_SERVICES(51), + + @SerializedName("53") + CLASSIFIEDS(53), + + @SerializedName("54") + TEXTLIVES(54), + + @SerializedName("55") + DONUT_FOR_DONS(55), + + @SerializedName("57") + BADGES(57), + + @SerializedName("58") + CHATS_CREATION(58); } diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupsArray.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupsArray.kt index 49c61bce71..2a9e55b759 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupsArray.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupsArray.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.collections.List @@ -39,5 +40,5 @@ data class GroupsGroupsArray( @SerializedName("count") val count: Int, @SerializedName("items") - val items: List + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsUserXtrRole.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsUserXtrRole.kt index 7d32477167..e94f4a7516 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsUserXtrRole.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsUserXtrRole.kt @@ -61,6 +61,7 @@ import kotlin.String import kotlin.collections.List /** + * @param id - User ID * @param role * @param firstNameNom - User's first name in nominative case * @param firstNameGen - User's first name in genitive case @@ -200,12 +201,13 @@ import kotlin.collections.List * @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("id") + val id: UserId, @SerializedName("role") val role: GroupsRoleOptions? = null, @SerializedName("first_name_nom") @@ -482,8 +484,6 @@ data class GroupsUserXtrRole( val firstName: String? = null, @SerializedName("hidden") val hidden: Int? = null, - @SerializedName("id") - val id: UserId? = null, @SerializedName("last_name") val lastName: String? = null, @SerializedName("can_access_closed") diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/LeadFormsService.kt b/api/src/main/java/com/vk/sdk/api/leadForms/LeadFormsService.kt index 2e585e4ba0..3cda794734 100644 --- a/api/src/main/java/com/vk/sdk/api/leadForms/LeadFormsService.kt +++ b/api/src/main/java/com/vk/sdk/api/leadForms/LeadFormsService.kt @@ -27,12 +27,17 @@ // ********************************************************************* package com.vk.sdk.api.leadForms +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.leadForms.dto.LeadFormsCreateResponse +import com.vk.sdk.api.leadForms.dto.LeadFormsDeleteResponse +import com.vk.sdk.api.leadForms.dto.LeadFormsForm +import com.vk.sdk.api.leadForms.dto.LeadFormsGetLeadsResponse import kotlin.Boolean import kotlin.Int import kotlin.String -import kotlin.Unit import kotlin.collections.List class LeadFormsService { @@ -51,7 +56,7 @@ class LeadFormsService { * @param pixelCode * @param notifyAdmins * @param notifyEmails - * @return [VKRequest] with [Unit] + * @return [VKRequest] with [LeadFormsCreateResponse] */ fun leadFormsCreate( groupId: Int, @@ -68,18 +73,19 @@ class LeadFormsService { pixelCode: String? = null, notifyAdmins: List? = null, notifyEmails: List? = null - ): VKRequest = NewApiRequest("leadForms.create") { + ): VKRequest = NewApiRequest("leadForms.create") { + GsonHolder.gson.fromJson(it, LeadFormsCreateResponse::class.java) } .apply { addParam("group_id", groupId) - addParam("name", name) - addParam("title", title) - addParam("description", description) + addParam("name", name, maxLength = 100) + addParam("title", title, maxLength = 60) + addParam("description", description, maxLength = 600) addParam("questions", questions) - addParam("policy_link_url", policyLinkUrl) + addParam("policy_link_url", policyLinkUrl, maxLength = 200) photo?.let { addParam("photo", it) } - confirmation?.let { addParam("confirmation", it) } - siteLinkUrl?.let { addParam("site_link_url", it) } + confirmation?.let { addParam("confirmation", it, maxLength = 300) } + siteLinkUrl?.let { addParam("site_link_url", it, maxLength = 200) } active?.let { addParam("active", it) } oncePerUser?.let { addParam("once_per_user", it) } pixelCode?.let { addParam("pixel_code", it) } @@ -90,10 +96,11 @@ class LeadFormsService { /** * @param groupId * @param formId - * @return [VKRequest] with [Unit] + * @return [VKRequest] with [LeadFormsDeleteResponse] */ - fun leadFormsDelete(groupId: Int, formId: Int): VKRequest = + fun leadFormsDelete(groupId: Int, formId: Int): VKRequest = NewApiRequest("leadForms.delete") { + GsonHolder.gson.fromJson(it, LeadFormsDeleteResponse::class.java) } .apply { addParam("group_id", groupId) @@ -103,9 +110,11 @@ class LeadFormsService { /** * @param groupId * @param formId - * @return [VKRequest] with [Unit] + * @return [VKRequest] with [LeadFormsForm] */ - fun leadFormsGet(groupId: Int, formId: Int): VKRequest = NewApiRequest("leadForms.get") { + fun leadFormsGet(groupId: Int, formId: Int): VKRequest = + NewApiRequest("leadForms.get") { + GsonHolder.gson.fromJson(it, LeadFormsForm::class.java) } .apply { addParam("group_id", groupId) @@ -117,33 +126,38 @@ class LeadFormsService { * @param formId * @param limit * @param nextPageToken - * @return [VKRequest] with [Unit] + * @return [VKRequest] with [LeadFormsGetLeadsResponse] */ fun leadFormsGetLeads( groupId: Int, formId: Int, limit: Int? = null, nextPageToken: String? = null - ): VKRequest = NewApiRequest("leadForms.getLeads") { + ): VKRequest = NewApiRequest("leadForms.getLeads") { + GsonHolder.gson.fromJson(it, LeadFormsGetLeadsResponse::class.java) } .apply { addParam("group_id", groupId) addParam("form_id", formId) - limit?.let { addParam("limit", it) } + limit?.let { addParam("limit", it, min = 1, max = 1000) } nextPageToken?.let { addParam("next_page_token", it) } } /** - * @return [VKRequest] with [Unit] + * @return [VKRequest] with [String] */ - fun leadFormsGetUploadURL(): VKRequest = NewApiRequest("leadForms.getUploadURL") { + fun leadFormsGetUploadURL(): VKRequest = NewApiRequest("leadForms.getUploadURL") { + GsonHolder.gson.fromJson(it, String::class.java) } /** * @param groupId * @return [VKRequest] with [Unit] */ - fun leadFormsList(groupId: Int): VKRequest = NewApiRequest("leadForms.list") { + fun leadFormsList(groupId: Int): VKRequest> = + NewApiRequest("leadForms.list") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("group_id", groupId) @@ -165,7 +179,7 @@ class LeadFormsService { * @param pixelCode * @param notifyAdmins * @param notifyEmails - * @return [VKRequest] with [Unit] + * @return [VKRequest] with [LeadFormsCreateResponse] */ fun leadFormsUpdate( groupId: Int, @@ -183,19 +197,20 @@ class LeadFormsService { pixelCode: String? = null, notifyAdmins: List? = null, notifyEmails: List? = null - ): VKRequest = NewApiRequest("leadForms.update") { + ): VKRequest = NewApiRequest("leadForms.update") { + GsonHolder.gson.fromJson(it, LeadFormsCreateResponse::class.java) } .apply { addParam("group_id", groupId) addParam("form_id", formId) - addParam("name", name) - addParam("title", title) - addParam("description", description) + addParam("name", name, maxLength = 100) + addParam("title", title, maxLength = 60) + addParam("description", description, maxLength = 600) addParam("questions", questions) - addParam("policy_link_url", policyLinkUrl) + addParam("policy_link_url", policyLinkUrl, maxLength = 200) photo?.let { addParam("photo", it) } - confirmation?.let { addParam("confirmation", it) } - siteLinkUrl?.let { addParam("site_link_url", it) } + confirmation?.let { addParam("confirmation", it, maxLength = 300) } + siteLinkUrl?.let { addParam("site_link_url", it, maxLength = 200) } active?.let { addParam("active", it) } oncePerUser?.let { addParam("once_per_user", it) } pixelCode?.let { addParam("pixel_code", it) } diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsAnswer.kt b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsAnswer.kt new file mode 100644 index 0000000000..3d1abb5ffb --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsAnswer.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.leadForms.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param key + * @param answer + */ +data class LeadFormsAnswer( + @SerializedName("key") + val key: String, + @SerializedName("answer") + val answer: LeadFormsAnswerItem +) diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsAnswerItem.kt b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsAnswerItem.kt new file mode 100644 index 0000000000..2832445d33 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsAnswerItem.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.leadForms.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param value + * @param key + */ +data class LeadFormsAnswerItem( + @SerializedName("value") + val value: String, + @SerializedName("key") + val key: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsCreateResponse.kt b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsCreateResponse.kt new file mode 100644 index 0000000000..1462000b9e --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsCreateResponse.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.leadForms.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param formId + * @param url + */ +data class LeadFormsCreateResponse( + @SerializedName("form_id") + val formId: Int, + @SerializedName("url") + val url: String +) diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsDeleteResponse.kt b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsDeleteResponse.kt new file mode 100644 index 0000000000..7c4fbe0410 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsDeleteResponse.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.leadForms.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +/** + * @param formId + */ +data class LeadFormsDeleteResponse( + @SerializedName("form_id") + val formId: Int +) diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsForm.kt b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsForm.kt new file mode 100644 index 0000000000..dbf763001d --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsForm.kt @@ -0,0 +1,91 @@ +/** + * 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.dto + +import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId +import com.vk.sdk.api.base.dto.BaseBoolInt +import kotlin.Int +import kotlin.String +import kotlin.collections.List + +/** + * @param formId + * @param groupId + * @param leadsCount + * @param url + * @param photo + * @param name + * @param title + * @param description + * @param confirmation + * @param siteLinkUrl + * @param policyLinkUrl + * @param questions + * @param active + * @param pixelCode + * @param oncePerUser + * @param notifyAdmins + * @param notifyEmails + */ +data class LeadFormsForm( + @SerializedName("form_id") + val formId: Int, + @SerializedName("group_id") + val groupId: UserId, + @SerializedName("leads_count") + val leadsCount: Int, + @SerializedName("url") + val url: String, + @SerializedName("photo") + val photo: String? = null, + @SerializedName("name") + val name: String? = null, + @SerializedName("title") + val title: String? = null, + @SerializedName("description") + val description: String? = null, + @SerializedName("confirmation") + val confirmation: String? = null, + @SerializedName("site_link_url") + val siteLinkUrl: String? = null, + @SerializedName("policy_link_url") + val policyLinkUrl: String? = null, + @SerializedName("questions") + val questions: List? = null, + @SerializedName("active") + val active: BaseBoolInt? = null, + @SerializedName("pixel_code") + val pixelCode: String? = null, + @SerializedName("once_per_user") + val oncePerUser: Int? = null, + @SerializedName("notify_admins") + val notifyAdmins: String? = null, + @SerializedName("notify_emails") + val notifyEmails: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsGetLeadsResponse.kt b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsGetLeadsResponse.kt new file mode 100644 index 0000000000..4ce066af00 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsGetLeadsResponse.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.leadForms.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String +import kotlin.collections.List + +/** + * @param leads + * @param nextPageToken + */ +data class LeadFormsGetLeadsResponse( + @SerializedName("leads") + val leads: List, + @SerializedName("next_page_token") + val nextPageToken: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsLead.kt b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsLead.kt new file mode 100644 index 0000000000..453dccaff9 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsLead.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.leadForms.dto + +import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId +import kotlin.Int +import kotlin.collections.List + +/** + * @param leadId + * @param userId + * @param date + * @param answers + * @param adId + */ +data class LeadFormsLead( + @SerializedName("lead_id") + val leadId: Int, + @SerializedName("user_id") + val userId: UserId, + @SerializedName("date") + val date: Int, + @SerializedName("answers") + val answers: List, + @SerializedName("ad_id") + val adId: Int? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsQuestionItem.kt b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsQuestionItem.kt new file mode 100644 index 0000000000..a74c17585b --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsQuestionItem.kt @@ -0,0 +1,68 @@ +/** + * 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.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String +import kotlin.collections.List + +/** + * @param key + * @param type + * @param label + * @param options - ----- ------ --- ----- radio, checkbox, select + */ +data class LeadFormsQuestionItem( + @SerializedName("key") + val key: String, + @SerializedName("type") + val type: LeadFormsQuestionItem.Type, + @SerializedName("label") + val label: String? = null, + @SerializedName("options") + val options: List? = null +) { + enum class Type( + val value: String + ) { + @SerializedName("input") + INPUT("input"), + + @SerializedName("textarea") + TEXTAREA("textarea"), + + @SerializedName("radio") + RADIO("radio"), + + @SerializedName("checkbox") + CHECKBOX("checkbox"), + + @SerializedName("select") + SELECT("select"); + } +} diff --git a/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsQuestionItemOption.kt b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsQuestionItemOption.kt new file mode 100644 index 0000000000..83dc62997d --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/leadForms/dto/LeadFormsQuestionItemOption.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.leadForms.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +/** + * @param label + * @param key + */ +data class LeadFormsQuestionItemOption( + @SerializedName("label") + val label: String, + @SerializedName("key") + val key: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/likes/LikesService.kt b/api/src/main/java/com/vk/sdk/api/likes/LikesService.kt index 5dd9e5c0a2..91cf540dc0 100644 --- a/api/src/main/java/com/vk/sdk/api/likes/LikesService.kt +++ b/api/src/main/java/com/vk/sdk/api/likes/LikesService.kt @@ -67,7 +67,7 @@ class LikesService { } .apply { addParam("type", type) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) ownerId?.let { addParam("owner_id", it) } accessKey?.let { addParam("access_key", it) } } @@ -94,7 +94,7 @@ class LikesService { } .apply { addParam("type", type) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) ownerId?.let { addParam("owner_id", it) } accessKey?.let { addParam("access_key", it) } } @@ -146,8 +146,8 @@ class LikesService { 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) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } skipOwn?.let { addParam("skip_own", it) } } @@ -199,8 +199,8 @@ class LikesService { 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) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } skipOwn?.let { addParam("skip_own", it) } } @@ -226,8 +226,8 @@ class LikesService { } .apply { addParam("type", type) - addParam("item_id", itemId) - userId?.let { addParam("user_id", it) } + addParam("item_id", itemId, min = 0) + userId?.let { addParam("user_id", it, min = 0) } ownerId?.let { addParam("owner_id", it) } } } diff --git a/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListResponse.kt b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListResponse.kt index 5e6c810e1b..bcea0771a2 100644 --- a/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListResponse.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.likes.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.collections.List @@ -39,5 +40,5 @@ data class LikesGetListResponse( @SerializedName("count") val count: Int, @SerializedName("items") - val items: List + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/market/MarketService.kt b/api/src/main/java/com/vk/sdk/api/market/MarketService.kt index 9e772840e0..0b436f4d12 100644 --- a/api/src/main/java/com/vk/sdk/api/market/MarketService.kt +++ b/api/src/main/java/com/vk/sdk/api/market/MarketService.kt @@ -55,11 +55,11 @@ import com.vk.sdk.api.market.dto.MarketReportReason import com.vk.sdk.api.market.dto.MarketSearchExtendedResponse import com.vk.sdk.api.market.dto.MarketSearchExtendedRev import com.vk.sdk.api.market.dto.MarketSearchExtendedSort -import com.vk.sdk.api.market.dto.MarketSearchExtendedStatus +import com.vk.sdk.api.market.dto.MarketSearchItemsSortBy +import com.vk.sdk.api.market.dto.MarketSearchItemsSortDirection import com.vk.sdk.api.market.dto.MarketSearchResponse import com.vk.sdk.api.market.dto.MarketSearchRev import com.vk.sdk.api.market.dto.MarketSearchSort -import com.vk.sdk.api.market.dto.MarketSearchStatus import com.vk.sdk.api.users.dto.UsersFields import kotlin.Boolean import kotlin.Float @@ -109,20 +109,20 @@ class MarketService { } .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) } + addParam("name", name, minLength = 4, maxLength = 100) + addParam("description", description, minLength = 10) + addParam("category_id", categoryId, min = 0) + price?.let { addParam("price", it, min = 0.0) } + oldPrice?.let { addParam("old_price", it, min = 0.01) } deleted?.let { addParam("deleted", it) } - mainPhotoId?.let { addParam("main_photo_id", it) } + mainPhotoId?.let { addParam("main_photo_id", it, min = 0) } 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) } + url?.let { addParam("url", it, minLength = 0, maxLength = 320) } + dimensionWidth?.let { addParam("dimension_width", it, min = 0, max = 100000) } + dimensionHeight?.let { addParam("dimension_height", it, min = 0, max = 100000) } + dimensionLength?.let { addParam("dimension_length", it, min = 0, max = 100000) } + weight?.let { addParam("weight", it, min = 0, max = 100000000) } + sku?.let { addParam("sku", it, maxLength = 50) } } /** @@ -146,8 +146,8 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("title", title) - photoId?.let { addParam("photo_id", it) } + addParam("title", title, maxLength = 128) + photoId?.let { addParam("photo_id", it, min = 0) } mainAlbum?.let { addParam("main_album", it) } isHidden?.let { addParam("is_hidden", it) } } @@ -205,12 +205,12 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) 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) } + replyToComment?.let { addParam("reply_to_comment", it, min = 0) } + stickerId?.let { addParam("sticker_id", it, min = 0) } guid?.let { addParam("guid", it) } } @@ -227,7 +227,7 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) } /** @@ -243,7 +243,7 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("album_id", albumId) + addParam("album_id", albumId, min = 0) } /** @@ -261,7 +261,7 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) } /** @@ -280,7 +280,7 @@ class MarketService { * @return [VKRequest] with [BaseOkResponse] */ fun marketEdit( - ownerId: Int, + ownerId: UserId, itemId: Int, name: String, description: String, @@ -295,15 +295,15 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("item_id", itemId) - addParam("name", name) - addParam("description", description) - addParam("category_id", categoryId) - price?.let { addParam("price", it) } + addParam("item_id", itemId, min = 0) + addParam("name", name, minLength = 4, maxLength = 100) + addParam("description", description, minLength = 10) + addParam("category_id", categoryId, min = 0) + price?.let { addParam("price", it, min = 0.0) } deleted?.let { addParam("deleted", it) } - mainPhotoId?.let { addParam("main_photo_id", it) } + mainPhotoId?.let { addParam("main_photo_id", it, min = 0) } photoIds?.let { addParam("photo_ids", it) } - url?.let { addParam("url", it) } + url?.let { addParam("url", it, minLength = 0, maxLength = 320) } } /** @@ -329,9 +329,9 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("album_id", albumId) - addParam("title", title) - photoId?.let { addParam("photo_id", it) } + addParam("album_id", albumId, min = 0) + addParam("title", title, maxLength = 128) + photoId?.let { addParam("photo_id", it, min = 0) } mainAlbum?.let { addParam("main_album", it) } isHidden?.let { addParam("is_hidden", it) } } @@ -360,7 +360,7 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) message?.let { addParam("message", it) } attachments?.let { addParam("attachments", it) } } @@ -397,17 +397,17 @@ class MarketService { 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) } + addParam("user_id", userId, min = 1) + addParam("order_id", orderId, min = 0) + merchantComment?.let { addParam("merchant_comment", it, maxLength = 800) } + status?.let { addParam("status", it, min = 0) } + trackNumber?.let { addParam("track_number", it, maxLength = 60) } 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) } + deliveryPrice?.let { addParam("delivery_price", it, min = 0) } + width?.let { addParam("width", it, min = 0, max = 100000) } + length?.let { addParam("length", it, min = 0, max = 100000) } + height?.let { addParam("height", it, min = 0, max = 100000) } + weight?.let { addParam("weight", it, min = 0, max = 100000000) } } /** @@ -422,27 +422,30 @@ class MarketService { * @param dateFrom - Items update date from (format_ yyyy-mm-dd) * @param dateTo - Items update date to (format_ yyyy-mm-dd) * @param needVariants - Add variants to response if exist + * @param withDisabled - Add disabled items to response * @return [VKRequest] with [MarketGetResponse] */ fun marketGet( - ownerId: Int, + ownerId: UserId, albumId: Int? = null, count: Int? = null, offset: Int? = null, dateFrom: String? = null, dateTo: String? = null, - needVariants: Boolean? = null + needVariants: Boolean? = null, + withDisabled: Boolean? = 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) } + albumId?.let { addParam("album_id", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } + offset?.let { addParam("offset", it, min = 0) } dateFrom?.let { addParam("date_from", it) } dateTo?.let { addParam("date_to", it) } needVariants?.let { addParam("need_variants", it) } + withDisabled?.let { addParam("with_disabled", it) } } /** @@ -457,28 +460,31 @@ class MarketService { * @param dateFrom - Items update date from (format_ yyyy-mm-dd) * @param dateTo - Items update date to (format_ yyyy-mm-dd) * @param needVariants - Add variants to response if exist + * @param withDisabled - Add disabled items to response * @return [VKRequest] with [MarketGetExtendedResponse] */ fun marketGetExtended( - ownerId: Int, + ownerId: UserId, albumId: Int? = null, count: Int? = null, offset: Int? = null, dateFrom: String? = null, dateTo: String? = null, - needVariants: Boolean? = null + needVariants: Boolean? = null, + withDisabled: Boolean? = 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) } + albumId?.let { addParam("album_id", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } + offset?.let { addParam("offset", it, min = 0) } addParam("extended", true) dateFrom?.let { addParam("date_from", it) } dateTo?.let { addParam("date_to", it) } needVariants?.let { addParam("need_variants", it) } + withDisabled?.let { addParam("with_disabled", it) } } /** @@ -516,8 +522,8 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } } /** @@ -565,8 +571,8 @@ class MarketService { GsonHolder.gson.fromJson(it, MarketGetCategoriesResponse::class.java) } .apply { - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0, max = 1000) } + offset?.let { addParam("offset", it, min = 0) } } /** @@ -597,11 +603,11 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) needLikes?.let { addParam("need_likes", it) } - startCommentId?.let { addParam("start_comment_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + startCommentId?.let { addParam("start_comment_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } sort?.let { addParam("sort", it.value) } val fieldsJsonConverted = fields?.map { it.value @@ -625,9 +631,9 @@ class MarketService { GsonHolder.gson.fromJson(it, MarketGetGroupOrdersResponse::class.java) } .apply { - addParam("group_id", groupId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + addParam("group_id", groupId, min = 1) + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 1, max = 50) } } /** @@ -642,8 +648,8 @@ class MarketService { GsonHolder.gson.fromJson(it, MarketGetOrderByIdResponse::class.java) } .apply { - addParam("order_id", orderId) - userId?.let { addParam("user_id", it) } + addParam("order_id", orderId, min = 0) + userId?.let { addParam("user_id", it, min = 0) } } /** @@ -664,10 +670,10 @@ class MarketService { 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) } + addParam("order_id", orderId, min = 0) + userId?.let { addParam("user_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } } /** @@ -686,8 +692,8 @@ class MarketService { GsonHolder.gson.fromJson(it, MarketGetOrdersResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 10) } dateFrom?.let { addParam("date_from", it) } dateTo?.let { addParam("date_to", it) } } @@ -708,8 +714,8 @@ class MarketService { GsonHolder.gson.fromJson(it, MarketGetOrdersExtendedResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 10) } addParam("extended", true) dateFrom?.let { addParam("date_from", it) } dateTo?.let { addParam("date_to", it) } @@ -732,7 +738,7 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) addParam("album_ids", albumIds) } @@ -756,8 +762,8 @@ class MarketService { .apply { addParam("owner_id", ownerId) addParam("album_id", albumId) - before?.let { addParam("before", it) } - after?.let { addParam("after", it) } + before?.let { addParam("before", it, min = 0) } + after?.let { addParam("after", it, min = 0) } } /** @@ -781,10 +787,10 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) albumId?.let { addParam("album_id", it) } - before?.let { addParam("before", it) } - after?.let { addParam("after", it) } + before?.let { addParam("before", it, min = 0) } + after?.let { addParam("after", it, min = 0) } } /** @@ -805,7 +811,7 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) reason?.let { addParam("reason", it.value) } } @@ -827,7 +833,7 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) addParam("reason", reason.value) } @@ -844,7 +850,7 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) } /** @@ -862,7 +868,7 @@ class MarketService { } .apply { addParam("owner_id", ownerId) - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) } /** @@ -891,22 +897,22 @@ class MarketService { rev: MarketSearchRev? = null, offset: Int? = null, count: Int? = null, - status: MarketSearchStatus? = null, + status: List? = null, needVariants: Boolean? = null ): VKRequest = NewApiRequest("market.search") { GsonHolder.gson.fromJson(it, MarketSearchResponse::class.java) } .apply { addParam("owner_id", ownerId) - albumId?.let { addParam("album_id", it) } + albumId?.let { addParam("album_id", it, min = 0) } q?.let { addParam("q", it) } - priceFrom?.let { addParam("price_from", it) } - priceTo?.let { addParam("price_to", it) } + priceFrom?.let { addParam("price_from", it, min = 0) } + priceTo?.let { addParam("price_to", it, min = 0) } 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) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } + status?.let { addParam("status", it) } needVariants?.let { addParam("need_variants", it) } } @@ -936,23 +942,63 @@ class MarketService { rev: MarketSearchExtendedRev? = null, offset: Int? = null, count: Int? = null, - status: MarketSearchExtendedStatus? = null, + status: List? = null, needVariants: Boolean? = null ): VKRequest = NewApiRequest("market.search") { GsonHolder.gson.fromJson(it, MarketSearchExtendedResponse::class.java) } .apply { addParam("owner_id", ownerId) - albumId?.let { addParam("album_id", it) } + albumId?.let { addParam("album_id", it, min = 0) } q?.let { addParam("q", it) } - priceFrom?.let { addParam("price_from", it) } - priceTo?.let { addParam("price_to", it) } + priceFrom?.let { addParam("price_from", it, min = 0) } + priceTo?.let { addParam("price_to", it, min = 0) } sort?.let { addParam("sort", it.value) } rev?.let { addParam("rev", it.value) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } addParam("extended", true) - status?.let { addParam("status", it.value) } + status?.let { addParam("status", it) } needVariants?.let { addParam("need_variants", it) } } + + /** + * @param q + * @param offset + * @param count + * @param categoryId + * @param priceFrom + * @param priceTo + * @param sortBy + * @param sortDirection + * @param country + * @param city + * @return [VKRequest] with [MarketSearchResponse] + */ + fun marketSearchItems( + q: String, + offset: Int? = null, + count: Int? = null, + categoryId: Int? = null, + priceFrom: Int? = null, + priceTo: Int? = null, + sortBy: MarketSearchItemsSortBy? = null, + sortDirection: MarketSearchItemsSortDirection? = null, + country: Int? = null, + city: Int? = null + ): VKRequest = NewApiRequest("market.searchItems") { + GsonHolder.gson.fromJson(it, MarketSearchResponse::class.java) + } + .apply { + addParam("q", q) + offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0, max = 300) } + categoryId?.let { addParam("category_id", it, min = 0) } + priceFrom?.let { addParam("price_from", it, min = 0) } + priceTo?.let { addParam("price_to", it, min = 0) } + sortBy?.let { addParam("sort_by", it.value) } + sortDirection?.let { addParam("sort_direction", it.value) } + country?.let { addParam("country", it, min = 0) } + city?.let { addParam("city", it, min = 0) } + } } diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketAddAlbumResponse.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketAddAlbumResponse.kt index cad49582c2..06ca64555d 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/MarketAddAlbumResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketAddAlbumResponse.kt @@ -32,8 +32,11 @@ import kotlin.Int /** * @param marketAlbumId - Album ID + * @param albumsCount - Albums count */ data class MarketAddAlbumResponse( @SerializedName("market_album_id") - val marketAlbumId: Int? = null + val marketAlbumId: Int? = null, + @SerializedName("albums_count") + val albumsCount: Int? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategory.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategory.kt index 39e296830a..64d483ec48 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategory.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketCategory.kt @@ -38,9 +38,9 @@ import kotlin.String */ data class MarketMarketCategory( @SerializedName("id") - val id: Int? = null, + val id: Int, @SerializedName("name") - val name: String? = null, + val name: String, @SerializedName("section") - val section: MarketSection? = null + val section: MarketSection ) diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemFull.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemFull.kt index 37f4c49ef7..943e8643d0 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemFull.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketMarketItemFull.kt @@ -40,6 +40,13 @@ import kotlin.String import kotlin.collections.List /** + * @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 albumsIds * @param photos * @param canComment - Information whether current use can comment the item @@ -50,25 +57,33 @@ import kotlin.collections.List * @param wishlistItemId - Object identifier in wishlist of viewer * @param cancelInfo - Information for cancel and revert order * @param userAgreementInfo - User agreement info + * @param adId - Contains ad ID if it has * @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 */ data class MarketMarketItemFull( + @SerializedName("availability") + val availability: MarketMarketItemAvailability, + @SerializedName("category") + val category: MarketMarketCategory, + @SerializedName("description") + val description: String, + @SerializedName("id") + val id: Int, + @SerializedName("owner_id") + val ownerId: UserId, + @SerializedName("price") + val price: MarketPrice, + @SerializedName("title") + val title: String, @SerializedName("albums_ids") val albumsIds: List? = null, @SerializedName("photos") @@ -89,32 +104,20 @@ data class MarketMarketItemFull( val cancelInfo: BaseLink? = null, @SerializedName("user_agreement_info") val userAgreementInfo: String? = null, + @SerializedName("ad_id") + val adId: Int? = null, @SerializedName("access_key") val accessKey: String? = null, - @SerializedName("availability") - val availability: MarketMarketItemAvailability? = null, @SerializedName("button_title") val buttonTitle: String? = null, - @SerializedName("category") - val category: MarketMarketCategory? = null, @SerializedName("date") val date: Int? = null, - @SerializedName("description") - val description: String? = null, @SerializedName("external_id") val externalId: String? = null, - @SerializedName("id") - val id: Int? = null, @SerializedName("is_favorite") val isFavorite: Boolean? = null, - @SerializedName("owner_id") - val ownerId: UserId? = null, - @SerializedName("price") - val price: MarketPrice? = null, @SerializedName("thumb_photo") val thumbPhoto: String? = null, - @SerializedName("title") - val title: String? = null, @SerializedName("url") val url: String? = null, @SerializedName("variants_grouping_id") diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchItemsSortBy.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchItemsSortBy.kt new file mode 100644 index 0000000000..f01046ff58 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchItemsSortBy.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.Int + +enum class MarketSearchItemsSortBy( + val value: Int +) { + @SerializedName("1") + DATE(1), + + @SerializedName("2") + PRICE(2), + + @SerializedName("3") + RELEVANCE(3); +} diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchItemsSortDirection.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchItemsSortDirection.kt new file mode 100644 index 0000000000..6dec2340bc --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchItemsSortDirection.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 MarketSearchItemsSortDirection( + val value: Int +) { + @SerializedName("0") + ZERO_(0), + + @SerializedName("1") + ONE_(1); +} diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchResponse.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchResponse.kt index 390c14e026..932f0f77f3 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchResponse.kt @@ -28,6 +28,7 @@ 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 @@ -36,6 +37,7 @@ import kotlin.collections.List * @param viewType * @param items * @param variants + * @param groups */ data class MarketSearchResponse( @SerializedName("count") @@ -45,5 +47,7 @@ data class MarketSearchResponse( @SerializedName("items") val items: List, @SerializedName("variants") - val variants: List? = null + val variants: List? = null, + @SerializedName("groups") + val groups: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/MessagesService.kt b/api/src/main/java/com/vk/sdk/api/messages/MessagesService.kt index d5a903428f..b72602c3fb 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/MessagesService.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/MessagesService.kt @@ -37,12 +37,14 @@ import com.vk.sdk.api.base.dto.BaseOkResponse import com.vk.sdk.api.base.dto.BaseUserGroupFields import com.vk.sdk.api.messages.dto.MessagesDeleteChatPhotoResponse import com.vk.sdk.api.messages.dto.MessagesDeleteConversationResponse +import com.vk.sdk.api.messages.dto.MessagesGetByConversationMessageIdExtendedResponse 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.MessagesGetConversationById -import com.vk.sdk.api.messages.dto.MessagesGetConversationMembersResponse +import com.vk.sdk.api.messages.dto.MessagesGetConversationByIdExtended +import com.vk.sdk.api.messages.dto.MessagesGetConversationMembers import com.vk.sdk.api.messages.dto.MessagesGetConversationsFilter import com.vk.sdk.api.messages.dto.MessagesGetConversationsResponse import com.vk.sdk.api.messages.dto.MessagesGetHistoryAttachmentsMediaType @@ -94,9 +96,9 @@ class MessagesService { 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) } + addParam("chat_id", chatId, min = 0, max = 100000000) + userId?.let { addParam("user_id", it, min = 0) } + visibleMessagesCount?.let { addParam("visible_messages_count", it, min = 0, max = 1000) } } /** @@ -111,8 +113,8 @@ class MessagesService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) - key?.let { addParam("key", it) } + addParam("group_id", groupId, min = 1) + key?.let { addParam("key", it, maxLength = 256) } } /** @@ -124,7 +126,7 @@ class MessagesService { * @return [VKRequest] with [Int] */ fun messagesCreateChat( - userIds: List? = null, + userIds: List? = null, title: String? = null, groupId: UserId? = null ): VKRequest = NewApiRequest("messages.createChat") { @@ -133,7 +135,7 @@ class MessagesService { .apply { userIds?.let { addParam("user_ids", it) } title?.let { addParam("title", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -145,7 +147,7 @@ class MessagesService { * @param deleteForAll - '1' - delete message for for all. * @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 cmids - Conversation message IDs. * @return [VKRequest] with [Any] */ fun messagesDelete( @@ -154,17 +156,17 @@ class MessagesService { groupId: UserId? = null, deleteForAll: Boolean? = null, peerId: Int? = null, - conversationMessageIds: List? = null + cmids: List? = 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) } + groupId?.let { addParam("group_id", it, min = 0) } deleteForAll?.let { addParam("delete_for_all", it) } peerId?.let { addParam("peer_id", it) } - conversationMessageIds?.let { addParam("conversation_message_ids", it) } + cmids?.let { addParam("cmids", it) } } /** @@ -179,8 +181,8 @@ class MessagesService { GsonHolder.gson.fromJson(it, MessagesDeleteChatPhotoResponse::class.java) } .apply { - addParam("chat_id", chatId) - groupId?.let { addParam("group_id", it) } + addParam("chat_id", chatId, min = 0, max = 100000000) + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -203,7 +205,7 @@ class MessagesService { .apply { userId?.let { addParam("user_id", it) } peerId?.let { addParam("peer_id", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -217,7 +219,7 @@ class MessagesService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -237,6 +239,7 @@ class MessagesService { * @param keepSnippets - '1' - to keep attached snippets. * @param groupId - Group ID (for group messages with user access token) * @param dontParseLinks + * @param disableMentions * @param messageId * @param conversationMessageId * @param template @@ -253,6 +256,7 @@ class MessagesService { keepSnippets: Boolean? = null, groupId: UserId? = null, dontParseLinks: Boolean? = null, + disableMentions: Boolean? = null, messageId: Int? = null, conversationMessageId: Int? = null, template: String? = null, @@ -262,16 +266,17 @@ class MessagesService { } .apply { addParam("peer_id", peerId) - message?.let { addParam("message", it) } + message?.let { addParam("message", it, maxLength = 9000) } 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) } + groupId?.let { addParam("group_id", it, min = 0) } dontParseLinks?.let { addParam("dont_parse_links", it) } - messageId?.let { addParam("message_id", it) } - conversationMessageId?.let { addParam("conversation_message_id", it) } + disableMentions?.let { addParam("disable_mentions", it) } + messageId?.let { addParam("message_id", it, min = 0) } + conversationMessageId?.let { addParam("conversation_message_id", it, min = 0) } template?.let { addParam("template", it) } keyboard?.let { addParam("keyboard", it) } } @@ -288,7 +293,7 @@ class MessagesService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("chat_id", chatId) + addParam("chat_id", chatId, min = 0, max = 100000000) title?.let { addParam("title", it) } } @@ -318,7 +323,37 @@ class MessagesService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } + } + + /** + * 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 [MessagesGetByConversationMessageIdExtendedResponse] + */ + fun messagesGetByConversationMessageIdExtended( + peerId: Int, + conversationMessageIds: List, + fields: List? = null, + groupId: UserId? = null + ): VKRequest = + NewApiRequest("messages.getByConversationMessageId") { + GsonHolder.gson.fromJson(it, MessagesGetByConversationMessageIdExtendedResponse::class.java) + } + .apply { + addParam("peer_id", peerId) + addParam("conversation_message_ids", conversationMessageIds) + addParam("extended", true) + val fieldsJsonConverted = fields?.map { + it.value + } + fieldsJsonConverted?.let { addParam("fields", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -342,12 +377,12 @@ class MessagesService { } .apply { addParam("message_ids", messageIds) - previewLength?.let { addParam("preview_length", it) } + previewLength?.let { addParam("preview_length", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -371,13 +406,13 @@ class MessagesService { } .apply { addParam("message_ids", messageIds) - previewLength?.let { addParam("preview_length", it) } + previewLength?.let { addParam("preview_length", it, min = 0) } addParam("extended", true) val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -394,7 +429,7 @@ class MessagesService { GsonHolder.gson.fromJson(it, MessagesGetChatPreviewResponse::class.java) } .apply { - peerId?.let { addParam("peer_id", it) } + peerId?.let { addParam("peer_id", it, min = 0) } link?.let { addParam("link", it) } val fieldsJsonConverted = fields?.map { it.value @@ -408,15 +443,15 @@ class MessagesService { * @param peerId - Peer ID. * @param fields - Profile fields to return. * @param groupId - Group ID (for group messages with group access token) - * @return [VKRequest] with [MessagesGetConversationMembersResponse] + * @return [VKRequest] with [MessagesGetConversationMembers] */ fun messagesGetConversationMembers( peerId: Int, fields: List? = null, groupId: UserId? = null - ): VKRequest = + ): VKRequest = NewApiRequest("messages.getConversationMembers") { - GsonHolder.gson.fromJson(it, MessagesGetConversationMembersResponse::class.java) + GsonHolder.gson.fromJson(it, MessagesGetConversationMembers::class.java) } .apply { addParam("peer_id", peerId) @@ -424,7 +459,7 @@ class MessagesService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -451,15 +486,15 @@ class MessagesService { GsonHolder.gson.fromJson(it, MessagesGetConversationsResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } filter?.let { addParam("filter", it.value) } - startMessageId?.let { addParam("start_message_id", it) } + startMessageId?.let { addParam("start_message_id", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -484,7 +519,7 @@ class MessagesService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -494,14 +529,15 @@ class MessagesService { * '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 [Any] + * @return [VKRequest] with [MessagesGetConversationByIdExtended] */ fun messagesGetConversationsByIdExtended( peerIds: List, fields: List? = null, groupId: UserId? = null - ): VKRequest = NewApiRequest("messages.getConversationsById") { - GsonHolder.gson.fromJson(it, Any::class.java) + ): VKRequest = + NewApiRequest("messages.getConversationsById") { + GsonHolder.gson.fromJson(it, MessagesGetConversationByIdExtended::class.java) } .apply { addParam("peer_ids", peerIds) @@ -510,7 +546,7 @@ class MessagesService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -541,7 +577,7 @@ class MessagesService { } .apply { offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 200) } userId?.let { addParam("user_id", it) } peerId?.let { addParam("peer_id", it) } startMessageId?.let { addParam("start_message_id", it) } @@ -550,7 +586,7 @@ class MessagesService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -581,7 +617,7 @@ class MessagesService { } .apply { offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 200) } userId?.let { addParam("user_id", it) } peerId?.let { addParam("peer_id", it) } startMessageId?.let { addParam("start_message_id", it) } @@ -591,7 +627,7 @@ class MessagesService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -628,15 +664,15 @@ class MessagesService { addParam("peer_id", peerId) mediaType?.let { addParam("media_type", it.value) } startFrom?.let { addParam("start_from", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 200) } photoSizes?.let { addParam("photo_sizes", it) } val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } preserveOrder?.let { addParam("preserve_order", it) } - maxForwardsLevel?.let { addParam("max_forwards_level", it) } + maxForwardsLevel?.let { addParam("max_forwards_level", it, min = 0, max = 45) } } /** @@ -662,15 +698,15 @@ class MessagesService { 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) } + count?.let { addParam("count", it, min = 0, max = 200) } + offset?.let { addParam("offset", it, min = 0) } + startMessageId?.let { addParam("start_message_id", it, min = 0) } + previewLength?.let { addParam("preview_length", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -696,16 +732,16 @@ class MessagesService { 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) } + count?.let { addParam("count", it, min = 0, max = 200) } + offset?.let { addParam("offset", it, min = 0) } + startMessageId?.let { addParam("start_message_id", it, min = 0) } + previewLength?.let { addParam("preview_length", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } addParam("extended", true) - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -729,9 +765,9 @@ class MessagesService { } .apply { addParam("intent", intent.value) - subscribeId?.let { addParam("subscribe_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + subscribeId?.let { addParam("subscribe_id", it, min = 0, max = 100) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } nameCase?.let { addParam("name_case", it) } fields?.let { addParam("fields", it) } } @@ -750,9 +786,9 @@ class MessagesService { GsonHolder.gson.fromJson(it, MessagesGetInviteLinkResponse::class.java) } .apply { - addParam("peer_id", peerId) + addParam("peer_id", peerId, min = 0) reset?.let { addParam("reset", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -810,20 +846,20 @@ class MessagesService { GsonHolder.gson.fromJson(it, MessagesGetLongPollHistoryResponse::class.java) } .apply { - ts?.let { addParam("ts", it) } - pts?.let { addParam("pts", it) } - previewLength?.let { addParam("preview_length", it) } + ts?.let { addParam("ts", it, min = 0) } + pts?.let { addParam("pts", it, min = 0) } + previewLength?.let { addParam("preview_length", it, min = 0) } 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) } + eventsLimit?.let { addParam("events_limit", it, min = 1000) } + msgsLimit?.let { addParam("msgs_limit", it, min = 200) } + maxMsgId?.let { addParam("max_msg_id", it, min = 0) } + groupId?.let { addParam("group_id", it, min = 0) } + lpVersion?.let { addParam("lp_version", it, min = 0) } + lastN?.let { addParam("last_n", it, min = 0, max = 2000) } credentials?.let { addParam("credentials", it) } } @@ -845,8 +881,8 @@ class MessagesService { } .apply { needPts?.let { addParam("need_pts", it) } - groupId?.let { addParam("group_id", it) } - lpVersion?.let { addParam("lp_version", it) } + groupId?.let { addParam("group_id", it, min = 0) } + lpVersion?.let { addParam("lp_version", it, min = 0) } } /** @@ -862,8 +898,8 @@ class MessagesService { GsonHolder.gson.fromJson(it, MessagesIsMessagesFromGroupAllowedResponse::class.java) } .apply { - addParam("group_id", groupId) - addParam("user_id", userId) + addParam("group_id", groupId, min = 1) + addParam("user_id", userId, min = 1) } /** @@ -896,7 +932,7 @@ class MessagesService { .apply { addParam("peer_id", peerId) answered?.let { addParam("answered", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -913,7 +949,7 @@ class MessagesService { } .apply { messageIds?.let { addParam("message_ids", it) } - important?.let { addParam("important", it) } + important?.let { addParam("important", it, min = 0) } } /** @@ -934,7 +970,7 @@ class MessagesService { .apply { addParam("peer_id", peerId) important?.let { addParam("important", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -960,8 +996,8 @@ class MessagesService { .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) } + startMessageId?.let { addParam("start_message_id", it, min = 0) } + groupId?.let { addParam("group_id", it, min = 0) } markConversationAsRead?.let { addParam("mark_conversation_as_read", it) } } @@ -983,8 +1019,8 @@ class MessagesService { } .apply { addParam("peer_id", peerId) - messageId?.let { addParam("message_id", it) } - conversationMessageId?.let { addParam("conversation_message_id", it) } + messageId?.let { addParam("message_id", it, min = 0) } + conversationMessageId?.let { addParam("conversation_message_id", it, min = 0) } } /** @@ -998,13 +1034,13 @@ class MessagesService { */ fun messagesRemoveChatUser( chatId: Int, - userId: Int? = null, - memberId: Int? = null + userId: UserId? = null, + memberId: UserId? = null ): VKRequest = NewApiRequest("messages.removeChatUser") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("chat_id", chatId) + addParam("chat_id", chatId, min = 0, max = 100000000) userId?.let { addParam("user_id", it) } memberId?.let { addParam("member_id", it) } } @@ -1021,8 +1057,8 @@ class MessagesService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("message_id", messageId) - groupId?.let { addParam("group_id", it) } + addParam("message_id", messageId, min = 0) + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -1054,14 +1090,14 @@ class MessagesService { GsonHolder.gson.fromJson(it, MessagesSearchResponse::class.java) } .apply { - q?.let { addParam("q", it) } + q?.let { addParam("q", it, maxLength = 9000) } 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) } + date?.let { addParam("date", it, min = 0) } + previewLength?.let { addParam("preview_length", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } fields?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -1093,15 +1129,15 @@ class MessagesService { GsonHolder.gson.fromJson(it, MessagesSearchExtendedResponse::class.java) } .apply { - q?.let { addParam("q", it) } + q?.let { addParam("q", it, maxLength = 9000) } 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) } + date?.let { addParam("date", it, min = 0) } + previewLength?.let { addParam("preview_length", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } addParam("extended", true) fields?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -1124,12 +1160,12 @@ class MessagesService { } .apply { q?.let { addParam("q", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 1, max = 255) } val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -1152,13 +1188,13 @@ class MessagesService { } .apply { q?.let { addParam("q", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 1, max = 255) } addParam("extended", true) val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -1197,13 +1233,13 @@ class MessagesService { * @return [VKRequest] with [Int] */ fun messagesSend( - userId: Int? = null, + userId: UserId? = null, randomId: Int? = null, peerId: Int? = null, peerIds: List? = null, domain: String? = null, chatId: Int? = null, - userIds: List? = null, + userIds: List? = null, message: String? = null, lat: Float? = null, long: Float? = null, @@ -1230,25 +1266,25 @@ class MessagesService { peerId?.let { addParam("peer_id", it) } peerIds?.let { addParam("peer_ids", it) } domain?.let { addParam("domain", it) } - chatId?.let { addParam("chat_id", it) } + chatId?.let { addParam("chat_id", it, min = 0, max = 100000000) } userIds?.let { addParam("user_ids", it) } - message?.let { addParam("message", it) } + message?.let { addParam("message", it, maxLength = 9000) } lat?.let { addParam("lat", it) } long?.let { addParam("long", it) } - attachment?.let { addParam("attachment", it) } + attachment?.let { addParam("attachment", it, maxLength = 9000) } 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) } + stickerId?.let { addParam("sticker_id", it, min = 0) } + groupId?.let { addParam("group_id", it, min = 0) } keyboard?.let { addParam("keyboard", it) } template?.let { addParam("template", it) } - payload?.let { addParam("payload", it) } + payload?.let { addParam("payload", it, maxLength = 1000) } 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) } + subscribeId?.let { addParam("subscribe_id", it, min = 0, max = 100) } } /** @@ -1270,7 +1306,7 @@ class MessagesService { addParam("event_id", eventId) addParam("user_id", userId) addParam("peer_id", peerId) - eventData?.let { addParam("event_data", it) } + eventData?.let { addParam("event_data", it, maxLength = 1000) } } /** @@ -1295,7 +1331,7 @@ class MessagesService { userId?.let { addParam("user_id", it) } type?.let { addParam("type", it.value) } peerId?.let { addParam("peer_id", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -1325,6 +1361,6 @@ class MessagesService { } .apply { addParam("peer_id", peerId) - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } } diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChat.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChat.kt index f07227b5a0..44341a629a 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChat.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChat.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import com.vk.sdk.api.base.dto.BaseBoolInt import kotlin.Boolean import kotlin.Int @@ -39,6 +40,7 @@ import kotlin.collections.List * @param id - Chat ID * @param type - Chat type * @param users + * @param membersCount - Count members in a chat * @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 @@ -47,16 +49,19 @@ import kotlin.collections.List * @param pushSettings * @param title - Chat title * @param isDefaultPhoto - If provided photo is default + * @param isGroupChannel - If chat is group channel */ data class MessagesChat( @SerializedName("admin_id") - val adminId: Int, + val adminId: UserId, @SerializedName("id") val id: Int, @SerializedName("type") val type: String, @SerializedName("users") - val users: List, + val users: List, + @SerializedName("members_count") + val membersCount: Int, @SerializedName("kicked") val kicked: BaseBoolInt? = null, @SerializedName("left") @@ -72,5 +77,7 @@ data class MessagesChat( @SerializedName("title") val title: String? = null, @SerializedName("is_default_photo") - val isDefaultPhoto: Boolean? = null + val isDefaultPhoto: Boolean? = null, + @SerializedName("is_group_channel") + val isGroupChannel: Boolean? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPreview.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPreview.kt index 45664b0d2e..9988099057 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPreview.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatPreview.kt @@ -28,6 +28,8 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId +import com.vk.sdk.api.base.dto.BaseLinkButton import kotlin.Boolean import kotlin.Int import kotlin.String @@ -41,20 +43,32 @@ import kotlin.collections.List * @param membersCount * @param title * @param isMember + * @param photo + * @param isDon + * @param isGroupChannel + * @param button */ data class MessagesChatPreview( @SerializedName("admin_id") - val adminId: Int? = null, + val adminId: UserId? = null, @SerializedName("joined") val joined: Boolean? = null, @SerializedName("local_id") val localId: Int? = null, @SerializedName("members") - val members: List? = null, + val members: List? = null, @SerializedName("members_count") val membersCount: Int? = null, @SerializedName("title") val title: String? = null, @SerializedName("is_member") - val isMember: Boolean? = null + val isMember: Boolean? = null, + @SerializedName("photo") + val photo: MessagesChatSettingsPhoto? = null, + @SerializedName("is_don") + val isDon: Boolean? = null, + @SerializedName("is_group_channel") + val isGroupChannel: Boolean? = null, + @SerializedName("button") + val button: BaseLinkButton? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettings.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettings.kt index a9bd360921..e2447af4c9 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettings.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettings.kt @@ -60,7 +60,7 @@ data class MessagesChatSettings( @SerializedName("state") val state: MessagesChatSettingsState, @SerializedName("active_ids") - val activeIds: List, + val activeIds: List, @SerializedName("acl") val acl: MessagesChatSettingsAcl, @SerializedName("members_count") @@ -72,7 +72,7 @@ data class MessagesChatSettings( @SerializedName("photo") val photo: MessagesChatSettingsPhoto? = null, @SerializedName("admin_ids") - val adminIds: List? = null, + val adminIds: List? = null, @SerializedName("is_group_channel") val isGroupChannel: Boolean? = null, @SerializedName("permissions") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPhoto.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPhoto.kt index 6de2f4ca74..72f6d2865f 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPhoto.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPhoto.kt @@ -36,6 +36,7 @@ import kotlin.String * @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 isDefaultCallPhoto - If provided photo is default call photo */ data class MessagesChatSettingsPhoto( @SerializedName("photo_50") @@ -45,5 +46,7 @@ data class MessagesChatSettingsPhoto( @SerializedName("photo_200") val photo200: String? = null, @SerializedName("is_default_photo") - val isDefaultPhoto: Boolean? = null + val isDefaultPhoto: Boolean? = null, + @SerializedName("is_default_call_photo") + val isDefaultCallPhoto: Boolean? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSuggestion.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSuggestion.kt new file mode 100644 index 0000000000..7c40238a2e --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSuggestion.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 com.vk.sdk.api.base.dto.BaseLinkChat +import kotlin.String + +/** + * Item of a suggestions block + * @param chat + * @param trackCode + */ +data class MessagesChatSuggestion( + @SerializedName("chat") + val chat: BaseLinkChat, + @SerializedName("track_code") + val trackCode: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversation.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversation.kt index cbac990a3e..beba8e0a4a 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversation.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversation.kt @@ -57,6 +57,7 @@ import kotlin.collections.List * @param chatSettings * @param spamExpiration * @param isNew + * @param isArchived */ data class MessagesConversation( @SerializedName("peer") @@ -104,7 +105,9 @@ data class MessagesConversation( @SerializedName("spam_expiration") val spamExpiration: Int? = null, @SerializedName("is_new") - val isNew: Boolean? = null + val isNew: Boolean? = null, + @SerializedName("is_archived") + val isArchived: Boolean? = null ) { enum class SpecialServiceType( val value: String diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationMember.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationMember.kt index 277f5d8d19..2c8bc8d31d 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationMember.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesConversationMember.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Boolean import kotlin.Int @@ -43,11 +44,11 @@ import kotlin.Int */ data class MessagesConversationMember( @SerializedName("member_id") - val memberId: Int, + val memberId: UserId, @SerializedName("can_kick") val canKick: Boolean? = null, @SerializedName("invited_by") - val invitedBy: Int? = null, + val invitedBy: UserId? = null, @SerializedName("is_admin") val isAdmin: Boolean? = null, @SerializedName("is_owner") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesForeignMessage.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesForeignMessage.kt index 86f099a87f..e3c566d89b 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesForeignMessage.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesForeignMessage.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import com.vk.sdk.api.base.dto.BaseGeo import kotlin.Boolean import kotlin.Int @@ -53,7 +54,7 @@ data class MessagesForeignMessage( @SerializedName("date") val date: Int, @SerializedName("from_id") - val fromId: Int, + val fromId: UserId, @SerializedName("text") val text: String, @SerializedName("attachments") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByConversationMessageIdExtendedResponse.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByConversationMessageIdExtendedResponse.kt new file mode 100644 index 0000000000..eb7555e87d --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetByConversationMessageIdExtendedResponse.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 MessagesGetByConversationMessageIdExtendedResponse( + @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/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetChatPreviewResponse.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetChatPreviewResponse.kt index d9475fc48b..f0dc4c5c20 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetChatPreviewResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetChatPreviewResponse.kt @@ -28,16 +28,20 @@ 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.collections.List /** * @param preview * @param profiles + * @param groups */ data class MessagesGetChatPreviewResponse( @SerializedName("preview") val preview: MessagesChatPreview? = null, @SerializedName("profiles") - val profiles: List? = null + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationByIdExtended.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationByIdExtended.kt new file mode 100644 index 0000000000..f95f022d24 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationByIdExtended.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 MessagesGetConversationByIdExtended( + @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/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationMembers.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationMembers.kt new file mode 100644 index 0000000000..07cb3d7acd --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationMembers.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 items + * @param count - Chat members count + * @param chatRestrictions + * @param profiles + * @param groups + */ +data class MessagesGetConversationMembers( + @SerializedName("items") + val items: List, + @SerializedName("count") + val count: Int, + @SerializedName("chat_restrictions") + val chatRestrictions: MessagesChatRestrictions? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsFilter.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsFilter.kt index 860b7941b7..81f666347e 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsFilter.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsFilter.kt @@ -36,6 +36,9 @@ enum class MessagesGetConversationsFilter( @SerializedName("all") ALL("all"), + @SerializedName("archive") + ARCHIVE("archive"), + @SerializedName("business_notify") BUSINESS_NOTIFY("business_notify"), diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsResponse.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsResponse.kt index 45b9ba7c2e..0b48fbed48 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsResponse.kt @@ -28,16 +28,24 @@ 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.String import kotlin.collections.List /** * @param items * @param nextFrom - Value for pagination + * @param profiles + * @param groups */ data class MessagesGetHistoryAttachmentsResponse( @SerializedName("items") val items: List? = null, @SerializedName("next_from") - val nextFrom: String? = null + val nextFrom: String? = null, + @SerializedName("profiles") + val profiles: List? = null, + @SerializedName("groups") + val groups: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesExtendedResponse.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesExtendedResponse.kt index 6e2ab7f52d..30d880b0e9 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesExtendedResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesExtendedResponse.kt @@ -28,8 +28,8 @@ 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 com.vk.sdk.api.groups.dto.GroupsGroupFull +import com.vk.sdk.api.users.dto.UsersUserFull import kotlin.collections.List /** @@ -42,9 +42,9 @@ data class MessagesGetImportantMessagesExtendedResponse( @SerializedName("messages") val messages: MessagesMessagesArray, @SerializedName("profiles") - val profiles: List? = null, + val profiles: List? = null, @SerializedName("groups") - val groups: List? = null, + val groups: List? = null, @SerializedName("conversations") val conversations: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesResponse.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesResponse.kt index c34de4fac1..4c59448019 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetImportantMessagesResponse.kt @@ -28,7 +28,7 @@ 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.groups.dto.GroupsGroupFull import com.vk.sdk.api.users.dto.UsersUser import kotlin.collections.List @@ -44,7 +44,7 @@ data class MessagesGetImportantMessagesResponse( @SerializedName("profiles") val profiles: List? = null, @SerializedName("groups") - val groups: List? = null, + val groups: List? = null, @SerializedName("conversations") val conversations: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersResponse.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersResponse.kt index c042b54ebe..4c76c492e5 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersResponse.kt @@ -42,7 +42,7 @@ data class MessagesGetIntentUsersResponse( @SerializedName("count") val count: Int, @SerializedName("items") - val items: UserId, + val items: List, @SerializedName("profiles") val profiles: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetLongPollHistoryResponse.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetLongPollHistoryResponse.kt index c6f2c6bbfb..9c77067cc5 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetLongPollHistoryResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetLongPollHistoryResponse.kt @@ -28,7 +28,7 @@ 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.groups.dto.GroupsGroupFull import com.vk.sdk.api.users.dto.UsersUserFull import kotlin.Boolean import kotlin.Int @@ -56,7 +56,7 @@ data class MessagesGetLongPollHistoryResponse( @SerializedName("profiles") val profiles: List? = null, @SerializedName("groups") - val groups: List? = null, + val groups: List? = null, @SerializedName("chats") val chats: List? = null, @SerializedName("new_pts") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGraffiti.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGraffiti.kt index b464a6d228..522d680cf1 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGraffiti.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGraffiti.kt @@ -33,16 +33,14 @@ 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 height - Graffiti height * @param accessKey - Access key for graffiti */ data class MessagesGraffiti( - @SerializedName("height") - val height: Int, @SerializedName("id") val id: Int, @SerializedName("owner_id") @@ -51,6 +49,8 @@ data class MessagesGraffiti( val url: String, @SerializedName("width") val width: Int, + @SerializedName("height") + val height: Int, @SerializedName("access_key") val accessKey: String? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryAttachment.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryAttachment.kt index e63f554bc0..8442c5cddd 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryAttachment.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryAttachment.kt @@ -28,6 +28,8 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId +import kotlin.Boolean import kotlin.Int /** @@ -35,6 +37,7 @@ import kotlin.Int * @param messageId - Message ID * @param fromId - Message author's ID * @param forwardLevel - Forward level (optional) + * @param wasListened */ data class MessagesHistoryAttachment( @SerializedName("attachment") @@ -42,7 +45,9 @@ data class MessagesHistoryAttachment( @SerializedName("message_id") val messageId: Int, @SerializedName("from_id") - val fromId: Int, + val fromId: UserId, @SerializedName("forward_level") - val forwardLevel: Int? = null + val forwardLevel: Int? = null, + @SerializedName("was_listened") + val wasListened: Boolean? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachment.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachment.kt index bcf17c9b7d..dd1349b4f1 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachment.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesHistoryMessageAttachment.kt @@ -31,8 +31,10 @@ import com.google.gson.annotations.SerializedName import com.vk.sdk.api.audio.dto.AudioAudio import com.vk.sdk.api.base.dto.BaseLink import com.vk.sdk.api.docs.dto.DocsDoc +import com.vk.sdk.api.market.dto.MarketMarketItem import com.vk.sdk.api.photos.dto.PhotosPhoto import com.vk.sdk.api.video.dto.VideoVideo +import com.vk.sdk.api.wall.dto.WallWallpostFull /** * @param type @@ -43,7 +45,6 @@ import com.vk.sdk.api.video.dto.VideoVideo * @param link * @param market * @param photo - * @param share * @param video * @param wall */ @@ -61,13 +62,11 @@ data class MessagesHistoryMessageAttachment( @SerializedName("link") val link: BaseLink? = null, @SerializedName("market") - val market: BaseLink? = null, + val market: MarketMarketItem? = null, @SerializedName("photo") val photo: PhotosPhoto? = null, - @SerializedName("share") - val share: BaseLink? = null, @SerializedName("video") val video: VideoVideo? = null, @SerializedName("wall") - val wall: BaseLink? = null + val wall: WallWallpostFull? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboard.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboard.kt index ee73961bd1..14c7d94f19 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboard.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboard.kt @@ -28,23 +28,23 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Boolean -import kotlin.Int import kotlin.collections.List /** - * @param buttons * @param oneTime - Should this keyboard disappear on first use + * @param buttons * @param authorId - Community or bot, which set this keyboard * @param inline */ data class MessagesKeyboard( - @SerializedName("buttons") - val buttons: List>, @SerializedName("one_time") val oneTime: Boolean, + @SerializedName("buttons") + val buttons: List>, @SerializedName("author_id") - val authorId: Int? = null, + val authorId: UserId? = null, @SerializedName("inline") val inline: Boolean? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButton.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButton.kt index 6ed769cd7d..9e4a98e10a 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButton.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButton.kt @@ -36,7 +36,7 @@ import kotlin.String */ data class MessagesKeyboardButton( @SerializedName("action") - val action: MessagesKeyboardButtonAction, + val action: MessagesKeyboardButtonPropertyAction, @SerializedName("color") val color: MessagesKeyboardButton.Color? = null ) { diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButtonPropertyAction.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButtonPropertyAction.kt new file mode 100644 index 0000000000..d457957bcb --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesKeyboardButtonPropertyAction.kt @@ -0,0 +1,52 @@ +/** + * 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 hash - Fragment value in app link like vk.com/app123456_-654321#{hash} + * @param type + * @param payload - Additional data sent along with message for developer convenience + */ +data class MessagesKeyboardButtonPropertyAction( + @SerializedName("hash") + val hash: String, + @SerializedName("type") + val type: MessagesKeyboardButtonPropertyAction.Type, + @SerializedName("payload") + val payload: String? = null +) { + enum class Type( + val value: String + ) { + @SerializedName("vkpay") + VKPAY("vkpay"); + } +} diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessage.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessage.kt index 66e847fa91..5b7eebd849 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessage.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessage.kt @@ -28,9 +28,9 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId 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 @@ -70,7 +70,7 @@ data class MessagesMessage( @SerializedName("date") val date: Int, @SerializedName("from_id") - val fromId: Int, + val fromId: UserId, @SerializedName("id") val id: Int, @SerializedName("out") @@ -80,9 +80,9 @@ data class MessagesMessage( @SerializedName("text") val text: String, @SerializedName("action") - val action: Any? = null, + val action: MessagesMessageAction? = null, @SerializedName("admin_author_id") - val adminAuthorId: Int? = null, + val adminAuthorId: UserId? = null, @SerializedName("attachments") val attachments: List? = null, @SerializedName("conversation_message_id") @@ -90,7 +90,7 @@ data class MessagesMessage( @SerializedName("deleted") val deleted: BaseBoolInt? = null, @SerializedName("fwd_messages") - val fwdMessages: Any? = null, + val fwdMessages: List? = null, @SerializedName("geo") val geo: BaseGeo? = null, @SerializedName("important") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAction.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAction.kt new file mode 100644 index 0000000000..7d50581584 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAction.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.messages.dto + +import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId +import kotlin.Int +import kotlin.String + +/** + * @param type + * @param conversationMessageId - Message ID + * @param email - Email address for chat_invite_user or chat_kick_user actions + * @param memberId - User or email peer ID + * @param message - Message body of related message + * @param photo + * @param text - New chat title for chat_create and chat_title_update actions + */ +data class MessagesMessageAction( + @SerializedName("type") + val type: MessagesMessageActionStatus, + @SerializedName("conversation_message_id") + val conversationMessageId: Int? = null, + @SerializedName("email") + val email: String? = null, + @SerializedName("member_id") + val memberId: UserId? = null, + @SerializedName("message") + val message: String? = null, + @SerializedName("photo") + val photo: MessagesMessageActionPhoto? = null, + @SerializedName("text") + val text: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageActionPhoto.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageActionPhoto.kt new file mode 100644 index 0000000000..fde37d515a --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageActionPhoto.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.messages.dto + +import com.google.gson.annotations.SerializedName +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 + */ +data class MessagesMessageActionPhoto( + @SerializedName("photo_50") + val photo50: String, + @SerializedName("photo_100") + val photo100: String, + @SerializedName("photo_200") + val photo200: String +) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageActionStatus.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageActionStatus.kt new file mode 100644 index 0000000000..bb81e90f51 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageActionStatus.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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class MessagesMessageActionStatus( + val value: String +) { + @SerializedName("accepted_message_request") + ACCEPTED_MESSAGE_REQUEST("accepted_message_request"); +} diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachment.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachment.kt index 74f706a56b..493ee8d9e5 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachment.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachment.kt @@ -29,7 +29,6 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName import com.vk.sdk.api.audio.dto.AudioAudio -import com.vk.sdk.api.base.dto.BaseLink import com.vk.sdk.api.base.dto.BaseSticker import com.vk.sdk.api.calls.dto.CallsCall import com.vk.sdk.api.docs.dto.DocsDoc @@ -39,9 +38,8 @@ import com.vk.sdk.api.market.dto.MarketMarketItem import com.vk.sdk.api.photos.dto.PhotosPhoto import com.vk.sdk.api.polls.dto.PollsPoll import com.vk.sdk.api.stories.dto.StoriesStory -import com.vk.sdk.api.video.dto.VideoVideo +import com.vk.sdk.api.video.dto.VideoVideoFull import com.vk.sdk.api.wall.dto.WallWallComment -import com.vk.sdk.api.wall.dto.WallWallpostFull /** * @param type @@ -51,14 +49,12 @@ import com.vk.sdk.api.wall.dto.WallWallpostFull * @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 */ @@ -77,8 +73,6 @@ data class MessagesMessageAttachment( val gift: GiftsLayout? = null, @SerializedName("graffiti") val graffiti: MessagesGraffiti? = null, - @SerializedName("link") - val link: BaseLink? = null, @SerializedName("market") val market: MarketMarketItem? = null, @SerializedName("market_market_album") @@ -90,9 +84,7 @@ data class MessagesMessageAttachment( @SerializedName("story") val story: StoriesStory? = null, @SerializedName("video") - val video: VideoVideo? = null, - @SerializedName("wall") - val wall: WallWallpostFull? = null, + val video: VideoVideoFull? = null, @SerializedName("wall_reply") val wallReply: WallWallComment? = null, @SerializedName("poll") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachmentType.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachmentType.kt index 6f9c9d8b74..75c6032296 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachmentType.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageAttachmentType.kt @@ -33,6 +33,6 @@ import kotlin.String enum class MessagesMessageAttachmentType( val value: String ) { - @SerializedName("mini_app") - MINI_APP("mini_app"); + @SerializedName("group_call_in_progress") + GROUP_CALL_IN_PROGRESS("group_call_in_progress"); } diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageRequestData.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageRequestData.kt index 3a857dc6f2..0ae65c4b7e 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageRequestData.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesMessageRequestData.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.String @@ -40,7 +41,7 @@ data class MessagesMessageRequestData( @SerializedName("status") val status: String? = null, @SerializedName("inviter_id") - val inviterId: Int? = null, + val inviterId: UserId? = null, @SerializedName("request_date") val requestDate: Int? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesOutReadBy.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesOutReadBy.kt index 4464470b36..79800da2a5 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesOutReadBy.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesOutReadBy.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.collections.List @@ -39,5 +40,5 @@ data class MessagesOutReadBy( @SerializedName("count") val count: Int? = null, @SerializedName("member_ids") - val memberIds: List? = null + val memberIds: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPinnedMessage.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPinnedMessage.kt index 348bda6089..bea828dfdc 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPinnedMessage.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesPinnedMessage.kt @@ -28,15 +28,16 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import com.vk.sdk.api.base.dto.BaseGeo import kotlin.Int import kotlin.String import kotlin.collections.List /** + * @param id - Message ID * @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 @@ -47,12 +48,12 @@ import kotlin.collections.List * @param keyboard */ data class MessagesPinnedMessage( + @SerializedName("id") + val id: Int, @SerializedName("date") val date: Int, @SerializedName("from_id") - val fromId: Int, - @SerializedName("id") - val id: Int, + val fromId: UserId, @SerializedName("peer_id") val peerId: Int, @SerializedName("text") diff --git a/api/src/main/java/com/vk/sdk/api/newsfeed/NewsfeedService.kt b/api/src/main/java/com/vk/sdk/api/newsfeed/NewsfeedService.kt index 5c0c921de1..fd296e5960 100644 --- a/api/src/main/java/com/vk/sdk/api/newsfeed/NewsfeedService.kt +++ b/api/src/main/java/com/vk/sdk/api/newsfeed/NewsfeedService.kt @@ -34,7 +34,6 @@ 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.NewsfeedCommentsFilters -import com.vk.sdk.api.newsfeed.dto.NewsfeedFilters import com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedExtendedNameCase import com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedExtendedResponse import com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedNameCase @@ -46,6 +45,7 @@ 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.NewsfeedNewsfeedItemType import com.vk.sdk.api.newsfeed.dto.NewsfeedSearchExtendedResponse import com.vk.sdk.api.newsfeed.dto.NewsfeedSearchResponse import com.vk.sdk.api.newsfeed.dto.NewsfeedUnsubscribeType @@ -100,7 +100,7 @@ class NewsfeedService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("list_id", listId) + addParam("list_id", listId, min = 0) } /** @@ -129,7 +129,7 @@ class NewsfeedService { * @return [VKRequest] with [NewsfeedGetResponse] */ fun newsfeedGet( - filters: List? = null, + filters: List? = null, returnBanned: Boolean? = null, startTime: Int? = null, endTime: Int? = null, @@ -148,12 +148,12 @@ class NewsfeedService { } 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) } + startTime?.let { addParam("start_time", it, min = 0) } + endTime?.let { addParam("end_time", it, min = 0) } + maxPhotos?.let { addParam("max_photos", it, min = 0) } sourceIds?.let { addParam("source_ids", it) } startFrom?.let { addParam("start_from", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } @@ -239,15 +239,15 @@ class NewsfeedService { GsonHolder.gson.fromJson(it, NewsfeedGetCommentsResponse::class.java) } .apply { - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 100) } 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) } + startTime?.let { addParam("start_time", it, min = 0) } + endTime?.let { addParam("end_time", it, min = 0) } + lastCommentsCount?.let { addParam("last_comments_count", it, min = 0, max = 10) } startFrom?.let { addParam("start_from", it) } val fieldsJsonConverted = fields?.map { it.value @@ -307,10 +307,10 @@ class NewsfeedService { } .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) } + startTime?.let { addParam("start_time", it, min = 0) } + endTime?.let { addParam("end_time", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 50) } } /** @@ -338,11 +338,11 @@ class NewsfeedService { 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) } + startTime?.let { addParam("start_time", it, min = 0) } + endTime?.let { addParam("end_time", it, min = 0) } + maxPhotos?.let { addParam("max_photos", it, min = 0) } startFrom?.let { addParam("start_from", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } @@ -369,8 +369,8 @@ class NewsfeedService { GsonHolder.gson.fromJson(it, NewsfeedGetSuggestedSourcesResponse::class.java) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } shuffle?.let { addParam("shuffle", it) } val fieldsJsonConverted = fields?.map { it.value @@ -398,7 +398,7 @@ class NewsfeedService { .apply { addParam("type", type) ownerId?.let { addParam("owner_id", it) } - itemId?.let { addParam("item_id", it) } + itemId?.let { addParam("item_id", it, min = 0) } } /** @@ -414,14 +414,14 @@ class NewsfeedService { fun newsfeedSaveList( title: String, listId: Int? = null, - sourceIds: List? = 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) } + listId?.let { addParam("list_id", it, min = 0) } sourceIds?.let { addParam("source_ids", it) } noReposts?.let { addParam("no_reposts", it) } } @@ -457,11 +457,11 @@ class NewsfeedService { } .apply { q?.let { addParam("q", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 200) } latitude?.let { addParam("latitude", it) } longitude?.let { addParam("longitude", it) } - startTime?.let { addParam("start_time", it) } - endTime?.let { addParam("end_time", it) } + startTime?.let { addParam("start_time", it, min = 0) } + endTime?.let { addParam("end_time", it, min = 0) } startFrom?.let { addParam("start_from", it) } val fieldsJsonConverted = fields?.map { it.value @@ -501,11 +501,11 @@ class NewsfeedService { .apply { q?.let { addParam("q", it) } addParam("extended", true) - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 200) } latitude?.let { addParam("latitude", it) } longitude?.let { addParam("longitude", it) } - startTime?.let { addParam("start_time", it) } - endTime?.let { addParam("end_time", it) } + startTime?.let { addParam("start_time", it, min = 0) } + endTime?.let { addParam("end_time", it, min = 0) } startFrom?.let { addParam("start_from", it) } val fieldsJsonConverted = fields?.map { it.value @@ -535,7 +535,7 @@ class NewsfeedService { .apply { addParam("type", type) addParam("owner_id", ownerId) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) trackCode?.let { addParam("track_code", it) } } @@ -557,7 +557,7 @@ class NewsfeedService { } .apply { addParam("type", type.value) - addParam("item_id", itemId) + addParam("item_id", itemId, min = 0) ownerId?.let { addParam("owner_id", it) } } } diff --git a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemDigestItem.kt b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemDigestItem.kt index 5552b3d348..929207904a 100644 --- a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemDigestItem.kt +++ b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedItemDigestItem.kt @@ -37,7 +37,6 @@ import com.vk.sdk.api.wall.dto.WallPostSource import com.vk.sdk.api.wall.dto.WallPostType import com.vk.sdk.api.wall.dto.WallViews import com.vk.sdk.api.wall.dto.WallWallpostAttachment -import kotlin.Any import kotlin.Boolean import kotlin.Int import kotlin.String @@ -57,7 +56,6 @@ import kotlin.collections.List * @param isFavorite - Information whether the post in favorites list * @param likes - Count of likes * @param ownerId - Wall owner's ID - * @param poster * @param postId - If post type 'reply', contains original post ID * @param parentsStack - If post type 'reply', contains original parent IDs stack * @param postSource @@ -81,7 +79,7 @@ data class NewsfeedItemDigestItem( @SerializedName("edited") val edited: Int? = null, @SerializedName("from_id") - val fromId: Int? = null, + val fromId: UserId? = null, @SerializedName("geo") val geo: WallGeo? = null, @SerializedName("id") @@ -94,8 +92,6 @@ data class NewsfeedItemDigestItem( val likes: BaseLikesInfo? = null, @SerializedName("owner_id") val ownerId: UserId? = null, - @SerializedName("poster") - val poster: Any? = null, @SerializedName("post_id") val postId: Int? = null, @SerializedName("parents_stack") @@ -107,7 +103,7 @@ data class NewsfeedItemDigestItem( @SerializedName("reposts") val reposts: BaseRepostsInfo? = null, @SerializedName("signer_id") - val signerId: Int? = null, + val signerId: UserId? = null, @SerializedName("text") val text: String? = null, @SerializedName("views") diff --git a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedListFull.kt b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedListFull.kt index 4d336434fe..3e0bda0e74 100644 --- a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedListFull.kt +++ b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedListFull.kt @@ -28,24 +28,25 @@ package com.vk.sdk.api.newsfeed.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import com.vk.sdk.api.base.dto.BaseBoolInt import kotlin.Int import kotlin.String import kotlin.collections.List /** - * @param noReposts - Information whether reposts hiding is enabled - * @param sourceIds * @param id - List ID * @param title - List title + * @param noReposts - Information whether reposts hiding is enabled + * @param sourceIds */ data class NewsfeedListFull( + @SerializedName("id") + val id: Int, + @SerializedName("title") + val title: String, @SerializedName("no_reposts") val noReposts: BaseBoolInt? = null, @SerializedName("source_ids") - val sourceIds: List? = null, - @SerializedName("id") - val id: Int? = null, - @SerializedName("title") - val title: String? = null + val sourceIds: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedItem.kt b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedItem.kt index 10f13107c5..c9fa839dd1 100644 --- a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedItem.kt +++ b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedItem.kt @@ -31,31 +31,41 @@ import com.google.gson.JsonDeserializationContext import com.google.gson.JsonDeserializer import com.google.gson.JsonElement import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import com.vk.sdk.api.aliexpress.dto.AliexpressBlockPanel import com.vk.sdk.api.aliexpress.dto.AliexpressCarouselItem +import com.vk.sdk.api.aliexpress.dto.AliexpressPromoCard +import com.vk.sdk.api.aliexpress.dto.AliexpressSocialFooter import com.vk.sdk.api.apps.dto.AppsApp import com.vk.sdk.api.base.dto.BaseBoolInt import com.vk.sdk.api.base.dto.BaseCommentsInfo -import com.vk.sdk.api.base.dto.BaseGeo import com.vk.sdk.api.base.dto.BaseImage import com.vk.sdk.api.base.dto.BaseLikesInfo import com.vk.sdk.api.base.dto.BaseLinkButton import com.vk.sdk.api.base.dto.BaseRepostsInfo +import com.vk.sdk.api.classifieds.dto.ClassifiedsWorkiCarouselItem import com.vk.sdk.api.classifieds.dto.ClassifiedsYoulaCarouselBlockGroup +import com.vk.sdk.api.classifieds.dto.ClassifiedsYoulaGroupsBlock import com.vk.sdk.api.classifieds.dto.ClassifiedsYoulaItemExtended import com.vk.sdk.api.discover.dto.DiscoverCarouselButton import com.vk.sdk.api.discover.dto.DiscoverCarouselItem import com.vk.sdk.api.discover.dto.DiscoverCarouselObjectsType import com.vk.sdk.api.groups.dto.GroupsSuggestion +import com.vk.sdk.api.messages.dto.MessagesChatSuggestion import com.vk.sdk.api.photos.dto.PhotosTagsSuggestionItem import com.vk.sdk.api.photos.dto.PhotosTagsSuggestionItemEndCard import com.vk.sdk.api.stories.dto.StoriesStory import com.vk.sdk.api.textlives.dto.TextlivesTextliveTextpostBlock import com.vk.sdk.api.video.dto.VideoVideo +import com.vk.sdk.api.video.dto.VideoVideoFull +import com.vk.sdk.api.wall.dto.WallGeo +import com.vk.sdk.api.wall.dto.WallPostCopyright import com.vk.sdk.api.wall.dto.WallPostSource +import com.vk.sdk.api.wall.dto.WallPostType import com.vk.sdk.api.wall.dto.WallViews -import com.vk.sdk.api.wall.dto.WallWallpost import com.vk.sdk.api.wall.dto.WallWallpostAttachment +import com.vk.sdk.api.wall.dto.WallWallpostDonut +import com.vk.sdk.api.wall.dto.WallWallpostFull import java.lang.IllegalStateException import java.lang.reflect.Type import kotlin.Boolean @@ -66,203 +76,294 @@ import kotlin.collections.List sealed class NewsfeedNewsfeedItem { /** - * @param activity - * @param attachments - * @param comments - * @param copyHistory + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime * @param feedback + * @param carouselOffset - Index of current carousel element + * @param copyHistory + * @param canEdit - Information whether current user can edit the post + * @param createdBy - Post creator ID (if post still can be edited) + * @param canDelete - Information whether current user can delete the post + * @param canPin - Information whether current user can pin the post + * @param donut + * @param isPinned - Information whether the post is pinned + * @param comments + * @param markedAsAds - Information whether the post is marked as ads + * @param topicId - Topic ID. Allowed values can be obtained from newsfeed.getPostTopics method + * @param shortTextRate - Preview length control parameter + * @param hash - Hash for sharing + * @param accessKey - Access key to private object + * @param isDeleted + * @param attachments + * @param copyright - Information about the source of the post + * @param edited - Date of editing in Unixtime + * @param fromId - Post author ID * @param geo + * @param id - Post ID + * @param isArchived - Is post archived, only for post owners * @param isFavorite - Information whether the post in favorites list - * @param likes - * @param markedAsAds - Information whether the post is marked as ads - * @param postId - Post ID + * @param likes - Count of likes + * @param ownerId - Wall owner's ID + * @param postId - If post type 'reply', contains original post ID + * @param parentsStack - If post type 'reply', contains original parent IDs stack * @param postSource * @param postType * @param reposts * @param signerId - Post signer ID * @param text - Post text * @param views - Count of views - * @param shortTextRate - Preview length control parameter - * @param carouselOffset - Index of current carousel element - * @param type - * @param sourceId - Item source ID - * @param date - Date when item has been added in Unixtime */ data class NewsfeedItemWallpost( - @SerializedName("activity") - val activity: NewsfeedEventActivity? = null, - @SerializedName("attachments") - val attachments: List? = null, - @SerializedName("comments") - val comments: BaseCommentsInfo? = null, - @SerializedName("copy_history") - val copyHistory: List? = null, + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("feedback") val feedback: NewsfeedItemWallpostFeedback? = null, + @SerializedName("carousel_offset") + val carouselOffset: Int? = null, + @SerializedName("copy_history") + val copyHistory: List? = null, + @SerializedName("can_edit") + val canEdit: BaseBoolInt? = null, + @SerializedName("created_by") + val createdBy: UserId? = null, + @SerializedName("can_delete") + val canDelete: BaseBoolInt? = null, + @SerializedName("can_pin") + val canPin: BaseBoolInt? = null, + @SerializedName("donut") + val donut: WallWallpostDonut? = null, + @SerializedName("is_pinned") + val isPinned: Int? = null, + @SerializedName("comments") + val comments: BaseCommentsInfo? = null, + @SerializedName("marked_as_ads") + val markedAsAds: BaseBoolInt? = null, + @SerializedName("topic_id") + val topicId: NewsfeedItemWallpost.TopicId? = null, + @SerializedName("short_text_rate") + val shortTextRate: Float? = null, + @SerializedName("hash") + val hash: String? = null, + @SerializedName("access_key") + val accessKey: String? = null, + @SerializedName("is_deleted") + val isDeleted: Boolean? = null, + @SerializedName("attachments") + val attachments: List? = null, + @SerializedName("copyright") + val copyright: WallPostCopyright? = null, + @SerializedName("edited") + val edited: Int? = null, + @SerializedName("from_id") + val fromId: UserId? = null, @SerializedName("geo") - val geo: BaseGeo? = null, + val geo: WallGeo? = null, + @SerializedName("id") + val id: Int? = null, + @SerializedName("is_archived") + val isArchived: Boolean? = null, @SerializedName("is_favorite") val isFavorite: Boolean? = null, @SerializedName("likes") val likes: BaseLikesInfo? = null, - @SerializedName("marked_as_ads") - val markedAsAds: BaseBoolInt? = null, + @SerializedName("owner_id") + val ownerId: UserId? = null, @SerializedName("post_id") val postId: Int? = null, + @SerializedName("parents_stack") + val parentsStack: List? = null, @SerializedName("post_source") val postSource: WallPostSource? = null, @SerializedName("post_type") - val postType: NewsfeedItemWallpostType? = null, + val postType: WallPostType? = null, @SerializedName("reposts") val reposts: BaseRepostsInfo? = null, @SerializedName("signer_id") - val signerId: Int? = null, + val signerId: UserId? = null, @SerializedName("text") val text: String? = null, @SerializedName("views") - val views: WallViews? = null, - @SerializedName("short_text_rate") - val shortTextRate: Float? = null, - @SerializedName("carousel_offset") - val carouselOffset: Int? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null - ) : NewsfeedNewsfeedItem() + val views: WallViews? = null + ) : NewsfeedNewsfeedItem() { + enum class TopicId( + val value: Int + ) { + @SerializedName("0") + EMPTY_TOPIC(0), + + @SerializedName("1") + ART(1), + + @SerializedName("7") + IT(7), + + @SerializedName("12") + GAMES(12), + + @SerializedName("16") + MUSIC(16), + + @SerializedName("19") + PHOTO(19), + + @SerializedName("21") + SCIENCE_AND_TECH(21), + + @SerializedName("23") + SPORT(23), + + @SerializedName("25") + TRAVEL(25), + + @SerializedName("26") + TV_AND_CINEMA(26), + + @SerializedName("32") + HUMOR(32), + + @SerializedName("43") + FASHION(43); + } + } /** - * @param photos - * @param postId - Post ID - * @param carouselOffset - Index of current carousel element * @param type * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param photos + * @param postId - Post ID + * @param carouselOffset - Index of current carousel element */ data class NewsfeedItemPhoto( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("photos") val photos: NewsfeedItemPhotoPhotos? = null, @SerializedName("post_id") val postId: Int? = null, @SerializedName("carousel_offset") - val carouselOffset: Int? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null + val carouselOffset: Int? = null ) : NewsfeedNewsfeedItem() /** - * @param photoTags - * @param postId - Post ID - * @param carouselOffset - Index of current carousel element * @param type * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param photoTags + * @param postId - Post ID + * @param carouselOffset - Index of current carousel element */ data class NewsfeedItemPhotoTag( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("photo_tags") val photoTags: NewsfeedItemPhotoTagPhotoTags? = null, @SerializedName("post_id") val postId: Int? = null, @SerializedName("carousel_offset") - val carouselOffset: Int? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null + val carouselOffset: Int? = null ) : NewsfeedNewsfeedItem() /** - * @param friends * @param type * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param friends */ data class NewsfeedItemFriend( - @SerializedName("friends") - val friends: NewsfeedItemFriendFriends? = null, @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, + val type: NewsfeedNewsfeedItemType, @SerializedName("source_id") - val sourceId: Int? = null, + val sourceId: UserId, @SerializedName("date") - val date: Int? = null + val date: Int, + @SerializedName("friends") + val friends: NewsfeedItemFriendFriends? = null ) : NewsfeedNewsfeedItem() /** - * @param audio - * @param postId - Post ID * @param type * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param audio + * @param postId - Post ID */ data class NewsfeedItemAudio( - @SerializedName("audio") - val audio: NewsfeedItemAudioAudio? = null, - @SerializedName("post_id") - val postId: Int? = null, @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, + val type: NewsfeedNewsfeedItemType, @SerializedName("source_id") - val sourceId: Int? = null, + val sourceId: UserId, @SerializedName("date") - val date: Int? = null + val date: Int, + @SerializedName("audio") + val audio: NewsfeedItemAudioAudio? = null, + @SerializedName("post_id") + val postId: Int? = null ) : NewsfeedNewsfeedItem() /** - * @param video - * @param carouselOffset - Index of current carousel element * @param type * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param video + * @param carouselOffset - Index of current carousel element */ data class NewsfeedItemVideo( - @SerializedName("video") - val video: NewsfeedItemVideoVideo? = null, - @SerializedName("carousel_offset") - val carouselOffset: Int? = null, @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, + val type: NewsfeedNewsfeedItemType, @SerializedName("source_id") - val sourceId: Int? = null, + val sourceId: UserId, @SerializedName("date") - val date: Int? = null + val date: Int, + @SerializedName("video") + val video: NewsfeedItemVideoVideo? = null, + @SerializedName("carousel_offset") + val carouselOffset: Int? = null ) : NewsfeedNewsfeedItem() /** - * @param comments - * @param likes * @param postId - Topic post ID * @param text - Post text * @param type * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param comments + * @param likes */ data class NewsfeedItemTopic( - @SerializedName("comments") - val comments: BaseCommentsInfo? = null, - @SerializedName("likes") - val likes: BaseLikesInfo? = null, @SerializedName("post_id") - val postId: Int? = null, + val postId: Int, @SerializedName("text") - val text: String? = null, + val text: String, @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, + val type: NewsfeedNewsfeedItemType, @SerializedName("source_id") - val sourceId: Int? = null, + val sourceId: UserId, @SerializedName("date") - val date: Int? = null + val date: Int, + @SerializedName("comments") + val comments: BaseCommentsInfo? = null, + @SerializedName("likes") + val likes: BaseLikesInfo? = null ) : NewsfeedNewsfeedItem() /** + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime * @param feedId - id of feed in digest * @param items * @param mainPostIds @@ -270,11 +371,14 @@ sealed class NewsfeedNewsfeedItem { * @param header * @param footer * @param trackCode - * @param type - * @param sourceId - Item source ID - * @param date - Date when item has been added in Unixtime */ data class NewsfeedItemDigest( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("feed_id") val feedId: String? = null, @SerializedName("items") @@ -288,13 +392,7 @@ sealed class NewsfeedNewsfeedItem { @SerializedName("footer") val footer: NewsfeedItemDigestFooter? = null, @SerializedName("track_code") - val trackCode: String? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null + val trackCode: String? = null ) : NewsfeedNewsfeedItem() { enum class Template( val value: String @@ -311,16 +409,22 @@ sealed class NewsfeedNewsfeedItem { } /** + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime * @param text * @param title * @param action * @param images * @param trackCode - * @param type - * @param sourceId - Item source ID - * @param date - Date when item has been added in Unixtime */ data class NewsfeedItemPromoButton( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("text") val text: String? = null, @SerializedName("title") @@ -330,25 +434,25 @@ sealed class NewsfeedNewsfeedItem { @SerializedName("images") val images: List? = null, @SerializedName("track_code") - val trackCode: String? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null + val trackCode: String? = null ) : NewsfeedNewsfeedItem() /** + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime * @param blockType * @param stories * @param title * @param trackCode - * @param type - * @param sourceId - Item source ID - * @param date - Date when item has been added in Unixtime */ data class NewsfeedItemStoriesBlock( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("block_type") val blockType: NewsfeedItemStoriesBlock.BlockType? = null, @SerializedName("stories") @@ -356,13 +460,7 @@ sealed class NewsfeedNewsfeedItem { @SerializedName("title") val title: String? = null, @SerializedName("track_code") - val trackCode: String? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null + val trackCode: String? = null ) : NewsfeedNewsfeedItem() { enum class BlockType( val value: String @@ -378,36 +476,46 @@ sealed class NewsfeedNewsfeedItem { /** * @param banner * @param poll - * @param trackCode * @param type * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param trackCode */ data class NewsfeedItemFeedbackPoll( @SerializedName("banner") - val banner: NewsfeedItemFeedbackPollBanner? = null, + val banner: NewsfeedItemFeedbackPollBanner, @SerializedName("poll") - val poll: NewsfeedItemFeedbackPollPoll? = null, - @SerializedName("track_code") - val trackCode: String? = null, + val poll: NewsfeedItemFeedbackPollPoll, @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, + val type: NewsfeedNewsfeedItemType, @SerializedName("source_id") - val sourceId: Int? = null, + val sourceId: UserId, @SerializedName("date") - val date: Int? = null + val date: Int, + @SerializedName("track_code") + val trackCode: String? = null ) : NewsfeedNewsfeedItem() /** + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime * @param blockId * @param text * @param animation * @param trackCode - * @param type - * @param sourceId - Item source ID - * @param date - Date when item has been added in Unixtime + * @param decoration - none - without background, background - with background, card - looks + * like a card + * @param subtitle + * @param button */ data class NewsfeedItemAnimatedBlock( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("block_id") val blockId: String? = null, @SerializedName("text") @@ -416,25 +524,44 @@ sealed class NewsfeedNewsfeedItem { val animation: NewsfeedItemAnimatedBlockAnimation? = null, @SerializedName("track_code") val trackCode: String? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null - ) : NewsfeedNewsfeedItem() + @SerializedName("decoration") + val decoration: NewsfeedItemAnimatedBlock.Decoration? = null, + @SerializedName("subtitle") + val subtitle: String? = null, + @SerializedName("button") + val button: BaseLinkButton? = null + ) : NewsfeedNewsfeedItem() { + enum class Decoration( + val value: String + ) { + @SerializedName("none") + NONE("none"), + + @SerializedName("background") + BACKGROUND("background"), + + @SerializedName("card") + CARD("card"); + } + } /** + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime * @param title * @param trackCode * @param items * @param nextFrom - Next from value * @param button - * @param type - * @param sourceId - Item source ID - * @param date - Date when item has been added in Unixtime */ data class NewsfeedItemClipsBlock( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("title") val title: String? = null, @SerializedName("track_code") @@ -444,13 +571,7 @@ sealed class NewsfeedNewsfeedItem { @SerializedName("next_from") val nextFrom: String? = null, @SerializedName("button") - val button: BaseLinkButton? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null + val button: BaseLinkButton? = null ) : NewsfeedNewsfeedItem() /** @@ -460,9 +581,9 @@ sealed class NewsfeedNewsfeedItem { * @param trackCode - Track code of the block * @param button * @param type - * @param nextFrom - Encoded string for the next page * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param nextFrom - Encoded string for the next page */ data class NewsfeedItemRecommendedGroupsBlock( @SerializedName("title") @@ -477,24 +598,30 @@ sealed class NewsfeedNewsfeedItem { val button: BaseLinkButton, @SerializedName("type") val type: NewsfeedNewsfeedItemType, - @SerializedName("next_from") - val nextFrom: String? = null, @SerializedName("source_id") - val sourceId: Int? = null, + val sourceId: UserId, @SerializedName("date") - val date: Int? = null + val date: Int, + @SerializedName("next_from") + val nextFrom: String? = null ) : NewsfeedNewsfeedItem() /** + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime * @param endCard * @param recognitionArticleLink - help link * @param trackCode - Track code of the block * @param items - * @param type - * @param sourceId - Item source ID - * @param date - Date when item has been added in Unixtime */ data class NewsfeedItemRecognizeBlock( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("end_card") val endCard: PhotosTagsSuggestionItemEndCard? = null, @SerializedName("recognition_article_link") @@ -502,68 +629,59 @@ sealed class NewsfeedNewsfeedItem { @SerializedName("track_code") val trackCode: String? = null, @SerializedName("items") - val items: List? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null + val items: List? = null ) : NewsfeedNewsfeedItem() /** * @param button * @param items - * @param objects - * @param objectsType * @param title - * @param trackCode * @param type * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param objects + * @param objectsType + * @param trackCode */ - data class NewsfeedItemGamesCarousel( + data class NewsfeedItemAppsCarousel( @SerializedName("button") - val button: DiscoverCarouselButton? = null, + val button: DiscoverCarouselButton, @SerializedName("items") - val items: List? = null, + val items: List, + @SerializedName("title") + val title: String, + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("objects") val objects: List? = null, @SerializedName("objects_type") val objectsType: DiscoverCarouselObjectsType? = null, - @SerializedName("title") - val title: String? = null, @SerializedName("track_code") - val trackCode: String? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null + val trackCode: String? = null ) : NewsfeedNewsfeedItem() /** * @param textliveTextpostBlock - * @param trackCode - * @param keepOffline * @param type * @param sourceId - Item source ID * @param date - Date when item has been added in Unixtime + * @param trackCode */ data class NewsfeedItemTextliveBlock( @SerializedName("textlive_textpost_block") - val textliveTextpostBlock: TextlivesTextliveTextpostBlock? = null, - @SerializedName("track_code") - val trackCode: String? = null, - @SerializedName("keep_offline") - val keepOffline: Boolean? = null, + val textliveTextpostBlock: TextlivesTextliveTextpostBlock, @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, + val type: NewsfeedNewsfeedItemType, @SerializedName("source_id") - val sourceId: Int? = null, + val sourceId: UserId, @SerializedName("date") - val date: Int? = null + val date: Int, + @SerializedName("track_code") + val trackCode: String? = null ) : NewsfeedNewsfeedItem() /** @@ -575,6 +693,7 @@ sealed class NewsfeedNewsfeedItem { * @param blockDescription - Block description * @param trackCode * @param group + * @param viewStyle */ data class NewsfeedItemYoulaCarouselBlock( @SerializedName("type") @@ -592,7 +711,9 @@ sealed class NewsfeedNewsfeedItem { @SerializedName("track_code") val trackCode: String? = null, @SerializedName("group") - val group: ClassifiedsYoulaCarouselBlockGroup? = null + val group: ClassifiedsYoulaCarouselBlockGroup? = null, + @SerializedName("view_style") + val viewStyle: String? = null ) : NewsfeedNewsfeedItem() { enum class Type( val value: String @@ -605,24 +726,39 @@ sealed class NewsfeedNewsfeedItem { /** * @param type - type * @param blockTitle - Block title - * @param items - * @param moreButton - More button url * @param trackCode + * @param goodsCarouselViewType - Display style of block * @param blockPanel - Block top panel + * @param promoCard - Promo card item + * @param items + * @param moreButton - More button url + * @param footer + * @param useOnelineProductTitle - Show product title in one row + * @param isAsync - Load products via API method */ data class NewsfeedItemAliexpressCarouselBlock( @SerializedName("type") val type: NewsfeedItemAliexpressCarouselBlock.Type, @SerializedName("block_title") val blockTitle: String, - @SerializedName("items") - val items: List, - @SerializedName("more_button") - val moreButton: BaseLinkButton, @SerializedName("track_code") val trackCode: String, + @SerializedName("goods_carousel_view_type") + val goodsCarouselViewType: String, @SerializedName("block_panel") - val blockPanel: AliexpressBlockPanel? = null + val blockPanel: AliexpressBlockPanel? = null, + @SerializedName("promo_card") + val promoCard: AliexpressPromoCard? = null, + @SerializedName("items") + val items: List? = null, + @SerializedName("more_button") + val moreButton: BaseLinkButton? = null, + @SerializedName("footer") + val footer: AliexpressSocialFooter? = null, + @SerializedName("use_oneline_product_title") + val useOnelineProductTitle: Boolean? = null, + @SerializedName("is_async") + val isAsync: Boolean? = null ) : NewsfeedNewsfeedItem() { enum class Type( val value: String @@ -636,21 +772,27 @@ sealed class NewsfeedNewsfeedItem { * @param app * @param title * @param buttonText + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime * @param trackCode * @param friendsPlayingText * @param friendsAvatars * @param appCover - * @param type - * @param sourceId - Item source ID - * @param date - Date when item has been added in Unixtime */ - data class NewsfeedItemRecommendedGameBlock( + data class NewsfeedItemRecommendedAppBlock( @SerializedName("app") val app: AppsApp, @SerializedName("title") val title: String, @SerializedName("button_text") val buttonText: String, + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("track_code") val trackCode: String? = null, @SerializedName("friends_playing_text") @@ -658,13 +800,7 @@ sealed class NewsfeedNewsfeedItem { @SerializedName("friends_avatars") val friendsAvatars: List>? = null, @SerializedName("app_cover") - val appCover: List? = null, - @SerializedName("type") - val type: NewsfeedNewsfeedItemType? = null, - @SerializedName("source_id") - val sourceId: Int? = null, - @SerializedName("date") - val date: Int? = null + val appCover: List? = null ) : NewsfeedNewsfeedItem() /** @@ -685,6 +821,150 @@ sealed class NewsfeedNewsfeedItem { } } + /** + * @param type - type + * @param items + * @param blockTitle - Block title + * @param moreButton - More button url + * @param trackCode + */ + data class NewsfeedItemWorkiCarouselBlock( + @SerializedName("type") + val type: NewsfeedItemWorkiCarouselBlock.Type, + @SerializedName("items") + val items: List, + @SerializedName("block_title") + val blockTitle: String? = null, + @SerializedName("more_button") + val moreButton: BaseLinkButton? = null, + @SerializedName("track_code") + val trackCode: String? = null + ) : NewsfeedNewsfeedItem() { + enum class Type( + val value: String + ) { + @SerializedName("worki_carousel") + WORKI_CAROUSEL("worki_carousel"); + } + } + + /** + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime + * @param title + * @param trackCode + * @param items + * @param nextFrom - Next from value + * @param button + */ + data class NewsfeedItemVideosForYouBlock( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, + @SerializedName("title") + val title: String? = null, + @SerializedName("track_code") + val trackCode: String? = null, + @SerializedName("items") + val items: List? = null, + @SerializedName("next_from") + val nextFrom: String? = null, + @SerializedName("button") + val button: BaseLinkButton? = null + ) : NewsfeedNewsfeedItem() + + /** + * @param type - type + * @param title + * @param trackCode + * @param isAsync + * @param data + */ + data class NewsfeedItemYoulaGroupsBlock( + @SerializedName("type") + val type: NewsfeedItemYoulaGroupsBlock.Type, + @SerializedName("title") + val title: String, + @SerializedName("track_code") + val trackCode: String, + @SerializedName("is_async") + val isAsync: Boolean, + @SerializedName("data") + val data: ClassifiedsYoulaGroupsBlock? = null + ) : NewsfeedNewsfeedItem() { + enum class Type( + val value: String + ) { + @SerializedName("youla_groups_block") + YOULA_GROUPS_BLOCK("youla_groups_block"); + } + } + + /** + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime + * @param title + * @param description + * @param privacyText + * @param trackCode + * @param item + * @param buttons + */ + data class NewsfeedItemVideoPostcardBlock( + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, + @SerializedName("title") + val title: String? = null, + @SerializedName("description") + val description: String? = null, + @SerializedName("privacy_text") + val privacyText: String? = null, + @SerializedName("track_code") + val trackCode: String? = null, + @SerializedName("item") + val item: VideoVideoFull? = null, + @SerializedName("buttons") + val buttons: List? = null + ) : NewsfeedNewsfeedItem() + + /** + * @param items - Items of the block + * @param count - Total count of recommendations + * @param trackCode - Track code of the block + * @param button + * @param type + * @param sourceId - Item source ID + * @param date - Date when item has been added in Unixtime + * @param nextFrom - Encoded string for a next page + */ + data class NewsfeedItemRecommendedChatsBlock( + @SerializedName("items") + val items: List, + @SerializedName("count") + val count: Int, + @SerializedName("track_code") + val trackCode: String, + @SerializedName("button") + val button: BaseLinkButton, + @SerializedName("type") + val type: NewsfeedNewsfeedItemType, + @SerializedName("source_id") + val sourceId: UserId, + @SerializedName("date") + val date: Int, + @SerializedName("next_from") + val nextFrom: String? = null + ) : NewsfeedNewsfeedItem() + class Deserializer : JsonDeserializer { override fun deserialize( json: JsonElement, diff --git a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedItemType.kt b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedItemType.kt index c8d120a8ab..4d32ee4e39 100644 --- a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedItemType.kt +++ b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedItemType.kt @@ -106,5 +106,35 @@ enum class NewsfeedNewsfeedItemType( CLIPS_CHALLENGES("clips_challenges"), @SerializedName("expert_card") - EXPERT_CARD("expert_card"); + EXPERT_CARD("expert_card"), + + @SerializedName("videos_for_you") + VIDEOS_FOR_YOU("videos_for_you"), + + @SerializedName("liked_by_friends_groups") + LIKED_BY_FRIENDS_GROUPS("liked_by_friends_groups"), + + @SerializedName("recommended_mini_app") + RECOMMENDED_MINI_APP("recommended_mini_app"), + + @SerializedName("note") + NOTE("note"), + + @SerializedName("audio_playlist") + AUDIO_PLAYLIST("audio_playlist"), + + @SerializedName("clip") + CLIP("clip"), + + @SerializedName("clips_block") + CLIPS_BLOCK("clips_block"), + + @SerializedName("videos_for_you_block") + VIDEOS_FOR_YOU_BLOCK("videos_for_you_block"), + + @SerializedName("mini_apps_carousel") + MINI_APPS_CAROUSEL("mini_apps_carousel"), + + @SerializedName("video_postcard") + VIDEO_POSTCARD("video_postcard"); } diff --git a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedPhoto.kt b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedPhoto.kt index 425a00929c..e686fbb062 100644 --- a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedPhoto.kt +++ b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedNewsfeedPhoto.kt @@ -41,18 +41,19 @@ import kotlin.String import kotlin.collections.List /** + * @param albumId - Album ID + * @param date - Date when uploaded + * @param id - Photo ID + * @param ownerId - Photo owner's ID + * @param hasTags - Whether photo has attached tag links * @param likes * @param comments * @param canRepost - Information whether current user can repost the photo * @param accessKey - Access key for the photo - * @param albumId - Album ID - * @param date - Date when uploaded * @param height - Original photo height - * @param id - Photo ID * @param images * @param lat - Latitude * @param long - Longitude - * @param ownerId - Photo owner's ID * @param photo256 - URL of image with 2560 px width * @param canComment - Information whether current user can comment the photo * @param place @@ -61,9 +62,18 @@ import kotlin.collections.List * @param text - Photo caption * @param userId - ID of the user who have uploaded the photo * @param width - Original photo width - * @param hasTags - Whether photo has attached tag links */ data class NewsfeedNewsfeedPhoto( + @SerializedName("album_id") + val albumId: Int, + @SerializedName("date") + val date: Int, + @SerializedName("id") + val id: Int, + @SerializedName("owner_id") + val ownerId: UserId, + @SerializedName("has_tags") + val hasTags: Boolean, @SerializedName("likes") val likes: BaseLikes? = null, @SerializedName("comments") @@ -72,22 +82,14 @@ data class NewsfeedNewsfeedPhoto( val canRepost: BaseBoolInt? = null, @SerializedName("access_key") val accessKey: String? = null, - @SerializedName("album_id") - val albumId: Int? = null, - @SerializedName("date") - val date: Int? = null, @SerializedName("height") val height: Int? = null, - @SerializedName("id") - val id: Int? = null, @SerializedName("images") val images: List? = null, @SerializedName("lat") val lat: Float? = null, @SerializedName("long") val long: Float? = null, - @SerializedName("owner_id") - val ownerId: UserId? = null, @SerializedName("photo_256") val photo256: String? = null, @SerializedName("can_comment") @@ -103,7 +105,5 @@ data class NewsfeedNewsfeedPhoto( @SerializedName("user_id") val userId: UserId? = null, @SerializedName("width") - val width: Int? = null, - @SerializedName("has_tags") - val hasTags: Boolean? = null + val width: Int? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/notes/NotesService.kt b/api/src/main/java/com/vk/sdk/api/notes/NotesService.kt index 14a7d26cc2..132bb8a222 100644 --- a/api/src/main/java/com/vk/sdk/api/notes/NotesService.kt +++ b/api/src/main/java/com/vk/sdk/api/notes/NotesService.kt @@ -88,10 +88,10 @@ class NotesService { GsonHolder.gson.fromJson(it, Int::class.java) } .apply { - addParam("note_id", noteId) + addParam("note_id", noteId, min = 0) addParam("message", message) - ownerId?.let { addParam("owner_id", it) } - replyTo?.let { addParam("reply_to", it) } + ownerId?.let { addParam("owner_id", it, min = 0) } + replyTo?.let { addParam("reply_to", it, min = 0) } guid?.let { addParam("guid", it) } } @@ -105,7 +105,7 @@ class NotesService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("note_id", noteId) + addParam("note_id", noteId, min = 0) } /** @@ -120,8 +120,8 @@ class NotesService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("comment_id", commentId) - ownerId?.let { addParam("owner_id", it) } + addParam("comment_id", commentId, min = 0) + ownerId?.let { addParam("owner_id", it, min = 0) } } /** @@ -144,7 +144,7 @@ class NotesService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("note_id", noteId) + addParam("note_id", noteId, min = 0) addParam("title", title) addParam("text", text) privacyView?.let { addParam("privacy_view", it) } @@ -167,9 +167,9 @@ class NotesService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("comment_id", commentId) - addParam("message", message) - ownerId?.let { addParam("owner_id", it) } + addParam("comment_id", commentId, min = 0) + addParam("message", message, minLength = 2) + ownerId?.let { addParam("owner_id", it, min = 0) } } /** @@ -193,9 +193,9 @@ class NotesService { } .apply { noteIds?.let { addParam("note_ids", it) } - userId?.let { addParam("user_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + userId?.let { addParam("user_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } sort?.let { addParam("sort", it.value) } } @@ -215,8 +215,8 @@ class NotesService { GsonHolder.gson.fromJson(it, NotesNote::class.java) } .apply { - addParam("note_id", noteId) - ownerId?.let { addParam("owner_id", it) } + addParam("note_id", noteId, min = 0) + ownerId?.let { addParam("owner_id", it, min = 0) } needWiki?.let { addParam("need_wiki", it) } } @@ -240,11 +240,11 @@ class NotesService { GsonHolder.gson.fromJson(it, NotesGetCommentsResponse::class.java) } .apply { - addParam("note_id", noteId) - ownerId?.let { addParam("owner_id", it) } + addParam("note_id", noteId, min = 0) + ownerId?.let { addParam("owner_id", it, min = 0) } sort?.let { addParam("sort", it.value) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } } /** @@ -259,7 +259,7 @@ class NotesService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("comment_id", commentId) - ownerId?.let { addParam("owner_id", it) } + addParam("comment_id", commentId, min = 0) + ownerId?.let { addParam("owner_id", it, min = 0) } } } diff --git a/api/src/main/java/com/vk/sdk/api/notes/dto/NotesNote.kt b/api/src/main/java/com/vk/sdk/api/notes/dto/NotesNote.kt index 250d0434a7..f3ae837618 100644 --- a/api/src/main/java/com/vk/sdk/api/notes/dto/NotesNote.kt +++ b/api/src/main/java/com/vk/sdk/api/notes/dto/NotesNote.kt @@ -32,6 +32,7 @@ import com.vk.dto.common.id.UserId import com.vk.sdk.api.base.dto.BaseBoolInt import kotlin.Int import kotlin.String +import kotlin.collections.List /** * @param comments - Comments number @@ -44,6 +45,8 @@ import kotlin.String * @param canComment - Information whether current user can comment the note * @param text - Note text * @param textWiki - Note text in wiki format + * @param privacyView + * @param privacyComment */ data class NotesNote( @SerializedName("comments") @@ -65,5 +68,9 @@ data class NotesNote( @SerializedName("text") val text: String? = null, @SerializedName("text_wiki") - val textWiki: String? = null + val textWiki: String? = null, + @SerializedName("privacy_view") + val privacyView: List? = null, + @SerializedName("privacy_comment") + val privacyComment: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/notifications/NotificationsService.kt b/api/src/main/java/com/vk/sdk/api/notifications/NotificationsService.kt index 26f70240ae..a5785fbece 100644 --- a/api/src/main/java/com/vk/sdk/api/notifications/NotificationsService.kt +++ b/api/src/main/java/com/vk/sdk/api/notifications/NotificationsService.kt @@ -67,7 +67,7 @@ class NotificationsService { GsonHolder.gson.fromJson(it, NotificationsGetResponse::class.java) } .apply { - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 1, max = 100) } startFrom?.let { addParam("start_from", it) } val filtersJsonConverted = filters?.map { it.value @@ -114,9 +114,9 @@ class NotificationsService { } .apply { addParam("user_ids", userIds) - addParam("message", message) - fragment?.let { addParam("fragment", it) } - groupId?.let { addParam("group_id", it) } + addParam("message", message, maxLength = 254) + fragment?.let { addParam("fragment", it, maxLength = 2047) } + groupId?.let { addParam("group_id", it, min = 0) } randomId?.let { addParam("random_id", it) } sendingMode?.let { addParam("sending_mode", it.value) } } diff --git a/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsNotification.kt b/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsNotification.kt new file mode 100644 index 0000000000..a07881dbed --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsNotification.kt @@ -0,0 +1,52 @@ +/** + * 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.notifications.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param date - Date when the event has been occurred + * @param feedback + * @param parent + * @param reply + * @param type - Notification type + */ +data class NotificationsNotification( + @SerializedName("date") + val date: Int? = null, + @SerializedName("feedback") + val feedback: NotificationsFeedback? = null, + @SerializedName("parent") + val parent: NotificationsNotification? = null, + @SerializedName("reply") + val reply: NotificationsReply? = null, + @SerializedName("type") + val type: String? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsNotificationItem.kt b/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsNotificationItem.kt index 26aa077fcf..eb7a693177 100644 --- a/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsNotificationItem.kt +++ b/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsNotificationItem.kt @@ -44,7 +44,7 @@ data class NotificationsNotificationItem( @SerializedName("feedback") val feedback: NotificationsFeedback? = null, @SerializedName("parent") - val parent: NotificationsNotificationParent? = null, + val parent: NotificationsNotification? = null, @SerializedName("reply") val reply: NotificationsReply? = null, @SerializedName("type") diff --git a/api/src/main/java/com/vk/sdk/api/orders/OrdersService.kt b/api/src/main/java/com/vk/sdk/api/orders/OrdersService.kt index adb5b177be..dddaf1811a 100644 --- a/api/src/main/java/com/vk/sdk/api/orders/OrdersService.kt +++ b/api/src/main/java/com/vk/sdk/api/orders/OrdersService.kt @@ -58,8 +58,8 @@ class OrdersService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("user_id", userId) - addParam("subscription_id", subscriptionId) + addParam("user_id", userId, min = 1) + addParam("subscription_id", subscriptionId, min = 0) pendingCancel?.let { addParam("pending_cancel", it) } } @@ -85,9 +85,9 @@ class OrdersService { GsonHolder.gson.fromJson(it, String::class.java) } .apply { - addParam("order_id", orderId) + addParam("order_id", orderId, min = 0) addParam("action", action.value) - appOrderId?.let { addParam("app_order_id", it) } + appOrderId?.let { addParam("app_order_id", it, min = 0) } testMode?.let { addParam("test_mode", it) } } @@ -109,8 +109,8 @@ class OrdersService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } testMode?.let { addParam("test_mode", it) } } @@ -125,7 +125,7 @@ class OrdersService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - addParam("user_id", userId) + addParam("user_id", userId, min = 1) addParam("votes", votes) } @@ -147,7 +147,7 @@ class OrdersService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - orderId?.let { addParam("order_id", it) } + orderId?.let { addParam("order_id", it, min = 0) } orderIds?.let { addParam("order_ids", it) } testMode?.let { addParam("test_mode", it) } } @@ -162,8 +162,8 @@ class OrdersService { GsonHolder.gson.fromJson(it, OrdersSubscription::class.java) } .apply { - addParam("user_id", userId) - addParam("subscription_id", subscriptionId) + addParam("user_id", userId, min = 1) + addParam("subscription_id", subscriptionId, min = 0) } /** @@ -175,7 +175,7 @@ class OrdersService { GsonHolder.gson.fromJson(it, OrdersGetUserSubscriptionsResponse::class.java) } .apply { - addParam("user_id", userId) + addParam("user_id", userId, min = 1) } /** @@ -192,8 +192,8 @@ class OrdersService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("user_id", userId) - addParam("subscription_id", subscriptionId) - addParam("price", price) + addParam("user_id", userId, min = 1) + addParam("subscription_id", subscriptionId, min = 0) + addParam("price", price, min = 0) } } diff --git a/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersOrder.kt b/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersOrder.kt index 88f2b7c276..b6846a5722 100644 --- a/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersOrder.kt +++ b/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersOrder.kt @@ -28,41 +28,61 @@ package com.vk.sdk.api.orders.dto import com.google.gson.annotations.SerializedName -import com.vk.dto.common.id.UserId -import kotlin.Int import kotlin.String /** * @param amount - Amount * @param appOrderId - App order ID - * @param cancelTransactionId - Cancel transaction ID * @param date - Date of creation in Unixtime * @param id - Order ID * @param item - Order item * @param receiverId - Receiver ID * @param status - Order status - * @param transactionId - Transaction ID * @param userId - User ID + * @param cancelTransactionId - Cancel transaction ID + * @param transactionId - Transaction ID */ data class OrdersOrder( @SerializedName("amount") - val amount: Int? = null, + val amount: String, @SerializedName("app_order_id") - val appOrderId: Int? = null, - @SerializedName("cancel_transaction_id") - val cancelTransactionId: Int? = null, + val appOrderId: String, @SerializedName("date") - val date: Int? = null, + val date: String, @SerializedName("id") - val id: Int? = null, + val id: String, @SerializedName("item") - val item: String? = null, + val item: String, @SerializedName("receiver_id") - val receiverId: Int? = null, + val receiverId: String, @SerializedName("status") - val status: String? = null, - @SerializedName("transaction_id") - val transactionId: Int? = null, + val status: OrdersOrder.Status, @SerializedName("user_id") - val userId: UserId? = null -) + val userId: String, + @SerializedName("cancel_transaction_id") + val cancelTransactionId: String? = null, + @SerializedName("transaction_id") + val transactionId: String? = null +) { + enum class Status( + val value: String + ) { + @SerializedName("created") + CREATED("created"), + + @SerializedName("charged") + CHARGED("charged"), + + @SerializedName("refunded") + REFUNDED("refunded"), + + @SerializedName("chargeable") + CHARGEABLE("chargeable"), + + @SerializedName("cancelled") + CANCELLED("cancelled"), + + @SerializedName("declined") + DECLINED("declined"); + } +} diff --git a/api/src/main/java/com/vk/sdk/api/pages/PagesService.kt b/api/src/main/java/com/vk/sdk/api/pages/PagesService.kt index 7bd9df4c6e..f7075551b0 100644 --- a/api/src/main/java/com/vk/sdk/api/pages/PagesService.kt +++ b/api/src/main/java/com/vk/sdk/api/pages/PagesService.kt @@ -165,7 +165,7 @@ class PagesService { } .apply { addParam("text", text) - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** diff --git a/api/src/main/java/com/vk/sdk/api/photos/PhotosService.kt b/api/src/main/java/com/vk/sdk/api/photos/PhotosService.kt index 93a275eab0..22a7012436 100644 --- a/api/src/main/java/com/vk/sdk/api/photos/PhotosService.kt +++ b/api/src/main/java/com/vk/sdk/api/photos/PhotosService.kt @@ -33,7 +33,6 @@ import com.vk.dto.common.id.UserId 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.BaseImage import com.vk.sdk.api.base.dto.BaseOkResponse import com.vk.sdk.api.base.dto.BaseUploadServer import com.vk.sdk.api.photos.dto.PhotosGetAlbumsResponse @@ -56,6 +55,7 @@ import com.vk.sdk.api.photos.dto.PhotosPhotoTag import com.vk.sdk.api.photos.dto.PhotosPhotoUpload import com.vk.sdk.api.photos.dto.PhotosReportCommentReason import com.vk.sdk.api.photos.dto.PhotosReportReason +import com.vk.sdk.api.photos.dto.PhotosSaveOwnerCoverPhotoResponse import com.vk.sdk.api.photos.dto.PhotosSaveOwnerPhotoResponse import com.vk.sdk.api.photos.dto.PhotosSearchResponse import com.vk.sdk.api.users.dto.UsersFields @@ -104,7 +104,7 @@ class PhotosService { } .apply { addParam("owner_id", ownerId) - addParam("photo_id", photoId) + addParam("photo_id", photoId, min = 0) accessKey?.let { addParam("access_key", it) } } @@ -132,7 +132,7 @@ class PhotosService { GsonHolder.gson.fromJson(it, PhotosPhotoAlbumFull::class.java) } .apply { - addParam("title", title) + addParam("title", title, minLength = 2) groupId?.let { addParam("group_id", it) } description?.let { addParam("description", it) } privacyView?.let { addParam("privacy_view", it) } @@ -179,7 +179,7 @@ class PhotosService { attachments?.let { addParam("attachments", it) } fromGroup?.let { addParam("from_group", it) } replyToComment?.let { addParam("reply_to_comment", it) } - stickerId?.let { addParam("sticker_id", it) } + stickerId?.let { addParam("sticker_id", it, min = 0) } accessKey?.let { addParam("access_key", it) } guid?.let { addParam("guid", it) } } @@ -196,7 +196,7 @@ class PhotosService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("photo_id", photoId) + addParam("photo_id", photoId, min = 0) ownerId?.let { addParam("owner_id", it) } } @@ -212,8 +212,8 @@ class PhotosService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("album_id", albumId) - groupId?.let { addParam("group_id", it) } + addParam("album_id", albumId, min = 0) + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -259,7 +259,7 @@ class PhotosService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("photo_id", photoId) + addParam("photo_id", photoId, min = 0) ownerId?.let { addParam("owner_id", it) } caption?.let { addParam("caption", it) } latitude?.let { addParam("latitude", it) } @@ -295,7 +295,7 @@ class PhotosService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("album_id", albumId) + addParam("album_id", albumId, min = 0) title?.let { addParam("title", it) } description?.let { addParam("description", it) } ownerId?.let { addParam("owner_id", it) } @@ -373,8 +373,8 @@ class PhotosService { feedType?.let { addParam("feed_type", it) } feed?.let { addParam("feed", it) } photoSizes?.let { addParam("photo_sizes", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -418,8 +418,8 @@ class PhotosService { feedType?.let { addParam("feed_type", it) } feed?.let { addParam("feed", it) } photoSizes?.let { addParam("photo_sizes", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -448,8 +448,8 @@ class PhotosService { .apply { ownerId?.let { addParam("owner_id", it) } albumIds?.let { addParam("album_ids", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } needSystem?.let { addParam("need_system", it) } needCovers?.let { addParam("need_covers", it) } photoSizes?.let { addParam("photo_sizes", it) } @@ -500,8 +500,8 @@ class PhotosService { } .apply { ownerId?.let { addParam("owner_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } photoSizes?.let { addParam("photo_sizes", it) } noServiceAlbums?.let { addParam("no_service_albums", it) } needHidden?.let { addParam("need_hidden", it) } @@ -538,8 +538,8 @@ class PhotosService { .apply { ownerId?.let { addParam("owner_id", it) } addParam("extended", true) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } photoSizes?.let { addParam("photo_sizes", it) } noServiceAlbums?.let { addParam("no_service_albums", it) } needHidden?.let { addParam("need_hidden", it) } @@ -569,10 +569,10 @@ class PhotosService { } .apply { ownerId?.let { addParam("owner_id", it) } - albumId?.let { addParam("album_id", it) } + albumId?.let { addParam("album_id", it, min = 0) } needLikes?.let { addParam("need_likes", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } } /** @@ -634,10 +634,10 @@ class PhotosService { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } .apply { - addParam("chat_id", chatId) - cropX?.let { addParam("crop_x", it) } - cropY?.let { addParam("crop_y", it) } - cropWidth?.let { addParam("crop_width", it) } + addParam("chat_id", chatId, min = 0) + cropX?.let { addParam("crop_x", it, min = 0) } + cropY?.let { addParam("crop_y", it, min = 0) } + cropWidth?.let { addParam("crop_width", it, min = 200) } } /** @@ -671,9 +671,9 @@ class PhotosService { addParam("photo_id", photoId) ownerId?.let { addParam("owner_id", it) } needLikes?.let { addParam("need_likes", it) } - startCommentId?.let { addParam("start_comment_id", it) } + startCommentId?.let { addParam("start_comment_id", it, min = 0) } offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 100) } sort?.let { addParam("sort", it.value) } accessKey?.let { addParam("access_key", it) } val fieldsJsonConverted = fields?.map { @@ -713,9 +713,9 @@ class PhotosService { addParam("photo_id", photoId) ownerId?.let { addParam("owner_id", it) } needLikes?.let { addParam("need_likes", it) } - startCommentId?.let { addParam("start_comment_id", it) } + startCommentId?.let { addParam("start_comment_id", it, min = 0) } offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 100) } sort?.let { addParam("sort", it.value) } accessKey?.let { addParam("access_key", it) } addParam("extended", true) @@ -736,7 +736,7 @@ class PhotosService { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) } /** @@ -759,11 +759,11 @@ class PhotosService { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) mainPhoto?.let { addParam("main_photo", it) } - cropX?.let { addParam("crop_x", it) } - cropY?.let { addParam("crop_y", it) } - cropWidth?.let { addParam("crop_width", it) } + cropX?.let { addParam("crop_x", it, min = 0) } + cropY?.let { addParam("crop_y", it, min = 0) } + cropWidth?.let { addParam("crop_width", it, min = 400) } } /** @@ -794,7 +794,7 @@ class PhotosService { } .apply { offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 100) } } /** @@ -818,11 +818,11 @@ class PhotosService { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } .apply { - addParam("group_id", groupId) - cropX?.let { addParam("crop_x", it) } - cropY?.let { addParam("crop_y", it) } - cropX2?.let { addParam("crop_x2", it) } - cropY2?.let { addParam("crop_y2", it) } + addParam("group_id", groupId, min = 1) + cropX?.let { addParam("crop_x", it, min = 0) } + cropY?.let { addParam("crop_y", it, min = 0) } + cropX2?.let { addParam("crop_x2", it, min = 0) } + cropY2?.let { addParam("crop_y2", it, min = 0) } } /** @@ -865,18 +865,18 @@ class PhotosService { /** * Returns the server address for photo upload. * + * @param albumId * @param groupId - ID of community that owns the album (if the photo will be uploaded to a * community album). - * @param albumId * @return [VKRequest] with [PhotosPhotoUpload] */ - fun photosGetUploadServer(groupId: UserId? = null, albumId: Int? = null): + fun photosGetUploadServer(albumId: Int? = null, groupId: UserId? = null): VKRequest = NewApiRequest("photos.getUploadServer") { GsonHolder.gson.fromJson(it, PhotosPhotoUpload::class.java) } .apply { - groupId?.let { addParam("group_id", it) } albumId?.let { addParam("album_id", it) } + groupId?.let { addParam("group_id", it) } } /** @@ -898,9 +898,9 @@ class PhotosService { GsonHolder.gson.fromJson(it, PhotosGetUserPhotosResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + userId?.let { addParam("user_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } sort?.let { addParam("sort", it) } } @@ -923,9 +923,9 @@ class PhotosService { GsonHolder.gson.fromJson(it, PhotosGetUserPhotosExtendedResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + userId?.let { addParam("user_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } addParam("extended", true) sort?.let { addParam("sort", it) } } @@ -936,7 +936,7 @@ class PhotosService { * @param groupId - ID of community to whose wall the photo will be uploaded. * @return [VKRequest] with [PhotosPhotoUpload] */ - fun photosGetWallUploadServer(groupId: Int? = null): VKRequest = + fun photosGetWallUploadServer(groupId: UserId? = null): VKRequest = NewApiRequest("photos.getWallUploadServer") { GsonHolder.gson.fromJson(it, PhotosPhotoUpload::class.java) } @@ -1014,7 +1014,7 @@ class PhotosService { GsonHolder.gson.fromJson(it, Int::class.java) } .apply { - addParam("photo_id", photoId) + addParam("photo_id", photoId, min = 0) addParam("user_id", userId) ownerId?.let { addParam("owner_id", it) } x?.let { addParam("x", it) } @@ -1110,7 +1110,7 @@ class PhotosService { } .apply { addParam("owner_id", ownerId) - addParam("photo_id", photoId) + addParam("photo_id", photoId, min = 0) reason?.let { addParam("reason", it.value) } } @@ -1132,7 +1132,7 @@ class PhotosService { } .apply { addParam("owner_id", ownerId) - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) reason?.let { addParam("reason", it.value) } } @@ -1148,7 +1148,7 @@ class PhotosService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("photo_id", photoId) + addParam("photo_id", photoId, min = 0) ownerId?.let { addParam("owner_id", it) } } @@ -1230,9 +1230,9 @@ class PhotosService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - addParam("group_id", groupId) + addParam("group_id", groupId, min = 1) addParam("photo", photo) - addParam("server", server) + addParam("server", server, min = 0) addParam("hash", hash) } @@ -1267,7 +1267,7 @@ class PhotosService { addParam("photo", photo) addParam("server", server) addParam("hash", hash) - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } cropData?.let { addParam("crop_data", it) } cropHash?.let { addParam("crop_hash", it) } } @@ -1303,12 +1303,12 @@ class PhotosService { * server]. * @param photo - Parameter returned when photos are [vk.com/dev/upload_files|uploaded to * server]. - * @return [VKRequest] with [Unit] + * @return [VKRequest] with [PhotosSaveOwnerCoverPhotoResponse] */ - fun photosSaveOwnerCoverPhoto(hash: String, photo: String): VKRequest> = + fun photosSaveOwnerCoverPhoto(hash: String, photo: String): + VKRequest = NewApiRequest("photos.saveOwnerCoverPhoto") { - val typeToken = object: TypeToken>() {}.type - GsonHolder.gson.fromJson>(it, typeToken) + GsonHolder.gson.fromJson(it, PhotosSaveOwnerCoverPhotoResponse::class.java) } .apply { addParam("hash", hash) @@ -1366,8 +1366,8 @@ class PhotosService { } .apply { addParam("photo", photo) - userId?.let { addParam("user_id", it) } - groupId?.let { addParam("group_id", it) } + userId?.let { addParam("user_id", it, min = 0) } + groupId?.let { addParam("group_id", it, min = 0) } server?.let { addParam("server", it) } hash?.let { addParam("hash", it) } latitude?.let { addParam("latitude", it) } @@ -1407,11 +1407,11 @@ class PhotosService { q?.let { addParam("q", it) } lat?.let { addParam("lat", it) } long?.let { addParam("long", it) } - startTime?.let { addParam("start_time", it) } - endTime?.let { addParam("end_time", it) } - sort?.let { addParam("sort", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } - radius?.let { addParam("radius", it) } + startTime?.let { addParam("start_time", it, min = 0) } + endTime?.let { addParam("end_time", it, min = 0) } + sort?.let { addParam("sort", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } + radius?.let { addParam("radius", it, min = 0) } } } diff --git a/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetAllCommentsResponse.kt b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetAllCommentsResponse.kt index aff870bab3..b6d545982e 100644 --- a/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetAllCommentsResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetAllCommentsResponse.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.photos.dto import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.wall.dto.WallWallComment import kotlin.Int import kotlin.collections.List @@ -39,5 +40,5 @@ data class PhotosGetAllCommentsResponse( @SerializedName("count") val count: Int? = null, @SerializedName("items") - val items: List? = null + val items: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosPhotoAlbumFull.kt b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosPhotoAlbumFull.kt index 81dbeeebf0..9abaea7c54 100644 --- a/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosPhotoAlbumFull.kt +++ b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosPhotoAlbumFull.kt @@ -30,6 +30,7 @@ package com.vk.sdk.api.photos.dto import com.google.gson.annotations.SerializedName import com.vk.dto.common.id.UserId import com.vk.sdk.api.base.dto.BaseBoolInt +import kotlin.Boolean import kotlin.Int import kotlin.String import kotlin.collections.List @@ -44,6 +45,7 @@ import kotlin.collections.List * @param canUpload - Information whether current user can upload photo to the album * @param commentsDisabled - Information whether album comments are disabled * @param description - Photo album description + * @param canDelete - album can delete * @param sizes * @param thumbId - Thumb photo ID * @param thumbIsLast - Information whether the album thumb is last photo @@ -69,6 +71,8 @@ data class PhotosPhotoAlbumFull( val commentsDisabled: BaseBoolInt? = null, @SerializedName("description") val description: String? = null, + @SerializedName("can_delete") + val canDelete: Boolean? = null, @SerializedName("sizes") val sizes: List? = null, @SerializedName("thumb_id") diff --git a/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosSaveOwnerCoverPhotoResponse.kt b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosSaveOwnerCoverPhotoResponse.kt new file mode 100644 index 0000000000..73f31b2302 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosSaveOwnerCoverPhotoResponse.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.photos.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseImage +import kotlin.collections.List + +/** + * @param images + */ +data class PhotosSaveOwnerCoverPhotoResponse( + @SerializedName("images") + val images: List? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/podcasts/PodcastsService.kt b/api/src/main/java/com/vk/sdk/api/podcasts/PodcastsService.kt index 986d9608ed..8631cb5c26 100644 --- a/api/src/main/java/com/vk/sdk/api/podcasts/PodcastsService.kt +++ b/api/src/main/java/com/vk/sdk/api/podcasts/PodcastsService.kt @@ -50,7 +50,7 @@ class PodcastsService { } .apply { addParam("search_string", searchString) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 1, max = 1000) } } } diff --git a/api/src/main/java/com/vk/sdk/api/polls/PollsService.kt b/api/src/main/java/com/vk/sdk/api/polls/PollsService.kt index 8ef9f7cbcf..a3d204ce44 100644 --- a/api/src/main/java/com/vk/sdk/api/polls/PollsService.kt +++ b/api/src/main/java/com/vk/sdk/api/polls/PollsService.kt @@ -68,7 +68,7 @@ class PollsService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("poll_id", pollId) + addParam("poll_id", pollId, min = 0) addParam("answer_ids", answerIds) ownerId?.let { addParam("owner_id", it) } isBoard?.let { addParam("is_board", it) } @@ -110,11 +110,11 @@ class PollsService { question?.let { addParam("question", it) } isAnonymous?.let { addParam("is_anonymous", it) } isMultiple?.let { addParam("is_multiple", it) } - endDate?.let { addParam("end_date", it) } + endDate?.let { addParam("end_date", it, min = 1550700000) } ownerId?.let { addParam("owner_id", it) } appId?.let { addParam("app_id", it) } addAnswers?.let { addParam("add_answers", it) } - photoId?.let { addParam("photo_id", it) } + photoId?.let { addParam("photo_id", it, min = 0) } backgroundId?.let { addParam("background_id", it.value) } disableUnvote?.let { addParam("disable_unvote", it) } } @@ -138,8 +138,8 @@ class PollsService { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { - addParam("poll_id", pollId) - addParam("answer_id", answerId) + addParam("poll_id", pollId, min = 0) + addParam("answer_id", answerId, min = 0) ownerId?.let { addParam("owner_id", it) } isBoard?.let { addParam("is_board", it) } } @@ -174,14 +174,14 @@ class PollsService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("poll_id", pollId) + addParam("poll_id", pollId, min = 0) ownerId?.let { addParam("owner_id", it) } question?.let { addParam("question", it) } addAnswers?.let { addParam("add_answers", it) } editAnswers?.let { addParam("edit_answers", it) } deleteAnswers?.let { addParam("delete_answers", it) } - endDate?.let { addParam("end_date", it) } - photoId?.let { addParam("photo_id", it) } + endDate?.let { addParam("end_date", it, min = 0) } + photoId?.let { addParam("photo_id", it, min = 0) } backgroundId?.let { addParam("background_id", it.value) } } @@ -217,10 +217,10 @@ class PollsService { GsonHolder.gson.fromJson(it, PollsPoll::class.java) } .apply { - addParam("poll_id", pollId) + addParam("poll_id", pollId, min = 0) ownerId?.let { addParam("owner_id", it) } isBoard?.let { addParam("is_board", it) } - friendsCount?.let { addParam("friends_count", it) } + friendsCount?.let { addParam("friends_count", it, min = 0, max = 100) } fields?.let { addParam("fields", it) } nameCase?.let { addParam("name_case", it.value) } } @@ -273,13 +273,13 @@ class PollsService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - addParam("poll_id", pollId) + addParam("poll_id", pollId, min = 0) addParam("answer_ids", answerIds) ownerId?.let { addParam("owner_id", it) } isBoard?.let { addParam("is_board", it) } friendsOnly?.let { addParam("friends_only", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } diff --git a/api/src/main/java/com/vk/sdk/api/polls/dto/PollsVotersUsers.kt b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsVotersUsers.kt index dad4edb3de..a235622d57 100644 --- a/api/src/main/java/com/vk/sdk/api/polls/dto/PollsVotersUsers.kt +++ b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsVotersUsers.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.polls.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.collections.List @@ -39,5 +40,5 @@ data class PollsVotersUsers( @SerializedName("count") val count: Int? = null, @SerializedName("items") - val items: List? = null + val items: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/prettyCards/PrettyCardsService.kt b/api/src/main/java/com/vk/sdk/api/prettyCards/PrettyCardsService.kt index 9c153418e9..4e137b9ca3 100644 --- a/api/src/main/java/com/vk/sdk/api/prettyCards/PrettyCardsService.kt +++ b/api/src/main/java/com/vk/sdk/api/prettyCards/PrettyCardsService.kt @@ -35,7 +35,7 @@ import com.vk.sdk.api.prettyCards.dto.PrettyCardsCreateResponse import com.vk.sdk.api.prettyCards.dto.PrettyCardsDeleteResponse import com.vk.sdk.api.prettyCards.dto.PrettyCardsEditResponse import com.vk.sdk.api.prettyCards.dto.PrettyCardsGetResponse -import com.vk.sdk.api.prettyCards.dto.PrettyCardsPrettyCard +import com.vk.sdk.api.prettyCards.dto.PrettyCardsPrettyCardOrError import kotlin.Int import kotlin.String import kotlin.collections.List @@ -66,10 +66,10 @@ class PrettyCardsService { addParam("owner_id", ownerId) addParam("photo", photo) addParam("title", title) - addParam("link", link) - price?.let { addParam("price", it) } - priceOld?.let { addParam("price_old", it) } - button?.let { addParam("button", it) } + addParam("link", link, maxLength = 2000) + price?.let { addParam("price", it, maxLength = 20) } + priceOld?.let { addParam("price_old", it, maxLength = 20) } + button?.let { addParam("button", it, maxLength = 255) } } /** @@ -114,10 +114,10 @@ class PrettyCardsService { addParam("card_id", cardId) photo?.let { addParam("photo", it) } title?.let { addParam("title", it) } - link?.let { addParam("link", it) } - price?.let { addParam("price", it) } - priceOld?.let { addParam("price_old", it) } - button?.let { addParam("button", it) } + link?.let { addParam("link", it, maxLength = 2000) } + price?.let { addParam("price", it, maxLength = 20) } + priceOld?.let { addParam("price_old", it, maxLength = 20) } + button?.let { addParam("button", it, maxLength = 255) } } /** @@ -135,8 +135,8 @@ class PrettyCardsService { } .apply { addParam("owner_id", ownerId) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } } /** @@ -144,10 +144,10 @@ class PrettyCardsService { * @param cardIds * @return [VKRequest] with [Unit] */ - fun prettyCardsGetById(ownerId: Int, cardIds: List): VKRequest> - = NewApiRequest("prettyCards.getById") { - val typeToken = object: TypeToken>() {}.type - GsonHolder.gson.fromJson>(it, typeToken) + fun prettyCardsGetById(ownerId: Int, cardIds: List): + VKRequest> = NewApiRequest("prettyCards.getById") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("owner_id", ownerId) diff --git a/api/src/main/java/com/vk/sdk/api/prettyCards/dto/PrettyCardsPrettyCard.kt b/api/src/main/java/com/vk/sdk/api/prettyCards/dto/PrettyCardsPrettyCard.kt index 145c9c3591..3e3ba9cea9 100644 --- a/api/src/main/java/com/vk/sdk/api/prettyCards/dto/PrettyCardsPrettyCard.kt +++ b/api/src/main/java/com/vk/sdk/api/prettyCards/dto/PrettyCardsPrettyCard.kt @@ -29,6 +29,7 @@ package com.vk.sdk.api.prettyCards.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 @@ -53,7 +54,7 @@ data class PrettyCardsPrettyCard( @SerializedName("title") val title: String, @SerializedName("button") - val button: String? = null, + val button: BaseLinkButton? = null, @SerializedName("button_text") val buttonText: String? = null, @SerializedName("images") diff --git a/api/src/main/java/com/vk/sdk/api/prettyCards/dto/PrettyCardsPrettyCardOrError.kt b/api/src/main/java/com/vk/sdk/api/prettyCards/dto/PrettyCardsPrettyCardOrError.kt new file mode 100644 index 0000000000..0a6c0b87c3 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/prettyCards/dto/PrettyCardsPrettyCardOrError.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.prettyCards.dto + +import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseRequestParam +import kotlin.Int +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 + */ +data class PrettyCardsPrettyCardOrError( + @SerializedName("error_code") + val errorCode: Int, + @SerializedName("error_subcode") + val errorSubcode: Int? = null, + @SerializedName("error_msg") + val errorMsg: String? = null, + @SerializedName("error_text") + val errorText: String? = null, + @SerializedName("request_params") + val requestParams: List? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/search/SearchService.kt b/api/src/main/java/com/vk/sdk/api/search/SearchService.kt index 23d7e23d97..8c491f62ae 100644 --- a/api/src/main/java/com/vk/sdk/api/search/SearchService.kt +++ b/api/src/main/java/com/vk/sdk/api/search/SearchService.kt @@ -59,9 +59,9 @@ class SearchService { GsonHolder.gson.fromJson(it, SearchGetHintsResponse::class.java) } .apply { - q?.let { addParam("q", it) } - offset?.let { addParam("offset", it) } - limit?.let { addParam("limit", it) } + q?.let { addParam("q", it, maxLength = 9000) } + offset?.let { addParam("offset", it, min = 0, max = 200) } + limit?.let { addParam("limit", it, min = 0, max = 200) } filters?.let { addParam("filters", it) } fields?.let { addParam("fields", it) } searchGlobal?.let { addParam("search_global", it) } diff --git a/api/src/main/java/com/vk/sdk/api/secure/SecureService.kt b/api/src/main/java/com/vk/sdk/api/secure/SecureService.kt index 74cff37505..eeb5b32788 100644 --- a/api/src/main/java/com/vk/sdk/api/secure/SecureService.kt +++ b/api/src/main/java/com/vk/sdk/api/secure/SecureService.kt @@ -32,6 +32,7 @@ import com.vk.api.sdk.requests.VKRequest import com.vk.dto.common.id.UserId 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.secure.dto.SecureGiveEventStickerItem import com.vk.sdk.api.secure.dto.SecureLevel @@ -62,9 +63,9 @@ class SecureService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("user_id", userId) - addParam("activity_id", activityId) - value?.let { addParam("value", it) } + addParam("user_id", userId, min = 1) + addParam("activity_id", activityId, min = 0) + value?.let { addParam("value", it, min = 0) } } /** @@ -115,10 +116,10 @@ class SecureService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - userId?.let { addParam("user_id", it) } - dateFrom?.let { addParam("date_from", it) } - dateTo?.let { addParam("date_to", it) } - limit?.let { addParam("limit", it) } + userId?.let { addParam("user_id", it, min = 0) } + dateFrom?.let { addParam("date_from", it, min = 0) } + dateTo?.let { addParam("date_to", it, min = 0) } + limit?.let { addParam("limit", it, min = 0, max = 1000) } } /** @@ -134,8 +135,8 @@ class SecureService { */ fun secureGetTransactionsHistory( type: Int? = null, - uidFrom: Int? = null, - uidTo: Int? = null, + uidFrom: UserId? = null, + uidTo: UserId? = null, dateFrom: Int? = null, dateTo: Int? = null, limit: Int? = null @@ -145,11 +146,11 @@ class SecureService { } .apply { type?.let { addParam("type", it) } - uidFrom?.let { addParam("uid_from", it) } - uidTo?.let { addParam("uid_to", it) } - dateFrom?.let { addParam("date_from", it) } - dateTo?.let { addParam("date_to", it) } - limit?.let { addParam("limit", it) } + uidFrom?.let { addParam("uid_from", it, min = 1) } + uidTo?.let { addParam("uid_to", it, min = 1) } + dateFrom?.let { addParam("date_from", it, min = 0) } + dateTo?.let { addParam("date_to", it, min = 0) } + limit?.let { addParam("limit", it, min = 0, max = 1000) } } /** @@ -158,7 +159,7 @@ class SecureService { * @param userIds * @return [VKRequest] with [Unit] */ - fun secureGetUserLevel(userIds: List): VKRequest> = + fun secureGetUserLevel(userIds: List): VKRequest> = NewApiRequest("secure.getUserLevel") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -174,14 +175,14 @@ class SecureService { * @param achievementId * @return [VKRequest] with [Unit] */ - fun secureGiveEventSticker(userIds: List, achievementId: Int): + fun secureGiveEventSticker(userIds: List, achievementId: Int): VKRequest> = NewApiRequest("secure.giveEventSticker") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("user_ids", userIds) - addParam("achievement_id", achievementId) + addParam("achievement_id", achievementId, min = 0) } /** @@ -195,16 +196,16 @@ class SecureService { */ fun secureSendNotification( message: String, - userIds: List? = null, + userIds: List? = null, userId: UserId? = null - ): VKRequest> = NewApiRequest("secure.sendNotification") { - val typeToken = object: TypeToken>() {}.type - GsonHolder.gson.fromJson>(it, typeToken) + ): VKRequest> = NewApiRequest("secure.sendNotification") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("message", message) userIds?.let { addParam("user_ids", it) } - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } } /** @@ -221,7 +222,7 @@ class SecureService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("user_id", userId) + addParam("user_id", userId, min = 1) addParam("message", message) } @@ -232,19 +233,19 @@ class SecureService { * @param userId * @param counter - counter value. * @param increment - * @return [VKRequest] with [BaseOkResponse] + * @return [VKRequest] with [BaseBoolInt] */ fun secureSetCounter( counters: List? = null, userId: UserId? = null, counter: Int? = null, increment: Boolean? = null - ): VKRequest = NewApiRequest("secure.setCounter") { - GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) + ): VKRequest = NewApiRequest("secure.setCounter") { + GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { counters?.let { addParam("counters", it) } - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } counter?.let { addParam("counter", it) } increment?.let { addParam("increment", it) } } diff --git a/api/src/main/java/com/vk/sdk/api/stats/StatsService.kt b/api/src/main/java/com/vk/sdk/api/stats/StatsService.kt index dcb98bd47a..823472df6e 100644 --- a/api/src/main/java/com/vk/sdk/api/stats/StatsService.kt +++ b/api/src/main/java/com/vk/sdk/api/stats/StatsService.kt @@ -68,12 +68,12 @@ class StatsService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - groupId?.let { addParam("group_id", it) } - appId?.let { addParam("app_id", it) } - timestampFrom?.let { addParam("timestamp_from", it) } - timestampTo?.let { addParam("timestamp_to", it) } + groupId?.let { addParam("group_id", it, min = 0) } + appId?.let { addParam("app_id", it, min = 0) } + timestampFrom?.let { addParam("timestamp_from", it, min = 0) } + timestampTo?.let { addParam("timestamp_to", it, min = 0) } interval?.let { addParam("interval", it.value) } - intervalsCount?.let { addParam("intervals_count", it) } + intervalsCount?.let { addParam("intervals_count", it, min = 0) } filters?.let { addParam("filters", it) } statsGroups?.let { addParam("stats_groups", it) } } diff --git a/api/src/main/java/com/vk/sdk/api/stats/dto/StatsCity.kt b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsCity.kt new file mode 100644 index 0000000000..a4c56b6842 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsCity.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.stats.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param count - Visitors number + * @param name - City name + * @param value - City ID + */ +data class StatsCity( + @SerializedName("count") + val count: Int? = null, + @SerializedName("name") + val name: String? = null, + @SerializedName("value") + val value: Int? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/stats/dto/StatsCountry.kt b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsCountry.kt new file mode 100644 index 0000000000..53431d8a53 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsCountry.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.stats.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.String + +/** + * @param code - Country code + * @param count - Visitors number + * @param name - Country name + * @param value - Country ID + */ +data class StatsCountry( + @SerializedName("code") + val code: String? = null, + @SerializedName("count") + val count: Int? = null, + @SerializedName("name") + val name: String? = null, + @SerializedName("value") + val value: Int? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/stats/dto/StatsPeriod.kt b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsPeriod.kt index c4fb7ef773..ec1328b99a 100644 --- a/api/src/main/java/com/vk/sdk/api/stats/dto/StatsPeriod.kt +++ b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsPeriod.kt @@ -28,7 +28,7 @@ package com.vk.sdk.api.stats.dto import com.google.gson.annotations.SerializedName -import kotlin.Any +import kotlin.Int /** * @param activity @@ -41,11 +41,11 @@ data class StatsPeriod( @SerializedName("activity") val activity: StatsActivity? = null, @SerializedName("period_from") - val periodFrom: Any? = null, + val periodFrom: Int? = null, @SerializedName("period_to") - val periodTo: Any? = null, + val periodTo: Int? = null, @SerializedName("reach") - val reach: Any? = null, + val reach: StatsReach? = null, @SerializedName("visitors") - val visitors: Any? = null + val visitors: StatsViews? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/stats/dto/StatsReach.kt b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsReach.kt new file mode 100644 index 0000000000..681b3e9be9 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsReach.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.stats.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * Reach stats + * @param age + * @param cities + * @param countries + * @param mobileReach - Reach count from mobile devices + * @param reach - Reach count + * @param reachSubscribers - Subscribers reach count + * @param sex + * @param sexAge + */ +data class StatsReach( + @SerializedName("age") + val age: List? = null, + @SerializedName("cities") + val cities: List? = null, + @SerializedName("countries") + val countries: List? = null, + @SerializedName("mobile_reach") + val mobileReach: Int? = null, + @SerializedName("reach") + val reach: Int? = null, + @SerializedName("reach_subscribers") + val reachSubscribers: Int? = null, + @SerializedName("sex") + val sex: List? = null, + @SerializedName("sex_age") + val sexAge: List? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/stats/dto/StatsViews.kt b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsViews.kt new file mode 100644 index 0000000000..1f1f97134d --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsViews.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.stats.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int +import kotlin.collections.List + +/** + * Views stats + * @param age + * @param cities + * @param countries + * @param mobileViews - Number of views from mobile devices + * @param sex + * @param sexAge + * @param views - Views number + * @param visitors - Visitors number + */ +data class StatsViews( + @SerializedName("age") + val age: List? = null, + @SerializedName("cities") + val cities: List? = null, + @SerializedName("countries") + val countries: List? = null, + @SerializedName("mobile_views") + val mobileViews: Int? = null, + @SerializedName("sex") + val sex: List? = null, + @SerializedName("sex_age") + val sexAge: List? = null, + @SerializedName("views") + val views: Int? = null, + @SerializedName("visitors") + val visitors: Int? = null +) diff --git a/api/src/main/java/com/vk/sdk/api/status/StatusService.kt b/api/src/main/java/com/vk/sdk/api/status/StatusService.kt index 46e8e0851f..a14a69deb3 100644 --- a/api/src/main/java/com/vk/sdk/api/status/StatusService.kt +++ b/api/src/main/java/com/vk/sdk/api/status/StatusService.kt @@ -49,7 +49,7 @@ class StatusService { } .apply { userId?.let { addParam("user_id", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -66,6 +66,6 @@ class StatusService { } .apply { text?.let { addParam("text", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } } diff --git a/api/src/main/java/com/vk/sdk/api/storage/StorageService.kt b/api/src/main/java/com/vk/sdk/api/storage/StorageService.kt index d8b336363c..4b95826427 100644 --- a/api/src/main/java/com/vk/sdk/api/storage/StorageService.kt +++ b/api/src/main/java/com/vk/sdk/api/storage/StorageService.kt @@ -56,9 +56,9 @@ class StorageService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - key?.let { addParam("key", it) } + key?.let { addParam("key", it, maxLength = 100) } keys?.let { addParam("keys", it) } - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } } /** @@ -79,9 +79,9 @@ class StorageService { GsonHolder.gson.fromJson>(it, typeToken) } .apply { - userId?.let { addParam("user_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + userId?.let { addParam("user_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -100,8 +100,8 @@ class StorageService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("key", key) + addParam("key", key, maxLength = 100) value?.let { addParam("value", it) } - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } } } diff --git a/api/src/main/java/com/vk/sdk/api/store/dto/StoreProduct.kt b/api/src/main/java/com/vk/sdk/api/store/dto/StoreProduct.kt index 96e087f42b..9917e86359 100644 --- a/api/src/main/java/com/vk/sdk/api/store/dto/StoreProduct.kt +++ b/api/src/main/java/com/vk/sdk/api/store/dto/StoreProduct.kt @@ -52,6 +52,7 @@ import kotlin.collections.List * @param hasAnimation - Information whether the product is an animated sticker pack (for stickers * product type) * @param subtitle - Subtitle of the product + * @param paymentRegion */ data class StoreProduct( @SerializedName("id") @@ -81,7 +82,9 @@ data class StoreProduct( @SerializedName("has_animation") val hasAnimation: Boolean? = null, @SerializedName("subtitle") - val subtitle: String? = null + val subtitle: String? = null, + @SerializedName("payment_region") + val paymentRegion: String? = null ) { enum class Type( val value: String diff --git a/api/src/main/java/com/vk/sdk/api/stories/StoriesService.kt b/api/src/main/java/com/vk/sdk/api/stories/StoriesService.kt index ba68d63fe4..e5e45e333a 100644 --- a/api/src/main/java/com/vk/sdk/api/stories/StoriesService.kt +++ b/api/src/main/java/com/vk/sdk/api/stories/StoriesService.kt @@ -36,7 +36,6 @@ import com.vk.sdk.api.base.dto.BaseUserGroupFields import com.vk.sdk.api.stories.dto.StoriesGetBannedExtendedResponse import com.vk.sdk.api.stories.dto.StoriesGetBannedResponse import com.vk.sdk.api.stories.dto.StoriesGetByIdExtendedResponse -import com.vk.sdk.api.stories.dto.StoriesGetByIdResponse import com.vk.sdk.api.stories.dto.StoriesGetPhotoUploadServerResponse import com.vk.sdk.api.stories.dto.StoriesGetV5113Response import com.vk.sdk.api.stories.dto.StoriesGetVideoUploadServerResponse @@ -56,7 +55,7 @@ class StoriesService { * @param ownersIds - List of sources IDs * @return [VKRequest] with [BaseOkResponse] */ - fun storiesBanOwner(ownersIds: List): VKRequest = + fun storiesBanOwner(ownersIds: List): VKRequest = NewApiRequest("stories.banOwner") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -81,7 +80,7 @@ class StoriesService { } .apply { ownerId?.let { addParam("owner_id", it) } - storyId?.let { addParam("story_id", it) } + storyId?.let { addParam("story_id", it, min = 0) } stories?.let { addParam("stories", it) } } @@ -139,26 +138,6 @@ class StoriesService { fieldsJsonConverted?.let { addParam("fields", it) } } - /** - * Returns story by its ID. - * - * @param stories - Stories IDs separated by commas. Use format {owner_id}+'_'+{story_id}, for - * example, 12345_54331. - * @param fields - Additional fields to return - * @return [VKRequest] with [StoriesGetByIdResponse] - */ - fun storiesGetById(stories: List, fields: List? = null): - VKRequest = NewApiRequest("stories.getById") { - GsonHolder.gson.fromJson(it, StoriesGetByIdResponse::class.java) - } - .apply { - addParam("stories", stories) - val fieldsJsonConverted = fields?.map { - it.value - } - fieldsJsonConverted?.let { addParam("fields", it) } - } - /** * Returns story by its ID. * @@ -167,13 +146,12 @@ class StoriesService { * @param fields - Additional fields to return * @return [VKRequest] with [StoriesGetByIdExtendedResponse] */ - fun storiesGetByIdExtended(stories: List, fields: List? = null): + fun storiesGetById(stories: List, fields: List? = null): VKRequest = NewApiRequest("stories.getById") { GsonHolder.gson.fromJson(it, StoriesGetByIdExtendedResponse::class.java) } .apply { addParam("stories", stories) - addParam("extended", true) val fieldsJsonConverted = fields?.map { it.value } @@ -210,8 +188,8 @@ class StoriesService { userIds?.let { addParam("user_ids", it) } replyToStory?.let { addParam("reply_to_story", it) } linkText?.let { addParam("link_text", it) } - linkUrl?.let { addParam("link_url", it) } - groupId?.let { addParam("group_id", it) } + linkUrl?.let { addParam("link_url", it, maxLength = 2048) } + groupId?.let { addParam("group_id", it, min = 0) } clickableStickers?.let { addParam("clickable_stickers", it) } } @@ -234,7 +212,7 @@ class StoriesService { } .apply { addParam("owner_id", ownerId) - addParam("story_id", storyId) + addParam("story_id", storyId, min = 0) accessKey?.let { addParam("access_key", it) } val fieldsJsonConverted = fields?.map { it.value @@ -255,7 +233,7 @@ class StoriesService { } .apply { addParam("owner_id", ownerId) - addParam("story_id", storyId) + addParam("story_id", storyId, min = 0) } /** @@ -288,8 +266,8 @@ class StoriesService { userIds?.let { addParam("user_ids", it) } replyToStory?.let { addParam("reply_to_story", it) } linkText?.let { addParam("link_text", it) } - linkUrl?.let { addParam("link_url", it) } - groupId?.let { addParam("group_id", it) } + linkUrl?.let { addParam("link_url", it, maxLength = 2048) } + groupId?.let { addParam("group_id", it, min = 0) } clickableStickers?.let { addParam("clickable_stickers", it) } } @@ -312,9 +290,9 @@ class StoriesService { } .apply { addParam("owner_id", ownerId) - addParam("story_id", storyId) - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + addParam("story_id", storyId, min = 0) + count?.let { addParam("count", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } } /** @@ -336,9 +314,9 @@ class StoriesService { } .apply { addParam("owner_id", ownerId) - addParam("story_id", storyId) - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + addParam("story_id", storyId, min = 0) + count?.let { addParam("count", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } addParam("extended", true) } @@ -355,7 +333,7 @@ class StoriesService { } .apply { addParam("owner_id", ownerId) - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -371,7 +349,7 @@ class StoriesService { } .apply { addParam("owner_id", ownerId) - addParam("story_id", storyId) + addParam("story_id", storyId, min = 0) } /** @@ -412,13 +390,13 @@ class StoriesService { GsonHolder.gson.fromJson(it, StoriesGetV5113Response::class.java) } .apply { - q?.let { addParam("q", it) } - placeId?.let { addParam("place_id", it) } + q?.let { addParam("q", it, maxLength = 255) } + placeId?.let { addParam("place_id", it, min = 0) } latitude?.let { addParam("latitude", it) } longitude?.let { addParam("longitude", it) } - radius?.let { addParam("radius", it) } + radius?.let { addParam("radius", it, min = 0) } mentionedId?.let { addParam("mentioned_id", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 1, max = 1000) } fields?.let { addParam("fields", it) } } @@ -441,7 +419,7 @@ class StoriesService { } .apply { addParam("access_key", accessKey) - message?.let { addParam("message", it) } + message?.let { addParam("message", it, maxLength = 1000) } isBroadcast?.let { addParam("is_broadcast", it) } isAnonymous?.let { addParam("is_anonymous", it) } unseenMarker?.let { addParam("unseen_marker", it) } @@ -453,7 +431,7 @@ class StoriesService { * @param ownersIds - List of hidden sources to show stories from. * @return [VKRequest] with [BaseOkResponse] */ - fun storiesUnbanOwner(ownersIds: List): VKRequest = + fun storiesUnbanOwner(ownersIds: List): VKRequest = NewApiRequest("stories.unbanOwner") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesClickableArea.kt b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesClickableArea.kt index 96f632db14..d936377c67 100644 --- a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesClickableArea.kt +++ b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesClickableArea.kt @@ -36,7 +36,7 @@ import kotlin.Int */ data class StoriesClickableArea( @SerializedName("x") - val x: Int? = null, + val x: Int, @SerializedName("y") - val y: Int? = null + val y: Int ) diff --git a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesGetBannedResponse.kt b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesGetBannedResponse.kt index 085de64d47..0ef2cfd684 100644 --- a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesGetBannedResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesGetBannedResponse.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.stories.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.collections.List @@ -39,5 +40,5 @@ data class StoriesGetBannedResponse( @SerializedName("count") val count: Int, @SerializedName("items") - val items: List + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesGetViewersExtendedV5115Response.kt b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesGetViewersExtendedV5115Response.kt index d1ce667fc4..eb0ae17d86 100644 --- a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesGetViewersExtendedV5115Response.kt +++ b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesGetViewersExtendedV5115Response.kt @@ -36,6 +36,7 @@ import kotlin.collections.List * @param count - Viewers count * @param items * @param hiddenReason + * @param nextFrom */ data class StoriesGetViewersExtendedV5115Response( @SerializedName("count") @@ -43,5 +44,7 @@ data class StoriesGetViewersExtendedV5115Response( @SerializedName("items") val items: List, @SerializedName("hidden_reason") - val hiddenReason: String? = null + val hiddenReason: String? = null, + @SerializedName("next_from") + val nextFrom: String? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesStory.kt b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesStory.kt index 7d86d6b962..dabf29d22b 100644 --- a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesStory.kt +++ b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesStory.kt @@ -48,7 +48,6 @@ import kotlin.String * @param canHide - Information whether current user can hide the story (0 - no, 1 - yes). * @param date - Date when story has been added in Unixtime. * @param expiresAt - Story expiration time. Unixtime. - * @param deleted - Information whether the story is deleted (0 - no, 1 - yes). * @param isDeleted - Information whether the story is deleted (false - no, true - yes). * @param isExpired - Information whether the story is expired (false - no, true - yes). * @param link @@ -95,8 +94,6 @@ data class StoriesStory( val date: Int? = null, @SerializedName("expires_at") val expiresAt: Int? = null, - @SerializedName("deleted") - val deleted: BaseBoolInt? = null, @SerializedName("is_deleted") val isDeleted: Boolean? = null, @SerializedName("is_expired") diff --git a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesStoryLink.kt b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesStoryLink.kt index eaa7c3d292..3ccf77c67a 100644 --- a/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesStoryLink.kt +++ b/api/src/main/java/com/vk/sdk/api/stories/dto/StoriesStoryLink.kt @@ -33,10 +33,13 @@ import kotlin.String /** * @param text - Link text * @param url - Link URL + * @param linkUrlTarget - How to open url */ data class StoriesStoryLink( @SerializedName("text") val text: String, @SerializedName("url") - val url: String + val url: String, + @SerializedName("link_url_target") + val linkUrlTarget: String? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/streaming/StreamingService.kt b/api/src/main/java/com/vk/sdk/api/streaming/StreamingService.kt index b40d850d1a..605c8b82ca 100644 --- a/api/src/main/java/com/vk/sdk/api/streaming/StreamingService.kt +++ b/api/src/main/java/com/vk/sdk/api/streaming/StreamingService.kt @@ -73,8 +73,8 @@ class StreamingService { .apply { type?.let { addParam("type", it.value) } interval?.let { addParam("interval", it.value) } - startTime?.let { addParam("start_time", it) } - endTime?.let { addParam("end_time", it) } + startTime?.let { addParam("start_time", it, min = 0) } + endTime?.let { addParam("end_time", it, min = 0) } } /** diff --git a/api/src/main/java/com/vk/sdk/api/users/UsersService.kt b/api/src/main/java/com/vk/sdk/api/users/UsersService.kt index f427623b7a..366366f033 100644 --- a/api/src/main/java/com/vk/sdk/api/users/UsersService.kt +++ b/api/src/main/java/com/vk/sdk/api/users/UsersService.kt @@ -44,7 +44,7 @@ import com.vk.sdk.api.users.dto.UsersSearchResponse import com.vk.sdk.api.users.dto.UsersSearchSex import com.vk.sdk.api.users.dto.UsersSearchSort import com.vk.sdk.api.users.dto.UsersSearchStatus -import com.vk.sdk.api.users.dto.UsersUserXtrCounters +import com.vk.sdk.api.users.dto.UsersUserFull import kotlin.Boolean import kotlin.Int import kotlin.String @@ -66,12 +66,12 @@ class UsersService { * @return [VKRequest] with [Unit] */ fun usersGet( - userIds: List? = null, + userIds: List? = null, fields: List? = null, nameCase: UsersGetNameCase? = null - ): VKRequest> = NewApiRequest("users.get") { - val typeToken = object: TypeToken>() {}.type - GsonHolder.gson.fromJson>(it, typeToken) + ): VKRequest> = NewApiRequest("users.get") { + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { userIds?.let { addParam("user_ids", it) } @@ -107,9 +107,9 @@ class UsersService { GsonHolder.gson.fromJson(it, UsersGetFollowersFieldsResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + userId?.let { addParam("user_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } val fieldsJsonConverted = fields?.map { it.value } @@ -135,9 +135,9 @@ class UsersService { GsonHolder.gson.fromJson(it, UsersGetSubscriptionsResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + userId?.let { addParam("user_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } val fieldsJsonConverted = fields?.map { it.value } @@ -162,10 +162,10 @@ class UsersService { GsonHolder.gson.fromJson(it, UsersGetSubscriptionsExtendedResponse::class.java) } .apply { - userId?.let { addParam("user_id", it) } + userId?.let { addParam("user_id", it, min = 0) } addParam("extended", true) - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } val fieldsJsonConverted = fields?.map { it.value } @@ -189,7 +189,7 @@ class UsersService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("user_id", userId) + addParam("user_id", userId, min = 1) addParam("type", type.value) comment?.let { addParam("comment", it) } } @@ -273,38 +273,38 @@ class UsersService { .apply { q?.let { addParam("q", it) } sort?.let { addParam("sort", it.value) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - city?.let { addParam("city", it) } - country?.let { addParam("country", it) } + city?.let { addParam("city", it, min = 0) } + country?.let { addParam("country", it, min = 0) } hometown?.let { addParam("hometown", it) } - universityCountry?.let { addParam("university_country", it) } - university?.let { addParam("university", it) } - universityYear?.let { addParam("university_year", it) } - universityFaculty?.let { addParam("university_faculty", it) } - universityChair?.let { addParam("university_chair", it) } + universityCountry?.let { addParam("university_country", it, min = 0) } + university?.let { addParam("university", it, min = 0) } + universityYear?.let { addParam("university_year", it, min = 0) } + universityFaculty?.let { addParam("university_faculty", it, min = 0) } + universityChair?.let { addParam("university_chair", it, min = 0) } sex?.let { addParam("sex", it.value) } status?.let { addParam("status", it.value) } - ageFrom?.let { addParam("age_from", it) } - ageTo?.let { addParam("age_to", it) } - birthDay?.let { addParam("birth_day", it) } - birthMonth?.let { addParam("birth_month", it) } - birthYear?.let { addParam("birth_year", it) } + ageFrom?.let { addParam("age_from", it, min = 0) } + ageTo?.let { addParam("age_to", it, min = 0) } + birthDay?.let { addParam("birth_day", it, min = 0) } + birthMonth?.let { addParam("birth_month", it, min = 0) } + birthYear?.let { addParam("birth_year", it, min = 1900, max = 2100) } online?.let { addParam("online", it) } hasPhoto?.let { addParam("has_photo", it) } - schoolCountry?.let { addParam("school_country", it) } - schoolCity?.let { addParam("school_city", it) } - schoolClass?.let { addParam("school_class", it) } - school?.let { addParam("school", it) } - schoolYear?.let { addParam("school_year", it) } + schoolCountry?.let { addParam("school_country", it, min = 0) } + schoolCity?.let { addParam("school_city", it, min = 0) } + schoolClass?.let { addParam("school_class", it, min = 0) } + school?.let { addParam("school", it, min = 0) } + schoolYear?.let { addParam("school_year", it, min = 0) } religion?.let { addParam("religion", it) } company?.let { addParam("company", it) } position?.let { addParam("position", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } fromList?.let { addParam("from_list", it) } } } diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersFields.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersFields.kt index 5bf0ab3813..6db6aa81c2 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersFields.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersFields.kt @@ -84,6 +84,9 @@ enum class UsersFields( @SerializedName("birthdate") BIRTHDATE("birthdate"), + @SerializedName("bdate_visibility") + BDATE_VISIBILITY("bdate_visibility"), + @SerializedName("city") CITY("city"), @@ -144,6 +147,9 @@ enum class UsersFields( @SerializedName("profile_buttons_tablet") PROFILE_BUTTONS_TABLET("profile_buttons_tablet"), + @SerializedName("third_party_buttons") + THIRD_PARTY_BUTTONS("third_party_buttons"), + @SerializedName("online") ONLINE("online"), @@ -405,6 +411,18 @@ enum class UsersFields( @SerializedName("is_subscribed") IS_SUBSCRIBED("is_subscribed"), + @SerializedName("is_subscribed_stories") + IS_SUBSCRIBED_STORIES("is_subscribed_stories"), + + @SerializedName("can_subscribe_stories") + CAN_SUBSCRIBE_STORIES("can_subscribe_stories"), + + @SerializedName("can_ask_question") + CAN_ASK_QUESTION("can_ask_question"), + + @SerializedName("can_ask_anonymous") + CAN_ASK_ANONYMOUS("can_ask_anonymous"), + @SerializedName("is_subscribed_podcasts") IS_SUBSCRIBED_PODCASTS("is_subscribed_podcasts"), @@ -420,6 +438,12 @@ enum class UsersFields( @SerializedName("has_rights") HAS_RIGHTS("has_rights"), + @SerializedName("sys_username") + SYS_USERNAME("sys_username"), + + @SerializedName("employee_mark") + EMPLOYEE_MARK("employee_mark"), + @SerializedName("rights_location") RIGHTS_LOCATION("rights_location"); } diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersRelative.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersRelative.kt index b3b30c66b9..fe910bd12b 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersRelative.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersRelative.kt @@ -28,7 +28,7 @@ package com.vk.sdk.api.users.dto import com.google.gson.annotations.SerializedName -import kotlin.Int +import com.vk.dto.common.id.UserId import kotlin.String /** @@ -43,7 +43,7 @@ data class UsersRelative( @SerializedName("birth_date") val birthDate: String? = null, @SerializedName("id") - val id: Int? = null, + val id: UserId? = null, @SerializedName("name") val name: String? = null ) { diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchResponse.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchResponse.kt index db4d939d3e..0bbe61f197 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchResponse.kt @@ -37,7 +37,7 @@ import kotlin.collections.List */ data class UsersSearchResponse( @SerializedName("count") - val count: Int? = null, + val count: Int, @SerializedName("items") - val items: List? = null + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersSubscriptionsItem.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSubscriptionsItem.kt index 2dd708cd74..7702ffa8a3 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersSubscriptionsItem.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSubscriptionsItem.kt @@ -66,6 +66,7 @@ import kotlin.collections.List sealed class UsersSubscriptionsItem { /** + * @param id - User ID * @param type * @param sex - User sex * @param screenName - Domain name of the user's page @@ -82,12 +83,13 @@ sealed class UsersSubscriptionsItem { * @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 UsersUserXtrType( + @SerializedName("id") + val id: UserId, @SerializedName("type") val type: UsersUserType? = null, @SerializedName("sex") @@ -120,8 +122,6 @@ sealed class UsersSubscriptionsItem { val firstName: String? = null, @SerializedName("hidden") val hidden: Int? = null, - @SerializedName("id") - val id: UserId? = null, @SerializedName("last_name") val lastName: String? = null, @SerializedName("can_access_closed") @@ -131,6 +131,7 @@ sealed class UsersSubscriptionsItem { ) : UsersSubscriptionsItem() /** + * @param id - Community ID * @param market * @param memberStatus - Current user's member status * @param isAdult - Information whether community is adult @@ -144,6 +145,7 @@ sealed class UsersSubscriptionsItem { * @param description - Community description * @param wikiPage - Community's main wiki page title * @param membersCount - Community members number + * @param membersCountText - Info about number of users in group * @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 @@ -191,7 +193,6 @@ sealed class UsersSubscriptionsItem { * @param liveCovers - Live covers state * @param storiesArchiveCount * @param hasUnseenStories - * @param id - Community ID * @param name - Community name * @param screenName - Domain of the community page * @param isClosed @@ -218,6 +219,8 @@ sealed class UsersSubscriptionsItem { * @param videoLive */ data class GroupsGroupFull( + @SerializedName("id") + val id: UserId, @SerializedName("market") val market: GroupsMarketInfo? = null, @SerializedName("member_status") @@ -242,6 +245,8 @@ sealed class UsersSubscriptionsItem { val wikiPage: String? = null, @SerializedName("members_count") val membersCount: Int? = null, + @SerializedName("members_count_text") + val membersCountText: String? = null, @SerializedName("requests_count") val requestsCount: Int? = null, @SerializedName("video_live_level") @@ -330,8 +335,6 @@ sealed class UsersSubscriptionsItem { val storiesArchiveCount: Int? = null, @SerializedName("has_unseen_stories") val hasUnseenStories: Boolean? = null, - @SerializedName("id") - val id: UserId? = null, @SerializedName("name") val name: String? = null, @SerializedName("screen_name") diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUser.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUser.kt index 12e1a53c50..bd6371a198 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUser.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUser.kt @@ -38,6 +38,7 @@ import kotlin.Int import kotlin.String /** + * @param id - User ID * @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 @@ -53,12 +54,13 @@ import kotlin.String * @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 UsersUser( + @SerializedName("id") + val id: UserId, @SerializedName("sex") val sex: BaseSex? = null, @SerializedName("screen_name") @@ -89,8 +91,6 @@ data class UsersUser( val firstName: String? = null, @SerializedName("hidden") val hidden: Int? = null, - @SerializedName("id") - val id: UserId? = null, @SerializedName("last_name") val lastName: String? = null, @SerializedName("can_access_closed") diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserCounters.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserCounters.kt index b823c489bd..780076f042 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserCounters.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserCounters.kt @@ -32,6 +32,7 @@ import kotlin.Int /** * @param albums - Albums number + * @param badges - Badges number * @param audios - Audios number * @param followers - Followers number * @param friends - Friends number @@ -58,6 +59,8 @@ import kotlin.Int data class UsersUserCounters( @SerializedName("albums") val albums: Int? = null, + @SerializedName("badges") + val badges: Int? = null, @SerializedName("audios") val audios: Int? = null, @SerializedName("followers") diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserFull.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserFull.kt index 87891d2769..02cc0b95b0 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserFull.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserFull.kt @@ -47,6 +47,7 @@ import kotlin.String import kotlin.collections.List /** + * @param id - User ID * @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 @@ -185,12 +186,13 @@ import kotlin.collections.List * @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 UsersUserFull( + @SerializedName("id") + val id: UserId, @SerializedName("first_name_nom") val firstNameNom: String? = null, @SerializedName("first_name_gen") @@ -465,8 +467,6 @@ data class UsersUserFull( val firstName: String? = null, @SerializedName("hidden") val hidden: Int? = null, - @SerializedName("id") - val id: UserId? = null, @SerializedName("last_name") val lastName: String? = null, @SerializedName("can_access_closed") diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserMin.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserMin.kt index a0cb55498d..f74fa41a46 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserMin.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserMin.kt @@ -34,25 +34,25 @@ import kotlin.Int import kotlin.String /** - * @param firstName - User first name * @param id - User ID - * @param lastName - User last name * @param deactivated - Returns if a profile is deleted or blocked + * @param firstName - User first name * @param hidden - Returns if a profile is hidden. + * @param lastName - User last name * @param canAccessClosed * @param isClosed */ data class UsersUserMin( - @SerializedName("first_name") - val firstName: String, @SerializedName("id") val id: UserId, - @SerializedName("last_name") - val lastName: String, @SerializedName("deactivated") val deactivated: String? = null, + @SerializedName("first_name") + val firstName: String? = null, @SerializedName("hidden") val hidden: Int? = null, + @SerializedName("last_name") + val lastName: String? = null, @SerializedName("can_access_closed") val canAccessClosed: Boolean? = null, @SerializedName("is_closed") diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserType.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserType.kt index 16c85305e7..75f6b537bf 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserType.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUserType.kt @@ -34,5 +34,8 @@ enum class UsersUserType( val value: String ) { @SerializedName("profile") - PROFILE("profile"); + PROFILE("profile"), + + @SerializedName("email") + EMAIL("email"); } diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUsersArray.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUsersArray.kt index da19f7529d..aad7c85436 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/UsersUsersArray.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersUsersArray.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.users.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import kotlin.Int import kotlin.collections.List @@ -39,5 +40,5 @@ data class UsersUsersArray( @SerializedName("count") val count: Int, @SerializedName("items") - val items: List + val items: List ) diff --git a/api/src/main/java/com/vk/sdk/api/utils/UtilsService.kt b/api/src/main/java/com/vk/sdk/api/utils/UtilsService.kt index 989077290a..9e8f52ffd6 100644 --- a/api/src/main/java/com/vk/sdk/api/utils/UtilsService.kt +++ b/api/src/main/java/com/vk/sdk/api/utils/UtilsService.kt @@ -87,8 +87,8 @@ class UtilsService { GsonHolder.gson.fromJson(it, UtilsGetLastShortenedLinksResponse::class.java) } .apply { - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } } /** @@ -115,7 +115,7 @@ class UtilsService { source?.let { addParam("source", it.value) } accessKey?.let { addParam("access_key", it) } interval?.let { addParam("interval", it.value) } - intervalsCount?.let { addParam("intervals_count", it) } + intervalsCount?.let { addParam("intervals_count", it, min = 0, max = 100) } } /** @@ -142,7 +142,7 @@ class UtilsService { source?.let { addParam("source", it.value) } accessKey?.let { addParam("access_key", it) } interval?.let { addParam("interval", it.value) } - intervalsCount?.let { addParam("intervals_count", it) } + intervalsCount?.let { addParam("intervals_count", it, min = 0, max = 100) } addParam("extended", true) } diff --git a/api/src/main/java/com/vk/sdk/api/video/VideoService.kt b/api/src/main/java/com/vk/sdk/api/video/VideoService.kt index 0d6db99cbd..701bfc8004 100644 --- a/api/src/main/java/com/vk/sdk/api/video/VideoService.kt +++ b/api/src/main/java/com/vk/sdk/api/video/VideoService.kt @@ -74,12 +74,12 @@ class VideoService { fun videoAdd( videoId: Int, ownerId: UserId, - targetId: Int? = null + targetId: UserId? = null ): VKRequest = NewApiRequest("video.add") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) addParam("owner_id", ownerId) targetId?.let { addParam("target_id", it) } } @@ -101,7 +101,7 @@ class VideoService { GsonHolder.gson.fromJson(it, VideoAddAlbumResponse::class.java) } .apply { - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } title?.let { addParam("title", it) } val privacyJsonConverted = privacy?.map { it.value @@ -120,7 +120,7 @@ class VideoService { fun videoAddToAlbum( ownerId: UserId, videoId: Int, - targetId: Int? = null, + targetId: UserId? = null, albumId: Int? = null, albumIds: List? = null ): VKRequest = NewApiRequest("video.addToAlbum") { @@ -128,7 +128,7 @@ class VideoService { } .apply { addParam("owner_id", ownerId) - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) targetId?.let { addParam("target_id", it) } albumId?.let { addParam("album_id", it) } albumIds?.let { addParam("album_ids", it) } @@ -163,13 +163,13 @@ class VideoService { GsonHolder.gson.fromJson(it, Int::class.java) } .apply { - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) ownerId?.let { addParam("owner_id", it) } 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) } + replyToComment?.let { addParam("reply_to_comment", it, min = 0) } + stickerId?.let { addParam("sticker_id", it, min = 0) } guid?.let { addParam("guid", it) } } @@ -184,12 +184,12 @@ class VideoService { fun videoDelete( videoId: Int, ownerId: UserId? = null, - targetId: Int? = null + targetId: UserId? = null ): VKRequest = NewApiRequest("video.delete") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) ownerId?.let { addParam("owner_id", it) } targetId?.let { addParam("target_id", it) } } @@ -206,8 +206,8 @@ class VideoService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("album_id", albumId) - groupId?.let { addParam("group_id", it) } + addParam("album_id", albumId, min = 0) + groupId?.let { addParam("group_id", it, min = 0) } } /** @@ -254,7 +254,7 @@ class VideoService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) ownerId?.let { addParam("owner_id", it) } name?.let { addParam("name", it) } desc?.let { addParam("desc", it) } @@ -283,9 +283,9 @@ class VideoService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("album_id", albumId) + addParam("album_id", albumId, min = 0) addParam("title", title) - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } val privacyJsonConverted = privacy?.map { it.value } @@ -346,8 +346,8 @@ class VideoService { ownerId?.let { addParam("owner_id", it) } videos?.let { addParam("videos", it) } albumId?.let { addParam("album_id", it) } - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0, max = 200) } + offset?.let { addParam("offset", it, min = 0) } fields?.let { addParam("fields", it) } } @@ -387,8 +387,8 @@ class VideoService { } .apply { ownerId?.let { addParam("owner_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } needSystem?.let { addParam("need_system", it) } } @@ -411,8 +411,8 @@ class VideoService { } .apply { ownerId?.let { addParam("owner_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 100) } addParam("extended", true) needSystem?.let { addParam("need_system", it) } } @@ -426,14 +426,14 @@ class VideoService { fun videoGetAlbumsByVideo( ownerId: UserId, videoId: Int, - targetId: Int? = null + targetId: UserId? = null ): VKRequest> = NewApiRequest("video.getAlbumsByVideo") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("owner_id", ownerId) - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) targetId?.let { addParam("target_id", it) } } @@ -446,13 +446,13 @@ class VideoService { fun videoGetAlbumsByVideoExtended( ownerId: UserId, videoId: Int, - targetId: Int? = null + targetId: UserId? = null ): VKRequest = NewApiRequest("video.getAlbumsByVideo") { GsonHolder.gson.fromJson(it, VideoGetAlbumsByVideoExtendedResponse::class.java) } .apply { addParam("owner_id", ownerId) - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) targetId?.let { addParam("target_id", it) } addParam("extended", true) } @@ -483,12 +483,12 @@ class VideoService { GsonHolder.gson.fromJson(it, VideoGetCommentsResponse::class.java) } .apply { - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) ownerId?.let { addParam("owner_id", it) } needLikes?.let { addParam("need_likes", it) } - startCommentId?.let { addParam("start_comment_id", it) } + startCommentId?.let { addParam("start_comment_id", it, min = 0) } offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 100) } sort?.let { addParam("sort", it.value) } fields?.let { addParam("fields", it) } } @@ -519,12 +519,12 @@ class VideoService { GsonHolder.gson.fromJson(it, VideoGetCommentsExtendedResponse::class.java) } .apply { - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) ownerId?.let { addParam("owner_id", it) } needLikes?.let { addParam("need_likes", it) } - startCommentId?.let { addParam("start_comment_id", it) } + startCommentId?.let { addParam("start_comment_id", it, min = 0) } offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0, max = 100) } sort?.let { addParam("sort", it.value) } addParam("extended", true) fields?.let { addParam("fields", it) } @@ -541,7 +541,7 @@ class VideoService { fun videoRemoveFromAlbum( ownerId: UserId, videoId: Int, - targetId: Int? = null, + targetId: UserId? = null, albumId: Int? = null, albumIds: List? = null ): VKRequest = NewApiRequest("video.removeFromAlbum") { @@ -549,7 +549,7 @@ class VideoService { } .apply { addParam("owner_id", ownerId) - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) targetId?.let { addParam("target_id", it) } albumId?.let { addParam("album_id", it) } albumIds?.let { addParam("album_ids", it) } @@ -573,10 +573,10 @@ class VideoService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("album_id", albumId) + addParam("album_id", albumId, min = 0) ownerId?.let { addParam("owner_id", it) } - before?.let { addParam("before", it) } - after?.let { addParam("after", it) } + before?.let { addParam("before", it, min = 0) } + after?.let { addParam("after", it, min = 0) } } /** @@ -597,24 +597,24 @@ class VideoService { fun videoReorderVideos( ownerId: UserId, videoId: Int, - targetId: Int? = null, + targetId: UserId? = null, albumId: Int? = null, - beforeOwnerId: Int? = null, + beforeOwnerId: UserId? = null, beforeVideoId: Int? = null, - afterOwnerId: Int? = null, + afterOwnerId: UserId? = null, afterVideoId: Int? = null ): VKRequest = NewApiRequest("video.reorderVideos") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { addParam("owner_id", ownerId) - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) targetId?.let { addParam("target_id", it) } albumId?.let { addParam("album_id", it) } beforeOwnerId?.let { addParam("before_owner_id", it) } - beforeVideoId?.let { addParam("before_video_id", it) } + beforeVideoId?.let { addParam("before_video_id", it, min = 0) } afterOwnerId?.let { addParam("after_owner_id", it) } - afterVideoId?.let { addParam("after_video_id", it) } + afterVideoId?.let { addParam("after_video_id", it, min = 0) } } /** @@ -639,7 +639,7 @@ class VideoService { } .apply { addParam("owner_id", ownerId) - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) reason?.let { addParam("reason", it.value) } comment?.let { addParam("comment", it) } searchQuery?.let { addParam("search_query", it) } @@ -663,7 +663,7 @@ class VideoService { } .apply { addParam("owner_id", ownerId) - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) reason?.let { addParam("reason", it.value) } } @@ -679,7 +679,7 @@ class VideoService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("video_id", videoId) + addParam("video_id", videoId, min = 0) ownerId?.let { addParam("owner_id", it) } } @@ -742,8 +742,8 @@ class VideoService { isPrivate?.let { addParam("is_private", it) } wallpost?.let { addParam("wallpost", it) } link?.let { addParam("link", it) } - groupId?.let { addParam("group_id", it) } - albumId?.let { addParam("album_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } + albumId?.let { addParam("album_id", it, min = 0) } privacyView?.let { addParam("privacy_view", it) } privacyComment?.let { addParam("privacy_comment", it) } noComments?.let { addParam("no_comments", it) } @@ -759,6 +759,7 @@ class VideoService { * @param hd - If not null, only searches for high-definition videos. * @param adult - '1' - to disable the Safe Search filter, '0' - to enable the Safe Search * filter + * @param live * @param filters - Filters to apply_ 'youtube' - return YouTube videos only, 'vimeo' - return * Vimeo videos only, 'short' - return short videos only, 'long' - return long videos only * @param searchOwn @@ -769,10 +770,11 @@ class VideoService { * @return [VKRequest] with [VideoSearchResponse] */ fun videoSearch( - q: String, + q: String? = null, sort: VideoSearchSort? = null, hd: Int? = null, adult: Boolean? = null, + live: Boolean? = null, filters: List? = null, searchOwn: Boolean? = null, offset: Int? = null, @@ -783,19 +785,20 @@ class VideoService { GsonHolder.gson.fromJson(it, VideoSearchResponse::class.java) } .apply { - addParam("q", q) + q?.let { addParam("q", it) } sort?.let { addParam("sort", it.value) } hd?.let { addParam("hd", it) } adult?.let { addParam("adult", it) } + live?.let { addParam("live", it) } val filtersJsonConverted = filters?.map { it.value } filtersJsonConverted?.let { addParam("filters", it) } searchOwn?.let { addParam("search_own", it) } - offset?.let { addParam("offset", it) } - longer?.let { addParam("longer", it) } - shorter?.let { addParam("shorter", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + longer?.let { addParam("longer", it, min = 0) } + shorter?.let { addParam("shorter", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } } /** @@ -806,6 +809,7 @@ class VideoService { * @param hd - If not null, only searches for high-definition videos. * @param adult - '1' - to disable the Safe Search filter, '0' - to enable the Safe Search * filter + * @param live * @param filters - Filters to apply_ 'youtube' - return YouTube videos only, 'vimeo' - return * Vimeo videos only, 'short' - return short videos only, 'long' - return long videos only * @param searchOwn @@ -816,10 +820,11 @@ class VideoService { * @return [VKRequest] with [VideoSearchExtendedResponse] */ fun videoSearchExtended( - q: String, + q: String? = null, sort: VideoSearchExtendedSort? = null, hd: Int? = null, adult: Boolean? = null, + live: Boolean? = null, filters: List? = null, searchOwn: Boolean? = null, offset: Int? = null, @@ -830,19 +835,20 @@ class VideoService { GsonHolder.gson.fromJson(it, VideoSearchExtendedResponse::class.java) } .apply { - addParam("q", q) + q?.let { addParam("q", it) } sort?.let { addParam("sort", it.value) } hd?.let { addParam("hd", it) } adult?.let { addParam("adult", it) } + live?.let { addParam("live", it) } val filtersJsonConverted = filters?.map { it.value } filtersJsonConverted?.let { addParam("filters", it) } searchOwn?.let { addParam("search_own", it) } - offset?.let { addParam("offset", it) } - longer?.let { addParam("longer", it) } - shorter?.let { addParam("shorter", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + longer?.let { addParam("longer", it, min = 0) } + shorter?.let { addParam("shorter", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 200) } addParam("extended", true) } } diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsExtendedResponse.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsExtendedResponse.kt index 64e4e2158c..a0af6452ac 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsExtendedResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsExtendedResponse.kt @@ -29,7 +29,7 @@ package com.vk.sdk.api.video.dto import com.google.gson.annotations.SerializedName import com.vk.sdk.api.groups.dto.GroupsGroupFull -import com.vk.sdk.api.users.dto.UsersUserMin +import com.vk.sdk.api.users.dto.UsersUserFull import com.vk.sdk.api.wall.dto.WallWallComment import kotlin.Int import kotlin.collections.List @@ -46,7 +46,7 @@ data class VideoGetCommentsExtendedResponse( @SerializedName("items") val items: List, @SerializedName("profiles") - val profiles: List, + val profiles: List, @SerializedName("groups") val groups: List ) diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetResponse.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetResponse.kt index 81a4f5cc14..a884315b90 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetResponse.kt @@ -29,7 +29,7 @@ package com.vk.sdk.api.video.dto import com.google.gson.annotations.SerializedName import com.vk.sdk.api.groups.dto.GroupsGroupFull -import com.vk.sdk.api.users.dto.UsersUserMin +import com.vk.sdk.api.users.dto.UsersUserFull import kotlin.Int import kotlin.collections.List @@ -45,7 +45,7 @@ data class VideoGetResponse( @SerializedName("items") val items: List, @SerializedName("profiles") - val profiles: List? = null, + val profiles: List? = null, @SerializedName("groups") val groups: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoLiveInfo.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoLiveInfo.kt index cbf37a96d7..7b2a4e15c8 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/VideoLiveInfo.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoLiveInfo.kt @@ -36,7 +36,7 @@ import com.vk.sdk.api.base.dto.BaseBoolInt */ data class VideoLiveInfo( @SerializedName("enabled") - val enabled: BaseBoolInt? = null, + val enabled: BaseBoolInt, @SerializedName("is_notifications_blocked") val isNotificationsBlocked: BaseBoolInt? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoAlbumFull.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoAlbumFull.kt index c71c64eae1..22d87234f8 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoAlbumFull.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoAlbumFull.kt @@ -36,29 +36,29 @@ import kotlin.collections.List /** * @param count - Total number of videos in album - * @param image - Album cover image in different sizes - * @param imageBlur - Need blur album thumb or not - * @param isSystem - Information whether album is system * @param updatedTime - Date when the album has been updated last time in Unixtime * @param id - Album ID * @param ownerId - Album owner's ID * @param title - Album title + * @param image - Album cover image in different sizes + * @param imageBlur - Need blur album thumb or not + * @param isSystem - Information whether album is system */ data class VideoVideoAlbumFull( @SerializedName("count") - val count: Int? = null, + val count: Int, + @SerializedName("updated_time") + val updatedTime: Int, + @SerializedName("id") + val id: Int, + @SerializedName("owner_id") + val ownerId: UserId, + @SerializedName("title") + val title: String, @SerializedName("image") val image: List? = null, @SerializedName("image_blur") val imageBlur: BasePropertyExists? = null, @SerializedName("is_system") - val isSystem: BasePropertyExists? = null, - @SerializedName("updated_time") - val updatedTime: Int? = null, - @SerializedName("id") - val id: Int? = null, - @SerializedName("owner_id") - val ownerId: UserId? = null, - @SerializedName("title") - val title: String? = null + val isSystem: BasePropertyExists? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoFull.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoFull.kt index f81e667a56..1371164ba2 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoFull.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoFull.kt @@ -42,6 +42,7 @@ import kotlin.collections.List /** * @param files + * @param trailer * @param liveSettings - Settings for live stream * @param accessKey - Video access key * @param addingDate - Date when the video has been added in Unixtime @@ -100,6 +101,8 @@ import kotlin.collections.List data class VideoVideoFull( @SerializedName("files") val files: VideoVideoFiles? = null, + @SerializedName("trailer") + val trailer: VideoVideoFiles? = null, @SerializedName("live_settings") val liveSettings: VideoLiveSettings? = null, @SerializedName("access_key") diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoImage.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoImage.kt index b6b9dc12b7..398e8a69ec 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoImage.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoVideoImage.kt @@ -33,21 +33,21 @@ import kotlin.Int import kotlin.String /** - * @param withPadding - * @param id - * @param height - Image height * @param url - Image url * @param width - Image width + * @param height - Image height + * @param withPadding + * @param id */ data class VideoVideoImage( + @SerializedName("url") + val url: String, + @SerializedName("width") + val width: Int, + @SerializedName("height") + val height: Int, @SerializedName("with_padding") val withPadding: BasePropertyExists? = null, @SerializedName("id") - val id: String? = null, - @SerializedName("height") - val height: Int? = null, - @SerializedName("url") - val url: String? = null, - @SerializedName("width") - val width: Int? = null + val id: String? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/wall/WallService.kt b/api/src/main/java/com/vk/sdk/api/wall/WallService.kt index 083f09b738..1def8d98f4 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/WallService.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/WallService.kt @@ -87,7 +87,7 @@ class WallService { } .apply { addParam("owner_id", ownerId) - addParam("post_id", postId) + addParam("post_id", postId, min = 0) } /** @@ -110,7 +110,7 @@ class WallService { fun wallCreateComment( postId: Int, ownerId: UserId? = null, - fromGroup: Int? = null, + fromGroup: UserId? = null, message: String? = null, replyToComment: Int? = null, attachments: List? = null, @@ -120,13 +120,13 @@ class WallService { GsonHolder.gson.fromJson(it, WallCreateCommentResponse::class.java) } .apply { - addParam("post_id", postId) + addParam("post_id", postId, min = 0) ownerId?.let { addParam("owner_id", it) } - fromGroup?.let { addParam("from_group", it) } + fromGroup?.let { addParam("from_group", it, min = 0) } message?.let { addParam("message", it) } replyToComment?.let { addParam("reply_to_comment", it) } attachments?.let { addParam("attachments", it) } - stickerId?.let { addParam("sticker_id", it) } + stickerId?.let { addParam("sticker_id", it, min = 0) } guid?.let { addParam("guid", it) } } @@ -143,7 +143,7 @@ class WallService { } .apply { ownerId?.let { addParam("owner_id", it) } - postId?.let { addParam("post_id", it) } + postId?.let { addParam("post_id", it, min = 0) } } /** @@ -158,7 +158,7 @@ class WallService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) ownerId?.let { addParam("owner_id", it) } } @@ -216,21 +216,21 @@ class WallService { GsonHolder.gson.fromJson(it, WallEditResponse::class.java) } .apply { - addParam("post_id", postId) + addParam("post_id", postId, min = 0) ownerId?.let { addParam("owner_id", it) } friendsOnly?.let { addParam("friends_only", it) } message?.let { addParam("message", it) } attachments?.let { addParam("attachments", it) } services?.let { addParam("services", it) } signed?.let { addParam("signed", it) } - publishDate?.let { addParam("publish_date", it) } + publishDate?.let { addParam("publish_date", it, min = 0) } lat?.let { addParam("lat", it) } long?.let { addParam("long", it) } - placeId?.let { addParam("place_id", it) } + placeId?.let { addParam("place_id", it, min = 0) } markAsAds?.let { addParam("mark_as_ads", it) } closeComments?.let { addParam("close_comments", it) } donutPaidDuration?.let { addParam("donut_paid_duration", it) } - posterBkgId?.let { addParam("poster_bkg_id", it) } + posterBkgId?.let { addParam("poster_bkg_id", it, min = 0) } posterBkgOwnerId?.let { addParam("poster_bkg_owner_id", it) } posterBkgAccessHash?.let { addParam("poster_bkg_access_hash", it) } copyright?.let { addParam("copyright", it) } @@ -279,14 +279,14 @@ class WallService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("post_id", postId) + addParam("post_id", postId, min = 0) ownerId?.let { addParam("owner_id", it) } message?.let { addParam("message", it) } attachments?.let { addParam("attachments", it) } signed?.let { addParam("signed", it) } lat?.let { addParam("lat", it) } long?.let { addParam("long", it) } - placeId?.let { addParam("place_id", it) } + placeId?.let { addParam("place_id", it, min = 0) } linkButton?.let { addParam("link_button", it) } linkTitle?.let { addParam("link_title", it) } linkImage?.let { addParam("link_image", it) } @@ -315,7 +315,7 @@ class WallService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) ownerId?.let { addParam("owner_id", it) } message?.let { addParam("message", it) } attachments?.let { addParam("attachments", it) } @@ -346,8 +346,8 @@ class WallService { .apply { ownerId?.let { addParam("owner_id", it) } domain?.let { addParam("domain", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } filter?.let { addParam("filter", it) } val fieldsJsonConverted = fields?.map { it.value @@ -380,8 +380,8 @@ class WallService { .apply { ownerId?.let { addParam("owner_id", it) } domain?.let { addParam("domain", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0) } filter?.let { addParam("filter", it) } addParam("extended", true) val fieldsJsonConverted = fields?.map { @@ -460,7 +460,7 @@ class WallService { GsonHolder.gson.fromJson(it, WallGetCommentResponse::class.java) } .apply { - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) ownerId?.let { addParam("owner_id", it) } val fieldsJsonConverted = fields?.map { it.value @@ -484,7 +484,7 @@ class WallService { GsonHolder.gson.fromJson(it, WallGetCommentExtendedResponse::class.java) } .apply { - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) ownerId?.let { addParam("owner_id", it) } addParam("extended", true) val fieldsJsonConverted = fields?.map { @@ -528,19 +528,19 @@ class WallService { } .apply { ownerId?.let { addParam("owner_id", it) } - postId?.let { addParam("post_id", it) } + postId?.let { addParam("post_id", it, min = 0) } needLikes?.let { addParam("need_likes", it) } - startCommentId?.let { addParam("start_comment_id", it) } + startCommentId?.let { addParam("start_comment_id", it, min = 0) } offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0) } sort?.let { addParam("sort", it.value) } - previewLength?.let { addParam("preview_length", it) } + previewLength?.let { addParam("preview_length", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - commentId?.let { addParam("comment_id", it) } - threadItemsCount?.let { addParam("thread_items_count", it) } + commentId?.let { addParam("comment_id", it, min = 0) } + threadItemsCount?.let { addParam("thread_items_count", it, min = 0, max = 10) } } /** @@ -578,20 +578,20 @@ class WallService { } .apply { ownerId?.let { addParam("owner_id", it) } - postId?.let { addParam("post_id", it) } + postId?.let { addParam("post_id", it, min = 0) } needLikes?.let { addParam("need_likes", it) } - startCommentId?.let { addParam("start_comment_id", it) } + startCommentId?.let { addParam("start_comment_id", it, min = 0) } offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + count?.let { addParam("count", it, min = 0) } sort?.let { addParam("sort", it.value) } - previewLength?.let { addParam("preview_length", it) } + previewLength?.let { addParam("preview_length", it, min = 0) } addParam("extended", true) val fieldsJsonConverted = fields?.map { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - commentId?.let { addParam("comment_id", it) } - threadItemsCount?.let { addParam("thread_items_count", it) } + commentId?.let { addParam("comment_id", it, min = 0) } + threadItemsCount?.let { addParam("thread_items_count", it, min = 0, max = 10) } } /** @@ -614,9 +614,9 @@ class WallService { } .apply { ownerId?.let { addParam("owner_id", it) } - postId?.let { addParam("post_id", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + postId?.let { addParam("post_id", it, min = 0) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 0, max = 1000) } } /** @@ -630,7 +630,7 @@ class WallService { } .apply { addParam("owner_id", ownerId) - addParam("post_id", postId) + addParam("post_id", postId, min = 0) } /** @@ -646,7 +646,7 @@ class WallService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("post_id", postId) + addParam("post_id", postId, min = 0) ownerId?.let { addParam("owner_id", it) } } @@ -718,11 +718,11 @@ class WallService { attachments?.let { addParam("attachments", it) } services?.let { addParam("services", it) } signed?.let { addParam("signed", it) } - publishDate?.let { addParam("publish_date", it) } + publishDate?.let { addParam("publish_date", it, min = 0) } lat?.let { addParam("lat", it) } long?.let { addParam("long", it) } - placeId?.let { addParam("place_id", it) } - postId?.let { addParam("post_id", it) } + placeId?.let { addParam("place_id", it, min = 0) } + postId?.let { addParam("post_id", it, min = 0) } guid?.let { addParam("guid", it) } markAsAds?.let { addParam("mark_as_ads", it) } closeComments?.let { addParam("close_comments", it) } @@ -781,7 +781,7 @@ class WallService { signed?.let { addParam("signed", it) } lat?.let { addParam("lat", it) } long?.let { addParam("long", it) } - placeId?.let { addParam("place_id", it) } + placeId?.let { addParam("place_id", it, min = 0) } guid?.let { addParam("guid", it) } linkButton?.let { addParam("link_button", it) } linkTitle?.let { addParam("link_title", it) } @@ -807,7 +807,7 @@ class WallService { } .apply { addParam("owner_id", ownerId) - addParam("comment_id", commentId) + addParam("comment_id", commentId, min = 0) reason?.let { addParam("reason", it.value) } } @@ -829,7 +829,7 @@ class WallService { } .apply { addParam("owner_id", ownerId) - addParam("post_id", postId) + addParam("post_id", postId, min = 0) reason?.let { addParam("reason", it.value) } } @@ -855,7 +855,7 @@ class WallService { .apply { addParam("object", objectValue) message?.let { addParam("message", it) } - groupId?.let { addParam("group_id", it) } + groupId?.let { addParam("group_id", it, min = 0) } markAsAds?.let { addParam("mark_as_ads", it) } muteNotifications?.let { addParam("mute_notifications", it) } } @@ -874,7 +874,7 @@ class WallService { } .apply { ownerId?.let { addParam("owner_id", it) } - postId?.let { addParam("post_id", it) } + postId?.let { addParam("post_id", it, min = 0) } } /** @@ -920,10 +920,10 @@ class WallService { .apply { ownerId?.let { addParam("owner_id", it) } domain?.let { addParam("domain", it) } - query?.let { addParam("query", it) } + query?.let { addParam("query", it, maxLength = 9000) } ownersOnly?.let { addParam("owners_only", it) } - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0, max = 100) } + offset?.let { addParam("offset", it, min = 0) } val fieldsJsonConverted = fields?.map { it.value } @@ -957,10 +957,10 @@ class WallService { .apply { ownerId?.let { addParam("owner_id", it) } domain?.let { addParam("domain", it) } - query?.let { addParam("query", it) } + query?.let { addParam("query", it, maxLength = 9000) } ownersOnly?.let { addParam("owners_only", it) } - count?.let { addParam("count", it) } - offset?.let { addParam("offset", it) } + count?.let { addParam("count", it, min = 0, max = 100) } + offset?.let { addParam("offset", it, min = 0) } addParam("extended", true) val fieldsJsonConverted = fields?.map { it.value @@ -981,7 +981,7 @@ class WallService { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { - addParam("post_id", postId) + addParam("post_id", postId, min = 0) ownerId?.let { addParam("owner_id", it) } } } diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallGeo.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGeo.kt index eb5c8276b5..ed11ba9398 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallGeo.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGeo.kt @@ -46,5 +46,15 @@ data class WallGeo( @SerializedName("showmap") val showmap: Int? = null, @SerializedName("type") - val type: String? = null -) + val type: WallGeo.Type? = null +) { + enum class Type( + val value: String + ) { + @SerializedName("place") + PLACE("place"), + + @SerializedName("point") + POINT("point"); + } +} diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsExtendedResponse.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsExtendedResponse.kt index 41f3366c21..e82d4088c6 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsExtendedResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsExtendedResponse.kt @@ -39,10 +39,10 @@ import kotlin.collections.List * @param items * @param profiles * @param groups - * @param showReplyButton + * @param currentLevelCount - Count of replies of current level * @param canPost - Information whether current user can comment the post + * @param showReplyButton * @param groupsCanPost - Information whether groups can comment the post - * @param currentLevelCount - Count of replies of current level */ data class WallGetCommentsExtendedResponse( @SerializedName("count") @@ -53,12 +53,12 @@ data class WallGetCommentsExtendedResponse( val profiles: List, @SerializedName("groups") val groups: List, - @SerializedName("show_reply_button") - val showReplyButton: Boolean? = null, + @SerializedName("current_level_count") + val currentLevelCount: Int? = null, @SerializedName("can_post") val canPost: Boolean? = null, + @SerializedName("show_reply_button") + val showReplyButton: Boolean? = null, @SerializedName("groups_can_post") - val groupsCanPost: Boolean? = null, - @SerializedName("current_level_count") - val currentLevelCount: Int? = null + val groupsCanPost: Boolean? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsResponse.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsResponse.kt index 4eb20f44e8..12257663b9 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsResponse.kt @@ -35,19 +35,22 @@ import kotlin.collections.List /** * @param count - Total number * @param items + * @param currentLevelCount - Count of replies of current level * @param canPost - Information whether current user can comment the post + * @param showReplyButton * @param groupsCanPost - Information whether groups can comment the post - * @param currentLevelCount - Count of replies of current level */ data class WallGetCommentsResponse( @SerializedName("count") val count: Int, @SerializedName("items") val items: List, + @SerializedName("current_level_count") + val currentLevelCount: Int? = null, @SerializedName("can_post") val canPost: Boolean? = null, + @SerializedName("show_reply_button") + val showReplyButton: Boolean? = null, @SerializedName("groups_can_post") - val groupsCanPost: Boolean? = null, - @SerializedName("current_level_count") - val currentLevelCount: Int? = null + val groupsCanPost: Boolean? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallGraffiti.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGraffiti.kt index 045290580f..f9157de82c 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallGraffiti.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGraffiti.kt @@ -37,6 +37,10 @@ import kotlin.String * @param ownerId - Graffiti owner's ID * @param photo200 - URL of the preview image with 200 px in width * @param photo586 - URL of the preview image with 586 px in width + * @param height - Graffiti height + * @param url - Graffiti URL + * @param width - Graffiti width + * @param accessKey - Access key for graffiti */ data class WallGraffiti( @SerializedName("id") @@ -46,5 +50,13 @@ data class WallGraffiti( @SerializedName("photo_200") val photo200: String? = null, @SerializedName("photo_586") - val photo586: String? = null + val photo586: String? = null, + @SerializedName("height") + val height: Int? = null, + @SerializedName("url") + val url: String? = null, + @SerializedName("width") + val width: Int? = null, + @SerializedName("access_key") + val accessKey: String? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostCopyright.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostCopyright.kt index 9812d131fd..cedfd59333 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostCopyright.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostCopyright.kt @@ -28,7 +28,7 @@ package com.vk.sdk.api.wall.dto import com.google.gson.annotations.SerializedName -import kotlin.Int +import com.vk.dto.common.id.UserId import kotlin.String /** @@ -45,5 +45,5 @@ data class WallPostCopyright( @SerializedName("type") val type: String, @SerializedName("id") - val id: Int? = null + val id: UserId? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostSource.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostSource.kt index e003075ae8..6f2f42e7ac 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostSource.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostSource.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.wall.dto import com.google.gson.annotations.SerializedName +import com.vk.sdk.api.base.dto.BaseLink import kotlin.String /** @@ -35,6 +36,7 @@ import kotlin.String * @param platform - Platform name * @param type * @param url - URL to an external site used to publish the post + * @param link */ data class WallPostSource( @SerializedName("data") @@ -44,5 +46,7 @@ data class WallPostSource( @SerializedName("type") val type: WallPostSourceType? = null, @SerializedName("url") - val url: String? = null + val url: String? = null, + @SerializedName("link") + val link: BaseLink? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostType.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostType.kt index 8e49b0fbd5..1e6f81904e 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostType.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostType.kt @@ -46,5 +46,14 @@ enum class WallPostType( POSTPONE("postpone"), @SerializedName("suggest") - SUGGEST("suggest"); + SUGGEST("suggest"), + + @SerializedName("post_ads") + POST_ADS("post_ads"), + + @SerializedName("photo") + PHOTO("photo"), + + @SerializedName("video") + VIDEO("video"); } diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallComment.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallComment.kt index 76173f32e7..9da9fc19c0 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallComment.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallComment.kt @@ -29,6 +29,7 @@ package com.vk.sdk.api.wall.dto import com.google.gson.annotations.SerializedName import com.vk.dto.common.id.UserId +import com.vk.sdk.api.base.dto.BaseBoolInt import com.vk.sdk.api.base.dto.BaseLikesInfo import com.vk.sdk.api.comment.dto.CommentThread import kotlin.Boolean @@ -37,31 +38,47 @@ 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 fromId - Author ID + * @param date - Date when the comment has been added in Unixtime * @param text - Comment text + * @param canEdit + * @param postId + * @param ownerId + * @param parentsStack + * @param photoId + * @param videoId * @param attachments * @param donut * @param likes * @param realOffset - Real position of the comment - * @param replyToComment - Replied comment ID * @param replyToUser - Replied user ID + * @param replyToComment - Replied comment ID * @param thread - * @param postId - * @param ownerId - * @param parentsStack * @param deleted + * @param pid - Photo ID */ data class WallWallComment( - @SerializedName("date") - val date: Int, - @SerializedName("from_id") - val fromId: Int, @SerializedName("id") val id: Int, + @SerializedName("from_id") + val fromId: UserId, + @SerializedName("date") + val date: Int, @SerializedName("text") val text: String, + @SerializedName("can_edit") + val canEdit: BaseBoolInt? = null, + @SerializedName("post_id") + val postId: Int? = null, + @SerializedName("owner_id") + val ownerId: UserId? = null, + @SerializedName("parents_stack") + val parentsStack: List? = null, + @SerializedName("photo_id") + val photoId: Int? = null, + @SerializedName("video_id") + val videoId: Int? = null, @SerializedName("attachments") val attachments: List? = null, @SerializedName("donut") @@ -70,18 +87,14 @@ data class WallWallComment( val likes: BaseLikesInfo? = null, @SerializedName("real_offset") val realOffset: Int? = null, + @SerializedName("reply_to_user") + val replyToUser: UserId? = null, @SerializedName("reply_to_comment") val replyToComment: Int? = null, - @SerializedName("reply_to_user") - val replyToUser: Int? = null, @SerializedName("thread") val thread: CommentThread? = null, - @SerializedName("post_id") - val postId: Int? = null, - @SerializedName("owner_id") - val ownerId: UserId? = null, - @SerializedName("parents_stack") - val parentsStack: List? = null, @SerializedName("deleted") - val deleted: Boolean? = null + val deleted: Boolean? = null, + @SerializedName("pid") + val pid: Int? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostAttachment.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostAttachment.kt index 19aca5a445..e187ed3b97 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostAttachment.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostAttachment.kt @@ -35,13 +35,13 @@ import com.vk.sdk.api.events.dto.EventsEventAttach import com.vk.sdk.api.groups.dto.GroupsGroupAttach import com.vk.sdk.api.market.dto.MarketMarketAlbum import com.vk.sdk.api.market.dto.MarketMarketItem +import com.vk.sdk.api.notes.dto.NotesNote import com.vk.sdk.api.pages.dto.PagesWikipageFull import com.vk.sdk.api.photos.dto.PhotosPhoto import com.vk.sdk.api.photos.dto.PhotosPhotoAlbum import com.vk.sdk.api.polls.dto.PollsPoll -import com.vk.sdk.api.video.dto.VideoVideo +import com.vk.sdk.api.video.dto.VideoVideoFull import kotlin.String -import kotlin.collections.List /** * @param type @@ -59,7 +59,6 @@ import kotlin.collections.List * @param note * @param page * @param photo - * @param photosList * @param poll * @param postedPhoto * @param video @@ -90,17 +89,15 @@ data class WallWallpostAttachment( @SerializedName("market_album") val marketAlbum: MarketMarketAlbum? = null, @SerializedName("note") - val note: WallAttachedNote? = null, + val note: NotesNote? = null, @SerializedName("page") val page: PagesWikipageFull? = null, @SerializedName("photo") val photo: PhotosPhoto? = null, - @SerializedName("photos_list") - val photosList: List? = null, @SerializedName("poll") val poll: PollsPoll? = null, @SerializedName("posted_photo") val postedPhoto: WallPostedPhoto? = null, @SerializedName("video") - val video: VideoVideo? = null + val video: VideoVideoFull? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostAttachmentType.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostAttachmentType.kt index e33712fadf..06ddedeb0d 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostAttachmentType.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostAttachmentType.kt @@ -36,12 +36,18 @@ enum class WallWallpostAttachmentType( @SerializedName("photo") PHOTO("photo"), + @SerializedName("photos_list") + PHOTOS_LIST("photos_list"), + @SerializedName("posted_photo") POSTED_PHOTO("posted_photo"), @SerializedName("audio") AUDIO("audio"), + @SerializedName("audio_playlist") + AUDIO_PLAYLIST("audio_playlist"), + @SerializedName("video") VIDEO("video"), @@ -66,14 +72,14 @@ enum class WallWallpostAttachmentType( @SerializedName("page") PAGE("page"), + @SerializedName("pretty_cards") + PRETTY_CARDS("pretty_cards"), + @SerializedName("album") ALBUM("album"), - @SerializedName("photos_list") - PHOTOS_LIST("photos_list"), - - @SerializedName("market_market_album") - MARKET_MARKET_ALBUM("market_market_album"), + @SerializedName("market_album") + MARKET_ALBUM("market_album"), @SerializedName("market") MARKET("market"), @@ -96,6 +102,24 @@ enum class WallWallpostAttachmentType( @SerializedName("textpost") TEXTPOST("textpost"), + @SerializedName("textpost_publish") + TEXTPOST_PUBLISH("textpost_publish"), + @SerializedName("situational_theme") - SITUATIONAL_THEME("situational_theme"); + SITUATIONAL_THEME("situational_theme"), + + @SerializedName("group") + GROUP("group"), + + @SerializedName("sticker") + STICKER("sticker"), + + @SerializedName("podcast") + PODCAST("podcast"), + + @SerializedName("curator") + CURATOR("curator"), + + @SerializedName("artist") + ARTIST("artist"); } diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostFull.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostFull.kt index ce275c3317..c261e8a160 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostFull.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostFull.kt @@ -33,7 +33,6 @@ import com.vk.sdk.api.base.dto.BaseBoolInt import com.vk.sdk.api.base.dto.BaseCommentsInfo import com.vk.sdk.api.base.dto.BaseLikesInfo import com.vk.sdk.api.base.dto.BaseRepostsInfo -import kotlin.Any import kotlin.Boolean import kotlin.Float import kotlin.Int @@ -67,7 +66,6 @@ import kotlin.collections.List * @param isFavorite - Information whether the post in favorites list * @param likes - Count of likes * @param ownerId - Wall owner's ID - * @param poster * @param postId - If post type 'reply', contains original post ID * @param parentsStack - If post type 'reply', contains original parent IDs stack * @param postSource @@ -79,11 +77,11 @@ import kotlin.collections.List */ data class WallWallpostFull( @SerializedName("copy_history") - val copyHistory: List? = null, + val copyHistory: List? = null, @SerializedName("can_edit") val canEdit: BaseBoolInt? = null, @SerializedName("created_by") - val createdBy: Int? = null, + val createdBy: UserId? = null, @SerializedName("can_delete") val canDelete: BaseBoolInt? = null, @SerializedName("can_pin") @@ -117,7 +115,7 @@ data class WallWallpostFull( @SerializedName("edited") val edited: Int? = null, @SerializedName("from_id") - val fromId: Int? = null, + val fromId: UserId? = null, @SerializedName("geo") val geo: WallGeo? = null, @SerializedName("id") @@ -130,8 +128,6 @@ data class WallWallpostFull( val likes: BaseLikesInfo? = null, @SerializedName("owner_id") val ownerId: UserId? = null, - @SerializedName("poster") - val poster: Any? = null, @SerializedName("post_id") val postId: Int? = null, @SerializedName("parents_stack") @@ -143,7 +139,7 @@ data class WallWallpostFull( @SerializedName("reposts") val reposts: BaseRepostsInfo? = null, @SerializedName("signer_id") - val signerId: Int? = null, + val signerId: UserId? = null, @SerializedName("text") val text: String? = null, @SerializedName("views") diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostToId.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostToId.kt index c9badc6233..30ac7c024a 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostToId.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallWallpostToId.kt @@ -28,6 +28,7 @@ package com.vk.sdk.api.wall.dto import com.google.gson.annotations.SerializedName +import com.vk.dto.common.id.UserId import com.vk.sdk.api.base.dto.BaseCommentsInfo import com.vk.sdk.api.base.dto.BaseLikesInfo import com.vk.sdk.api.base.dto.BaseRepostsInfo @@ -61,13 +62,13 @@ data class WallWallpostToId( @SerializedName("comments") val comments: BaseCommentsInfo? = null, @SerializedName("copy_owner_id") - val copyOwnerId: Int? = null, + val copyOwnerId: UserId? = null, @SerializedName("copy_post_id") val copyPostId: Int? = null, @SerializedName("date") val date: Int? = null, @SerializedName("from_id") - val fromId: Int? = null, + val fromId: UserId? = null, @SerializedName("geo") val geo: WallGeo? = null, @SerializedName("id") @@ -85,9 +86,9 @@ data class WallWallpostToId( @SerializedName("reposts") val reposts: BaseRepostsInfo? = null, @SerializedName("signer_id") - val signerId: Int? = null, + val signerId: UserId? = null, @SerializedName("text") val text: String? = null, @SerializedName("to_id") - val toId: Int? = null + val toId: UserId? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/widgets/WidgetsService.kt b/api/src/main/java/com/vk/sdk/api/widgets/WidgetsService.kt index 328dc2d1e5..c43de54ca6 100644 --- a/api/src/main/java/com/vk/sdk/api/widgets/WidgetsService.kt +++ b/api/src/main/java/com/vk/sdk/api/widgets/WidgetsService.kt @@ -70,8 +70,8 @@ class WidgetsService { it.value } fieldsJsonConverted?.let { addParam("fields", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 10, max = 200) } } /** @@ -98,7 +98,7 @@ class WidgetsService { widgetApiId?.let { addParam("widget_api_id", it) } order?.let { addParam("order", it) } period?.let { addParam("period", it) } - offset?.let { addParam("offset", it) } - count?.let { addParam("count", it) } + offset?.let { addParam("offset", it, min = 0) } + count?.let { addParam("count", it, min = 10, max = 200) } } } diff --git a/build.gradle b/build.gradle index fb718a4437..8fceeee96f 100644 --- a/build.gradle +++ b/build.gradle @@ -27,11 +27,8 @@ 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") - } + maven { + url "https://plugins.gradle.org/m2/" } google() mavenCentral() diff --git a/core/build.gradle b/core/build.gradle index d34e072563..a7410fd4a2 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,3 +1,30 @@ +/** + * Copyright (c) 2020 - present, LLC “V Kontakte” + * + * 1. Permission is hereby granted to any person obtaining a copy of this Software to + * use the Software without charge. + * + * 2. Restrictions + * You may not modify, merge, publish, distribute, sublicense, and/or sell copies, + * create derivative works based upon the Software or any part thereof. + * + * 3. Termination + * This License is effective until terminated. LLC “V Kontakte” may terminate this + * License at any time without any negative consequences to our rights. + * You may terminate this License at any time by deleting the Software and all copies + * thereof. Upon termination of this license for any reason, you shall continue to be + * bound by the provisions of Section 2 above. + * Termination will be without prejudice to any rights LLC “V Kontakte” may have as + * a result of this agreement. + * + * 4. Disclaimer of warranty and liability + * THE SOFTWARE IS MADE AVAILABLE ON THE “AS IS” BASIS. LLC “V KONTAKTE” DISCLAIMS + * ALL WARRANTIES THAT THE SOFTWARE MAY BE SUITABLE OR UNSUITABLE FOR ANY SPECIFIC + * PURPOSES OF USE. LLC “V KONTAKTE” CAN NOT GUARANTEE AND DOES NOT PROMISE ANY + * SPECIFIC RESULTS OF USE OF THE SOFTWARE. + * UNDER NO CIRCUMSTANCES LLC “V KONTAKTE” BEAR LIABILITY TO THE LICENSEE OR ANY + * THIRD PARTIES FOR ANY DAMAGE IN CONNECTION WITH USE OF THE SOFTWARE. +*/ /******************************************************************************* * The MIT License (MIT) * @@ -49,6 +76,7 @@ android { exclude("autoTest/**") exclude("META-INF/spring.*") exclude("META-INF/notice.txt") + exclude("META-INF/resources/**") exclude("mockito-extensions/org.mockito.plugins.MockMaker") } @@ -67,6 +95,7 @@ dependencies { implementation sdkLibraries.okHttp implementation sdkLibraries.okHttpLoggingInterceptor implementation sdkLibrariesSupport.collection + implementation sdkLibrariesSupport.activity testImplementation testLibraries.junit testImplementation testLibraries.mockito diff --git a/core/gradle.properties b/core/gradle.properties deleted file mode 100644 index 26840e6130..0000000000 --- a/core/gradle.properties +++ /dev/null @@ -1,25 +0,0 @@ -# ******************************************************************************* -# 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. -# ******************************************************************************/ -POM_ARTIFACT_TYPE=superapp,vksdk -POM_ARTIFACT_SCOPE=public diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml index 857c7974b5..a5a6aa6215 100644 --- a/core/src/main/AndroidManifest.xml +++ b/core/src/main/AndroidManifest.xml @@ -1,3 +1,30 @@ + diff --git a/core/src/main/res/values-ru/string.xml b/core/src/main/res/values-ru/string.xml index f738fba6ed..87318919aa 100644 --- a/core/src/main/res/values-ru/string.xml +++ b/core/src/main/res/values-ru/string.xml @@ -1,4 +1,31 @@ + Повторить Введите код с картинки diff --git a/core/src/main/res/values/booleans.xml b/core/src/main/res/values/booleans.xml index 7e935bbf0f..74a0f971d0 100644 --- a/core/src/main/res/values/booleans.xml +++ b/core/src/main/res/values/booleans.xml @@ -1,4 +1,31 @@ + true \ No newline at end of file diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 3c2a061617..11b25f713c 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -1,4 +1,31 @@ + Retry Please enter the code from the picture diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 9537268539..d2444c30d8 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -1,4 +1,31 @@ +