From 07f2adf0dbb5a4ada01ce0f23be262ce74d4e890 Mon Sep 17 00:00:00 2001 From: "a.mochalov" Date: Mon, 13 Sep 2021 21:32:47 +0300 Subject: [PATCH] version 3.3.0 --- api/build.gradle | 11 + .../main/java/com/vk/sdk/api/GsonHolder.kt | 1 - .../com/vk/sdk/api/account/AccountService.kt | 48 ++-- ...erParam.kt => AccountGetCountersFilter.kt} | 2 +- ...FieldsParam.kt => AccountGetInfoFields.kt} | 2 +- ... AccountSaveProfileInfoBdateVisibility.kt} | 2 +- ...m.kt => AccountSaveProfileInfoRelation.kt} | 2 +- ...xParam.kt => AccountSaveProfileInfoSex.kt} | 2 +- .../java/com/vk/sdk/api/ads/AdsService.kt | 94 +++---- ...nkTypeParam.kt => AdsCheckLinkLinkType.kt} | 2 +- ...ieldsParam.kt => AdsGetCampaignsFields.kt} | 2 +- .../api/ads/dto/AdsGetDemographicsIdsType.kt | 41 +++ .../api/ads/dto/AdsGetDemographicsPeriod.kt | 44 ++++ ...ypeParam.kt => AdsGetPostsReachIdsType.kt} | 2 +- .../api/ads/dto/AdsGetStatisticsIdsType.kt | 47 ++++ ...riodParam.kt => AdsGetStatisticsPeriod.kt} | 2 +- ...aram.kt => AdsGetStatisticsStatsFields.kt} | 2 +- ...{LangParam.kt => AdsGetSuggestionsLang.kt} | 2 +- ...onParam.kt => AdsGetSuggestionsSection.kt} | 2 +- ...ram.kt => AdsGetTargetingStatsAdFormat.kt} | 2 +- .../api/ads/dto/AdsGetUploadURLAdFormat.kt | 50 ++++ .../sdk/api/appWidgets/AppWidgetsService.kt | 17 +- ...WidgetsGetAppImageUploadServerImageType.kt | 50 ++++ ....kt => AppWidgetsGetAppImagesImageType.kt} | 2 +- ...dgetsGetGroupImageUploadServerImageType.kt | 50 ++++ .../dto/AppWidgetsGetGroupImagesImageType.kt | 50 ++++ .../{TypeParam.kt => AppWidgetsUpdateType.kt} | 2 +- .../java/com/vk/sdk/api/apps/AppsService.kt | 65 ++--- ...FilterParam.kt => AppsGetCatalogFilter.kt} | 2 +- .../{SortParam.kt => AppsGetCatalogSort.kt} | 2 +- .../api/apps/dto/AppsGetFriendsListType.kt | 41 +++ .../dto/AppsGetLeaderboardExtendedType.kt | 44 ++++ .../api/apps/dto/AppsGetLeaderboardType.kt | 44 ++++ .../{NameCaseParam.kt => AppsGetNameCase.kt} | 2 +- .../{PlatformParam.kt => AppsGetPlatform.kt} | 2 +- .../vk/sdk/api/apps/dto/AppsGetScopesType.kt | 41 +++ .../{TypeParam.kt => AppsSendRequestType.kt} | 2 +- .../com/vk/sdk/api/base/dto/BaseLinkButton.kt | 3 + .../api/base/dto/BaseLinkButtonActionType.kt | 5 +- .../java/com/vk/sdk/api/board/BoardService.kt | 74 +++--- .../board/dto/BoardGetCommentsExtendedSort.kt | 41 +++ .../{SortParam.kt => BoardGetCommentsSort.kt} | 2 +- .../board/dto/BoardGetTopicsExtendedOrder.kt | 50 ++++ .../dto/BoardGetTopicsExtendedPreview.kt | 44 ++++ .../{OrderParam.kt => BoardGetTopicsOrder.kt} | 2 +- ...eviewParam.kt => BoardGetTopicsPreview.kt} | 2 +- .../java/com/vk/sdk/api/docs/DocsService.kt | 28 ++- .../dto/DocsGetMessagesUploadServerType.kt | 44 ++++ .../docs/dto/{TypeParam.kt => DocsGetType.kt} | 2 +- .../java/com/vk/sdk/api/donut/DonutService.kt | 7 +- .../downloadedGames/DownloadedGamesService.kt | 4 +- .../java/com/vk/sdk/api/fave/FaveService.kt | 43 ++-- ...PositionParam.kt => FaveAddTagPosition.kt} | 2 +- .../api/fave/dto/FaveGetExtendedItemType.kt | 65 +++++ .../{ItemTypeParam.kt => FaveGetItemType.kt} | 2 +- .../dto/{TypeParam.kt => FaveGetPagesType.kt} | 2 +- .../sdk/api/fave/dto/FaveSetTagsItemType.kt | 65 +++++ .../com/vk/sdk/api/friends/FriendsService.kt | 69 ++--- ...NameCaseParam.kt => FriendsGetNameCase.kt} | 2 +- .../dto/{OrderParam.kt => FriendsGetOrder.kt} | 2 +- ...SortParam.kt => FriendsGetRequestsSort.kt} | 2 +- ...aram.kt => FriendsGetSuggestionsFilter.kt} | 2 +- .../dto/FriendsGetSuggestionsNameCase.kt | 53 ++++ .../api/friends/dto/FriendsSearchNameCase.kt | 53 ++++ .../java/com/vk/sdk/api/gifts/GiftsService.kt | 3 +- .../com/vk/sdk/api/groups/GroupsService.kt | 236 +++++++++--------- ...m.kt => GroupsAddAddressWorkInfoStatus.kt} | 2 +- .../vk/sdk/api/groups/dto/GroupsAppButton.kt | 48 ---- .../sdk/api/groups/dto/GroupsCountersGroup.kt | 5 +- ...SubtypeParam.kt => GroupsCreateSubtype.kt} | 2 +- .../dto/{TypeParam.kt => GroupsCreateType.kt} | 2 +- .../dto/GroupsEditAddressWorkInfoStatus.kt | 50 ++++ ...eLimitsParam.kt => GroupsEditAgeLimits.kt} | 2 +- ...am.kt => GroupsGetInvitedUsersNameCase.kt} | 2 +- ...lterParam.kt => GroupsGetMembersFilter.kt} | 2 +- .../{SortParam.kt => GroupsGetMembersSort.kt} | 2 +- ....kt => GroupsGetObjectExtendedResponse.kt} | 2 +- .../com/vk/sdk/api/groups/dto/GroupsGroup.kt | 19 +- .../vk/sdk/api/groups/dto/GroupsGroupFull.kt | 17 +- .../vk/sdk/api/groups/dto/GroupsGroupLink.kt | 56 ----- .../vk/sdk/api/groups/dto/GroupsLinksItem.kt | 6 +- .../vk/sdk/api/groups/dto/GroupsMarketInfo.kt | 6 +- .../vk/sdk/api/groups/dto/GroupsSearchSort.kt | 53 ++++ .../vk/sdk/api/groups/dto/GroupsSearchType.kt | 44 ++++ ...gColorParam.kt => GroupsTagAddTagColor.kt} | 2 +- .../dto/{ActParam.kt => GroupsTagBindAct.kt} | 2 +- ...ateParam.kt => GroupsToggleMarketState.kt} | 2 +- .../java/com/vk/sdk/api/likes/LikesService.kt | 45 ++-- .../likes/dto/LikesGetListExtendedFilter.kt | 41 +++ .../dto/LikesGetListExtendedFriendsOnly.kt | 47 ++++ .../{FilterParam.kt => LikesGetListFilter.kt} | 2 +- ...nlyParam.kt => LikesGetListFriendsOnly.kt} | 2 +- .../com/vk/sdk/api/market/MarketService.kt | 146 ++++++----- ...ram.kt => MarketEditOrderPaymentStatus.kt} | 2 +- ...{SortParam.kt => MarketGetCommentsSort.kt} | 2 +- .../market/dto/MarketGetExtendedResponse.kt | 5 +- .../sdk/api/market/dto/MarketGetResponse.kt | 5 +- .../market/dto/MarketReportCommentReason.kt | 56 +++++ .../{ReasonParam.kt => MarketReportReason.kt} | 2 +- .../dto/MarketSearchExtendedResponse.kt | 5 +- .../api/market/dto/MarketSearchExtendedRev.kt | 41 +++ .../market/dto/MarketSearchExtendedSort.kt | 47 ++++ .../market/dto/MarketSearchExtendedStatus.kt | 41 +++ .../api/market/dto/MarketSearchResponse.kt | 5 +- .../dto/{RevParam.kt => MarketSearchRev.kt} | 2 +- .../vk/sdk/api/market/dto/MarketSearchSort.kt | 47 ++++ .../{StatusParam.kt => MarketSearchStatus.kt} | 2 +- .../vk/sdk/api/messages/MessagesService.kt | 185 +++++++------- ...m.kt => MessagesGetConversationsFilter.kt} | 2 +- ...MessagesGetHistoryAttachmentsMediaType.kt} | 2 +- .../dto/MessagesGetHistoryExtendedRev.kt | 41 +++ .../{RevParam.kt => MessagesGetHistoryRev.kt} | 2 +- ...ram.kt => MessagesGetIntentUsersIntent.kt} | 2 +- .../api/messages/dto/MessagesSendIntent.kt | 68 +++++ ...ypeParam.kt => MessagesSetActivityType.kt} | 2 +- .../vk/sdk/api/newsfeed/NewsfeedService.kt | 40 +-- .../dto/NewsfeedGetBannedExtendedNameCase.kt | 53 ++++ ...eParam.kt => NewsfeedGetBannedNameCase.kt} | 2 +- ...ypeParam.kt => NewsfeedUnsubscribeType.kt} | 2 +- .../java/com/vk/sdk/api/notes/NotesService.kt | 22 +- .../sdk/api/notes/dto/NotesGetCommentsSort.kt | 41 +++ .../dto/{SortParam.kt => NotesGetSort.kt} | 2 +- .../api/notifications/NotificationsService.kt | 15 +- ...ersParam.kt => NotificationsGetFilters.kt} | 2 +- ...=> NotificationsSendMessageSendingMode.kt} | 2 +- .../com/vk/sdk/api/orders/OrdersService.kt | 22 +- .../vk/sdk/api/orders/dto/OrdersAmountItem.kt | 4 +- ...ionParam.kt => OrdersChangeStateAction.kt} | 2 +- .../java/com/vk/sdk/api/pages/PagesService.kt | 35 +-- .../{EditParam.kt => PagesSaveAccessEdit.kt} | 2 +- .../{ViewParam.kt => PagesSaveAccessView.kt} | 2 +- .../com/vk/sdk/api/photos/PhotosService.kt | 145 +++++------ .../dto/PhotosGetCommentsExtendedSort.kt | 41 +++ ...{SortParam.kt => PhotosGetCommentsSort.kt} | 2 +- .../photos/dto/PhotosReportCommentReason.kt | 56 +++++ .../{ReasonParam.kt => PhotosReportReason.kt} | 2 +- .../java/com/vk/sdk/api/polls/PollsService.kt | 41 +-- ...dIdParam.kt => PollsCreateBackgroundId.kt} | 2 +- .../api/polls/dto/PollsEditBackgroundId.kt | 59 +++++ ...meCaseParam.kt => PollsGetByIdNameCase.kt} | 2 +- .../api/polls/dto/PollsGetVotersNameCase.kt | 53 ++++ .../com/vk/sdk/api/secure/SecureService.kt | 15 +- .../java/com/vk/sdk/api/stats/StatsService.kt | 7 +- .../{IntervalParam.kt => StatsGetInterval.kt} | 2 +- .../com/vk/sdk/api/status/StatusService.kt | 6 +- .../com/vk/sdk/api/storage/StorageService.kt | 7 +- .../com/vk/sdk/api/stories/StoriesService.kt | 25 +- .../vk/sdk/api/streaming/StreamingService.kt | 14 +- ...lParam.kt => StreamingGetStatsInterval.kt} | 2 +- ...{TypeParam.kt => StreamingGetStatsType.kt} | 2 +- ....kt => StreamingSetSettingsMonthlyTier.kt} | 2 +- .../java/com/vk/sdk/api/users/UsersService.kt | 50 ++-- .../users/dto/UsersGetFollowersNameCase.kt | 53 ++++ .../{NameCaseParam.kt => UsersGetNameCase.kt} | 2 +- .../dto/{TypeParam.kt => UsersReportType.kt} | 2 +- .../dto/{SexParam.kt => UsersSearchSex.kt} | 2 +- .../dto/{SortParam.kt => UsersSearchSort.kt} | 2 +- .../{StatusParam.kt => UsersSearchStatus.kt} | 2 +- .../api/users/dto/UsersSubscriptionsItem.kt | 18 +- .../java/com/vk/sdk/api/utils/UtilsService.kt | 16 +- .../dto/UtilsGetLinkStatsExtendedInterval.kt | 50 ++++ .../dto/UtilsGetLinkStatsExtendedSource.kt | 41 +++ ...lParam.kt => UtilsGetLinkStatsInterval.kt} | 2 +- ...rceParam.kt => UtilsGetLinkStatsSource.kt} | 2 +- .../java/com/vk/sdk/api/video/VideoService.kt | 123 ++++----- ...rivacyParam.kt => VideoAddAlbumPrivacy.kt} | 2 +- .../api/video/dto/VideoEditAlbumPrivacy.kt | 47 ++++ .../video/dto/VideoGetCommentsExtendedSort.kt | 41 +++ .../{SortParam.kt => VideoGetCommentsSort.kt} | 2 +- .../api/video/dto/VideoReportCommentReason.kt | 56 +++++ .../{ReasonParam.kt => VideoReportReason.kt} | 2 +- .../video/dto/VideoSearchExtendedFilters.kt | 47 ++++ .../api/video/dto/VideoSearchExtendedSort.kt | 44 ++++ ...{FiltersParam.kt => VideoSearchFilters.kt} | 2 +- .../vk/sdk/api/video/dto/VideoSearchSort.kt | 44 ++++ .../java/com/vk/sdk/api/wall/WallService.kt | 142 ++++++----- .../{TopicIdParam.kt => WallEditTopicId.kt} | 2 +- .../wall/dto/WallGetCommentsExtendedSort.kt | 41 +++ .../{SortParam.kt => WallGetCommentsSort.kt} | 2 +- .../vk/sdk/api/wall/dto/WallPostTopicId.kt | 71 ++++++ .../api/wall/dto/WallReportCommentReason.kt | 56 +++++ ...ReasonParam.kt => WallReportPostReason.kt} | 2 +- .../wall/dto/WallWallpostAttachmentType.kt | 5 +- .../vk/sdk/api/wall/dto/WallWallpostFull.kt | 3 + core/build.gradle | 14 ++ core/src/main/AndroidManifest.xml | 2 + core/src/main/java/com/vk/api/sdk/VK.kt | 31 ++- .../main/java/com/vk/api/sdk/VKApiConfig.kt | 12 +- .../com/vk/api/sdk/VKApiResponseValidator.kt | 12 + .../java/com/vk/api/sdk/VKOkHttpProvider.kt | 2 + .../com/vk/api/sdk/auth/VKAuthCallback.kt | 9 +- .../java/com/vk/api/sdk/auth/VKAuthManager.kt | 33 ++- .../com/vk/api/sdk/chain/MethodChainCall.kt | 21 +- .../sdk/chain/TooManyRequestRetryChainCall.kt | 2 +- .../com/vk/api/sdk/exceptions/VKApiCodes.kt | 4 + .../vk/api/sdk/exceptions/VKAuthException.kt | 14 ++ .../com/vk/api/sdk/extensions/ContextExt.kt | 5 + .../com/vk/api/sdk/okhttp/OkHttpExecutor.kt | 4 +- .../com/vk/api/sdk/okhttp/OkHttpMethodCall.kt | 2 + .../vk/api/sdk/okhttp/UserAgentInterceptor.kt | 17 ++ .../java/com/vk/api/sdk/requests/VKRequest.kt | 3 + .../vk/api/sdk/ui/VKWebViewAuthActivity.kt | 32 +-- .../com/vk/api/sdk/utils/DefaultUserAgent.kt | 25 ++ .../com/vk/api/sdk/utils/UserAgentProvider.kt | 5 + .../main/java/com/vk/api/sdk/utils/VKUtils.kt | 49 ++++ core/src/main/res/values-ru/string.xml | 1 + core/src/main/res/values/strings.xml | 1 + dependencies.gradle | 22 +- gradle/wrapper/gradle-wrapper.properties | 2 +- id/build.gradle | 13 + id/src/main/java/com/vk/sdk/id/UserId.kt | 33 ++- .../com/vk/sdk/id/UserIdGsonSerializerTest.kt | 95 +++++++ .../java/com/vk/sdk/sample/WelcomeActivity.kt | 22 +- .../app/src/main/res/values-es/strings.xml | 8 - .../app/src/main/res/values-kk/strings.xml | 8 - .../app/src/main/res/values-pt/strings.xml | 8 - .../app/src/main/res/values-ru/strings.xml | 9 - .../app/src/main/res/values-uk/strings.xml | 8 - samples/app/src/main/res/values/strings.xml | 3 + 219 files changed, 3894 insertions(+), 1208 deletions(-) rename api/src/main/java/com/vk/sdk/api/account/dto/{FilterParam.kt => AccountGetCountersFilter.kt} (98%) rename api/src/main/java/com/vk/sdk/api/account/dto/{FieldsParam.kt => AccountGetInfoFields.kt} (98%) rename api/src/main/java/com/vk/sdk/api/account/dto/{BdateVisibilityParam.kt => AccountSaveProfileInfoBdateVisibility.kt} (97%) rename api/src/main/java/com/vk/sdk/api/account/dto/{RelationParam.kt => AccountSaveProfileInfoRelation.kt} (97%) rename api/src/main/java/com/vk/sdk/api/account/dto/{SexParam.kt => AccountSaveProfileInfoSex.kt} (97%) rename api/src/main/java/com/vk/sdk/api/ads/dto/{LinkTypeParam.kt => AdsCheckLinkLinkType.kt} (98%) rename api/src/main/java/com/vk/sdk/api/ads/dto/{FieldsParam.kt => AdsGetCampaignsFields.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetDemographicsIdsType.kt create mode 100644 api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetDemographicsPeriod.kt rename api/src/main/java/com/vk/sdk/api/ads/dto/{IdsTypeParam.kt => AdsGetPostsReachIdsType.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsIdsType.kt rename api/src/main/java/com/vk/sdk/api/ads/dto/{PeriodParam.kt => AdsGetStatisticsPeriod.kt} (97%) rename api/src/main/java/com/vk/sdk/api/ads/dto/{StatsFieldsParam.kt => AdsGetStatisticsStatsFields.kt} (97%) rename api/src/main/java/com/vk/sdk/api/ads/dto/{LangParam.kt => AdsGetSuggestionsLang.kt} (97%) rename api/src/main/java/com/vk/sdk/api/ads/dto/{SectionParam.kt => AdsGetSuggestionsSection.kt} (98%) rename api/src/main/java/com/vk/sdk/api/ads/dto/{AdFormatParam.kt => AdsGetTargetingStatsAdFormat.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetUploadURLAdFormat.kt create mode 100644 api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImageUploadServerImageType.kt rename api/src/main/java/com/vk/sdk/api/appWidgets/dto/{ImageTypeParam.kt => AppWidgetsGetAppImagesImageType.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImageUploadServerImageType.kt create mode 100644 api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImagesImageType.kt rename api/src/main/java/com/vk/sdk/api/appWidgets/dto/{TypeParam.kt => AppWidgetsUpdateType.kt} (98%) rename api/src/main/java/com/vk/sdk/api/apps/dto/{FilterParam.kt => AppsGetCatalogFilter.kt} (98%) rename api/src/main/java/com/vk/sdk/api/apps/dto/{SortParam.kt => AppsGetCatalogSort.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListType.kt create mode 100644 api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedType.kt create mode 100644 api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardType.kt rename api/src/main/java/com/vk/sdk/api/apps/dto/{NameCaseParam.kt => AppsGetNameCase.kt} (98%) rename api/src/main/java/com/vk/sdk/api/apps/dto/{PlatformParam.kt => AppsGetPlatform.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetScopesType.kt rename api/src/main/java/com/vk/sdk/api/apps/dto/{TypeParam.kt => AppsSendRequestType.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsExtendedSort.kt rename api/src/main/java/com/vk/sdk/api/board/dto/{SortParam.kt => BoardGetCommentsSort.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedOrder.kt create mode 100644 api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedPreview.kt rename api/src/main/java/com/vk/sdk/api/board/dto/{OrderParam.kt => BoardGetTopicsOrder.kt} (98%) rename api/src/main/java/com/vk/sdk/api/board/dto/{PreviewParam.kt => BoardGetTopicsPreview.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetMessagesUploadServerType.kt rename api/src/main/java/com/vk/sdk/api/docs/dto/{TypeParam.kt => DocsGetType.kt} (98%) rename api/src/main/java/com/vk/sdk/api/fave/dto/{PositionParam.kt => FaveAddTagPosition.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetExtendedItemType.kt rename api/src/main/java/com/vk/sdk/api/fave/dto/{ItemTypeParam.kt => FaveGetItemType.kt} (98%) rename api/src/main/java/com/vk/sdk/api/fave/dto/{TypeParam.kt => FaveGetPagesType.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/fave/dto/FaveSetTagsItemType.kt rename api/src/main/java/com/vk/sdk/api/friends/dto/{NameCaseParam.kt => FriendsGetNameCase.kt} (98%) rename api/src/main/java/com/vk/sdk/api/friends/dto/{OrderParam.kt => FriendsGetOrder.kt} (98%) rename api/src/main/java/com/vk/sdk/api/friends/dto/{SortParam.kt => FriendsGetRequestsSort.kt} (97%) rename api/src/main/java/com/vk/sdk/api/friends/dto/{FilterParam.kt => FriendsGetSuggestionsFilter.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsNameCase.kt create mode 100644 api/src/main/java/com/vk/sdk/api/friends/dto/FriendsSearchNameCase.kt rename api/src/main/java/com/vk/sdk/api/groups/dto/{WorkInfoStatusParam.kt => GroupsAddAddressWorkInfoStatus.kt} (97%) delete mode 100644 api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAppButton.kt rename api/src/main/java/com/vk/sdk/api/groups/dto/{SubtypeParam.kt => GroupsCreateSubtype.kt} (98%) rename api/src/main/java/com/vk/sdk/api/groups/dto/{TypeParam.kt => GroupsCreateType.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/groups/dto/GroupsEditAddressWorkInfoStatus.kt rename api/src/main/java/com/vk/sdk/api/groups/dto/{AgeLimitsParam.kt => GroupsEditAgeLimits.kt} (98%) rename api/src/main/java/com/vk/sdk/api/groups/dto/{NameCaseParam.kt => GroupsGetInvitedUsersNameCase.kt} (97%) rename api/src/main/java/com/vk/sdk/api/groups/dto/{FilterParam.kt => GroupsGetMembersFilter.kt} (98%) rename api/src/main/java/com/vk/sdk/api/groups/dto/{SortParam.kt => GroupsGetMembersSort.kt} (98%) rename api/src/main/java/com/vk/sdk/api/groups/dto/{GroupsGetExtendedResponse.kt => GroupsGetObjectExtendedResponse.kt} (97%) delete mode 100644 api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupLink.kt create mode 100644 api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchSort.kt create mode 100644 api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchType.kt rename api/src/main/java/com/vk/sdk/api/groups/dto/{TagColorParam.kt => GroupsTagAddTagColor.kt} (98%) rename api/src/main/java/com/vk/sdk/api/groups/dto/{ActParam.kt => GroupsTagBindAct.kt} (98%) rename api/src/main/java/com/vk/sdk/api/groups/dto/{StateParam.kt => GroupsToggleMarketState.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedFilter.kt create mode 100644 api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedFriendsOnly.kt rename api/src/main/java/com/vk/sdk/api/likes/dto/{FilterParam.kt => LikesGetListFilter.kt} (98%) rename api/src/main/java/com/vk/sdk/api/likes/dto/{FriendsOnlyParam.kt => LikesGetListFriendsOnly.kt} (97%) rename api/src/main/java/com/vk/sdk/api/market/dto/{PaymentStatusParam.kt => MarketEditOrderPaymentStatus.kt} (97%) rename api/src/main/java/com/vk/sdk/api/market/dto/{SortParam.kt => MarketGetCommentsSort.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/market/dto/MarketReportCommentReason.kt rename api/src/main/java/com/vk/sdk/api/market/dto/{ReasonParam.kt => MarketReportReason.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedRev.kt create mode 100644 api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedSort.kt create mode 100644 api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedStatus.kt rename api/src/main/java/com/vk/sdk/api/market/dto/{RevParam.kt => MarketSearchRev.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchSort.kt rename api/src/main/java/com/vk/sdk/api/market/dto/{StatusParam.kt => MarketSearchStatus.kt} (98%) rename api/src/main/java/com/vk/sdk/api/messages/dto/{FilterParam.kt => MessagesGetConversationsFilter.kt} (97%) rename api/src/main/java/com/vk/sdk/api/messages/dto/{MediaTypeParam.kt => MessagesGetHistoryAttachmentsMediaType.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryExtendedRev.kt rename api/src/main/java/com/vk/sdk/api/messages/dto/{RevParam.kt => MessagesGetHistoryRev.kt} (97%) rename api/src/main/java/com/vk/sdk/api/messages/dto/{IntentParam.kt => MessagesGetIntentUsersIntent.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSendIntent.kt rename api/src/main/java/com/vk/sdk/api/messages/dto/{TypeParam.kt => MessagesSetActivityType.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedExtendedNameCase.kt rename api/src/main/java/com/vk/sdk/api/newsfeed/dto/{NameCaseParam.kt => NewsfeedGetBannedNameCase.kt} (97%) rename api/src/main/java/com/vk/sdk/api/newsfeed/dto/{TypeParam.kt => NewsfeedUnsubscribeType.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/notes/dto/NotesGetCommentsSort.kt rename api/src/main/java/com/vk/sdk/api/notes/dto/{SortParam.kt => NotesGetSort.kt} (98%) rename api/src/main/java/com/vk/sdk/api/notifications/dto/{FiltersParam.kt => NotificationsGetFilters.kt} (98%) rename api/src/main/java/com/vk/sdk/api/notifications/dto/{SendingModeParam.kt => NotificationsSendMessageSendingMode.kt} (97%) rename api/src/main/java/com/vk/sdk/api/orders/dto/{ActionParam.kt => OrdersChangeStateAction.kt} (97%) rename api/src/main/java/com/vk/sdk/api/pages/dto/{EditParam.kt => PagesSaveAccessEdit.kt} (98%) rename api/src/main/java/com/vk/sdk/api/pages/dto/{ViewParam.kt => PagesSaveAccessView.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetCommentsExtendedSort.kt rename api/src/main/java/com/vk/sdk/api/photos/dto/{SortParam.kt => PhotosGetCommentsSort.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/photos/dto/PhotosReportCommentReason.kt rename api/src/main/java/com/vk/sdk/api/photos/dto/{ReasonParam.kt => PhotosReportReason.kt} (98%) rename api/src/main/java/com/vk/sdk/api/polls/dto/{BackgroundIdParam.kt => PollsCreateBackgroundId.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/polls/dto/PollsEditBackgroundId.kt rename api/src/main/java/com/vk/sdk/api/polls/dto/{NameCaseParam.kt => PollsGetByIdNameCase.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/polls/dto/PollsGetVotersNameCase.kt rename api/src/main/java/com/vk/sdk/api/stats/dto/{IntervalParam.kt => StatsGetInterval.kt} (98%) rename api/src/main/java/com/vk/sdk/api/streaming/dto/{IntervalParam.kt => StreamingGetStatsInterval.kt} (97%) rename api/src/main/java/com/vk/sdk/api/streaming/dto/{TypeParam.kt => StreamingGetStatsType.kt} (97%) rename api/src/main/java/com/vk/sdk/api/streaming/dto/{MonthlyTierParam.kt => StreamingSetSettingsMonthlyTier.kt} (97%) create mode 100644 api/src/main/java/com/vk/sdk/api/users/dto/UsersGetFollowersNameCase.kt rename api/src/main/java/com/vk/sdk/api/users/dto/{NameCaseParam.kt => UsersGetNameCase.kt} (98%) rename api/src/main/java/com/vk/sdk/api/users/dto/{TypeParam.kt => UsersReportType.kt} (98%) rename api/src/main/java/com/vk/sdk/api/users/dto/{SexParam.kt => UsersSearchSex.kt} (98%) rename api/src/main/java/com/vk/sdk/api/users/dto/{SortParam.kt => UsersSearchSort.kt} (98%) rename api/src/main/java/com/vk/sdk/api/users/dto/{StatusParam.kt => UsersSearchStatus.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsExtendedInterval.kt create mode 100644 api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsExtendedSource.kt rename api/src/main/java/com/vk/sdk/api/utils/dto/{IntervalParam.kt => UtilsGetLinkStatsInterval.kt} (97%) rename api/src/main/java/com/vk/sdk/api/utils/dto/{SourceParam.kt => UtilsGetLinkStatsSource.kt} (97%) rename api/src/main/java/com/vk/sdk/api/video/dto/{PrivacyParam.kt => VideoAddAlbumPrivacy.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/video/dto/VideoEditAlbumPrivacy.kt create mode 100644 api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsExtendedSort.kt rename api/src/main/java/com/vk/sdk/api/video/dto/{SortParam.kt => VideoGetCommentsSort.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/video/dto/VideoReportCommentReason.kt rename api/src/main/java/com/vk/sdk/api/video/dto/{ReasonParam.kt => VideoReportReason.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchExtendedFilters.kt create mode 100644 api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchExtendedSort.kt rename api/src/main/java/com/vk/sdk/api/video/dto/{FiltersParam.kt => VideoSearchFilters.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchSort.kt rename api/src/main/java/com/vk/sdk/api/wall/dto/{TopicIdParam.kt => WallEditTopicId.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsExtendedSort.kt rename api/src/main/java/com/vk/sdk/api/wall/dto/{SortParam.kt => WallGetCommentsSort.kt} (98%) create mode 100644 api/src/main/java/com/vk/sdk/api/wall/dto/WallPostTopicId.kt create mode 100644 api/src/main/java/com/vk/sdk/api/wall/dto/WallReportCommentReason.kt rename api/src/main/java/com/vk/sdk/api/wall/dto/{ReasonParam.kt => WallReportPostReason.kt} (98%) create mode 100644 core/src/main/java/com/vk/api/sdk/VKApiResponseValidator.kt create mode 100644 core/src/main/java/com/vk/api/sdk/exceptions/VKAuthException.kt create mode 100644 core/src/main/java/com/vk/api/sdk/okhttp/UserAgentInterceptor.kt create mode 100644 core/src/main/java/com/vk/api/sdk/utils/DefaultUserAgent.kt create mode 100644 core/src/main/java/com/vk/api/sdk/utils/UserAgentProvider.kt create mode 100644 id/src/test/java/com/vk/sdk/id/UserIdGsonSerializerTest.kt delete mode 100644 samples/app/src/main/res/values-es/strings.xml delete mode 100644 samples/app/src/main/res/values-kk/strings.xml delete mode 100644 samples/app/src/main/res/values-pt/strings.xml delete mode 100644 samples/app/src/main/res/values-ru/strings.xml delete mode 100644 samples/app/src/main/res/values-uk/strings.xml diff --git a/api/build.gradle b/api/build.gradle index 0b49a7aa9e..30c9f976a8 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -25,6 +25,17 @@ android { versionName "$sdkVersions.name" } + packagingOptions { + exclude("builddef.lst") + exclude("**/com/**") + exclude("META-INF/*.kotlin_module") + exclude("META-INF/*.version") + exclude("autoTest/**") + exclude("META-INF/spring.*") + exclude("META-INF/notice.txt") + exclude("mockito-extensions/org.mockito.plugins.MockMaker") + } + kotlinOptions { jvmTarget = '1.8' } 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 c399ccd106..6c21006b19 100644 --- a/api/src/main/java/com/vk/sdk/api/GsonHolder.kt +++ b/api/src/main/java/com/vk/sdk/api/GsonHolder.kt @@ -30,7 +30,6 @@ package com.vk.sdk.api import com.google.gson.Gson import com.google.gson.GsonBuilder import com.vk.dto.common.id.UserId -import com.vk.dto.common.id.UserId.GsonSerializer import com.vk.sdk.api.newsfeed.dto.NewsfeedNewsfeedItem import com.vk.sdk.api.users.dto.UsersSubscriptionsItem 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 2c23588eac..4a4ff2c1a4 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 @@ -28,21 +28,22 @@ package com.vk.sdk.api.account 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.account.dto.AccountAccountCounters import com.vk.sdk.api.account.dto.AccountChangePasswordResponse import com.vk.sdk.api.account.dto.AccountGetActiveOffersResponse import com.vk.sdk.api.account.dto.AccountGetBannedResponse +import com.vk.sdk.api.account.dto.AccountGetCountersFilter +import com.vk.sdk.api.account.dto.AccountGetInfoFields import com.vk.sdk.api.account.dto.AccountInfo import com.vk.sdk.api.account.dto.AccountPushSettings +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.AccountUserSettings -import com.vk.sdk.api.account.dto.BdateVisibilityParam -import com.vk.sdk.api.account.dto.FieldsParam -import com.vk.sdk.api.account.dto.FilterParam -import com.vk.sdk.api.account.dto.RelationParam -import com.vk.sdk.api.account.dto.SexParam import com.vk.sdk.api.base.dto.BaseOkResponse import kotlin.Boolean import kotlin.Int @@ -54,7 +55,8 @@ class AccountService { * @param ownerId * @return [VKRequest] with [BaseOkResponse] */ - fun accountBan(ownerId: Int? = null): VKRequest = NewApiRequest("account.ban") { + fun accountBan(ownerId: UserId? = null): VKRequest = + NewApiRequest("account.ban") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { @@ -108,10 +110,10 @@ class AccountService { /** * Gets settings of the user in this application. * - * @param userId - User ID whose settings information shall be got. By default: current user. + * @param userId - User ID whose settings information shall be got. By default_ current user. * @return [VKRequest] with [Int] */ - fun accountGetAppPermissions(userId: Int): VKRequest = + fun accountGetAppPermissions(userId: UserId): VKRequest = NewApiRequest("account.getAppPermissions") { GsonHolder.gson.fromJson(it, Int::class.java) } @@ -142,7 +144,7 @@ class AccountService { * @param userId - User ID * @return [VKRequest] with [AccountAccountCounters] */ - fun accountGetCounters(filter: List? = null, userId: Int? = null): + fun accountGetCounters(filter: List? = null, userId: UserId? = null): VKRequest = NewApiRequest("account.getCounters") { GsonHolder.gson.fromJson(it, AccountAccountCounters::class.java) } @@ -157,13 +159,13 @@ class AccountService { /** * Returns current account info. * - * @param fields - Fields to return. Possible values: *'country' - user country,, + * @param fields - Fields to return. Possible values_ *'country' - user country,, * *'https_required' - is "HTTPS only" option enabled,, *'own_posts_default' - is "Show my posts * only" option is enabled,, *'no_wall_replies' - are wall replies disabled or not,, *'intro' - is - * intro passed by user or not,, *'lang' - user language. By default: all. + * intro passed by user or not,, *'lang' - user language. By default_ all. * @return [VKRequest] with [AccountInfo] */ - fun accountGetInfo(fields: List? = null): VKRequest = + fun accountGetInfo(fields: List? = null): VKRequest = NewApiRequest("account.getInfo") { GsonHolder.gson.fromJson(it, AccountInfo::class.java) } @@ -241,13 +243,13 @@ class AccountService { * @param screenName - User screen name. * @param cancelRequestId - ID of the name change request to be canceled. If this parameter is * sent, all the others are ignored. - * @param sex - User sex. Possible values: , * '1' - female,, * '2' - male. - * @param relation - User relationship status. Possible values: , * '1' - single,, * '2' - in a + * @param sex - User sex. Possible values_ , * '1' - female,, * '2' - male. + * @param relation - User relationship status. Possible values_ , * '1' - single,, * '2' - in a * relationship,, * '3' - engaged,, * '4' - married,, * '5' - it's complicated,, * '6' - actively * searching,, * '7' - in love,, * '0' - not specified. * @param relationPartnerId - ID of the relationship partner. - * @param bdate - User birth date, format: DD.MM.YYYY. - * @param bdateVisibility - Birth date visibility. Returned values: , * '1' - show birth date,, + * @param bdate - User birth date, format_ DD.MM.YYYY. + * @param bdateVisibility - Birth date visibility. Returned values_ , * '1' - show birth date,, * * '2' - show only month and day,, * '0' - hide birth date. * @param homeTown - User home town. * @param countryId - User country. @@ -261,11 +263,11 @@ class AccountService { maidenName: String? = null, screenName: String? = null, cancelRequestId: Int? = null, - sex: SexParam? = null, - relation: RelationParam? = null, + sex: AccountSaveProfileInfoSex? = null, + relation: AccountSaveProfileInfoRelation? = null, relationPartnerId: Int? = null, bdate: String? = null, - bdateVisibility: BdateVisibilityParam? = null, + bdateVisibility: AccountSaveProfileInfoBdateVisibility? = null, homeTown: String? = null, countryId: Int? = null, cityId: Int? = null, @@ -314,7 +316,7 @@ class AccountService { * @param name - Application screen name. * @return [VKRequest] with [BaseOkResponse] */ - fun accountSetNameInMenu(userId: Int, name: String? = null): VKRequest = + fun accountSetNameInMenu(userId: UserId, name: String? = null): VKRequest = NewApiRequest("account.setNameInMenu") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -376,8 +378,8 @@ class AccountService { * @param deviceId - Unique device ID. * @param time - Time in seconds for what notifications should be disabled. '-1' to disable * forever. - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'Chat ID', e.g. '2000000001'. For community_ '- Community ID', e.g. '-12345'. " * @param sound - '1' - to enable sound in this dialog, '0' - to disable sound. Only if * 'peer_id' contains user or community ID. * @return [VKRequest] with [BaseOkResponse] @@ -401,7 +403,7 @@ class AccountService { * @param ownerId * @return [VKRequest] with [BaseOkResponse] */ - fun accountUnban(ownerId: Int? = null): VKRequest = + fun accountUnban(ownerId: UserId? = null): VKRequest = NewApiRequest("account.unban") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/account/dto/FilterParam.kt b/api/src/main/java/com/vk/sdk/api/account/dto/AccountGetCountersFilter.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/account/dto/FilterParam.kt rename to api/src/main/java/com/vk/sdk/api/account/dto/AccountGetCountersFilter.kt index 2d76b8b6c1..737cb84992 100644 --- a/api/src/main/java/com/vk/sdk/api/account/dto/FilterParam.kt +++ b/api/src/main/java/com/vk/sdk/api/account/dto/AccountGetCountersFilter.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FilterParam( +enum class AccountGetCountersFilter( val value: String ) { @SerializedName("friends") diff --git a/api/src/main/java/com/vk/sdk/api/account/dto/FieldsParam.kt b/api/src/main/java/com/vk/sdk/api/account/dto/AccountGetInfoFields.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/account/dto/FieldsParam.kt rename to api/src/main/java/com/vk/sdk/api/account/dto/AccountGetInfoFields.kt index f3f69266b8..1b849644ce 100644 --- a/api/src/main/java/com/vk/sdk/api/account/dto/FieldsParam.kt +++ b/api/src/main/java/com/vk/sdk/api/account/dto/AccountGetInfoFields.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FieldsParam( +enum class AccountGetInfoFields( val value: String ) { @SerializedName("country") diff --git a/api/src/main/java/com/vk/sdk/api/account/dto/BdateVisibilityParam.kt b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoBdateVisibility.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/account/dto/BdateVisibilityParam.kt rename to api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoBdateVisibility.kt index 6ad8370290..fe5cac1b24 100644 --- a/api/src/main/java/com/vk/sdk/api/account/dto/BdateVisibilityParam.kt +++ b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoBdateVisibility.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class BdateVisibilityParam( +enum class AccountSaveProfileInfoBdateVisibility( val value: Int ) { @SerializedName("1") diff --git a/api/src/main/java/com/vk/sdk/api/account/dto/RelationParam.kt b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoRelation.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/account/dto/RelationParam.kt rename to api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoRelation.kt index 65e8c4285b..d3cfb1df58 100644 --- a/api/src/main/java/com/vk/sdk/api/account/dto/RelationParam.kt +++ b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoRelation.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class RelationParam( +enum class AccountSaveProfileInfoRelation( val value: Int ) { @SerializedName("1") diff --git a/api/src/main/java/com/vk/sdk/api/account/dto/SexParam.kt b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoSex.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/account/dto/SexParam.kt rename to api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoSex.kt index 0df9b7c3f0..a398daaf3e 100644 --- a/api/src/main/java/com/vk/sdk/api/account/dto/SexParam.kt +++ b/api/src/main/java/com/vk/sdk/api/account/dto/AccountSaveProfileInfoSex.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.account.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class SexParam( +enum class AccountSaveProfileInfoSex( val value: Int ) { @SerializedName("0") 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 ceef3e7e27..3d3b6c7cf3 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 @@ -31,18 +31,29 @@ import com.google.gson.reflect.TypeToken import com.vk.api.sdk.requests.VKRequest import com.vk.sdk.api.GsonHolder import com.vk.sdk.api.NewApiRequest -import com.vk.sdk.api.ads.dto.AdFormatParam import com.vk.sdk.api.ads.dto.AdsAccount import com.vk.sdk.api.ads.dto.AdsAd import com.vk.sdk.api.ads.dto.AdsAdLayout import com.vk.sdk.api.ads.dto.AdsCampaign +import com.vk.sdk.api.ads.dto.AdsCheckLinkLinkType import com.vk.sdk.api.ads.dto.AdsClient import com.vk.sdk.api.ads.dto.AdsCreateTargetGroupResponse import com.vk.sdk.api.ads.dto.AdsDemoStats import com.vk.sdk.api.ads.dto.AdsFloodStats +import com.vk.sdk.api.ads.dto.AdsGetCampaignsFields import com.vk.sdk.api.ads.dto.AdsGetCategoriesResponse +import com.vk.sdk.api.ads.dto.AdsGetDemographicsIdsType +import com.vk.sdk.api.ads.dto.AdsGetDemographicsPeriod import com.vk.sdk.api.ads.dto.AdsGetLookalikeRequestsResponse import com.vk.sdk.api.ads.dto.AdsGetMusiciansResponse +import com.vk.sdk.api.ads.dto.AdsGetPostsReachIdsType +import com.vk.sdk.api.ads.dto.AdsGetStatisticsIdsType +import com.vk.sdk.api.ads.dto.AdsGetStatisticsPeriod +import com.vk.sdk.api.ads.dto.AdsGetStatisticsStatsFields +import com.vk.sdk.api.ads.dto.AdsGetSuggestionsLang +import com.vk.sdk.api.ads.dto.AdsGetSuggestionsSection +import com.vk.sdk.api.ads.dto.AdsGetTargetingStatsAdFormat +import com.vk.sdk.api.ads.dto.AdsGetUploadURLAdFormat import com.vk.sdk.api.ads.dto.AdsLinkStatus import com.vk.sdk.api.ads.dto.AdsPromotedPostReach import com.vk.sdk.api.ads.dto.AdsRejectReason @@ -53,13 +64,6 @@ 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.AdsUsers -import com.vk.sdk.api.ads.dto.FieldsParam -import com.vk.sdk.api.ads.dto.IdsTypeParam -import com.vk.sdk.api.ads.dto.LangParam -import com.vk.sdk.api.ads.dto.LinkTypeParam -import com.vk.sdk.api.ads.dto.PeriodParam -import com.vk.sdk.api.ads.dto.SectionParam -import com.vk.sdk.api.ads.dto.StatsFieldsParam import com.vk.sdk.api.base.dto.BaseOkResponse import kotlin.Boolean import kotlin.Int @@ -89,7 +93,7 @@ class AdsService { * Allows to check the ad link. * * @param accountId - Advertising account ID. - * @param linkType - Object type: *'community' - community,, *'post' - community post,, + * @param linkType - Object type_ *'community' - community,, *'post' - community post,, * *'application' - VK application,, *'video' - video,, *'site' - external site. * @param linkUrl - Object URL. * @param campaignId - Campaign ID @@ -97,7 +101,7 @@ class AdsService { */ fun adsCheckLink( accountId: Int, - linkType: LinkTypeParam, + linkType: AdsCheckLinkLinkType, linkUrl: String, campaignId: Int? = null ): VKRequest = NewApiRequest("ads.checkLink") { @@ -351,9 +355,9 @@ class AdsService { * IDs. If the parameter is null, ads of all campaigns will be shown. * @param clientId - 'Available and required for advertising agencies.' ID of the client ads are * retrieved from. - * @param includeDeleted - Flag that specifies whether archived ads shall be shown: *0 - show + * @param includeDeleted - Flag that specifies whether archived ads shall be shown_ *0 - show * only active ads,, *1 - show all ads. - * @param onlyDeleted - Flag that specifies whether to show only archived ads: *0 - show all + * @param onlyDeleted - Flag that specifies whether to show only archived ads_ *0 - show all * ads,, *1 - show only archived ads. Available when include_deleted flag is *1 * @param limit - Limit of number of returned ads. Used only if ad_ids parameter is null, and * 'campaign_ids' parameter contains ID of only one campaign. @@ -391,7 +395,7 @@ class AdsService { * @param clientId - 'For advertising agencies.' ID of the client ads are retrieved from. * @param includeDeleted - Flag that specifies whether archived ads shall be shown. *0 - show * only active ads,, *1 - show all ads. - * @param onlyDeleted - Flag that specifies whether to show only archived ads: *0 - show all + * @param onlyDeleted - Flag that specifies whether to show only archived ads_ *0 - show all * ads,, *1 - show only archived ads. Available when include_deleted flag is *1 * @param campaignIds - Filter by advertising campaigns. Serialized JSON array with campaign * IDs. If the parameter is null, ads of all campaigns will be shown. @@ -435,7 +439,7 @@ class AdsService { * @param campaignIds - Filter by advertising campaigns. Serialized JSON array with campaign * IDs. If the parameter is null, ads of all campaigns will be shown. * @param clientId - 'For advertising agencies.' ID of the client ads are retrieved from. - * @param includeDeleted - flag that specifies whether archived ads shall be shown: *0 - show + * @param includeDeleted - flag that specifies whether archived ads shall be shown_ *0 - show * only active ads,, *1 - show all ads. * @param limit - Limit of number of returned ads. Used only if 'ad_ids' parameter is null, and * 'campaign_ids' parameter contains ID of only one campaign. @@ -496,7 +500,7 @@ class AdsService { clientId: Int? = null, includeDeleted: Boolean? = null, campaignIds: String? = null, - fields: List? = null + fields: List? = null ): VKRequest> = NewApiRequest("ads.getCampaigns") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -546,27 +550,27 @@ class AdsService { * Returns demographics for ads or campaigns. * * @param accountId - Advertising account ID. - * @param idsType - Type of requested objects listed in 'ids' parameter: *ad - ads,, *campaign - + * @param idsType - Type of requested objects listed in 'ids' parameter_ *ad - ads,, *campaign - * campaigns. * @param ids - IDs requested ads or campaigns, separated with a comma, depending on the value * set in 'ids_type'. Maximum 2000 objects. - * @param period - Data grouping by dates: *day - statistics by days,, *month - statistics by + * @param period - Data grouping by dates_ *day - statistics by days,, *month - statistics by * months,, *overall - overall statistics. 'date_from' and 'date_to' parameters set temporary * limits. * @param dateFrom - Date to show statistics from. For different value of 'period' different - * date format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - day it - * was created on,, *month: YYYY-MM, example: 2011-09 - September 2011, **0 - month it was created - * in,, *overall: 0. + * date format is used_ *day_ YYYY-MM-DD, example_ 2011-09-27 - September 27, 2011, **0 - day it + * was created on,, *month_ YYYY-MM, example_ 2011-09 - September 2011, **0 - month it was created + * in,, *overall_ 0. * @param dateTo - Date to show statistics to. For different value of 'period' different date - * format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - current day,, - * *month: YYYY-MM, example: 2011-09 - September 2011, **0 - current month,, *overall: 0. + * format is used_ *day_ YYYY-MM-DD, example_ 2011-09-27 - September 27, 2011, **0 - current day,, + * *month_ YYYY-MM, example_ 2011-09 - September 2011, **0 - current month,, *overall_ 0. * @return [VKRequest] with [Unit] */ fun adsGetDemographics( accountId: Int, - idsType: IdsTypeParam, + idsType: AdsGetDemographicsIdsType, ids: String, - period: PeriodParam, + period: AdsGetDemographicsPeriod, dateFrom: String, dateTo: String ): VKRequest> = NewApiRequest("ads.getDemographics") { @@ -668,7 +672,7 @@ class AdsService { * Returns detailed statistics of promoted posts reach from campaigns and ads. * * @param accountId - Advertising account ID. - * @param idsType - Type of requested objects listed in 'ids' parameter: *ad - ads,, *campaign - + * @param idsType - Type of requested objects listed in 'ids' parameter_ *ad - ads,, *campaign - * campaigns. * @param ids - IDs requested ads or campaigns, separated with a comma, depending on the value * set in 'ids_type'. Maximum 100 objects. @@ -676,7 +680,7 @@ class AdsService { */ fun adsGetPostsReach( accountId: Int, - idsType: IdsTypeParam, + idsType: AdsGetPostsReachIdsType, ids: String ): VKRequest> = NewApiRequest("ads.getPostsReach") { val typeToken = object: TypeToken>() {}.type @@ -709,31 +713,31 @@ class AdsService { * account. * * @param accountId - Advertising account ID. - * @param idsType - Type of requested objects listed in 'ids' parameter: *ad - ads,, *campaign - + * @param idsType - Type of requested objects listed in 'ids' parameter_ *ad - ads,, *campaign - * campaigns,, *client - clients,, *office - account. * @param ids - IDs requested ads, campaigns, clients or account, separated with a comma, * depending on the value set in 'ids_type'. Maximum 2000 objects. - * @param period - Data grouping by dates: *day - statistics by days,, *month - statistics by + * @param period - Data grouping by dates_ *day - statistics by days,, *month - statistics by * months,, *overall - overall statistics. 'date_from' and 'date_to' parameters set temporary * limits. * @param dateFrom - Date to show statistics from. For different value of 'period' different - * date format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - day it - * was created on,, *month: YYYY-MM, example: 2011-09 - September 2011, **0 - month it was created - * in,, *overall: 0. + * date format is used_ *day_ YYYY-MM-DD, example_ 2011-09-27 - September 27, 2011, **0 - day it + * was created on,, *month_ YYYY-MM, example_ 2011-09 - September 2011, **0 - month it was created + * in,, *overall_ 0. * @param dateTo - Date to show statistics to. For different value of 'period' different date - * format is used: *day: YYYY-MM-DD, example: 2011-09-27 - September 27, 2011, **0 - current day,, - * *month: YYYY-MM, example: 2011-09 - September 2011, **0 - current month,, *overall: 0. + * format is used_ *day_ YYYY-MM-DD, example_ 2011-09-27 - September 27, 2011, **0 - current day,, + * *month_ YYYY-MM, example_ 2011-09 - September 2011, **0 - current month,, *overall_ 0. * @param statsFields - Additional fields to add to statistics * @return [VKRequest] with [Unit] */ fun adsGetStatistics( accountId: Int, - idsType: IdsTypeParam, + idsType: AdsGetStatisticsIdsType, ids: String, - period: PeriodParam, + period: AdsGetStatisticsPeriod, dateFrom: String, dateTo: String, - statsFields: List? = null + statsFields: List? = null ): VKRequest> = NewApiRequest("ads.getStatistics") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -754,7 +758,7 @@ class AdsService { /** * Returns a set of auto-suggestions for various targeting parameters. * - * @param section - Section, suggestions are retrieved in. Available values: *countries - + * @param section - Section, suggestions are retrieved in. Available values_ *countries - * request of a list of countries. If q is not set or blank, a short list of countries is shown. * Otherwise, a full list of countries is shown. *regions - requested list of regions. 'country' * parameter is required. *cities - requested list of cities. 'country' parameter is required. @@ -770,17 +774,17 @@ class AdsService { * interests, positions). * @param country - ID of the country objects are searched in. * @param cities - IDs of cities where objects are searched in, separated with a comma. - * @param lang - Language of the returned string values. Supported languages: *ru - Russian,, + * @param lang - Language of the returned string values. Supported languages_ *ru - Russian,, * *ua - Ukrainian,, *en - English. * @return [VKRequest] with [Unit] */ fun adsGetSuggestions( - section: SectionParam, + section: AdsGetSuggestionsSection, ids: String? = null, q: String? = null, country: Int? = null, cities: String? = null, - lang: LangParam? = null + lang: AdsGetSuggestionsLang? = null ): VKRequest> = NewApiRequest("ads.getSuggestions") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -834,10 +838,10 @@ class AdsService { * @param criteria - Serialized JSON object that describes targeting parameters. Description of * 'criteria' object see below. * @param adId - ID of an ad which targeting parameters shall be analyzed. - * @param adFormat - Ad format. Possible values: *'1' - image and text,, *'2' - big image,, + * @param adFormat - Ad format. Possible values_ *'1' - image and text,, *'2' - big image,, * *'3' - exclusive format,, *'4' - community, square image,, *'7' - special app format,, *'8' - * special community format,, *'9' - post in community,, *'10' - app board. - * @param adPlatform - Platforms to use for ad showing. Possible values: (for 'ad_format' = + * @param adPlatform - Platforms to use for ad showing. Possible values_ (for 'ad_format' = * '1'), *'0' - VK and partner sites,, *'1' - VK only. (for 'ad_format' = '9'), *'all' - all * platforms,, *'desktop' - desktop version,, *'mobile' - mobile version and apps. * @param adPlatformNoWall @@ -856,7 +860,7 @@ class AdsService { clientId: Int? = null, criteria: String? = null, adId: Int? = null, - adFormat: AdFormatParam? = null, + adFormat: AdsGetTargetingStatsAdFormat? = null, adPlatform: String? = null, adPlatformNoWall: String? = null, adPlatformNoAdNetwork: String? = null, @@ -886,12 +890,12 @@ class AdsService { /** * Returns URL to upload an ad photo to. * - * @param adFormat - Ad format: *1 - image and text,, *2 - big image,, *3 - exclusive format,, + * @param adFormat - Ad format_ *1 - image and text,, *2 - big image,, *3 - exclusive format,, * *4 - community, square image,, *7 - special app format. * @param icon * @return [VKRequest] with [String] */ - fun adsGetUploadURL(adFormat: AdFormatParam, icon: Int? = null): VKRequest = + fun adsGetUploadURL(adFormat: AdsGetUploadURLAdFormat, icon: Int? = null): VKRequest = NewApiRequest("ads.getUploadURL") { GsonHolder.gson.fromJson(it, String::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/LinkTypeParam.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCheckLinkLinkType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/ads/dto/LinkTypeParam.kt rename to api/src/main/java/com/vk/sdk/api/ads/dto/AdsCheckLinkLinkType.kt index 212a44a9d3..b359a9b451 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/LinkTypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsCheckLinkLinkType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.ads.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class LinkTypeParam( +enum class AdsCheckLinkLinkType( val value: String ) { @SerializedName("community") diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/FieldsParam.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetCampaignsFields.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/ads/dto/FieldsParam.kt rename to api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetCampaignsFields.kt index 8811b3d45f..067ebfa4a2 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/FieldsParam.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetCampaignsFields.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.ads.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FieldsParam( +enum class AdsGetCampaignsFields( val value: String ) { @SerializedName("ads_count") diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetDemographicsIdsType.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetDemographicsIdsType.kt new file mode 100644 index 0000000000..81689887fd --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetDemographicsIdsType.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 AdsGetDemographicsIdsType( + val value: String +) { + @SerializedName("ad") + AD("ad"), + + @SerializedName("campaign") + CAMPAIGN("campaign"); +} diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetDemographicsPeriod.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetDemographicsPeriod.kt new file mode 100644 index 0000000000..217b777f0e --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetDemographicsPeriod.kt @@ -0,0 +1,44 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class AdsGetDemographicsPeriod( + val value: String +) { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("overall") + OVERALL("overall"); +} diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/IdsTypeParam.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetPostsReachIdsType.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/ads/dto/IdsTypeParam.kt rename to api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetPostsReachIdsType.kt index 1e269877a7..569eecc22b 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/IdsTypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetPostsReachIdsType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.ads.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class IdsTypeParam( +enum class AdsGetPostsReachIdsType( val value: String ) { @SerializedName("ad") diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsIdsType.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsIdsType.kt new file mode 100644 index 0000000000..509496c43e --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsIdsType.kt @@ -0,0 +1,47 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class AdsGetStatisticsIdsType( + val value: String +) { + @SerializedName("ad") + AD("ad"), + + @SerializedName("campaign") + CAMPAIGN("campaign"), + + @SerializedName("client") + CLIENT("client"), + + @SerializedName("office") + OFFICE("office"); +} diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/PeriodParam.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsPeriod.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/ads/dto/PeriodParam.kt rename to api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsPeriod.kt index eaa01a054e..0646c87047 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/PeriodParam.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsPeriod.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.ads.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class PeriodParam( +enum class AdsGetStatisticsPeriod( val value: String ) { @SerializedName("day") diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/StatsFieldsParam.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsStatsFields.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/ads/dto/StatsFieldsParam.kt rename to api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsStatsFields.kt index e65a8c0c7e..0e53afbeb8 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/StatsFieldsParam.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetStatisticsStatsFields.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.ads.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class StatsFieldsParam( +enum class AdsGetStatisticsStatsFields( val value: String ) { @SerializedName("views_times") diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/LangParam.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetSuggestionsLang.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/ads/dto/LangParam.kt rename to api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetSuggestionsLang.kt index ff60c0c7fe..c36a7d231c 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/LangParam.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetSuggestionsLang.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.ads.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class LangParam( +enum class AdsGetSuggestionsLang( val value: String ) { @SerializedName("ru") diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/SectionParam.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetSuggestionsSection.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/ads/dto/SectionParam.kt rename to api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetSuggestionsSection.kt index f0d26137de..212a395cf2 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/SectionParam.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetSuggestionsSection.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.ads.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SectionParam( +enum class AdsGetSuggestionsSection( val value: String ) { @SerializedName("countries") diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdFormatParam.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetTargetingStatsAdFormat.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/ads/dto/AdFormatParam.kt rename to api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetTargetingStatsAdFormat.kt index f8fce34dce..8922b397dd 100644 --- a/api/src/main/java/com/vk/sdk/api/ads/dto/AdFormatParam.kt +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetTargetingStatsAdFormat.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.ads.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class AdFormatParam( +enum class AdsGetTargetingStatsAdFormat( val value: Int ) { @SerializedName("1") diff --git a/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetUploadURLAdFormat.kt b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetUploadURLAdFormat.kt new file mode 100644 index 0000000000..86de3a8b45 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/ads/dto/AdsGetUploadURLAdFormat.kt @@ -0,0 +1,50 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.ads.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class AdsGetUploadURLAdFormat( + val value: Int +) { + @SerializedName("1") + IMAGE_AND_TEXT(1), + + @SerializedName("2") + BIG_IMAGE(2), + + @SerializedName("3") + EXCLUSIVE_FORMAT(3), + + @SerializedName("4") + COMMUNITY_SQUARE_IMAGE(4), + + @SerializedName("7") + SPECIAL_APP_FORMAT(7); +} 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 921ff7974e..0a11a9b1a3 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 @@ -31,12 +31,15 @@ import com.google.gson.reflect.TypeToken import com.vk.api.sdk.requests.VKRequest import com.vk.sdk.api.GsonHolder import com.vk.sdk.api.NewApiRequest +import com.vk.sdk.api.appWidgets.dto.AppWidgetsGetAppImageUploadServerImageType import com.vk.sdk.api.appWidgets.dto.AppWidgetsGetAppImageUploadServerResponse +import com.vk.sdk.api.appWidgets.dto.AppWidgetsGetAppImagesImageType +import com.vk.sdk.api.appWidgets.dto.AppWidgetsGetGroupImageUploadServerImageType import com.vk.sdk.api.appWidgets.dto.AppWidgetsGetGroupImageUploadServerResponse +import com.vk.sdk.api.appWidgets.dto.AppWidgetsGetGroupImagesImageType import com.vk.sdk.api.appWidgets.dto.AppWidgetsPhoto import com.vk.sdk.api.appWidgets.dto.AppWidgetsPhotos -import com.vk.sdk.api.appWidgets.dto.ImageTypeParam -import com.vk.sdk.api.appWidgets.dto.TypeParam +import com.vk.sdk.api.appWidgets.dto.AppWidgetsUpdateType import com.vk.sdk.api.base.dto.BaseOkResponse import kotlin.Int import kotlin.String @@ -49,7 +52,7 @@ class AppWidgetsService { * @param imageType * @return [VKRequest] with [AppWidgetsGetAppImageUploadServerResponse] */ - fun appWidgetsGetAppImageUploadServer(imageType: ImageTypeParam): + fun appWidgetsGetAppImageUploadServer(imageType: AppWidgetsGetAppImageUploadServerImageType): VKRequest = NewApiRequest("appWidgets.getAppImageUploadServer") { GsonHolder.gson.fromJson(it, AppWidgetsGetAppImageUploadServerResponse::class.java) @@ -69,7 +72,7 @@ class AppWidgetsService { fun appWidgetsGetAppImages( offset: Int? = null, count: Int? = null, - imageType: ImageTypeParam? = null + imageType: AppWidgetsGetAppImagesImageType? = null ): VKRequest = NewApiRequest("appWidgets.getAppImages") { GsonHolder.gson.fromJson(it, AppWidgetsPhotos::class.java) } @@ -85,7 +88,7 @@ class AppWidgetsService { * @param imageType * @return [VKRequest] with [AppWidgetsGetGroupImageUploadServerResponse] */ - fun appWidgetsGetGroupImageUploadServer(imageType: ImageTypeParam): + fun appWidgetsGetGroupImageUploadServer(imageType: AppWidgetsGetGroupImageUploadServerImageType): VKRequest = NewApiRequest("appWidgets.getGroupImageUploadServer") { GsonHolder.gson.fromJson(it, AppWidgetsGetGroupImageUploadServerResponse::class.java) @@ -105,7 +108,7 @@ class AppWidgetsService { fun appWidgetsGetGroupImages( offset: Int? = null, count: Int? = null, - imageType: ImageTypeParam? = null + imageType: AppWidgetsGetGroupImagesImageType? = null ): VKRequest = NewApiRequest("appWidgets.getGroupImages") { GsonHolder.gson.fromJson(it, AppWidgetsPhotos::class.java) } @@ -169,7 +172,7 @@ class AppWidgetsService { * @param type * @return [VKRequest] with [BaseOkResponse] */ - fun appWidgetsUpdate(code: String, type: TypeParam): VKRequest = + fun appWidgetsUpdate(code: String, type: AppWidgetsUpdateType): VKRequest = NewApiRequest("appWidgets.update") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImageUploadServerImageType.kt b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImageUploadServerImageType.kt new file mode 100644 index 0000000000..f0a291e69b --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImageUploadServerImageType.kt @@ -0,0 +1,50 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.appWidgets.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class AppWidgetsGetAppImageUploadServerImageType( + val value: String +) { + @SerializedName("160x160") + SIXTEEN_0X160("160x160"), + + @SerializedName("160x240") + SIXTEEN_0X240("160x240"), + + @SerializedName("24x24") + TWENTY_FOUR_X24("24x24"), + + @SerializedName("50x50") + FIFTYZERO_X50("50x50"), + + @SerializedName("510x128") + FIFTY_ONE_0X128("510x128"); +} diff --git a/api/src/main/java/com/vk/sdk/api/appWidgets/dto/ImageTypeParam.kt b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImagesImageType.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/appWidgets/dto/ImageTypeParam.kt rename to api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImagesImageType.kt index 61becddf4c..79153ee0bd 100644 --- a/api/src/main/java/com/vk/sdk/api/appWidgets/dto/ImageTypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetAppImagesImageType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.appWidgets.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class ImageTypeParam( +enum class AppWidgetsGetAppImagesImageType( val value: String ) { @SerializedName("160x160") diff --git a/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImageUploadServerImageType.kt b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImageUploadServerImageType.kt new file mode 100644 index 0000000000..cd5040db78 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImageUploadServerImageType.kt @@ -0,0 +1,50 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.appWidgets.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class AppWidgetsGetGroupImageUploadServerImageType( + val value: String +) { + @SerializedName("160x160") + SIXTEEN_0X160("160x160"), + + @SerializedName("160x240") + SIXTEEN_0X240("160x240"), + + @SerializedName("24x24") + TWENTY_FOUR_X24("24x24"), + + @SerializedName("50x50") + FIFTYZERO_X50("50x50"), + + @SerializedName("510x128") + FIFTY_ONE_0X128("510x128"); +} diff --git a/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImagesImageType.kt b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImagesImageType.kt new file mode 100644 index 0000000000..8ab05e8519 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsGetGroupImagesImageType.kt @@ -0,0 +1,50 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.appWidgets.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class AppWidgetsGetGroupImagesImageType( + val value: String +) { + @SerializedName("160x160") + SIXTEEN_0X160("160x160"), + + @SerializedName("160x240") + SIXTEEN_0X240("160x240"), + + @SerializedName("24x24") + TWENTY_FOUR_X24("24x24"), + + @SerializedName("50x50") + FIFTYZERO_X50("50x50"), + + @SerializedName("510x128") + FIFTY_ONE_0X128("510x128"); +} diff --git a/api/src/main/java/com/vk/sdk/api/appWidgets/dto/TypeParam.kt b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsUpdateType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/appWidgets/dto/TypeParam.kt rename to api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsUpdateType.kt index 23340bc7fc..daaef17107 100644 --- a/api/src/main/java/com/vk/sdk/api/appWidgets/dto/TypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/appWidgets/dto/AppWidgetsUpdateType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.appWidgets.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class TypeParam( +enum class AppWidgetsUpdateType( val value: String ) { @SerializedName("compact_list") 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 dc3dd84e02..34f00c7dac 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 @@ -28,20 +28,25 @@ package com.vk.sdk.api.apps 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.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.AppsGetFriendsListResponse +import com.vk.sdk.api.apps.dto.AppsGetFriendsListType import com.vk.sdk.api.apps.dto.AppsGetLeaderboardExtendedResponse +import com.vk.sdk.api.apps.dto.AppsGetLeaderboardExtendedType import com.vk.sdk.api.apps.dto.AppsGetLeaderboardResponse +import com.vk.sdk.api.apps.dto.AppsGetLeaderboardType import com.vk.sdk.api.apps.dto.AppsGetMiniAppPoliciesResponse +import com.vk.sdk.api.apps.dto.AppsGetNameCase +import com.vk.sdk.api.apps.dto.AppsGetPlatform import com.vk.sdk.api.apps.dto.AppsGetResponse import com.vk.sdk.api.apps.dto.AppsGetScopesResponse -import com.vk.sdk.api.apps.dto.FilterParam -import com.vk.sdk.api.apps.dto.NameCaseParam -import com.vk.sdk.api.apps.dto.PlatformParam -import com.vk.sdk.api.apps.dto.SortParam -import com.vk.sdk.api.apps.dto.TypeParam +import com.vk.sdk.api.apps.dto.AppsGetScopesType +import com.vk.sdk.api.apps.dto.AppsSendRequestType import com.vk.sdk.api.base.dto.BaseBoolInt import com.vk.sdk.api.base.dto.BaseOkResponse import com.vk.sdk.api.users.dto.UsersFields @@ -66,15 +71,15 @@ class AppsService { * * @param appId - Application ID * @param appIds - List of application ID - * @param platform - platform. Possible values: *'ios' - iOS,, *'android' - Android,, - * *'winphone' - Windows Phone,, *'web' - ---------- -- vk.com. By default: 'web'. + * @param platform - platform. Possible values_ *'ios' - iOS,, *'android' - Android,, + * *'winphone' - Windows Phone,, *'web' - ---------- -- vk.com. By default_ 'web'. * @param returnFriends - * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * @param fields - Profile fields to return. Sample values_ 'nickname', 'screen_name', 'sex', * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', * 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', * 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities', (only * if return_friends - 1) - * @param nameCase - Case for declension of user name and surname: 'nom' - nominative + * @param nameCase - Case for declension of user name and surname_ 'nom' - nominative * (default),, 'gen' - genitive,, 'dat' - dative,, 'acc' - accusative,, 'ins' - instrumental,, * 'abl' - prepositional. (only if 'return_friends' = '1') * @return [VKRequest] with [AppsGetResponse] @@ -82,10 +87,10 @@ class AppsService { fun appsGet( appId: Int? = null, appIds: List? = null, - platform: PlatformParam? = null, + platform: AppsGetPlatform? = null, returnFriends: Boolean? = null, fields: List? = null, - nameCase: NameCaseParam? = null + nameCase: AppsGetNameCase? = null ): VKRequest = NewApiRequest("apps.get") { GsonHolder.gson.fromJson(it, AppsGetResponse::class.java) } @@ -105,7 +110,7 @@ class AppsService { * Returns a list of applications (apps) available to users in the App Catalog. * * @param count - Number of apps to return. - * @param sort - Sort order: 'popular_today' - popular for one day (default), 'visitors' - by + * @param sort - Sort order_ 'popular_today' - popular for one day (default), 'visitors' - by * visitors number , 'create_date' - by creation date, 'growth_rate' - by growth rate, * 'popular_week' - popular for one week * @param offset - Offset required to return a specific subset of apps. @@ -120,7 +125,7 @@ class AppsService { */ fun appsGetCatalog( count: Int, - sort: SortParam? = null, + sort: AppsGetCatalogSort? = null, offset: Int? = null, platform: String? = null, returnFriends: Boolean? = null, @@ -128,7 +133,7 @@ class AppsService { nameCase: String? = null, q: String? = null, genreId: Int? = null, - filter: FilterParam? = null + filter: AppsGetCatalogFilter? = null ): VKRequest = NewApiRequest("apps.getCatalog") { GsonHolder.gson.fromJson(it, AppsCatalogList::class.java) } @@ -153,15 +158,15 @@ class AppsService { * * @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 type - List type. Possible values_ * 'invite' - available for invites (don't play the + * game),, * 'request' - available for request (play the game). By default_ 'invite'. * @param fields - Additional profile fields, see [vk.com/dev/fields|description]. * @return [VKRequest] with [AppsGetFriendsListResponse] */ fun appsGetFriendsList( count: Int? = null, offset: Int? = null, - type: TypeParam? = null, + type: AppsGetFriendsListType? = null, fields: List? = null ): VKRequest = NewApiRequest("apps.getFriendsList") { GsonHolder.gson.fromJson(it, AppsGetFriendsListResponse::class.java) @@ -179,13 +184,13 @@ class AppsService { /** * Returns players rating in the game. * - * @param type - Leaderboard type. Possible values: *'level' - by level,, *'points' - by mission + * @param type - Leaderboard type. Possible values_ *'level' - by level,, *'points' - by mission * points,, *'score' - by score (). - * @param global - Rating type. Possible values: *'1' - global rating among all players,, *'0' - + * @param global - Rating type. Possible values_ *'1' - global rating among all players,, *'0' - * rating among user friends. * @return [VKRequest] with [AppsGetLeaderboardResponse] */ - fun appsGetLeaderboard(type: TypeParam, global: Boolean? = null): + fun appsGetLeaderboard(type: AppsGetLeaderboardType, global: Boolean? = null): VKRequest = NewApiRequest("apps.getLeaderboard") { GsonHolder.gson.fromJson(it, AppsGetLeaderboardResponse::class.java) } @@ -197,13 +202,13 @@ class AppsService { /** * Returns players rating in the game. * - * @param type - Leaderboard type. Possible values: *'level' - by level,, *'points' - by mission + * @param type - Leaderboard type. Possible values_ *'level' - by level,, *'points' - by mission * points,, *'score' - by score (). - * @param global - Rating type. Possible values: *'1' - global rating among all players,, *'0' - + * @param global - Rating type. Possible values_ *'1' - global rating among all players,, *'0' - * rating among user friends. * @return [VKRequest] with [AppsGetLeaderboardExtendedResponse] */ - fun appsGetLeaderboardExtended(type: TypeParam, global: Boolean? = null): + fun appsGetLeaderboardExtended(type: AppsGetLeaderboardExtendedType, global: Boolean? = null): VKRequest = NewApiRequest("apps.getLeaderboard") { GsonHolder.gson.fromJson(it, AppsGetLeaderboardExtendedResponse::class.java) } @@ -233,7 +238,7 @@ class AppsService { * @param type * @return [VKRequest] with [AppsGetScopesResponse] */ - fun appsGetScopes(type: TypeParam? = null): VKRequest = + fun appsGetScopes(type: AppsGetScopesType? = null): VKRequest = NewApiRequest("apps.getScopes") { GsonHolder.gson.fromJson(it, AppsGetScopesResponse::class.java) } @@ -247,7 +252,7 @@ class AppsService { * @param userId * @return [VKRequest] with [Int] */ - fun appsGetScore(userId: Int): VKRequest = NewApiRequest("apps.getScore") { + fun appsGetScore(userId: UserId): VKRequest = NewApiRequest("apps.getScore") { GsonHolder.gson.fromJson(it, Int::class.java) } .apply { @@ -259,7 +264,7 @@ class AppsService { * @param userId * @return [VKRequest] with [BaseBoolInt] */ - fun appsPromoHasActiveGift(promoId: Int, userId: Int? = null): VKRequest = + fun appsPromoHasActiveGift(promoId: Int, userId: UserId? = null): VKRequest = NewApiRequest("apps.promoHasActiveGift") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -273,7 +278,7 @@ class AppsService { * @param userId * @return [VKRequest] with [BaseBoolInt] */ - fun appsPromoUseGift(promoId: Int, userId: Int? = null): VKRequest = + fun appsPromoUseGift(promoId: Int, userId: UserId? = null): VKRequest = NewApiRequest("apps.promoUseGift") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -287,7 +292,7 @@ class AppsService { * * @param userId - id of the user to send a request * @param text - request text - * @param type - request type. Values: 'invite' - if the request is sent to a user who does not + * @param type - request type. Values_ 'invite' - if the request is sent to a user who does not * have the app installed,, 'request' - if a user has already installed the app * @param name * @param key - special string key to be sent with the request @@ -295,9 +300,9 @@ class AppsService { * @return [VKRequest] with [Int] */ fun appsSendRequest( - userId: Int, + userId: UserId, text: String? = null, - type: TypeParam? = null, + type: AppsSendRequestType? = null, name: String? = null, key: String? = null, separate: Boolean? = null diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/FilterParam.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetCatalogFilter.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/apps/dto/FilterParam.kt rename to api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetCatalogFilter.kt index e3277b4e4c..7f55275bf2 100644 --- a/api/src/main/java/com/vk/sdk/api/apps/dto/FilterParam.kt +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetCatalogFilter.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.apps.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FilterParam( +enum class AppsGetCatalogFilter( val value: String ) { @SerializedName("favorite") diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetCatalogSort.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/apps/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetCatalogSort.kt index 7a9adea1f2..7caf51c92c 100644 --- a/api/src/main/java/com/vk/sdk/api/apps/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetCatalogSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.apps.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SortParam( +enum class AppsGetCatalogSort( val value: String ) { @SerializedName("popular_today") diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListType.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListType.kt new file mode 100644 index 0000000000..bc1809fa44 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetFriendsListType.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 AppsGetFriendsListType( + val value: String +) { + @SerializedName("invite") + INVITE("invite"), + + @SerializedName("request") + REQUEST("request"); +} diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedType.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedType.kt new file mode 100644 index 0000000000..ad029e95eb --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardExtendedType.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 kotlin.String + +enum class AppsGetLeaderboardExtendedType( + val value: String +) { + @SerializedName("level") + LEVEL("level"), + + @SerializedName("points") + POINTS("points"), + + @SerializedName("score") + SCORE("score"); +} diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardType.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardType.kt new file mode 100644 index 0000000000..daf9dbb3a4 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetLeaderboardType.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 kotlin.String + +enum class AppsGetLeaderboardType( + val value: String +) { + @SerializedName("level") + LEVEL("level"), + + @SerializedName("points") + POINTS("points"), + + @SerializedName("score") + SCORE("score"); +} diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/NameCaseParam.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetNameCase.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/apps/dto/NameCaseParam.kt rename to api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetNameCase.kt index 2423e5fc9a..65b756bdfc 100644 --- a/api/src/main/java/com/vk/sdk/api/apps/dto/NameCaseParam.kt +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetNameCase.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.apps.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class NameCaseParam( +enum class AppsGetNameCase( val value: String ) { @SerializedName("nom") diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/PlatformParam.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetPlatform.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/apps/dto/PlatformParam.kt rename to api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetPlatform.kt index 9624ec62a6..649776705f 100644 --- a/api/src/main/java/com/vk/sdk/api/apps/dto/PlatformParam.kt +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetPlatform.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.apps.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class PlatformParam( +enum class AppsGetPlatform( val value: String ) { @SerializedName("android") diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetScopesType.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetScopesType.kt new file mode 100644 index 0000000000..7ab1b6c636 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsGetScopesType.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 AppsGetScopesType( + val value: String +) { + @SerializedName("group") + GROUP("group"), + + @SerializedName("user") + USER("user"); +} diff --git a/api/src/main/java/com/vk/sdk/api/apps/dto/TypeParam.kt b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsSendRequestType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/apps/dto/TypeParam.kt rename to api/src/main/java/com/vk/sdk/api/apps/dto/AppsSendRequestType.kt index c5f7387c9e..3f43014c47 100644 --- a/api/src/main/java/com/vk/sdk/api/apps/dto/TypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/apps/dto/AppsSendRequestType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.apps.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class TypeParam( +enum class AppsSendRequestType( val value: String ) { @SerializedName("invite") diff --git a/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButton.kt b/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButton.kt index e0795d8c99..85ae3e7632 100644 --- a/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButton.kt +++ b/api/src/main/java/com/vk/sdk/api/base/dto/BaseLinkButton.kt @@ -38,6 +38,7 @@ import kotlin.String * @param blockId - Target block id * @param sectionId - Target section id * @param curatorId - curator id + * @param albumId - Video album id * @param ownerId - Owner id * @param icon - Button icon name, e.g. 'phone' or 'gift' * @param style @@ -53,6 +54,8 @@ data class BaseLinkButton( val sectionId: String? = null, @SerializedName("curator_id") val curatorId: Int? = null, + @SerializedName("album_id") + val albumId: Int? = null, @SerializedName("owner_id") val ownerId: UserId? = null, @SerializedName("icon") 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 7c2db424bc..65f248ed55 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 @@ -151,5 +151,8 @@ enum class BaseLinkButtonActionType( MODAL_PAGE("modal_page"), @SerializedName("live_categories") - LIVE_CATEGORIES("live_categories"); + LIVE_CATEGORIES("live_categories"), + + @SerializedName("toggle_video_album_subscription") + TOGGLE_VIDEO_ALBUM_SUBSCRIPTION("toggle_video_album_subscription"); } 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 b5cd51faeb..f0060ac611 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 @@ -28,16 +28,20 @@ package com.vk.sdk.api.board 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.BaseOkResponse import com.vk.sdk.api.board.dto.BoardGetCommentsExtendedResponse +import com.vk.sdk.api.board.dto.BoardGetCommentsExtendedSort import com.vk.sdk.api.board.dto.BoardGetCommentsResponse +import com.vk.sdk.api.board.dto.BoardGetCommentsSort +import com.vk.sdk.api.board.dto.BoardGetTopicsExtendedOrder +import com.vk.sdk.api.board.dto.BoardGetTopicsExtendedPreview import com.vk.sdk.api.board.dto.BoardGetTopicsExtendedResponse +import com.vk.sdk.api.board.dto.BoardGetTopicsOrder +import com.vk.sdk.api.board.dto.BoardGetTopicsPreview import com.vk.sdk.api.board.dto.BoardGetTopicsResponse -import com.vk.sdk.api.board.dto.OrderParam -import com.vk.sdk.api.board.dto.PreviewParam -import com.vk.sdk.api.board.dto.SortParam import kotlin.Boolean import kotlin.Int import kotlin.String @@ -50,17 +54,17 @@ class BoardService { * @param groupId - ID of the community that owns the discussion board. * @param title - Topic title. * @param text - Text of the topic. - * @param fromGroup - For a community: '1' - to post the topic as by the community, '0' - to + * @param fromGroup - For a community_ '1' - to post the topic as by the community, '0' - to * post the topic as by the user (default) - * @param attachments - List of media objects attached to the topic, in the following format: - * "_,_", '' - Type of media object: 'photo' - photo, + * @param attachments - List of media objects attached to the topic, in the following format_ + * "_,_", '' - Type of media object_ 'photo' - photo, * 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media owner. - * '' - Media ID. Example: "photo100172_166443618,photo66748_265827614", , "NOTE: If you + * '' - Media ID. Example_ "photo100172_166443618,photo66748_265827614", , "NOTE_ If you * try to attach more than one reference, an error will be thrown.", * @return [VKRequest] with [Int] */ fun boardAddTopic( - groupId: Int, + groupId: UserId, title: String, text: String? = null, fromGroup: Boolean? = null, @@ -99,8 +103,8 @@ class BoardService { * @param topicId - ID of the topic to be commented on. * @param message - (Required if 'attachments' is not set.) Text of the comment. * @param attachments - (Required if 'text' is not set.) List of media objects attached to the - * comment, in the following format: "_,_", '' - Type of - * media object: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, + * comment, in the following format_ "_,_", '' - Type of + * media object_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, * '' - ID of the media owner. '' - Media ID. * @param fromGroup - '1' - to post the comment as by the community, '0' - to post the comment * as by the user (default) @@ -109,7 +113,7 @@ class BoardService { * @return [VKRequest] with [Int] */ fun boardCreateComment( - groupId: Int, + groupId: UserId, topicId: Int, message: String? = null, attachments: List? = null, @@ -138,7 +142,7 @@ class BoardService { * @return [VKRequest] with [BaseOkResponse] */ fun boardDeleteComment( - groupId: Int, + groupId: UserId, topicId: Int, commentId: Int ): VKRequest = NewApiRequest("board.deleteComment") { @@ -157,7 +161,7 @@ class BoardService { * @param topicId - Topic ID. * @return [VKRequest] with [BaseOkResponse] */ - fun boardDeleteTopic(groupId: Int, topicId: Int): VKRequest = + fun boardDeleteTopic(groupId: UserId, topicId: Int): VKRequest = NewApiRequest("board.deleteTopic") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -174,14 +178,14 @@ class BoardService { * @param commentId - ID of the comment on the topic. * @param message - (Required if 'attachments' is not set). New comment text. * @param attachments - (Required if 'message' is not set.) List of media objects attached to - * the comment, in the following format: "_,_", '' - Type - * of media object: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, - * '' - ID of the media owner. '' - Media ID. Example: + * the comment, in the following format_ "_,_", '' - Type + * of media object_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, + * '' - ID of the media owner. '' - Media ID. Example_ * "photo100172_166443618,photo66748_265827614" * @return [VKRequest] with [BaseOkResponse] */ fun boardEditComment( - groupId: Int, + groupId: UserId, topicId: Int, commentId: Int, message: String? = null, @@ -206,7 +210,7 @@ class BoardService { * @return [VKRequest] with [BaseOkResponse] */ fun boardEditTopic( - groupId: Int, + groupId: UserId, topicId: Int, title: String ): VKRequest = NewApiRequest("board.editTopic") { @@ -244,18 +248,18 @@ class BoardService { * @param startCommentId * @param offset - Offset needed to return a specific subset of comments. * @param count - Number of comments to return. - * @param sort - Sort order: 'asc' - by creation date in chronological order, 'desc' - by + * @param sort - Sort order_ 'asc' - by creation date in chronological order, 'desc' - by * creation date in reverse chronological order, * @return [VKRequest] with [BoardGetCommentsResponse] */ fun boardGetComments( - groupId: Int, + groupId: UserId, topicId: Int, needLikes: Boolean? = null, startCommentId: Int? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null + sort: BoardGetCommentsSort? = null ): VKRequest = NewApiRequest("board.getComments") { GsonHolder.gson.fromJson(it, BoardGetCommentsResponse::class.java) } @@ -279,18 +283,18 @@ class BoardService { * @param startCommentId * @param offset - Offset needed to return a specific subset of comments. * @param count - Number of comments to return. - * @param sort - Sort order: 'asc' - by creation date in chronological order, 'desc' - by + * @param sort - Sort order_ 'asc' - by creation date in chronological order, 'desc' - by * creation date in reverse chronological order, * @return [VKRequest] with [BoardGetCommentsExtendedResponse] */ fun boardGetCommentsExtended( - groupId: Int, + groupId: UserId, topicId: Int, needLikes: Boolean? = null, startCommentId: Int? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null + sort: BoardGetCommentsExtendedSort? = null ): VKRequest = NewApiRequest("board.getComments") { GsonHolder.gson.fromJson(it, BoardGetCommentsExtendedResponse::class.java) } @@ -311,7 +315,7 @@ class BoardService { * @param groupId - ID of the community that owns the discussion board. * @param topicIds - IDs of topics to be returned (100 maximum). By default, all topics are * returned. If this parameter is set, the 'order', 'offset', and 'count' parameters are ignored. - * @param order - Sort order: '1' - by date updated in reverse chronological order. '2' - by + * @param order - Sort order_ '1' - by date updated in reverse chronological order. '2' - by * date created in reverse chronological order. '-1' - by date updated in chronological order. * '-2' - by date created in chronological order. If no sort order is specified, topics are * returned in the order specified by the group administrator. Pinned topics are returned first, @@ -319,18 +323,18 @@ class BoardService { * @param offset - Offset needed to return a specific subset of topics. * @param count - Number of topics to return. * @param preview - '1' - to return the first comment in each topic,, '2' - to return the last - * comment in each topic,, '0' - to return no comments. By default: '0'. + * comment in each topic,, '0' - to return no comments. By default_ '0'. * @param previewLength - Number of characters after which to truncate the previewed comment. To * preview the full comment, specify '0'. * @return [VKRequest] with [BoardGetTopicsResponse] */ fun boardGetTopics( - groupId: Int, + groupId: UserId, topicIds: List? = null, - order: OrderParam? = null, + order: BoardGetTopicsOrder? = null, offset: Int? = null, count: Int? = null, - preview: PreviewParam? = null, + preview: BoardGetTopicsPreview? = null, previewLength: Int? = null ): VKRequest = NewApiRequest("board.getTopics") { GsonHolder.gson.fromJson(it, BoardGetTopicsResponse::class.java) @@ -351,7 +355,7 @@ class BoardService { * @param groupId - ID of the community that owns the discussion board. * @param topicIds - IDs of topics to be returned (100 maximum). By default, all topics are * returned. If this parameter is set, the 'order', 'offset', and 'count' parameters are ignored. - * @param order - Sort order: '1' - by date updated in reverse chronological order. '2' - by + * @param order - Sort order_ '1' - by date updated in reverse chronological order. '2' - by * date created in reverse chronological order. '-1' - by date updated in chronological order. * '-2' - by date created in chronological order. If no sort order is specified, topics are * returned in the order specified by the group administrator. Pinned topics are returned first, @@ -359,18 +363,18 @@ class BoardService { * @param offset - Offset needed to return a specific subset of topics. * @param count - Number of topics to return. * @param preview - '1' - to return the first comment in each topic,, '2' - to return the last - * comment in each topic,, '0' - to return no comments. By default: '0'. + * comment in each topic,, '0' - to return no comments. By default_ '0'. * @param previewLength - Number of characters after which to truncate the previewed comment. To * preview the full comment, specify '0'. * @return [VKRequest] with [BoardGetTopicsExtendedResponse] */ fun boardGetTopicsExtended( - groupId: Int, + groupId: UserId, topicIds: List? = null, - order: OrderParam? = null, + order: BoardGetTopicsExtendedOrder? = null, offset: Int? = null, count: Int? = null, - preview: PreviewParam? = null, + preview: BoardGetTopicsExtendedPreview? = null, previewLength: Int? = null ): VKRequest = NewApiRequest("board.getTopics") { GsonHolder.gson.fromJson(it, BoardGetTopicsExtendedResponse::class.java) @@ -411,7 +415,7 @@ class BoardService { * @return [VKRequest] with [BaseOkResponse] */ fun boardRestoreComment( - groupId: Int, + groupId: UserId, topicId: Int, commentId: Int ): VKRequest = NewApiRequest("board.restoreComment") { diff --git a/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsExtendedSort.kt b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsExtendedSort.kt new file mode 100644 index 0000000000..e0427d1125 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsExtendedSort.kt @@ -0,0 +1,41 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.board.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class BoardGetCommentsExtendedSort( + val value: String +) { + @SerializedName("asc") + CHRONOLOGICAL("asc"), + + @SerializedName("desc") + REVERSE_CHRONOLOGICAL("desc"); +} diff --git a/api/src/main/java/com/vk/sdk/api/board/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsSort.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/board/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsSort.kt index 5c587b4773..d9c5f037e4 100644 --- a/api/src/main/java/com/vk/sdk/api/board/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetCommentsSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.board.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SortParam( +enum class BoardGetCommentsSort( val value: String ) { @SerializedName("asc") diff --git a/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedOrder.kt b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedOrder.kt new file mode 100644 index 0000000000..e0db3160d2 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedOrder.kt @@ -0,0 +1,50 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.board.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class BoardGetTopicsExtendedOrder( + val value: Int +) { + @SerializedName("1") + UPDATED_DESC(1), + + @SerializedName("2") + CREATED_DESC(2), + + @SerializedName("-1") + UPDATED_ASC(-1), + + @SerializedName("-2") + CREATED_ASC(-2), + + @SerializedName("0") + AS_BY_ADMINISTRATOR(0); +} diff --git a/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedPreview.kt b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedPreview.kt new file mode 100644 index 0000000000..3893f3c5b8 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsExtendedPreview.kt @@ -0,0 +1,44 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.board.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class BoardGetTopicsExtendedPreview( + val value: Int +) { + @SerializedName("1") + FIRST(1), + + @SerializedName("2") + LAST(2), + + @SerializedName("0") + NONE(0); +} diff --git a/api/src/main/java/com/vk/sdk/api/board/dto/OrderParam.kt b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsOrder.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/board/dto/OrderParam.kt rename to api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsOrder.kt index 8a9dd939f3..9e33472c44 100644 --- a/api/src/main/java/com/vk/sdk/api/board/dto/OrderParam.kt +++ b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsOrder.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.board.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class OrderParam( +enum class BoardGetTopicsOrder( val value: Int ) { @SerializedName("1") diff --git a/api/src/main/java/com/vk/sdk/api/board/dto/PreviewParam.kt b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsPreview.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/board/dto/PreviewParam.kt rename to api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsPreview.kt index c85ef9ee1c..8e8664ebd6 100644 --- a/api/src/main/java/com/vk/sdk/api/board/dto/PreviewParam.kt +++ b/api/src/main/java/com/vk/sdk/api/board/dto/BoardGetTopicsPreview.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.board.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class PreviewParam( +enum class BoardGetTopicsPreview( val value: Int ) { @SerializedName("1") 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 a1f61f2385..56666991ba 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 @@ -29,16 +29,18 @@ package com.vk.sdk.api.docs import com.google.gson.reflect.TypeToken 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.BaseOkResponse import com.vk.sdk.api.base.dto.BaseUploadServer import com.vk.sdk.api.docs.dto.DocsDoc +import com.vk.sdk.api.docs.dto.DocsGetMessagesUploadServerType import com.vk.sdk.api.docs.dto.DocsGetResponse +import com.vk.sdk.api.docs.dto.DocsGetType import com.vk.sdk.api.docs.dto.DocsGetTypesResponse import com.vk.sdk.api.docs.dto.DocsSaveResponse import com.vk.sdk.api.docs.dto.DocsSearchResponse -import com.vk.sdk.api.docs.dto.TypeParam import kotlin.Boolean import kotlin.Int import kotlin.String @@ -56,7 +58,7 @@ class DocsService { * @return [VKRequest] with [Int] */ fun docsAdd( - ownerId: Int, + ownerId: UserId, docId: Int, accessKey: String? = null ): VKRequest = NewApiRequest("docs.add") { @@ -76,7 +78,7 @@ class DocsService { * @param docId - Document ID. * @return [VKRequest] with [BaseOkResponse] */ - fun docsDelete(ownerId: Int, docId: Int): VKRequest = + fun docsDelete(ownerId: UserId, docId: Int): VKRequest = NewApiRequest("docs.delete") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -95,7 +97,7 @@ class DocsService { * @return [VKRequest] with [BaseOkResponse] */ fun docsEdit( - ownerId: Int, + ownerId: UserId, docId: Int, title: String, tags: List? = null @@ -123,8 +125,8 @@ class DocsService { fun docsGet( count: Int? = null, offset: Int? = null, - type: TypeParam? = null, - ownerId: Int? = null, + type: DocsGetType? = null, + ownerId: UserId? = null, returnTags: Boolean? = null ): VKRequest = NewApiRequest("docs.get") { GsonHolder.gson.fromJson(it, DocsGetResponse::class.java) @@ -140,7 +142,7 @@ class DocsService { /** * Returns information about documents by their IDs. * - * @param docs - Document IDs. Example: , "66748_91488,66748_91455", + * @param docs - Document IDs. Example_ , "66748_91488,66748_91455", * @param returnTags * @return [VKRequest] with [Unit] */ @@ -158,12 +160,12 @@ class DocsService { * Returns the server address for document upload. * * @param type - Document type. - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'Chat ID', e.g. '2000000001'. For community_ '- Community ID', e.g. '-12345'. " * @return [VKRequest] with [BaseUploadServer] */ - fun docsGetMessagesUploadServer(type: TypeParam? = null, peerId: Int? = null): - VKRequest = NewApiRequest("docs.getMessagesUploadServer") { + fun docsGetMessagesUploadServer(type: DocsGetMessagesUploadServerType? = null, peerId: Int? = + null): VKRequest = NewApiRequest("docs.getMessagesUploadServer") { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } .apply { @@ -178,7 +180,7 @@ class DocsService { * designate a community ID. * @return [VKRequest] with [DocsGetTypesResponse] */ - fun docsGetTypes(ownerId: Int): VKRequest = + fun docsGetTypes(ownerId: UserId): VKRequest = NewApiRequest("docs.getTypes") { GsonHolder.gson.fromJson(it, DocsGetTypesResponse::class.java) } @@ -192,7 +194,7 @@ class DocsService { * @param groupId - Community ID (if the document will be uploaded to the community). * @return [VKRequest] with [BaseUploadServer] */ - fun docsGetUploadServer(groupId: Int? = null): VKRequest = + fun docsGetUploadServer(groupId: UserId? = null): VKRequest = NewApiRequest("docs.getUploadServer") { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetMessagesUploadServerType.kt b/api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetMessagesUploadServerType.kt new file mode 100644 index 0000000000..d7b33ede25 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetMessagesUploadServerType.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.docs.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class DocsGetMessagesUploadServerType( + val value: String +) { + @SerializedName("audio_message") + AUDIO_MESSAGE("audio_message"), + + @SerializedName("doc") + DOC("doc"), + + @SerializedName("graffiti") + GRAFFITI("graffiti"); +} diff --git a/api/src/main/java/com/vk/sdk/api/docs/dto/TypeParam.kt b/api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/docs/dto/TypeParam.kt rename to api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetType.kt index e03067877e..334040d9f3 100644 --- a/api/src/main/java/com/vk/sdk/api/docs/dto/TypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/docs/dto/DocsGetType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.docs.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class TypeParam( +enum class DocsGetType( val value: Int ) { @SerializedName("0") 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 6fec23af21..59312b8ca5 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 @@ -28,6 +28,7 @@ package com.vk.sdk.api.donut 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 @@ -48,7 +49,7 @@ class DonutService { * @return [VKRequest] with [GroupsGetMembersFieldsResponse] */ fun donutGetFriends( - ownerId: Int, + ownerId: UserId, offset: Int? = null, count: Int? = null, fields: List? = null @@ -66,7 +67,7 @@ class DonutService { * @param ownerId * @return [VKRequest] with [DonutDonatorSubscriptionInfo] */ - fun donutGetSubscription(ownerId: Int): VKRequest = + fun donutGetSubscription(ownerId: UserId): VKRequest = NewApiRequest("donut.getSubscription") { GsonHolder.gson.fromJson(it, DonutDonatorSubscriptionInfo::class.java) } @@ -102,7 +103,7 @@ class DonutService { * @param ownerId * @return [VKRequest] with [BaseBoolInt] */ - fun donutIsDon(ownerId: Int): VKRequest = NewApiRequest("donut.isDon") { + fun donutIsDon(ownerId: UserId): VKRequest = NewApiRequest("donut.isDon") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } .apply { 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 8e84f9e574..b4db9a35e2 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 @@ -28,17 +28,17 @@ package com.vk.sdk.api.downloadedGames 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.downloadedGames.dto.DownloadedGamesPaidStatusResponse -import kotlin.Int class DownloadedGamesService { /** * @param userId * @return [VKRequest] with [DownloadedGamesPaidStatusResponse] */ - fun downloadedGamesGetPaidStatus(userId: Int? = null): + fun downloadedGamesGetPaidStatus(userId: UserId? = null): VKRequest = NewApiRequest("downloadedGames.getPaidStatus") { GsonHolder.gson.fromJson(it, DownloadedGamesPaidStatusResponse::class.java) 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 6ca2d3d323..e4a2e1ccea 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 @@ -28,19 +28,22 @@ package com.vk.sdk.api.fave 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.base.dto.BaseUserGroupFields +import com.vk.sdk.api.fave.dto.FaveAddTagPosition +import com.vk.sdk.api.fave.dto.FaveGetExtendedItemType import com.vk.sdk.api.fave.dto.FaveGetExtendedResponse +import com.vk.sdk.api.fave.dto.FaveGetItemType import com.vk.sdk.api.fave.dto.FaveGetPagesResponse +import com.vk.sdk.api.fave.dto.FaveGetPagesType import com.vk.sdk.api.fave.dto.FaveGetResponse import com.vk.sdk.api.fave.dto.FaveGetTagsResponse +import com.vk.sdk.api.fave.dto.FaveSetTagsItemType import com.vk.sdk.api.fave.dto.FaveTag -import com.vk.sdk.api.fave.dto.ItemTypeParam -import com.vk.sdk.api.fave.dto.PositionParam -import com.vk.sdk.api.fave.dto.TypeParam import kotlin.Boolean import kotlin.Int import kotlin.String @@ -76,7 +79,7 @@ class FaveService { * @param groupId * @return [VKRequest] with [BaseOkResponse] */ - fun faveAddPage(userId: Int? = null, groupId: Int? = null): VKRequest = + fun faveAddPage(userId: UserId? = null, groupId: UserId? = null): VKRequest = NewApiRequest("fave.addPage") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -92,7 +95,7 @@ class FaveService { * @return [VKRequest] with [BaseOkResponse] */ fun faveAddPost( - ownerId: Int, + ownerId: UserId, id: Int, accessKey: String? = null ): VKRequest = NewApiRequest("fave.addPost") { @@ -111,7 +114,7 @@ class FaveService { * @return [VKRequest] with [BaseOkResponse] */ fun faveAddProduct( - ownerId: Int, + ownerId: UserId, id: Int, accessKey: String? = null ): VKRequest = NewApiRequest("fave.addProduct") { @@ -128,7 +131,7 @@ class FaveService { * @param position * @return [VKRequest] with [FaveTag] */ - fun faveAddTag(name: String? = null, position: PositionParam? = null): VKRequest = + fun faveAddTag(name: String? = null, position: FaveAddTagPosition? = null): VKRequest = NewApiRequest("fave.addTag") { GsonHolder.gson.fromJson(it, FaveTag::class.java) } @@ -144,7 +147,7 @@ class FaveService { * @return [VKRequest] with [BaseOkResponse] */ fun faveAddVideo( - ownerId: Int, + ownerId: UserId, id: Int, accessKey: String? = null ): VKRequest = NewApiRequest("fave.addVideo") { @@ -180,7 +183,7 @@ class FaveService { * @return [VKRequest] with [FaveGetResponse] */ fun faveGet( - itemType: ItemTypeParam? = null, + itemType: FaveGetItemType? = null, tagId: Int? = null, offset: Int? = null, count: Int? = null, @@ -208,7 +211,7 @@ class FaveService { * @return [VKRequest] with [FaveGetExtendedResponse] */ fun faveGetExtended( - itemType: ItemTypeParam? = null, + itemType: FaveGetExtendedItemType? = null, tagId: Int? = null, offset: Int? = null, count: Int? = null, @@ -238,7 +241,7 @@ class FaveService { fun faveGetPages( offset: Int? = null, count: Int? = null, - type: TypeParam? = null, + type: FaveGetPagesType? = null, fields: List? = null, tagId: Int? = null ): VKRequest = NewApiRequest("fave.getPages") { @@ -274,7 +277,7 @@ class FaveService { * @param articleId * @return [VKRequest] with [BaseBoolInt] */ - fun faveRemoveArticle(ownerId: Int, articleId: Int): VKRequest = + fun faveRemoveArticle(ownerId: UserId, articleId: Int): VKRequest = NewApiRequest("fave.removeArticle") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -305,7 +308,7 @@ class FaveService { * @param groupId * @return [VKRequest] with [BaseOkResponse] */ - fun faveRemovePage(userId: Int? = null, groupId: Int? = null): VKRequest = + fun faveRemovePage(userId: UserId? = null, groupId: UserId? = null): VKRequest = NewApiRequest("fave.removePage") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -319,7 +322,7 @@ class FaveService { * @param id * @return [VKRequest] with [BaseOkResponse] */ - fun faveRemovePost(ownerId: Int, id: Int): VKRequest = + fun faveRemovePost(ownerId: UserId, id: Int): VKRequest = NewApiRequest("fave.removePost") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -333,7 +336,7 @@ class FaveService { * @param id * @return [VKRequest] with [BaseOkResponse] */ - fun faveRemoveProduct(ownerId: Int, id: Int): VKRequest = + fun faveRemoveProduct(ownerId: UserId, id: Int): VKRequest = NewApiRequest("fave.removeProduct") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -358,7 +361,7 @@ class FaveService { * @param id * @return [VKRequest] with [BaseOkResponse] */ - fun faveRemoveVideo(ownerId: Int, id: Int): VKRequest = + fun faveRemoveVideo(ownerId: UserId, id: Int): VKRequest = NewApiRequest("fave.removeVideo") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -386,8 +389,8 @@ class FaveService { * @return [VKRequest] with [BaseOkResponse] */ fun faveSetPageTags( - userId: Int? = null, - groupId: Int? = null, + userId: UserId? = null, + groupId: UserId? = null, tagIds: List? = null ): VKRequest = NewApiRequest("fave.setPageTags") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) @@ -408,7 +411,7 @@ class FaveService { * @return [VKRequest] with [BaseOkResponse] */ fun faveSetTags( - itemType: ItemTypeParam? = null, + itemType: FaveSetTagsItemType? = null, itemOwnerId: Int? = null, itemId: Int? = null, tagIds: List? = null, @@ -431,7 +434,7 @@ class FaveService { * @param groupId * @return [VKRequest] with [BaseOkResponse] */ - fun faveTrackPageInteraction(userId: Int? = null, groupId: Int? = null): + fun faveTrackPageInteraction(userId: UserId? = null, groupId: UserId? = null): VKRequest = NewApiRequest("fave.trackPageInteraction") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/fave/dto/PositionParam.kt b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveAddTagPosition.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/fave/dto/PositionParam.kt rename to api/src/main/java/com/vk/sdk/api/fave/dto/FaveAddTagPosition.kt index 51467b3f7f..953d2cb11c 100644 --- a/api/src/main/java/com/vk/sdk/api/fave/dto/PositionParam.kt +++ b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveAddTagPosition.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.fave.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class PositionParam( +enum class FaveAddTagPosition( val value: String ) { @SerializedName("back") diff --git a/api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetExtendedItemType.kt b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetExtendedItemType.kt new file mode 100644 index 0000000000..07249bd91e --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetExtendedItemType.kt @@ -0,0 +1,65 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.fave.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FaveGetExtendedItemType( + val value: String +) { + @SerializedName("article") + ARTICLE("article"), + + @SerializedName("clip") + CLIP("clip"), + + @SerializedName("link") + LINK("link"), + + @SerializedName("narrative") + NARRATIVE("narrative"), + + @SerializedName("page") + PAGE("page"), + + @SerializedName("podcast") + PODCAST("podcast"), + + @SerializedName("post") + POST("post"), + + @SerializedName("product") + PRODUCT("product"), + + @SerializedName("video") + VIDEO("video"), + + @SerializedName("youla_product") + YOULA_PRODUCT("youla_product"); +} diff --git a/api/src/main/java/com/vk/sdk/api/fave/dto/ItemTypeParam.kt b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetItemType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/fave/dto/ItemTypeParam.kt rename to api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetItemType.kt index ec567c77dc..5a62c1a725 100644 --- a/api/src/main/java/com/vk/sdk/api/fave/dto/ItemTypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetItemType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.fave.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class ItemTypeParam( +enum class FaveGetItemType( val value: String ) { @SerializedName("article") diff --git a/api/src/main/java/com/vk/sdk/api/fave/dto/TypeParam.kt b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetPagesType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/fave/dto/TypeParam.kt rename to api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetPagesType.kt index fae64023c9..5b3ac9d1f9 100644 --- a/api/src/main/java/com/vk/sdk/api/fave/dto/TypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveGetPagesType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.fave.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class TypeParam( +enum class FaveGetPagesType( val value: String ) { @SerializedName("groups") diff --git a/api/src/main/java/com/vk/sdk/api/fave/dto/FaveSetTagsItemType.kt b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveSetTagsItemType.kt new file mode 100644 index 0000000000..11fc56154d --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/fave/dto/FaveSetTagsItemType.kt @@ -0,0 +1,65 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.fave.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FaveSetTagsItemType( + val value: String +) { + @SerializedName("article") + ARTICLE("article"), + + @SerializedName("clip") + CLIP("clip"), + + @SerializedName("link") + LINK("link"), + + @SerializedName("narrative") + NARRATIVE("narrative"), + + @SerializedName("page") + PAGE("page"), + + @SerializedName("podcast") + PODCAST("podcast"), + + @SerializedName("post") + POST("post"), + + @SerializedName("product") + PRODUCT("product"), + + @SerializedName("video") + VIDEO("video"), + + @SerializedName("youla_product") + YOULA_PRODUCT("youla_product"); +} diff --git a/api/src/main/java/com/vk/sdk/api/friends/FriendsService.kt b/api/src/main/java/com/vk/sdk/api/friends/FriendsService.kt index 57aac08166..d762661733 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 @@ -29,10 +29,10 @@ package com.vk.sdk.api.friends import com.google.gson.reflect.TypeToken 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.BaseOkResponse -import com.vk.sdk.api.friends.dto.FilterParam import com.vk.sdk.api.friends.dto.FriendsAddListResponse import com.vk.sdk.api.friends.dto.FriendsAddResponse import com.vk.sdk.api.friends.dto.FriendsDeleteResponse @@ -40,13 +40,16 @@ import com.vk.sdk.api.friends.dto.FriendsFriendExtendedStatus import com.vk.sdk.api.friends.dto.FriendsFriendStatus import com.vk.sdk.api.friends.dto.FriendsGetFieldsResponse import com.vk.sdk.api.friends.dto.FriendsGetListsResponse +import com.vk.sdk.api.friends.dto.FriendsGetNameCase +import com.vk.sdk.api.friends.dto.FriendsGetOrder import com.vk.sdk.api.friends.dto.FriendsGetRequestsResponse +import com.vk.sdk.api.friends.dto.FriendsGetRequestsSort +import com.vk.sdk.api.friends.dto.FriendsGetSuggestionsFilter +import com.vk.sdk.api.friends.dto.FriendsGetSuggestionsNameCase import com.vk.sdk.api.friends.dto.FriendsGetSuggestionsResponse +import com.vk.sdk.api.friends.dto.FriendsSearchNameCase import com.vk.sdk.api.friends.dto.FriendsSearchResponse import com.vk.sdk.api.friends.dto.FriendsUserXtrPhone -import com.vk.sdk.api.friends.dto.NameCaseParam -import com.vk.sdk.api.friends.dto.OrderParam -import com.vk.sdk.api.friends.dto.SortParam import com.vk.sdk.api.users.dto.UsersFields import kotlin.Boolean import kotlin.Int @@ -64,7 +67,7 @@ class FriendsService { * @return [VKRequest] with [FriendsAddResponse] */ fun friendsAdd( - userId: Int? = null, + userId: UserId? = null, text: String? = null, follow: Boolean? = null ): VKRequest = NewApiRequest("friends.add") { @@ -98,7 +101,7 @@ class FriendsService { * @param userIds - IDs of the users whose friendship status to check. * @param needSign - '1' - to return 'sign' field. 'sign' is * md5("{id}_{user_id}_{friends_status}_{application_secret}"), where id is current user ID. This - * field allows to check that data has not been modified by the client. By default: '0'. + * 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): @@ -117,7 +120,7 @@ class FriendsService { * @param userIds - IDs of the users whose friendship status to check. * @param needSign - '1' - to return 'sign' field. 'sign' is * md5("{id}_{user_id}_{friends_status}_{application_secret}"), where id is current user ID. This - * field allows to check that data has not been modified by the client. By default: '0'. + * 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): @@ -138,7 +141,7 @@ class FriendsService { * from the current user's friend list. * @return [VKRequest] with [FriendsDeleteResponse] */ - fun friendsDelete(userId: Int? = null): VKRequest = + fun friendsDelete(userId: UserId? = null): VKRequest = NewApiRequest("friends.delete") { GsonHolder.gson.fromJson(it, FriendsDeleteResponse::class.java) } @@ -177,7 +180,7 @@ class FriendsService { * @param listIds - IDs of the friend lists to which to add the user. * @return [VKRequest] with [BaseOkResponse] */ - fun friendsEdit(userId: Int, listIds: List? = null): VKRequest = + fun friendsEdit(userId: UserId, listIds: List? = null): VKRequest = NewApiRequest("friends.edit") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -219,7 +222,7 @@ class FriendsService { * Returns a list of user IDs or detailed information about a user's friends. * * @param userId - User ID. By default, the current user ID. - * @param order - Sort order: , 'name' - by name (enabled only if the 'fields' parameter is + * @param order - Sort order_ , 'name' - by name (enabled only if the 'fields' parameter is * used), 'hints' - by rating, similar to how friends are sorted in My friends section, , This * parameter is available only for [vk.com/dev/standalone|desktop applications]. * @param listId - ID of the friend list returned by the @@ -228,23 +231,23 @@ class FriendsService { * is available only for [vk.com/dev/standalone|desktop applications]. * @param count - Number of friends to return. * @param offset - Offset needed to return a specific subset of friends. - * @param fields - Profile fields to return. Sample values: 'uid', 'first_name', 'last_name', + * @param fields - Profile fields to return. Sample values_ 'uid', 'first_name', 'last_name', * 'nickname', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', * 'photo_big', 'domain', 'has_mobile', 'rate', 'contacts', 'education'. - * @param nameCase - Case for declension of user name and surname: , 'nom' - nominative + * @param nameCase - Case for declension of user name and surname_ , 'nom' - nominative * (default) , 'gen' - genitive , 'dat' - dative , 'acc' - accusative , 'ins' - instrumental , * 'abl' - prepositional * @param ref * @return [VKRequest] with [FriendsGetFieldsResponse] */ fun friendsGet( - userId: Int? = null, - order: OrderParam? = null, + userId: UserId? = null, + order: FriendsGetOrder? = null, listId: Int? = null, count: Int? = null, offset: Int? = null, fields: List? = null, - nameCase: NameCaseParam? = null, + nameCase: FriendsGetNameCase? = null, ref: String? = null ): VKRequest = NewApiRequest("friends.get") { GsonHolder.gson.fromJson(it, FriendsGetFieldsResponse::class.java) @@ -277,9 +280,9 @@ class FriendsService { * Returns a list of the current user's friends whose phone numbers, validated or specified in a * profile, are in a given list. * - * @param phones - List of phone numbers in MSISDN format (maximum 1000). Example: + * @param phones - List of phone numbers in MSISDN format (maximum 1000). Example_ * "+79219876543,+79111234567" - * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * @param fields - Profile fields to return. Sample values_ 'nickname', 'screen_name', 'sex', * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', * 'has_mobile', 'rate', 'contacts', 'education', 'online, counters'. * @return [VKRequest] with [Unit] @@ -301,10 +304,10 @@ class FriendsService { * Returns a list of the user's friend lists. * * @param userId - User ID. - * @param returnSystem - '1' - to return system friend lists. By default: '0'. + * @param returnSystem - '1' - to return system friend lists. By default_ '0'. * @return [VKRequest] with [FriendsGetListsResponse] */ - fun friendsGetLists(userId: Int? = null, returnSystem: Boolean? = null): + fun friendsGetLists(userId: UserId? = null, returnSystem: Boolean? = null): VKRequest = NewApiRequest("friends.getLists") { GsonHolder.gson.fromJson(it, FriendsGetListsResponse::class.java) } @@ -322,7 +325,7 @@ class FriendsService { * user specified in 'source_uid'. * @param targetUids - IDs of the users whose friends will be checked against the friends of the * user specified in 'source_uid'. - * @param order - Sort order: 'random' - random order + * @param order - Sort order_ 'random' - random order * @param count - Number of mutual friends to return. * @param offset - Offset needed to return a specific subset of mutual friends. * @return [VKRequest] with [Unit] @@ -354,13 +357,13 @@ class FriendsService { * @param listId - Friend list ID. If this parameter is not set, information about all online * friends is returned. * @param onlineMobile - '1' - to return an additional 'online_mobile' field, '0' - (default), - * @param order - Sort order: 'random' - random order + * @param order - Sort order_ 'random' - random order * @param count - Number of friends to return. * @param offset - Offset needed to return a specific subset of friends. * @return [VKRequest] with [Unit] */ fun friendsGetOnline( - userId: Int? = null, + userId: UserId? = null, listId: Int? = null, onlineMobile: Boolean? = null, order: String? = null, @@ -401,7 +404,7 @@ class FriendsService { * @param count - Number of friend requests to return (default 100, maximum 1000). * @param needMutual - '1' - to return a list of mutual friends (up to 20), if any * @param out - '1' - to return outgoing requests, '0' - to return incoming requests (default) - * @param sort - Sort order: '1' - by number of mutual friends, '0' - by date + * @param sort - Sort order_ '1' - by number of mutual friends, '0' - by date * @param needViewed * @param suggested - '1' - to return a list of suggested friends, '0' - to return friend * requests (default) @@ -414,7 +417,7 @@ class FriendsService { count: Int? = null, needMutual: Boolean? = null, out: Boolean? = null, - sort: SortParam? = null, + sort: FriendsGetRequestsSort? = null, needViewed: Boolean? = null, suggested: Boolean? = null, ref: String? = null, @@ -440,27 +443,27 @@ class FriendsService { /** * Returns a list of profiles of users whom the current user may know. * - * @param filter - Types of potential friends to return: 'mutual' - users with many mutual + * @param filter - Types of potential friends to return_ 'mutual' - users with many mutual * friends , 'contacts' - users found with the * [vk.com/dev/account.importContacts|account.importContacts] method , 'mutual_contacts' - users * who imported the same contacts as the current user with the * [vk.com/dev/account.importContacts|account.importContacts] method * @param count - Number of suggestions to return. * @param offset - Offset needed to return a specific subset of suggestions. - * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * @param fields - Profile fields to return. Sample values_ 'nickname', 'screen_name', 'sex', * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', * 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'. - * @param nameCase - Case for declension of user name and surname: , 'nom' - nominative + * @param nameCase - Case for declension of user name and surname_ , 'nom' - nominative * (default) , 'gen' - genitive , 'dat' - dative , 'acc' - accusative , 'ins' - instrumental , * 'abl' - prepositional * @return [VKRequest] with [FriendsGetSuggestionsResponse] */ fun friendsGetSuggestions( - filter: List? = null, + filter: List? = null, count: Int? = null, offset: Int? = null, fields: List? = null, - nameCase: NameCaseParam? = null + nameCase: FriendsGetSuggestionsNameCase? = null ): VKRequest = NewApiRequest("friends.getSuggestions") { GsonHolder.gson.fromJson(it, FriendsGetSuggestionsResponse::class.java) } @@ -483,10 +486,10 @@ class FriendsService { * * @param userId - User ID. * @param q - Search query string (e.g., 'Vasya Babich'). - * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * @param fields - Profile fields to return. Sample values_ 'nickname', 'screen_name', 'sex', * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', * 'has_mobile', 'rate', 'contacts', 'education', 'online', - * @param nameCase - Case for declension of user name and surname: 'nom' - nominative (default), + * @param nameCase - Case for declension of user name and surname_ 'nom' - nominative (default), * 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - * prepositional * @param offset - Offset needed to return a specific subset of friends. @@ -494,10 +497,10 @@ class FriendsService { * @return [VKRequest] with [FriendsSearchResponse] */ fun friendsSearch( - userId: Int, + userId: UserId, q: String? = null, fields: List? = null, - nameCase: NameCaseParam? = null, + nameCase: FriendsSearchNameCase? = null, offset: Int? = null, count: Int? = null ): VKRequest = NewApiRequest("friends.search") { diff --git a/api/src/main/java/com/vk/sdk/api/friends/dto/NameCaseParam.kt b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetNameCase.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/friends/dto/NameCaseParam.kt rename to api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetNameCase.kt index b831c8ea55..d536801535 100644 --- a/api/src/main/java/com/vk/sdk/api/friends/dto/NameCaseParam.kt +++ b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetNameCase.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.friends.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class NameCaseParam( +enum class FriendsGetNameCase( val value: String ) { @SerializedName("nom") diff --git a/api/src/main/java/com/vk/sdk/api/friends/dto/OrderParam.kt b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetOrder.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/friends/dto/OrderParam.kt rename to api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetOrder.kt index 09b8da52b0..2827434cb9 100644 --- a/api/src/main/java/com/vk/sdk/api/friends/dto/OrderParam.kt +++ b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetOrder.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.friends.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class OrderParam( +enum class FriendsGetOrder( val value: String ) { @SerializedName("hints") diff --git a/api/src/main/java/com/vk/sdk/api/friends/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsSort.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/friends/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsSort.kt index 37075947c6..4229f95482 100644 --- a/api/src/main/java/com/vk/sdk/api/friends/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetRequestsSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.friends.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class SortParam( +enum class FriendsGetRequestsSort( val value: Int ) { @SerializedName("0") diff --git a/api/src/main/java/com/vk/sdk/api/friends/dto/FilterParam.kt b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsFilter.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/friends/dto/FilterParam.kt rename to api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsFilter.kt index 197d6a5b5c..a1f0178348 100644 --- a/api/src/main/java/com/vk/sdk/api/friends/dto/FilterParam.kt +++ b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsFilter.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.friends.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FilterParam( +enum class FriendsGetSuggestionsFilter( val value: String ) { @SerializedName("mutual") diff --git a/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsNameCase.kt b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsNameCase.kt new file mode 100644 index 0000000000..8f125e98ac --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsGetSuggestionsNameCase.kt @@ -0,0 +1,53 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FriendsGetSuggestionsNameCase( + val value: String +) { + @SerializedName("nom") + NOMINATIVE("nom"), + + @SerializedName("gen") + GENITIVE("gen"), + + @SerializedName("dat") + DATIVE("dat"), + + @SerializedName("acc") + ACCUSATIVE("acc"), + + @SerializedName("ins") + INSTRUMENTAL("ins"), + + @SerializedName("abl") + PREPOSITIONAL("abl"); +} diff --git a/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsSearchNameCase.kt b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsSearchNameCase.kt new file mode 100644 index 0000000000..ae7d9599e3 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/friends/dto/FriendsSearchNameCase.kt @@ -0,0 +1,53 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.friends.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class FriendsSearchNameCase( + val value: String +) { + @SerializedName("Nom") + NOMINATIVE("Nom"), + + @SerializedName("Gen") + GENITIVE("Gen"), + + @SerializedName("Dat") + DATIVE("Dat"), + + @SerializedName("Acc") + ACCUSATIVE("Acc"), + + @SerializedName("Ins") + INSTRUMENTAL("Ins"), + + @SerializedName("Abl") + PREPOSITIONAL("Abl"); +} diff --git a/api/src/main/java/com/vk/sdk/api/gifts/GiftsService.kt b/api/src/main/java/com/vk/sdk/api/gifts/GiftsService.kt index 1eafb5b011..8f17d075d8 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 @@ -28,6 +28,7 @@ package com.vk.sdk.api.gifts 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.gifts.dto.GiftsGetResponse @@ -43,7 +44,7 @@ class GiftsService { * @return [VKRequest] with [GiftsGetResponse] */ fun giftsGet( - userId: Int? = null, + userId: UserId? = null, count: Int? = null, offset: Int? = null ): VKRequest = NewApiRequest("gifts.get") { 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 dae43c05bc..5cde15296d 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 @@ -29,18 +29,21 @@ package com.vk.sdk.api.groups import com.google.gson.reflect.TypeToken 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.addresses.dto.AddressesFields import com.vk.sdk.api.base.dto.BaseBoolInt import com.vk.sdk.api.base.dto.BaseOkResponse import com.vk.sdk.api.base.dto.BaseUserGroupFields -import com.vk.sdk.api.groups.dto.ActParam -import com.vk.sdk.api.groups.dto.AgeLimitsParam -import com.vk.sdk.api.groups.dto.FilterParam +import com.vk.sdk.api.groups.dto.GroupsAddAddressWorkInfoStatus import com.vk.sdk.api.groups.dto.GroupsAddCallbackServerResponse import com.vk.sdk.api.groups.dto.GroupsAddress import com.vk.sdk.api.groups.dto.GroupsCallbackSettings +import com.vk.sdk.api.groups.dto.GroupsCreateSubtype +import com.vk.sdk.api.groups.dto.GroupsCreateType +import com.vk.sdk.api.groups.dto.GroupsEditAddressWorkInfoStatus +import com.vk.sdk.api.groups.dto.GroupsEditAgeLimits import com.vk.sdk.api.groups.dto.GroupsFields import com.vk.sdk.api.groups.dto.GroupsFilter import com.vk.sdk.api.groups.dto.GroupsGetAddressesResponse @@ -50,29 +53,30 @@ import com.vk.sdk.api.groups.dto.GroupsGetCallbackServersResponse import com.vk.sdk.api.groups.dto.GroupsGetCatalogInfoExtendedResponse import com.vk.sdk.api.groups.dto.GroupsGetCatalogInfoResponse import com.vk.sdk.api.groups.dto.GroupsGetCatalogResponse -import com.vk.sdk.api.groups.dto.GroupsGetExtendedResponse +import com.vk.sdk.api.groups.dto.GroupsGetInvitedUsersNameCase import com.vk.sdk.api.groups.dto.GroupsGetInvitedUsersResponse import com.vk.sdk.api.groups.dto.GroupsGetInvitesExtendedResponse import com.vk.sdk.api.groups.dto.GroupsGetInvitesResponse import com.vk.sdk.api.groups.dto.GroupsGetMembersFieldsResponse +import com.vk.sdk.api.groups.dto.GroupsGetMembersFilter +import com.vk.sdk.api.groups.dto.GroupsGetMembersSort +import com.vk.sdk.api.groups.dto.GroupsGetObjectExtendedResponse import com.vk.sdk.api.groups.dto.GroupsGetRequestsFieldsResponse import com.vk.sdk.api.groups.dto.GroupsGetResponse import com.vk.sdk.api.groups.dto.GroupsGetSettingsResponse import com.vk.sdk.api.groups.dto.GroupsGetTokenPermissionsResponse import com.vk.sdk.api.groups.dto.GroupsGroup import com.vk.sdk.api.groups.dto.GroupsGroupFull -import com.vk.sdk.api.groups.dto.GroupsGroupLink import com.vk.sdk.api.groups.dto.GroupsGroupTag +import com.vk.sdk.api.groups.dto.GroupsLinksItem import com.vk.sdk.api.groups.dto.GroupsLongPollServer import com.vk.sdk.api.groups.dto.GroupsLongPollSettings import com.vk.sdk.api.groups.dto.GroupsSearchResponse -import com.vk.sdk.api.groups.dto.NameCaseParam -import com.vk.sdk.api.groups.dto.SortParam -import com.vk.sdk.api.groups.dto.StateParam -import com.vk.sdk.api.groups.dto.SubtypeParam -import com.vk.sdk.api.groups.dto.TagColorParam -import com.vk.sdk.api.groups.dto.TypeParam -import com.vk.sdk.api.groups.dto.WorkInfoStatusParam +import com.vk.sdk.api.groups.dto.GroupsSearchSort +import com.vk.sdk.api.groups.dto.GroupsSearchType +import com.vk.sdk.api.groups.dto.GroupsTagAddTagColor +import com.vk.sdk.api.groups.dto.GroupsTagBindAct +import com.vk.sdk.api.groups.dto.GroupsToggleMarketState import com.vk.sdk.api.users.dto.UsersFields import kotlin.Boolean import kotlin.Float @@ -99,7 +103,7 @@ class GroupsService { * @return [VKRequest] with [GroupsAddress] */ fun groupsAddAddress( - groupId: Int, + groupId: UserId, title: String, address: String, countryId: Int, @@ -109,7 +113,7 @@ class GroupsService { additionalAddress: String? = null, metroId: Int? = null, phone: String? = null, - workInfoStatus: WorkInfoStatusParam? = null, + workInfoStatus: GroupsAddAddressWorkInfoStatus? = null, timetable: String? = null, isMainAddress: Boolean? = null ): VKRequest = NewApiRequest("groups.addAddress") { @@ -139,7 +143,7 @@ class GroupsService { * @return [VKRequest] with [GroupsAddCallbackServerResponse] */ fun groupsAddCallbackServer( - groupId: Int, + groupId: UserId, url: String, title: String, secretKey: String? = null @@ -159,14 +163,14 @@ class GroupsService { * @param groupId - Community ID. * @param link - Link URL. * @param text - Description text for the link. - * @return [VKRequest] with [GroupsGroupLink] + * @return [VKRequest] with [GroupsLinksItem] */ fun groupsAddLink( - groupId: Int, + groupId: UserId, link: String, text: String? = null - ): VKRequest = NewApiRequest("groups.addLink") { - GsonHolder.gson.fromJson(it, GroupsGroupLink::class.java) + ): VKRequest = NewApiRequest("groups.addLink") { + GsonHolder.gson.fromJson(it, GroupsLinksItem::class.java) } .apply { addParam("group_id", groupId) @@ -181,7 +185,7 @@ class GroupsService { * @param userId - User ID. * @return [VKRequest] with [BaseOkResponse] */ - fun groupsApproveRequest(groupId: Int, userId: Int): VKRequest = + fun groupsApproveRequest(groupId: UserId, userId: UserId): VKRequest = NewApiRequest("groups.approveRequest") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -200,8 +204,8 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsBan( - groupId: Int, - ownerId: Int? = null, + groupId: UserId, + ownerId: UserId? = null, endDate: Int? = null, reason: Int? = null, comment: String? = null, @@ -223,11 +227,11 @@ class GroupsService { * * @param title - Community title. * @param description - Community description (ignored for 'type' = 'public'). - * @param type - Community type. Possible values: *'group' - group,, *'event' - event,, + * @param type - Community type. Possible values_ *'group' - group,, *'event' - event,, * *'public' - public page * @param publicCategory - Category ID (for 'type' = 'public' only). * @param publicSubcategory - Public page subcategory ID. - * @param subtype - Public page subtype. Possible values: *'1' - place or small business,, + * @param subtype - Public page subtype. Possible values_ *'1' - place or small business,, * *'2' - company, organization or website,, *'3' - famous person or group of people,, *'4' - * product or work of art. * @return [VKRequest] with [GroupsGroup] @@ -235,10 +239,10 @@ class GroupsService { fun groupsCreate( title: String, description: String? = null, - type: TypeParam? = null, + type: GroupsCreateType? = null, publicCategory: Int? = null, publicSubcategory: Int? = null, - subtype: SubtypeParam? = null + subtype: GroupsCreateSubtype? = null ): VKRequest = NewApiRequest("groups.create") { GsonHolder.gson.fromJson(it, GroupsGroup::class.java) } @@ -256,7 +260,7 @@ class GroupsService { * @param addressId * @return [VKRequest] with [BaseOkResponse] */ - fun groupsDeleteAddress(groupId: Int, addressId: Int): VKRequest = + fun groupsDeleteAddress(groupId: UserId, addressId: Int): VKRequest = NewApiRequest("groups.deleteAddress") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -270,7 +274,7 @@ class GroupsService { * @param serverId * @return [VKRequest] with [BaseOkResponse] */ - fun groupsDeleteCallbackServer(groupId: Int, serverId: Int): VKRequest = + fun groupsDeleteCallbackServer(groupId: UserId, serverId: Int): VKRequest = NewApiRequest("groups.deleteCallbackServer") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -286,7 +290,7 @@ class GroupsService { * @param linkId - Link ID. * @return [VKRequest] with [BaseOkResponse] */ - fun groupsDeleteLink(groupId: Int, linkId: Int): VKRequest = + fun groupsDeleteLink(groupId: UserId, linkId: Int): VKRequest = NewApiRequest("groups.deleteLink") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -299,7 +303,7 @@ class GroupsService { * @param groupId * @return [VKRequest] with [BaseOkResponse] */ - fun groupsDisableOnline(groupId: Int): VKRequest = + fun groupsDisableOnline(groupId: UserId): VKRequest = NewApiRequest("groups.disableOnline") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -314,10 +318,10 @@ class GroupsService { * @param title - Community title. * @param description - Community description. * @param screenName - Community screen name. - * @param access - Community type. Possible values: *'0' - open,, *'1' - closed,, *'2' - + * @param access - Community type. Possible values_ *'0' - open,, *'1' - closed,, *'2' - * private. * @param website - Website that will be displayed in the community information field. - * @param subject - Community subject. Possible values: , *'1' - auto/moto,, *'2' - activity + * @param subject - Community subject. Possible values_ , *'1' - auto/moto,, *'2' - activity * holidays,, *'3' - business,, *'4' - pets,, *'5' - health,, *'6' - dating and communication, , * *'7' - games,, *'8' - IT (computers and software),, *'9' - cinema,, *'10' - beauty and fashion,, * *'11' - cooking,, *'12' - art and culture,, *'13' - literature,, *'14' - mobile services and @@ -339,46 +343,46 @@ class GroupsService { * @param publicSubcategory - Public page subcategory ID. * @param publicDate - Founding date of a company or organization owning the community in * "dd.mm.YYYY" format. - * @param wall - Wall settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - limited + * @param wall - Wall settings. Possible values_ *'0' - disabled,, *'1' - open,, *'2' - limited * (groups and events only),, *'3' - closed (groups and events only). - * @param topics - Board topics settings. Possbile values: , *'0' - disabled,, *'1' - open,, + * @param topics - Board topics settings. Possbile values_ , *'0' - disabled,, *'1' - open,, * *'2' - limited (for groups and events only). - * @param photos - Photos settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * @param photos - Photos settings. Possible values_ *'0' - disabled,, *'1' - open,, *'2' - * limited (for groups and events only). - * @param video - Video settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * @param video - Video settings. Possible values_ *'0' - disabled,, *'1' - open,, *'2' - * limited (for groups and events only). - * @param audio - Audio settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * @param audio - Audio settings. Possible values_ *'0' - disabled,, *'1' - open,, *'2' - * limited (for groups and events only). - * @param links - Links settings (for public pages only). Possible values: *'0' - disabled,, + * @param links - Links settings (for public pages only). Possible values_ *'0' - disabled,, * *'1' - enabled. - * @param events - Events settings (for public pages only). Possible values: *'0' - disabled,, + * @param events - Events settings (for public pages only). Possible values_ *'0' - disabled,, * *'1' - enabled. - * @param places - Places settings (for public pages only). Possible values: *'0' - disabled,, + * @param places - Places settings (for public pages only). Possible values_ *'0' - disabled,, * *'1' - enabled. - * @param contacts - Contacts settings (for public pages only). Possible values: *'0' - + * @param contacts - Contacts settings (for public pages only). Possible values_ *'0' - * disabled,, *'1' - enabled. - * @param docs - Documents settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * @param docs - Documents settings. Possible values_ *'0' - disabled,, *'1' - open,, *'2' - * limited (for groups and events only). - * @param wiki - Wiki pages settings. Possible values: *'0' - disabled,, *'1' - open,, *'2' - + * @param wiki - Wiki pages settings. Possible values_ *'0' - disabled,, *'1' - open,, *'2' - * limited (for groups and events only). - * @param messages - Community messages. Possible values: *'0' - disabled,, *'1' - enabled. + * @param messages - Community messages. Possible values_ *'0' - disabled,, *'1' - enabled. * @param articles * @param addresses - * @param ageLimits - Community age limits. Possible values: *'1' - no limits,, *'2' - 16+,, + * @param ageLimits - Community age limits. Possible values_ *'1' - no limits,, *'2' - 16+,, * *'3' - 18+. - * @param market - Market settings. Possible values: *'0' - disabled,, *'1' - enabled. - * @param marketComments - market comments settings. Possible values: *'0' - disabled,, *'1' - + * @param market - Market settings. Possible values_ *'0' - disabled,, *'1' - enabled. + * @param marketComments - market comments settings. Possible values_ *'0' - disabled,, *'1' - * enabled. * @param marketCountry - Market delivery countries. * @param marketCity - Market delivery cities (if only one country is specified). - * @param marketCurrency - Market currency settings. Possbile values: , *'643' - Russian + * @param marketCurrency - Market currency settings. Possbile values_ , *'643' - Russian * rubles,, *'980' - Ukrainian hryvnia,, *'398' - Kazakh tenge,, *'978' - Euro,, *'840' - US * dollars * @param marketContact - Seller contact for market. Set '0' for community messages. * @param marketWiki - ID of a wiki page with market description. - * @param obsceneFilter - Obscene expressions filter in comments. Possible values: , *'0' - + * @param obsceneFilter - Obscene expressions filter in comments. Possible values_ , *'0' - * disabled,, *'1' - enabled. - * @param obsceneStopwords - Stopwords filter in comments. Possible values: , *'0' - disabled,, + * @param obsceneStopwords - Stopwords filter in comments. Possible values_ , *'0' - disabled,, * *'1' - enabled. * @param obsceneWords - Keywords for stopwords filter. * @param mainSection @@ -388,7 +392,7 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsEdit( - groupId: Int, + groupId: UserId, title: String? = null, description: String? = null, screenName: String? = null, @@ -400,7 +404,7 @@ class GroupsService { rss: String? = null, eventStartDate: Int? = null, eventFinishDate: Int? = null, - eventGroupId: Int? = null, + eventGroupId: UserId? = null, publicCategory: Int? = null, publicSubcategory: Int? = null, publicDate: String? = null, @@ -418,7 +422,7 @@ class GroupsService { messages: Boolean? = null, articles: Boolean? = null, addresses: Boolean? = null, - ageLimits: AgeLimitsParam? = null, + ageLimits: GroupsEditAgeLimits? = null, market: Boolean? = null, marketComments: Boolean? = null, marketCountry: List? = null, @@ -502,7 +506,7 @@ class GroupsService { * @return [VKRequest] with [GroupsAddress] */ fun groupsEditAddress( - groupId: Int, + groupId: UserId, addressId: Int, title: String? = null, address: String? = null, @@ -513,7 +517,7 @@ class GroupsService { latitude: Float? = null, longitude: Float? = null, phone: String? = null, - workInfoStatus: WorkInfoStatusParam? = null, + workInfoStatus: GroupsEditAddressWorkInfoStatus? = null, timetable: String? = null, isMainAddress: Boolean? = null ): VKRequest = NewApiRequest("groups.editAddress") { @@ -545,7 +549,7 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsEditCallbackServer( - groupId: Int, + groupId: UserId, serverId: Int, url: String, title: String, @@ -570,7 +574,7 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsEditLink( - groupId: Int, + groupId: UserId, linkId: Int, text: String? = null ): VKRequest = NewApiRequest("groups.editLink") { @@ -587,7 +591,7 @@ class GroupsService { * * @param groupId - Community ID. * @param userId - User ID. - * @param role - Manager role. Possible values: *'moderator',, *'editor',, *'administrator',, + * @param role - Manager role. Possible values_ *'moderator',, *'editor',, *'administrator',, * *'advertiser'. * @param isContact - '1' - to show the manager in Contacts block of the community. * @param contactPosition - Position to show in Contacts block. @@ -596,8 +600,8 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsEditManager( - groupId: Int, - userId: Int, + groupId: UserId, + userId: UserId, role: String? = null, isContact: Boolean? = null, contactPosition: String? = null, @@ -620,7 +624,7 @@ class GroupsService { * @param groupId * @return [VKRequest] with [BaseOkResponse] */ - fun groupsEnableOnline(groupId: Int): VKRequest = + fun groupsEnableOnline(groupId: UserId): VKRequest = NewApiRequest("groups.enableOnline") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -632,7 +636,7 @@ class GroupsService { * Returns a list of the communities to which a user belongs. * * @param userId - User ID. - * @param filter - Types of communities to return: 'admin' - to return communities administered + * @param filter - Types of communities to return_ 'admin' - to return communities administered * by the user , 'editor' - to return communities where the user is an administrator or editor, * 'moder' - to return communities where the user is an administrator, editor, or moderator, * 'groups' - to return only groups, 'publics' - to return only public pages, 'events' - to return @@ -643,7 +647,7 @@ class GroupsService { * @return [VKRequest] with [GroupsGetResponse] */ fun groupsGet( - userId: Int? = null, + userId: UserId? = null, filter: List? = null, fields: List? = null, offset: Int? = null, @@ -669,7 +673,7 @@ class GroupsService { * Returns a list of the communities to which a user belongs. * * @param userId - User ID. - * @param filter - Types of communities to return: 'admin' - to return communities administered + * @param filter - Types of communities to return_ 'admin' - to return communities administered * by the user , 'editor' - to return communities where the user is an administrator or editor, * 'moder' - to return communities where the user is an administrator, editor, or moderator, * 'groups' - to return only groups, 'publics' - to return only public pages, 'events' - to return @@ -677,16 +681,16 @@ class GroupsService { * @param fields - Profile fields to return. * @param offset - Offset needed to return a specific subset of communities. * @param count - Number of communities to return. - * @return [VKRequest] with [GroupsGetExtendedResponse] + * @return [VKRequest] with [GroupsGetObjectExtendedResponse] */ fun groupsGetExtended( - userId: Int? = null, + userId: UserId? = null, filter: List? = null, fields: List? = null, offset: Int? = null, count: Int? = null - ): VKRequest = NewApiRequest("groups.get") { - GsonHolder.gson.fromJson(it, GroupsGetExtendedResponse::class.java) + ): VKRequest = NewApiRequest("groups.get") { + GsonHolder.gson.fromJson(it, GroupsGetObjectExtendedResponse::class.java) } .apply { userId?.let { addParam("user_id", it) } @@ -716,7 +720,7 @@ class GroupsService { * @return [VKRequest] with [GroupsGetAddressesResponse] */ fun groupsGetAddresses( - groupId: Int, + groupId: UserId, addressIds: List? = null, latitude: Float? = null, longitude: Float? = null, @@ -750,11 +754,11 @@ class GroupsService { * @return [VKRequest] with [GroupsGetBannedResponse] */ fun groupsGetBanned( - groupId: Int, + groupId: UserId, offset: Int? = null, count: Int? = null, fields: List? = null, - ownerId: Int? = null + ownerId: UserId? = null ): VKRequest = NewApiRequest("groups.getBanned") { GsonHolder.gson.fromJson(it, GroupsGetBannedResponse::class.java) } @@ -800,7 +804,7 @@ class GroupsService { * @param groupId - Community ID. * @return [VKRequest] with [GroupsGetCallbackConfirmationCodeResponse] */ - fun groupsGetCallbackConfirmationCode(groupId: Int): + fun groupsGetCallbackConfirmationCode(groupId: UserId): VKRequest = NewApiRequest("groups.getCallbackConfirmationCode") { GsonHolder.gson.fromJson(it, GroupsGetCallbackConfirmationCodeResponse::class.java) @@ -814,7 +818,7 @@ class GroupsService { * @param serverIds * @return [VKRequest] with [GroupsGetCallbackServersResponse] */ - fun groupsGetCallbackServers(groupId: Int, serverIds: List? = null): + fun groupsGetCallbackServers(groupId: UserId, serverIds: List? = null): VKRequest = NewApiRequest("groups.getCallbackServers") { GsonHolder.gson.fromJson(it, GroupsGetCallbackServersResponse::class.java) @@ -831,7 +835,7 @@ class GroupsService { * @param serverId - Server ID. * @return [VKRequest] with [GroupsCallbackSettings] */ - fun groupsGetCallbackSettings(groupId: Int, serverId: Int? = null): + fun groupsGetCallbackSettings(groupId: UserId, serverId: Int? = null): VKRequest = NewApiRequest("groups.getCallbackSettings") { GsonHolder.gson.fromJson(it, GroupsCallbackSettings::class.java) } @@ -861,7 +865,7 @@ class GroupsService { /** * Returns categories list for communities catalog * - * @param subcategories - 1 - to return subcategories info. By default: 0. + * @param subcategories - 1 - to return subcategories info. By default_ 0. * @return [VKRequest] with [GroupsGetCatalogInfoResponse] */ fun groupsGetCatalogInfo(subcategories: Boolean? = null): @@ -875,7 +879,7 @@ class GroupsService { /** * Returns categories list for communities catalog * - * @param subcategories - 1 - to return subcategories info. By default: 0. + * @param subcategories - 1 - to return subcategories info. By default_ 0. * @return [VKRequest] with [GroupsGetCatalogInfoExtendedResponse] */ fun groupsGetCatalogInfoExtended(subcategories: Boolean? = null): @@ -894,22 +898,22 @@ class GroupsService { * @param groupId - Group ID to return invited users for. * @param offset - Offset needed to return a specific subset of results. * @param count - Number of results to return. - * @param fields - List of additional fields to be returned. Available values: 'sex, bdate, + * @param fields - List of additional fields to be returned. Available values_ 'sex, bdate, * city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, * photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, * education, universities, schools, can_post, can_see_all_posts, can_see_audio, * can_write_private_message, status, last_seen, common_count, relation, relatives, counters'. - * @param nameCase - Case for declension of user name and surname. Possible values: *'nom' - + * @param nameCase - Case for declension of user name and surname. Possible values_ *'nom' - * nominative (default),, *'gen' - genitive,, *'dat' - dative,, *'acc' - accusative, , *'ins' - * instrumental,, *'abl' - prepositional. * @return [VKRequest] with [GroupsGetInvitedUsersResponse] */ fun groupsGetInvitedUsers( - groupId: Int, + groupId: UserId, offset: Int? = null, count: Int? = null, fields: List? = null, - nameCase: NameCaseParam? = null + nameCase: GroupsGetInvitedUsersNameCase? = null ): VKRequest = NewApiRequest("groups.getInvitedUsers") { GsonHolder.gson.fromJson(it, GroupsGetInvitedUsersResponse::class.java) } @@ -963,7 +967,7 @@ class GroupsService { * @param groupId - Community ID * @return [VKRequest] with [GroupsLongPollServer] */ - fun groupsGetLongPollServer(groupId: Int): VKRequest = + fun groupsGetLongPollServer(groupId: UserId): VKRequest = NewApiRequest("groups.getLongPollServer") { GsonHolder.gson.fromJson(it, GroupsLongPollServer::class.java) } @@ -977,7 +981,7 @@ class GroupsService { * @param groupId - Community ID. * @return [VKRequest] with [GroupsLongPollSettings] */ - fun groupsGetLongPollSettings(groupId: Int): VKRequest = + fun groupsGetLongPollSettings(groupId: UserId): VKRequest = NewApiRequest("groups.getLongPollSettings") { GsonHolder.gson.fromJson(it, GroupsLongPollSettings::class.java) } @@ -989,12 +993,12 @@ class GroupsService { * Returns a list of community members. * * @param groupId - ID or screen name of the community. - * @param sort - Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', 'time_desc'. + * @param sort - Sort order. Available values_ 'id_asc', 'id_desc', 'time_asc', 'time_desc'. * 'time_asc' and 'time_desc' are availavle only if the method is called by the group's * 'moderator'. * @param offset - Offset needed to return a specific subset of community members. * @param count - Number of community members to return. - * @param fields - List of additional fields to be returned. Available values: 'sex, bdate, + * @param fields - List of additional fields to be returned. Available values_ 'sex, bdate, * city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, * photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, * education, universities, schools, can_post, can_see_all_posts, can_see_audio, @@ -1005,11 +1009,11 @@ class GroupsService { */ fun groupsGetMembers( groupId: String? = null, - sort: SortParam? = null, + sort: GroupsGetMembersSort? = null, offset: Int? = null, count: Int? = null, fields: List? = null, - filter: FilterParam? = null + filter: GroupsGetMembersFilter? = null ): VKRequest = NewApiRequest("groups.getMembers") { GsonHolder.gson.fromJson(it, GroupsGetMembersFieldsResponse::class.java) } @@ -1029,7 +1033,7 @@ class GroupsService { * @param groupId * @return [VKRequest] with [Unit] */ - fun groupsGetOnlineStatus(groupId: Int): VKRequest = + fun groupsGetOnlineStatus(groupId: UserId): VKRequest = NewApiRequest("groups.getOnlineStatus") { } .apply { @@ -1046,7 +1050,7 @@ class GroupsService { * @return [VKRequest] with [GroupsGetRequestsFieldsResponse] */ fun groupsGetRequests( - groupId: Int, + groupId: UserId, offset: Int? = null, count: Int? = null, fields: List? = null @@ -1069,7 +1073,7 @@ class GroupsService { * @param groupId - Community ID. * @return [VKRequest] with [GroupsGetSettingsResponse] */ - fun groupsGetSettings(groupId: Int): VKRequest = + fun groupsGetSettings(groupId: UserId): VKRequest = NewApiRequest("groups.getSettings") { GsonHolder.gson.fromJson(it, GroupsGetSettingsResponse::class.java) } @@ -1083,7 +1087,7 @@ class GroupsService { * @param groupId * @return [VKRequest] with [Unit] */ - fun groupsGetTagList(groupId: Int): VKRequest> = + fun groupsGetTagList(groupId: UserId): VKRequest> = NewApiRequest("groups.getTagList") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -1107,7 +1111,7 @@ class GroupsService { * @param userId - User ID. * @return [VKRequest] with [BaseOkResponse] */ - fun groupsInvite(groupId: Int, userId: Int): VKRequest = + fun groupsInvite(groupId: UserId, userId: UserId): VKRequest = NewApiRequest("groups.invite") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1126,7 +1130,7 @@ class GroupsService { */ fun groupsIsMember( groupId: String, - userId: Int? = null, + userId: UserId? = null, userIds: List? = null ): VKRequest = NewApiRequest("groups.isMember") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) @@ -1143,10 +1147,10 @@ class GroupsService { * * @param groupId - ID or screen name of the community. * @param notSure - Optional parameter which is taken into account when 'gid' belongs to the - * event: '1' - Perhaps I will attend, '0' - I will be there for sure (default), , + * event_ '1' - Perhaps I will attend, '0' - I will be there for sure (default), , * @return [VKRequest] with [BaseOkResponse] */ - fun groupsJoin(groupId: Int? = null, notSure: String? = null): VKRequest = + fun groupsJoin(groupId: UserId? = null, notSure: String? = null): VKRequest = NewApiRequest("groups.join") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1161,7 +1165,7 @@ class GroupsService { * @param groupId - ID or screen name of the community. * @return [VKRequest] with [BaseOkResponse] */ - fun groupsLeave(groupId: Int): VKRequest = NewApiRequest("groups.leave") { + fun groupsLeave(groupId: UserId): VKRequest = NewApiRequest("groups.leave") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { @@ -1175,7 +1179,7 @@ class GroupsService { * @param userId - User ID. * @return [VKRequest] with [BaseOkResponse] */ - fun groupsRemoveUser(groupId: Int, userId: Int): VKRequest = + fun groupsRemoveUser(groupId: UserId, userId: UserId): VKRequest = NewApiRequest("groups.removeUser") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1193,7 +1197,7 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsReorderLink( - groupId: Int, + groupId: UserId, linkId: Int, after: Int? = null ): VKRequest = NewApiRequest("groups.reorderLink") { @@ -1209,12 +1213,12 @@ class GroupsService { * Returns a list of communities matching the search criteria. * * @param q - Search query string. - * @param type - Community type. Possible values: 'group, page, event.' + * @param type - Community type. Possible values_ 'group, page, event.' * @param countryId - Country ID. * @param cityId - City ID. If this parameter is transmitted, country_id is ignored. * @param future - '1' - to return only upcoming events. Works with the 'type' = 'event' only. * @param market - '1' - to return communities with enabled market only. - * @param sort - Sort order. Possible values: *'0' - default sorting (similar the full version + * @param sort - Sort order. Possible values_ *'0' - default sorting (similar the full version * of the site),, *'1' - by growth speed,, *'2'- by the "day attendance/members number" ratio,, * *'3' - by the "Likes number/members number" ratio,, *'4' - by the "comments number/members * number" ratio,, *'5' - by the "boards entries number/members number" ratio. @@ -1225,12 +1229,12 @@ class GroupsService { */ fun groupsSearch( q: String, - type: TypeParam? = null, + type: GroupsSearchType? = null, countryId: Int? = null, cityId: Int? = null, future: Boolean? = null, market: Boolean? = null, - sort: SortParam? = null, + sort: GroupsSearchSort? = null, offset: Int? = null, count: Int? = null ): VKRequest = NewApiRequest("groups.search") { @@ -1315,7 +1319,7 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsSetCallbackSettings( - groupId: Int, + groupId: UserId, serverId: Int? = null, apiVersion: String? = null, messageNew: Boolean? = null, @@ -1495,7 +1499,7 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsSetLongPollSettings( - groupId: Int, + groupId: UserId, enabled: Boolean? = null, apiVersion: String? = null, messageNew: Boolean? = null, @@ -1614,7 +1618,7 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsSetSettings( - groupId: Int, + groupId: UserId, messages: Boolean? = null, botsCapabilities: Boolean? = null, botsStartButton: Boolean? = null, @@ -1639,8 +1643,8 @@ class GroupsService { * @return [VKRequest] with [BaseBoolInt] */ fun groupsSetUserNote( - groupId: Int, - userId: Int, + groupId: UserId, + userId: UserId, note: String? = null ): VKRequest = NewApiRequest("groups.setUserNote") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) @@ -1660,9 +1664,9 @@ class GroupsService { * @return [VKRequest] with [BaseBoolInt] */ fun groupsTagAdd( - groupId: Int, + groupId: UserId, tagName: String, - tagColor: TagColorParam? = null + tagColor: GroupsTagAddTagColor? = null ): VKRequest = NewApiRequest("groups.tagAdd") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -1682,10 +1686,10 @@ class GroupsService { * @return [VKRequest] with [BaseBoolInt] */ fun groupsTagBind( - groupId: Int, + groupId: UserId, tagId: Int, - userId: Int, - act: ActParam + userId: UserId, + act: GroupsTagBindAct ): VKRequest = NewApiRequest("groups.tagBind") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -1703,7 +1707,7 @@ class GroupsService { * @param tagId * @return [VKRequest] with [BaseBoolInt] */ - fun groupsTagDelete(groupId: Int, tagId: Int): VKRequest = + fun groupsTagDelete(groupId: UserId, tagId: Int): VKRequest = NewApiRequest("groups.tagDelete") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -1721,7 +1725,7 @@ class GroupsService { * @return [VKRequest] with [BaseBoolInt] */ fun groupsTagUpdate( - groupId: Int, + groupId: UserId, tagId: Int, tagName: String ): VKRequest = NewApiRequest("groups.tagUpdate") { @@ -1740,8 +1744,8 @@ class GroupsService { * @return [VKRequest] with [BaseOkResponse] */ fun groupsToggleMarket( - groupId: Int, - state: StateParam, + groupId: UserId, + state: GroupsToggleMarketState, ref: String? = null ): VKRequest = NewApiRequest("groups.toggleMarket") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) @@ -1757,7 +1761,7 @@ class GroupsService { * @param ownerId * @return [VKRequest] with [BaseOkResponse] */ - fun groupsUnban(groupId: Int, ownerId: Int? = null): VKRequest = + fun groupsUnban(groupId: UserId, ownerId: UserId? = null): VKRequest = NewApiRequest("groups.unban") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/WorkInfoStatusParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddAddressWorkInfoStatus.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/groups/dto/WorkInfoStatusParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddAddressWorkInfoStatus.kt index da63d5f8ab..c55f505444 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/WorkInfoStatusParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAddAddressWorkInfoStatus.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class WorkInfoStatusParam( +enum class GroupsAddAddressWorkInfoStatus( val value: String ) { @SerializedName("always_opened") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAppButton.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAppButton.kt deleted file mode 100644 index fe634115ce..0000000000 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsAppButton.kt +++ /dev/null @@ -1,48 +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. -*/ -// ********************************************************************* -// THIS FILE IS AUTO GENERATED! -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. -// ********************************************************************* -package com.vk.sdk.api.groups.dto - -import com.google.gson.annotations.SerializedName -import com.vk.sdk.api.base.dto.BaseImage -import kotlin.Int -import kotlin.String -import kotlin.collections.List - -/** - * @param title - * @param appId - * @param images - images - */ -data class GroupsAppButton( - @SerializedName("title") - val title: String? = null, - @SerializedName("app_id") - val appId: Int? = null, - @SerializedName("images") - val images: List? = null -) diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCountersGroup.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCountersGroup.kt index 71d4a0e61f..c1436ecab5 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCountersGroup.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCountersGroup.kt @@ -46,7 +46,6 @@ import kotlin.Int * @param narratives - Narratives number * @param clips - Clips number * @param clipsFollowers - Clips followers number - * @param classifiedYoula - Classified youla number */ data class GroupsCountersGroup( @SerializedName("addresses") @@ -78,7 +77,5 @@ data class GroupsCountersGroup( @SerializedName("clips") val clips: Int? = null, @SerializedName("clips_followers") - val clipsFollowers: Int? = null, - @SerializedName("classified_youla") - val classifiedYoula: Int? = null + val clipsFollowers: Int? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/SubtypeParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCreateSubtype.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/groups/dto/SubtypeParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCreateSubtype.kt index 42601c8260..24c7ccf7e7 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/SubtypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCreateSubtype.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class SubtypeParam( +enum class GroupsCreateSubtype( val value: Int ) { @SerializedName("1") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/TypeParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCreateType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/groups/dto/TypeParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCreateType.kt index 63a0b6adee..49c77f99af 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/TypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsCreateType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class TypeParam( +enum class GroupsCreateType( val value: String ) { @SerializedName("event") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsEditAddressWorkInfoStatus.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsEditAddressWorkInfoStatus.kt new file mode 100644 index 0000000000..8821195870 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsEditAddressWorkInfoStatus.kt @@ -0,0 +1,50 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class GroupsEditAddressWorkInfoStatus( + val value: String +) { + @SerializedName("always_opened") + ALWAYS_OPENED("always_opened"), + + @SerializedName("forever_closed") + FOREVER_CLOSED("forever_closed"), + + @SerializedName("no_information") + NO_INFORMATION("no_information"), + + @SerializedName("temporarily_closed") + TEMPORARILY_CLOSED("temporarily_closed"), + + @SerializedName("timetable") + TIMETABLE("timetable"); +} diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/AgeLimitsParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsEditAgeLimits.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/groups/dto/AgeLimitsParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsEditAgeLimits.kt index 86923485fa..f04c81d6bb 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/AgeLimitsParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsEditAgeLimits.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class AgeLimitsParam( +enum class GroupsEditAgeLimits( val value: Int ) { @SerializedName("1") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/NameCaseParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitedUsersNameCase.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/groups/dto/NameCaseParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitedUsersNameCase.kt index 7fd4941471..d6d7e325e4 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/NameCaseParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetInvitedUsersNameCase.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class NameCaseParam( +enum class GroupsGetInvitedUsersNameCase( val value: String ) { @SerializedName("nom") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/FilterParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetMembersFilter.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/groups/dto/FilterParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetMembersFilter.kt index 31b5bad7d1..d43f1a25da 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/FilterParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetMembersFilter.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FilterParam( +enum class GroupsGetMembersFilter( val value: String ) { @SerializedName("friends") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetMembersSort.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/groups/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetMembersSort.kt index 5a82c7e758..0d682a6f77 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetMembersSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SortParam( +enum class GroupsGetMembersSort( val value: String ) { @SerializedName("id_asc") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetExtendedResponse.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetObjectExtendedResponse.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetExtendedResponse.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetObjectExtendedResponse.kt index a72cfad670..1c2e8859c5 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetExtendedResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGetObjectExtendedResponse.kt @@ -35,7 +35,7 @@ import kotlin.collections.List * @param count - Total communities number * @param items */ -data class GroupsGetExtendedResponse( +data class GroupsGetObjectExtendedResponse( @SerializedName("count") val count: Int, @SerializedName("items") 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 b5aaa2f3b5..fb9882d303 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 @@ -31,10 +31,8 @@ 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.video.dto.VideoLiveInfo -import kotlin.Boolean import kotlin.Int import kotlin.String -import kotlin.collections.List /** * @param id - Community ID @@ -60,13 +58,8 @@ import kotlin.collections.List * @param estDate - Established date * @param publicDateLabel - Public date label * @param photoMaxSize - * @param appButton - * @param appButtons * @param isVideoLiveNotificationsBlocked * @param videoLive - * @param hadTorch - * @param audioArtistId - * @param audioCuratorId */ data class GroupsGroup( @SerializedName("id") @@ -115,18 +108,8 @@ data class GroupsGroup( val publicDateLabel: String? = null, @SerializedName("photo_max_size") val photoMaxSize: GroupsPhotoSize? = null, - @SerializedName("app_button") - val appButton: GroupsAppButton? = null, - @SerializedName("app_buttons") - val appButtons: List? = null, @SerializedName("is_video_live_notifications_blocked") val isVideoLiveNotificationsBlocked: BaseBoolInt? = null, @SerializedName("video_live") - val videoLive: VideoLiveInfo? = null, - @SerializedName("had_torch") - val hadTorch: Boolean? = null, - @SerializedName("audio_artist_id") - val audioArtistId: String? = null, - @SerializedName("audio_curator_id") - val audioCuratorId: Int? = null + val videoLive: VideoLiveInfo? = null ) 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 04531f4ddb..e0838677ae 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 @@ -122,13 +122,8 @@ import kotlin.collections.List * @param estDate - Established date * @param publicDateLabel - Public date label * @param photoMaxSize - * @param appButton - * @param appButtons * @param isVideoLiveNotificationsBlocked * @param videoLive - * @param hadTorch - * @param audioArtistId - * @param audioCuratorId */ data class GroupsGroupFull( @SerializedName("market") @@ -289,20 +284,10 @@ data class GroupsGroupFull( val publicDateLabel: String? = null, @SerializedName("photo_max_size") val photoMaxSize: GroupsPhotoSize? = null, - @SerializedName("app_button") - val appButton: GroupsAppButton? = null, - @SerializedName("app_buttons") - val appButtons: List? = null, @SerializedName("is_video_live_notifications_blocked") val isVideoLiveNotificationsBlocked: BaseBoolInt? = null, @SerializedName("video_live") - val videoLive: VideoLiveInfo? = null, - @SerializedName("had_torch") - val hadTorch: Boolean? = null, - @SerializedName("audio_artist_id") - val audioArtistId: String? = null, - @SerializedName("audio_curator_id") - val audioCuratorId: Int? = null + val videoLive: VideoLiveInfo? = null ) { enum class Wall( val value: Int diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupLink.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupLink.kt deleted file mode 100644 index c2edb4e98b..0000000000 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsGroupLink.kt +++ /dev/null @@ -1,56 +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. -*/ -// ********************************************************************* -// THIS FILE IS AUTO GENERATED! -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. -// ********************************************************************* -package com.vk.sdk.api.groups.dto - -import com.google.gson.annotations.SerializedName -import com.vk.sdk.api.base.dto.BaseBoolInt -import kotlin.Int -import kotlin.String - -/** - * @param name - Link label - * @param desc - Link description - * @param editTitle - Information whether the title can be edited - * @param id - Link ID - * @param imageProcessing - Information whether the image on processing - * @param url - Link URL - */ -data class GroupsGroupLink( - @SerializedName("name") - val name: String? = null, - @SerializedName("desc") - val desc: String? = null, - @SerializedName("edit_title") - val editTitle: BaseBoolInt? = null, - @SerializedName("id") - val id: Int? = null, - @SerializedName("image_processing") - val imageProcessing: BaseBoolInt? = null, - @SerializedName("url") - val url: String? = null -) diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLinksItem.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLinksItem.kt index 1ddb5053df..ca83733cdb 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLinksItem.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsLinksItem.kt @@ -33,24 +33,24 @@ import kotlin.Int import kotlin.String /** + * @param name - Link title * @param desc - Link description * @param editTitle - Information whether the link title can be edited * @param id - Link ID - * @param name - Link title * @param photo100 - URL of square image of the link with 100 pixels in width * @param photo50 - URL of square image of the link with 50 pixels in width * @param url - Link URL * @param imageProcessing - Information whether the image on processing */ data class GroupsLinksItem( + @SerializedName("name") + val name: String? = null, @SerializedName("desc") val desc: String? = null, @SerializedName("edit_title") val editTitle: BaseBoolInt? = null, @SerializedName("id") val id: Int? = null, - @SerializedName("name") - val name: String? = null, @SerializedName("photo_100") val photo100: String? = null, @SerializedName("photo_50") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsMarketInfo.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsMarketInfo.kt index aa1313096a..f715718731 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsMarketInfo.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsMarketInfo.kt @@ -31,7 +31,6 @@ import com.google.gson.annotations.SerializedName import com.vk.sdk.api.base.dto.BaseBoolInt import com.vk.sdk.api.market.dto.MarketCurrency import com.vk.sdk.api.market.dto.MarketPrice -import com.vk.sdk.api.pages.dto.PagesWikipageFull import kotlin.Int import kotlin.String @@ -45,7 +44,6 @@ import kotlin.String * @param priceMax - Maximum price * @param priceMin - Minimum price * @param minOrderPrice - * @param wiki */ data class GroupsMarketInfo( @SerializedName("type") @@ -65,7 +63,5 @@ data class GroupsMarketInfo( @SerializedName("price_min") val priceMin: String? = null, @SerializedName("min_order_price") - val minOrderPrice: MarketPrice? = null, - @SerializedName("wiki") - val wiki: PagesWikipageFull? = null + val minOrderPrice: MarketPrice? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchSort.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchSort.kt new file mode 100644 index 0000000000..dfa43460da --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchSort.kt @@ -0,0 +1,53 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class GroupsSearchSort( + val value: Int +) { + @SerializedName("0") + DEFAULT(0), + + @SerializedName("1") + GROWTH(1), + + @SerializedName("2") + ATTENDANCE(2), + + @SerializedName("3") + LIKES(3), + + @SerializedName("4") + COMMENTS(4), + + @SerializedName("5") + ENTRIES(5); +} diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchType.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchType.kt new file mode 100644 index 0000000000..6ce25b4280 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsSearchType.kt @@ -0,0 +1,44 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.groups.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class GroupsSearchType( + val value: String +) { + @SerializedName("group") + GROUP("group"), + + @SerializedName("page") + PAGE("page"), + + @SerializedName("event") + EVENT("event"); +} diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/TagColorParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTagAddTagColor.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/groups/dto/TagColorParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTagAddTagColor.kt index 533bd91785..f9bf0d03d4 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/TagColorParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTagAddTagColor.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class TagColorParam( +enum class GroupsTagAddTagColor( val value: String ) { @SerializedName("454647") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/ActParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTagBindAct.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/groups/dto/ActParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTagBindAct.kt index b1252a1911..242a2264b5 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/ActParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsTagBindAct.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class ActParam( +enum class GroupsTagBindAct( val value: String ) { @SerializedName("bind") diff --git a/api/src/main/java/com/vk/sdk/api/groups/dto/StateParam.kt b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsToggleMarketState.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/groups/dto/StateParam.kt rename to api/src/main/java/com/vk/sdk/api/groups/dto/GroupsToggleMarketState.kt index 1642b474f8..feab037dbd 100644 --- a/api/src/main/java/com/vk/sdk/api/groups/dto/StateParam.kt +++ b/api/src/main/java/com/vk/sdk/api/groups/dto/GroupsToggleMarketState.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.groups.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class StateParam( +enum class GroupsToggleMarketState( val value: String ) { @SerializedName("advanced") 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 a30c3dee24..5dd9e5c0a2 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 @@ -28,13 +28,16 @@ package com.vk.sdk.api.likes 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.likes.dto.FilterParam -import com.vk.sdk.api.likes.dto.FriendsOnlyParam import com.vk.sdk.api.likes.dto.LikesAddResponse import com.vk.sdk.api.likes.dto.LikesDeleteResponse +import com.vk.sdk.api.likes.dto.LikesGetListExtendedFilter +import com.vk.sdk.api.likes.dto.LikesGetListExtendedFriendsOnly import com.vk.sdk.api.likes.dto.LikesGetListExtendedResponse +import com.vk.sdk.api.likes.dto.LikesGetListFilter +import com.vk.sdk.api.likes.dto.LikesGetListFriendsOnly import com.vk.sdk.api.likes.dto.LikesGetListResponse import com.vk.sdk.api.likes.dto.LikesIsLikedResponse import kotlin.Boolean @@ -45,7 +48,7 @@ class LikesService { /** * Adds the specified object to the 'Likes' list of the current user. * - * @param type - Object type: 'post' - post on user or community wall, 'comment' - comment on a + * @param type - Object type_ 'post' - post on user or community wall, 'comment' - comment on a * wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the * discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed @@ -57,7 +60,7 @@ class LikesService { fun likesAdd( type: String, itemId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, accessKey: String? = null ): VKRequest = NewApiRequest("likes.add") { GsonHolder.gson.fromJson(it, LikesAddResponse::class.java) @@ -72,7 +75,7 @@ class LikesService { /** * Deletes the specified object from the 'Likes' list of the current user. * - * @param type - Object type: 'post' - post on user or community wall, 'comment' - comment on a + * @param type - Object type_ 'post' - post on user or community wall, 'comment' - comment on a * wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the * discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed @@ -84,7 +87,7 @@ class LikesService { fun likesDelete( type: String, itemId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, accessKey: String? = null ): VKRequest = NewApiRequest("likes.delete") { GsonHolder.gson.fromJson(it, LikesDeleteResponse::class.java) @@ -99,7 +102,7 @@ class LikesService { /** * Returns a list of IDs of users who added the specified object to their 'Likes' list. * - * @param type - , Object type: 'post' - post on user or community wall, 'comment' - comment on + * @param type - , Object type_ 'post' - post on user or community wall, 'comment' - comment on * a wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the * discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed @@ -112,10 +115,10 @@ class LikesService { * 'page_id' parameter value used during initialization of the [vk.com/dev/Like|Like widget]. * @param pageUrl - URL of the page where the [vk.com/dev/Like|Like widget] is installed. Used * instead of the 'item_id' parameter. - * @param filter - Filters to apply: 'likes' - returns information about all users who liked the + * @param filter - Filters to apply_ 'likes' - returns information about all users who liked the * object (default), 'copies' - returns information only about users who told their friends about * the object - * @param friendsOnly - Specifies which users are returned: '1' - to return only the current + * @param friendsOnly - Specifies which users are returned_ '1' - to return only the current * user's friends, '0' - to return all users (default) * @param offset - Offset needed to select a specific subset of users. * @param count - Number of user IDs to return (maximum '1000'). Default is '100' if @@ -125,11 +128,11 @@ class LikesService { */ fun likesGetList( type: String, - ownerId: Int? = null, + ownerId: UserId? = null, itemId: Int? = null, pageUrl: String? = null, - filter: FilterParam? = null, - friendsOnly: FriendsOnlyParam? = null, + filter: LikesGetListFilter? = null, + friendsOnly: LikesGetListFriendsOnly? = null, offset: Int? = null, count: Int? = null, skipOwn: Boolean? = null @@ -151,7 +154,7 @@ class LikesService { /** * Returns a list of IDs of users who added the specified object to their 'Likes' list. * - * @param type - , Object type: 'post' - post on user or community wall, 'comment' - comment on + * @param type - , Object type_ 'post' - post on user or community wall, 'comment' - comment on * a wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the * discussion, 'sitepage' - page of the site where the [vk.com/dev/Like|Like widget] is installed @@ -164,10 +167,10 @@ class LikesService { * 'page_id' parameter value used during initialization of the [vk.com/dev/Like|Like widget]. * @param pageUrl - URL of the page where the [vk.com/dev/Like|Like widget] is installed. Used * instead of the 'item_id' parameter. - * @param filter - Filters to apply: 'likes' - returns information about all users who liked the + * @param filter - Filters to apply_ 'likes' - returns information about all users who liked the * object (default), 'copies' - returns information only about users who told their friends about * the object - * @param friendsOnly - Specifies which users are returned: '1' - to return only the current + * @param friendsOnly - Specifies which users are returned_ '1' - to return only the current * user's friends, '0' - to return all users (default) * @param offset - Offset needed to select a specific subset of users. * @param count - Number of user IDs to return (maximum '1000'). Default is '100' if @@ -177,11 +180,11 @@ class LikesService { */ fun likesGetListExtended( type: String, - ownerId: Int? = null, + ownerId: UserId? = null, itemId: Int? = null, pageUrl: String? = null, - filter: FilterParam? = null, - friendsOnly: FriendsOnlyParam? = null, + filter: LikesGetListExtendedFilter? = null, + friendsOnly: LikesGetListExtendedFriendsOnly? = null, offset: Int? = null, count: Int? = null, skipOwn: Boolean? = null @@ -204,7 +207,7 @@ class LikesService { /** * Checks for the object in the 'Likes' list of the specified user. * - * @param type - Object type: 'post' - post on user or community wall, 'comment' - comment on a + * @param type - Object type_ 'post' - post on user or community wall, 'comment' - comment on a * wall post, 'photo' - photo, 'audio' - audio, 'video' - video, 'note' - note, 'photo_comment' - * comment on the photo, 'video_comment' - comment on the video, 'topic_comment' - comment in the * discussion @@ -216,8 +219,8 @@ class LikesService { fun likesIsLiked( type: String, itemId: Int, - userId: Int? = null, - ownerId: Int? = null + userId: UserId? = null, + ownerId: UserId? = null ): VKRequest = NewApiRequest("likes.isLiked") { GsonHolder.gson.fromJson(it, LikesIsLikedResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedFilter.kt b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedFilter.kt new file mode 100644 index 0000000000..a8fbaaae8b --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedFilter.kt @@ -0,0 +1,41 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.likes.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class LikesGetListExtendedFilter( + val value: String +) { + @SerializedName("likes") + LIKES("likes"), + + @SerializedName("copies") + COPIES("copies"); +} diff --git a/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedFriendsOnly.kt b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedFriendsOnly.kt new file mode 100644 index 0000000000..031616d0ca --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListExtendedFriendsOnly.kt @@ -0,0 +1,47 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.likes.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class LikesGetListExtendedFriendsOnly( + val value: Int +) { + @SerializedName("0") + ZERO_(0), + + @SerializedName("1") + ONE_(1), + + @SerializedName("2") + TWO_(2), + + @SerializedName("3") + THREE_(3); +} diff --git a/api/src/main/java/com/vk/sdk/api/likes/dto/FilterParam.kt b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListFilter.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/likes/dto/FilterParam.kt rename to api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListFilter.kt index 41517f5d23..eae31d1876 100644 --- a/api/src/main/java/com/vk/sdk/api/likes/dto/FilterParam.kt +++ b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListFilter.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.likes.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FilterParam( +enum class LikesGetListFilter( val value: String ) { @SerializedName("likes") diff --git a/api/src/main/java/com/vk/sdk/api/likes/dto/FriendsOnlyParam.kt b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListFriendsOnly.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/likes/dto/FriendsOnlyParam.kt rename to api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListFriendsOnly.kt index 9d4e3222c5..662d039d57 100644 --- a/api/src/main/java/com/vk/sdk/api/likes/dto/FriendsOnlyParam.kt +++ b/api/src/main/java/com/vk/sdk/api/likes/dto/LikesGetListFriendsOnly.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.likes.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class FriendsOnlyParam( +enum class LikesGetListFriendsOnly( val value: Int ) { @SerializedName("0") 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 44b6c10a0d..9e772840e0 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 @@ -28,18 +28,21 @@ package com.vk.sdk.api.market 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.market.dto.MarketAddAlbumResponse import com.vk.sdk.api.market.dto.MarketAddResponse +import com.vk.sdk.api.market.dto.MarketEditOrderPaymentStatus import com.vk.sdk.api.market.dto.MarketGetAlbumByIdResponse import com.vk.sdk.api.market.dto.MarketGetAlbumsResponse import com.vk.sdk.api.market.dto.MarketGetByIdExtendedResponse import com.vk.sdk.api.market.dto.MarketGetByIdResponse import com.vk.sdk.api.market.dto.MarketGetCategoriesResponse import com.vk.sdk.api.market.dto.MarketGetCommentsResponse +import com.vk.sdk.api.market.dto.MarketGetCommentsSort import com.vk.sdk.api.market.dto.MarketGetExtendedResponse import com.vk.sdk.api.market.dto.MarketGetGroupOrdersResponse import com.vk.sdk.api.market.dto.MarketGetOrderByIdResponse @@ -47,13 +50,16 @@ import com.vk.sdk.api.market.dto.MarketGetOrderItemsResponse import com.vk.sdk.api.market.dto.MarketGetOrdersExtendedResponse import com.vk.sdk.api.market.dto.MarketGetOrdersResponse import com.vk.sdk.api.market.dto.MarketGetResponse +import com.vk.sdk.api.market.dto.MarketReportCommentReason +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.MarketSearchResponse -import com.vk.sdk.api.market.dto.PaymentStatusParam -import com.vk.sdk.api.market.dto.ReasonParam -import com.vk.sdk.api.market.dto.RevParam -import com.vk.sdk.api.market.dto.SortParam -import com.vk.sdk.api.market.dto.StatusParam +import com.vk.sdk.api.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 @@ -83,7 +89,7 @@ class MarketService { * @return [VKRequest] with [MarketAddResponse] */ fun marketAdd( - ownerId: Int, + ownerId: UserId, name: String, description: String, categoryId: Int, @@ -130,7 +136,7 @@ class MarketService { * @return [VKRequest] with [MarketAddAlbumResponse] */ fun marketAddAlbum( - ownerId: Int, + ownerId: UserId, title: String, photoId: Int? = null, mainAlbum: Boolean? = null, @@ -155,7 +161,7 @@ class MarketService { * @return [VKRequest] with [BaseOkResponse] */ fun marketAddToAlbum( - ownerId: Int, + ownerId: UserId, itemIds: List, albumIds: List ): VKRequest = NewApiRequest("market.addToAlbum") { @@ -174,9 +180,9 @@ class MarketService { * @param itemId - Item ID. * @param message - Comment text (required if 'attachments' parameter is not specified) * @param attachments - Comma-separated list of objects attached to a comment. The field is - * submitted the following way: , "'_,_'", , '' - media - * attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , - * '' - media owner id, '' - media attachment id, , For example: + * submitted the following way_ , "'_,_'", , '' - media + * attachment type_ "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , + * '' - media owner id, '' - media attachment id, , For example_ * "photo100172_166443618,photo66748_265827614", * @param fromGroup - '1' - comment will be published on behalf of a community, '0' - on behalf * of a user (by default). @@ -186,7 +192,7 @@ class MarketService { * @return [VKRequest] with [Int] */ fun marketCreateComment( - ownerId: Int, + ownerId: UserId, itemId: Int, message: String? = null, attachments: List? = null, @@ -215,7 +221,7 @@ class MarketService { * @param itemId - Item ID. * @return [VKRequest] with [BaseOkResponse] */ - fun marketDelete(ownerId: Int, itemId: Int): VKRequest = + fun marketDelete(ownerId: UserId, itemId: Int): VKRequest = NewApiRequest("market.delete") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -231,7 +237,7 @@ class MarketService { * @param albumId - Collection ID. * @return [VKRequest] with [BaseOkResponse] */ - fun marketDeleteAlbum(ownerId: Int, albumId: Int): VKRequest = + fun marketDeleteAlbum(ownerId: UserId, albumId: Int): VKRequest = NewApiRequest("market.deleteAlbum") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -249,7 +255,7 @@ class MarketService { * @param commentId - comment id * @return [VKRequest] with [BaseBoolInt] */ - fun marketDeleteComment(ownerId: Int, commentId: Int): VKRequest = + fun marketDeleteComment(ownerId: UserId, commentId: Int): VKRequest = NewApiRequest("market.deleteComment") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -312,7 +318,7 @@ class MarketService { * @return [VKRequest] with [BaseOkResponse] */ fun marketEditAlbum( - ownerId: Int, + ownerId: UserId, albumId: Int, title: String, photoId: Int? = null, @@ -338,14 +344,14 @@ class MarketService { * @param message - New comment text (required if 'attachments' are not specified), , 2048 * symbols maximum. * @param attachments - Comma-separated list of objects attached to a comment. The field is - * submitted the following way: , "'_,_'", , '' - media - * attachment type: "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , - * '' - media owner id, '' - media attachment id, , For example: + * submitted the following way_ , "'_,_'", , '' - media + * attachment type_ "'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document", , + * '' - media owner id, '' - media attachment id, , For example_ * "photo100172_166443618,photo66748_265827614", * @return [VKRequest] with [BaseOkResponse] */ fun marketEditComment( - ownerId: Int, + ownerId: UserId, commentId: Int, message: String? = null, attachments: List? = null @@ -376,12 +382,12 @@ class MarketService { * @return [VKRequest] with [BaseOkResponse] */ fun marketEditOrder( - userId: Int, + userId: UserId, orderId: Int, merchantComment: String? = null, status: Int? = null, trackNumber: String? = null, - paymentStatus: PaymentStatusParam? = null, + paymentStatus: MarketEditOrderPaymentStatus? = null, deliveryPrice: Int? = null, width: Int? = null, length: Int? = null, @@ -413,8 +419,9 @@ class MarketService { * @param albumId * @param count - Number of items to return. * @param offset - Offset needed to return a specific subset of results. - * @param dateFrom - Items update date from (format: yyyy-mm-dd) - * @param dateTo - Items update date to (format: yyyy-mm-dd) + * @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 * @return [VKRequest] with [MarketGetResponse] */ fun marketGet( @@ -423,7 +430,8 @@ class MarketService { count: Int? = null, offset: Int? = null, dateFrom: String? = null, - dateTo: String? = null + dateTo: String? = null, + needVariants: Boolean? = null ): VKRequest = NewApiRequest("market.get") { GsonHolder.gson.fromJson(it, MarketGetResponse::class.java) } @@ -434,6 +442,7 @@ class MarketService { offset?.let { addParam("offset", it) } dateFrom?.let { addParam("date_from", it) } dateTo?.let { addParam("date_to", it) } + needVariants?.let { addParam("need_variants", it) } } /** @@ -445,8 +454,9 @@ class MarketService { * @param albumId * @param count - Number of items to return. * @param offset - Offset needed to return a specific subset of results. - * @param dateFrom - Items update date from (format: yyyy-mm-dd) - * @param dateTo - Items update date to (format: yyyy-mm-dd) + * @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 * @return [VKRequest] with [MarketGetExtendedResponse] */ fun marketGetExtended( @@ -455,7 +465,8 @@ class MarketService { count: Int? = null, offset: Int? = null, dateFrom: String? = null, - dateTo: String? = null + dateTo: String? = null, + needVariants: Boolean? = null ): VKRequest = NewApiRequest("market.get") { GsonHolder.gson.fromJson(it, MarketGetExtendedResponse::class.java) } @@ -467,6 +478,7 @@ class MarketService { addParam("extended", true) dateFrom?.let { addParam("date_from", it) } dateTo?.let { addParam("date_to", it) } + needVariants?.let { addParam("need_variants", it) } } /** @@ -478,8 +490,8 @@ class MarketService { * @param albumIds - collections identifiers to obtain data from * @return [VKRequest] with [MarketGetAlbumByIdResponse] */ - fun marketGetAlbumById(ownerId: Int, albumIds: List): VKRequest - = NewApiRequest("market.getAlbumById") { + fun marketGetAlbumById(ownerId: UserId, albumIds: List): + VKRequest = NewApiRequest("market.getAlbumById") { GsonHolder.gson.fromJson(it, MarketGetAlbumByIdResponse::class.java) } .apply { @@ -496,7 +508,7 @@ class MarketService { * @return [VKRequest] with [MarketGetAlbumsResponse] */ fun marketGetAlbums( - ownerId: Int, + ownerId: UserId, offset: Int? = null, count: Int? = null ): VKRequest = NewApiRequest("market.getAlbums") { @@ -511,8 +523,8 @@ class MarketService { /** * Returns information about market items by their ids. * - * @param itemIds - Comma-separated ids list: {user id}_{item id}. If an item belongs to a - * community -{community id} is used. " 'Videos' value example: , + * @param itemIds - Comma-separated ids list_ {user id}_{item id}. If an item belongs to a + * community -{community id} is used. " 'Videos' value example_ , * '-4363_136089719,13245770_137352259'" * @return [VKRequest] with [MarketGetByIdResponse] */ @@ -527,8 +539,8 @@ class MarketService { /** * Returns information about market items by their ids. * - * @param itemIds - Comma-separated ids list: {user id}_{item id}. If an item belongs to a - * community -{community id} is used. " 'Videos' value example: , + * @param itemIds - Comma-separated ids list_ {user id}_{item id}. If an item belongs to a + * community -{community id} is used. " 'Videos' value example_ , * '-4363_136089719,13245770_137352259'" * @return [VKRequest] with [MarketGetByIdExtendedResponse] */ @@ -572,13 +584,13 @@ class MarketService { * @return [VKRequest] with [MarketGetCommentsResponse] */ fun marketGetComments( - ownerId: Int, + ownerId: UserId, itemId: Int, needLikes: Boolean? = null, startCommentId: Int? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null, + sort: MarketGetCommentsSort? = null, fields: List? = null ): VKRequest = NewApiRequest("market.getComments") { GsonHolder.gson.fromJson(it, MarketGetCommentsResponse::class.java) @@ -606,7 +618,7 @@ class MarketService { * @return [VKRequest] with [MarketGetGroupOrdersResponse] */ fun marketGetGroupOrders( - groupId: Int, + groupId: UserId, offset: Int? = null, count: Int? = null ): VKRequest = NewApiRequest("market.getGroupOrders") { @@ -625,8 +637,8 @@ class MarketService { * @param userId * @return [VKRequest] with [MarketGetOrderByIdResponse] */ - fun marketGetOrderById(orderId: Int, userId: Int? = null): VKRequest - = NewApiRequest("market.getOrderById") { + fun marketGetOrderById(orderId: Int, userId: UserId? = null): + VKRequest = NewApiRequest("market.getOrderById") { GsonHolder.gson.fromJson(it, MarketGetOrderByIdResponse::class.java) } .apply { @@ -645,7 +657,7 @@ class MarketService { */ fun marketGetOrderItems( orderId: Int, - userId: Int? = null, + userId: UserId? = null, offset: Int? = null, count: Int? = null ): VKRequest = NewApiRequest("market.getOrderItems") { @@ -661,8 +673,8 @@ class MarketService { /** * @param offset * @param count - * @param dateFrom - Orders status updated date from (format: yyyy-mm-dd) - * @param dateTo - Orders status updated date to (format: yyyy-mm-dd) + * @param dateFrom - Orders status updated date from (format_ yyyy-mm-dd) + * @param dateTo - Orders status updated date to (format_ yyyy-mm-dd) * @return [VKRequest] with [MarketGetOrdersResponse] */ fun marketGetOrders( @@ -683,8 +695,8 @@ class MarketService { /** * @param offset * @param count - * @param dateFrom - Orders status updated date from (format: yyyy-mm-dd) - * @param dateTo - Orders status updated date to (format: yyyy-mm-dd) + * @param dateFrom - Orders status updated date from (format_ yyyy-mm-dd) + * @param dateTo - Orders status updated date to (format_ yyyy-mm-dd) * @return [VKRequest] with [MarketGetOrdersExtendedResponse] */ fun marketGetOrdersExtended( @@ -712,7 +724,7 @@ class MarketService { * @return [VKRequest] with [BaseOkResponse] */ fun marketRemoveFromAlbum( - ownerId: Int, + ownerId: UserId, itemId: Int, albumIds: List ): VKRequest = NewApiRequest("market.removeFromAlbum") { @@ -734,7 +746,7 @@ class MarketService { * @return [VKRequest] with [BaseOkResponse] */ fun marketReorderAlbums( - ownerId: Int, + ownerId: UserId, albumId: Int, before: Int? = null, after: Int? = null @@ -759,7 +771,7 @@ class MarketService { * @return [VKRequest] with [BaseOkResponse] */ fun marketReorderItems( - ownerId: Int, + ownerId: UserId, itemId: Int, albumId: Int? = null, before: Int? = null, @@ -780,14 +792,14 @@ class MarketService { * * @param ownerId - ID of an item owner community. * @param itemId - Item ID. - * @param reason - Complaint reason. Possible values: *'0' - spam,, *'1' - child porn,, *'2' - + * @param reason - Complaint reason. Possible values_ *'0' - spam,, *'1' - child porn,, *'2' - * extremism,, *'3' - violence,, *'4' - drugs propaganda,, *'5' - adult materials,, *'6' - insult. * @return [VKRequest] with [BaseOkResponse] */ fun marketReport( - ownerId: Int, + ownerId: UserId, itemId: Int, - reason: ReasonParam? = null + reason: MarketReportReason? = null ): VKRequest = NewApiRequest("market.report") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -802,14 +814,14 @@ class MarketService { * * @param ownerId - ID of an item owner community. * @param commentId - Comment ID. - * @param reason - Complaint reason. Possible values: *'0' - spam,, *'1' - child porn,, *'2' - + * @param reason - Complaint reason. Possible values_ *'0' - spam,, *'1' - child porn,, *'2' - * extremism,, *'3' - violence,, *'4' - drugs propaganda,, *'5' - adult materials,, *'6' - insult. * @return [VKRequest] with [BaseOkResponse] */ fun marketReportComment( - ownerId: Int, + ownerId: UserId, commentId: Int, - reason: ReasonParam + reason: MarketReportCommentReason ): VKRequest = NewApiRequest("market.reportComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -826,7 +838,7 @@ class MarketService { * @param itemId - Deleted item ID. * @return [VKRequest] with [BaseOkResponse] */ - fun marketRestore(ownerId: Int, itemId: Int): VKRequest = + fun marketRestore(ownerId: UserId, itemId: Int): VKRequest = NewApiRequest("market.restore") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -844,7 +856,7 @@ class MarketService { * @param commentId - deleted comment id * @return [VKRequest] with [BaseBoolInt] */ - fun marketRestoreComment(ownerId: Int, commentId: Int): VKRequest = + fun marketRestoreComment(ownerId: UserId, commentId: Int): VKRequest = NewApiRequest("market.restoreComment") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -866,19 +878,21 @@ class MarketService { * @param offset - Offset needed to return a specific subset of results. * @param count - Number of items to return. * @param status + * @param needVariants - Add variants to response if exist * @return [VKRequest] with [MarketSearchResponse] */ fun marketSearch( - ownerId: Int, + ownerId: UserId, albumId: Int? = null, q: String? = null, priceFrom: Int? = null, priceTo: Int? = null, - sort: SortParam? = null, - rev: RevParam? = null, + sort: MarketSearchSort? = null, + rev: MarketSearchRev? = null, offset: Int? = null, count: Int? = null, - status: StatusParam? = null + status: MarketSearchStatus? = null, + needVariants: Boolean? = null ): VKRequest = NewApiRequest("market.search") { GsonHolder.gson.fromJson(it, MarketSearchResponse::class.java) } @@ -893,6 +907,7 @@ class MarketService { offset?.let { addParam("offset", it) } count?.let { addParam("count", it) } status?.let { addParam("status", it.value) } + needVariants?.let { addParam("need_variants", it) } } /** @@ -908,19 +923,21 @@ class MarketService { * @param offset - Offset needed to return a specific subset of results. * @param count - Number of items to return. * @param status + * @param needVariants - Add variants to response if exist * @return [VKRequest] with [MarketSearchExtendedResponse] */ fun marketSearchExtended( - ownerId: Int, + ownerId: UserId, albumId: Int? = null, q: String? = null, priceFrom: Int? = null, priceTo: Int? = null, - sort: SortParam? = null, - rev: RevParam? = null, + sort: MarketSearchExtendedSort? = null, + rev: MarketSearchExtendedRev? = null, offset: Int? = null, count: Int? = null, - status: StatusParam? = null + status: MarketSearchExtendedStatus? = null, + needVariants: Boolean? = null ): VKRequest = NewApiRequest("market.search") { GsonHolder.gson.fromJson(it, MarketSearchExtendedResponse::class.java) } @@ -936,5 +953,6 @@ class MarketService { count?.let { addParam("count", it) } addParam("extended", true) status?.let { addParam("status", it.value) } + needVariants?.let { addParam("need_variants", it) } } } diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/PaymentStatusParam.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketEditOrderPaymentStatus.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/market/dto/PaymentStatusParam.kt rename to api/src/main/java/com/vk/sdk/api/market/dto/MarketEditOrderPaymentStatus.kt index 74fa5059dc..a00c486af5 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/PaymentStatusParam.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketEditOrderPaymentStatus.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.market.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class PaymentStatusParam( +enum class MarketEditOrderPaymentStatus( val value: String ) { @SerializedName("not_paid") diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetCommentsSort.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/market/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/market/dto/MarketGetCommentsSort.kt index 1244a8b8cf..a248f490b1 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetCommentsSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.market.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SortParam( +enum class MarketGetCommentsSort( val value: String ) { @SerializedName("asc") diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetExtendedResponse.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetExtendedResponse.kt index a10d779040..9a84b288bc 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetExtendedResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetExtendedResponse.kt @@ -34,10 +34,13 @@ import kotlin.collections.List /** * @param count - Total number * @param items + * @param variants */ data class MarketGetExtendedResponse( @SerializedName("count") val count: Int? = null, @SerializedName("items") - val items: List? = null + val items: List? = null, + @SerializedName("variants") + val variants: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetResponse.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetResponse.kt index dd62565aa1..5482bf07c6 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketGetResponse.kt @@ -34,10 +34,13 @@ import kotlin.collections.List /** * @param count - Total number * @param items + * @param variants */ data class MarketGetResponse( @SerializedName("count") val count: Int? = null, @SerializedName("items") - val items: List? = null + val items: List? = null, + @SerializedName("variants") + val variants: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketReportCommentReason.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketReportCommentReason.kt new file mode 100644 index 0000000000..381b69c547 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketReportCommentReason.kt @@ -0,0 +1,56 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class MarketReportCommentReason( + val value: Int +) { + @SerializedName("0") + SPAM(0), + + @SerializedName("1") + CHILD_PORNOGRAPHY(1), + + @SerializedName("2") + EXTREMISM(2), + + @SerializedName("3") + VIOLENCE(3), + + @SerializedName("4") + DRUG_PROPAGANDA(4), + + @SerializedName("5") + ADULT_MATERIAL(5), + + @SerializedName("6") + INSULT_ABUSE(6); +} diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/ReasonParam.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketReportReason.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/market/dto/ReasonParam.kt rename to api/src/main/java/com/vk/sdk/api/market/dto/MarketReportReason.kt index ab18579e10..f1a63626e4 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/ReasonParam.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketReportReason.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.market.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class ReasonParam( +enum class MarketReportReason( val value: Int ) { @SerializedName("0") diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedResponse.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedResponse.kt index 68a6c2ac6e..2898813904 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedResponse.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedResponse.kt @@ -35,6 +35,7 @@ import kotlin.collections.List * @param count - Total number * @param viewType * @param items + * @param variants */ data class MarketSearchExtendedResponse( @SerializedName("count") @@ -42,5 +43,7 @@ data class MarketSearchExtendedResponse( @SerializedName("view_type") val viewType: MarketServicesViewType, @SerializedName("items") - val items: List + val items: List, + @SerializedName("variants") + val variants: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedRev.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedRev.kt new file mode 100644 index 0000000000..c1615820bf --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedRev.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 MarketSearchExtendedRev( + val value: Int +) { + @SerializedName("0") + NORMAL(0), + + @SerializedName("1") + REVERSE(1); +} diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedSort.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedSort.kt new file mode 100644 index 0000000000..9f98f3fd52 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedSort.kt @@ -0,0 +1,47 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class MarketSearchExtendedSort( + val value: Int +) { + @SerializedName("0") + DEFAULT(0), + + @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/MarketSearchExtendedStatus.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedStatus.kt new file mode 100644 index 0000000000..ac37f57e7c --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchExtendedStatus.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 MarketSearchExtendedStatus( + val value: Int +) { + @SerializedName("0") + ACTIVE(0), + + @SerializedName("2") + DISABLED(2); +} 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 416e54e68a..390c14e026 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 @@ -35,6 +35,7 @@ import kotlin.collections.List * @param count - Total number * @param viewType * @param items + * @param variants */ data class MarketSearchResponse( @SerializedName("count") @@ -42,5 +43,7 @@ data class MarketSearchResponse( @SerializedName("view_type") val viewType: MarketServicesViewType, @SerializedName("items") - val items: List + val items: List, + @SerializedName("variants") + val variants: List? = null ) diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/RevParam.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchRev.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/market/dto/RevParam.kt rename to api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchRev.kt index 11b403b726..a8dba13392 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/RevParam.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchRev.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.market.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class RevParam( +enum class MarketSearchRev( val value: Int ) { @SerializedName("0") diff --git a/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchSort.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchSort.kt new file mode 100644 index 0000000000..36d8d2a4a1 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchSort.kt @@ -0,0 +1,47 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.market.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class MarketSearchSort( + val value: Int +) { + @SerializedName("0") + DEFAULT(0), + + @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/StatusParam.kt b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchStatus.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/market/dto/StatusParam.kt rename to api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchStatus.kt index 3a75c2daee..2aa5f3d951 100644 --- a/api/src/main/java/com/vk/sdk/api/market/dto/StatusParam.kt +++ b/api/src/main/java/com/vk/sdk/api/market/dto/MarketSearchStatus.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.market.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class StatusParam( +enum class MarketSearchStatus( val value: Int ) { @SerializedName("0") 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 cba2709cf0..d5a903428f 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 @@ -29,14 +29,12 @@ package com.vk.sdk.api.messages import com.google.gson.reflect.TypeToken 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.base.dto.BaseUserGroupFields -import com.vk.sdk.api.messages.dto.FilterParam -import com.vk.sdk.api.messages.dto.IntentParam -import com.vk.sdk.api.messages.dto.MediaTypeParam import com.vk.sdk.api.messages.dto.MessagesDeleteChatPhotoResponse import com.vk.sdk.api.messages.dto.MessagesDeleteConversationResponse import com.vk.sdk.api.messages.dto.MessagesGetByConversationMessageIdResponse @@ -45,12 +43,17 @@ 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.MessagesGetConversationsFilter import com.vk.sdk.api.messages.dto.MessagesGetConversationsResponse +import com.vk.sdk.api.messages.dto.MessagesGetHistoryAttachmentsMediaType import com.vk.sdk.api.messages.dto.MessagesGetHistoryAttachmentsResponse import com.vk.sdk.api.messages.dto.MessagesGetHistoryExtendedResponse +import com.vk.sdk.api.messages.dto.MessagesGetHistoryExtendedRev import com.vk.sdk.api.messages.dto.MessagesGetHistoryResponse +import com.vk.sdk.api.messages.dto.MessagesGetHistoryRev import com.vk.sdk.api.messages.dto.MessagesGetImportantMessagesExtendedResponse import com.vk.sdk.api.messages.dto.MessagesGetImportantMessagesResponse +import com.vk.sdk.api.messages.dto.MessagesGetIntentUsersIntent import com.vk.sdk.api.messages.dto.MessagesGetIntentUsersResponse import com.vk.sdk.api.messages.dto.MessagesGetInviteLinkResponse import com.vk.sdk.api.messages.dto.MessagesGetLongPollHistoryResponse @@ -63,9 +66,9 @@ import com.vk.sdk.api.messages.dto.MessagesSearchConversationsExtendedResponse import com.vk.sdk.api.messages.dto.MessagesSearchConversationsResponse import com.vk.sdk.api.messages.dto.MessagesSearchExtendedResponse import com.vk.sdk.api.messages.dto.MessagesSearchResponse +import com.vk.sdk.api.messages.dto.MessagesSendIntent +import com.vk.sdk.api.messages.dto.MessagesSetActivityType import com.vk.sdk.api.messages.dto.MessagesSetChatPhotoResponse -import com.vk.sdk.api.messages.dto.RevParam -import com.vk.sdk.api.messages.dto.TypeParam import com.vk.sdk.api.users.dto.UsersFields import kotlin.Any import kotlin.Boolean @@ -85,7 +88,7 @@ class MessagesService { */ fun messagesAddChatUser( chatId: Int, - userId: Int? = null, + userId: UserId? = null, visibleMessagesCount: Int? = null ): VKRequest = NewApiRequest("messages.addChatUser") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) @@ -103,8 +106,8 @@ class MessagesService { * @param key * @return [VKRequest] with [BaseOkResponse] */ - fun messagesAllowMessagesFromGroup(groupId: Int, key: String? = null): VKRequest - = NewApiRequest("messages.allowMessagesFromGroup") { + fun messagesAllowMessagesFromGroup(groupId: UserId, key: String? = null): + VKRequest = NewApiRequest("messages.allowMessagesFromGroup") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { @@ -123,7 +126,7 @@ class MessagesService { fun messagesCreateChat( userIds: List? = null, title: String? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.createChat") { GsonHolder.gson.fromJson(it, Int::class.java) } @@ -140,15 +143,15 @@ class MessagesService { * @param spam - '1' - to mark message as spam. * @param groupId - Group ID (for group messages with user access token) * @param deleteForAll - '1' - delete message for for all. - * @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 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. * @return [VKRequest] with [Any] */ fun messagesDelete( messageIds: List? = null, spam: Boolean? = null, - groupId: Int? = null, + groupId: UserId? = null, deleteForAll: Boolean? = null, peerId: Int? = null, conversationMessageIds: List? = null @@ -171,7 +174,7 @@ class MessagesService { * @param groupId * @return [VKRequest] with [MessagesDeleteChatPhotoResponse] */ - fun messagesDeleteChatPhoto(chatId: Int, groupId: Int? = null): + fun messagesDeleteChatPhoto(chatId: Int, groupId: UserId? = null): VKRequest = NewApiRequest("messages.deleteChatPhoto") { GsonHolder.gson.fromJson(it, MessagesDeleteChatPhotoResponse::class.java) } @@ -184,15 +187,15 @@ class MessagesService { * Deletes all private messages in a conversation. * * @param userId - User ID. To clear a chat history use 'chat_id' - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'chat_id', e.g. '2000000001'. For community_ '- community ID', e.g. '-12345'. " * @param groupId - Group ID (for group messages with user access token) * @return [VKRequest] with [MessagesDeleteConversationResponse] */ fun messagesDeleteConversation( userId: Int? = null, peerId: Int? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.deleteConversation") { GsonHolder.gson.fromJson(it, MessagesDeleteConversationResponse::class.java) @@ -209,7 +212,7 @@ class MessagesService { * @param groupId - Group ID. * @return [VKRequest] with [BaseOkResponse] */ - fun messagesDenyMessagesFromGroup(groupId: Int): VKRequest = + fun messagesDenyMessagesFromGroup(groupId: UserId): VKRequest = NewApiRequest("messages.denyMessagesFromGroup") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -220,16 +223,16 @@ class MessagesService { /** * Edits the message. * - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'chat_id', e.g. '2000000001'. For community_ '- community ID', e.g. '-12345'. " * @param message - (Required if 'attachments' is not set.) Text of the message. * @param lat - Geographical latitude of a check-in, in degrees (from -90 to 90). * @param long - Geographical longitude of a check-in, in degrees (from -180 to 180). * @param attachment - (Required if 'message' is not set.) List of objects attached to the - * message, separated by commas, in the following format: "_", '' - Type of - * media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'wall' - + * message, separated by commas, in the following format_ "_", '' - Type of + * media attachment_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'wall' - * wall post, '' - ID of the media attachment owner. '' - media attachment ID. - * Example: "photo100172_166443618" + * Example_ "photo100172_166443618" * @param keepForwardMessages - '1' - to keep forwarded, messages. * @param keepSnippets - '1' - to keep attached snippets. * @param groupId - Group ID (for group messages with user access token) @@ -248,7 +251,7 @@ class MessagesService { attachment: String? = null, keepForwardMessages: Boolean? = null, keepSnippets: Boolean? = null, - groupId: Int? = null, + groupId: UserId? = null, dontParseLinks: Boolean? = null, messageId: Int? = null, conversationMessageId: Int? = null, @@ -292,8 +295,8 @@ class MessagesService { /** * 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 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) @@ -303,7 +306,7 @@ class MessagesService { peerId: Int, conversationMessageIds: List, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getByConversationMessageId") { GsonHolder.gson.fromJson(it, MessagesGetByConversationMessageIdResponse::class.java) @@ -323,7 +326,7 @@ class MessagesService { * * @param messageIds - Message IDs. * @param previewLength - Number of characters after which to truncate a previewed message. To - * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * preview the full message, specify '0'. "NOTE_ Messages are not truncated by default. Messages * are truncated by words." * @param fields - Profile fields to return. * @param groupId - Group ID (for group messages with group access token) @@ -333,7 +336,7 @@ class MessagesService { messageIds: List, previewLength: Int? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getById") { GsonHolder.gson.fromJson(it, MessagesGetByIdResponse::class.java) } @@ -352,7 +355,7 @@ class MessagesService { * * @param messageIds - Message IDs. * @param previewLength - Number of characters after which to truncate a previewed message. To - * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * preview the full message, specify '0'. "NOTE_ Messages are not truncated by default. Messages * are truncated by words." * @param fields - Profile fields to return. * @param groupId - Group ID (for group messages with group access token) @@ -362,7 +365,7 @@ class MessagesService { messageIds: List, previewLength: Int? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getById") { GsonHolder.gson.fromJson(it, MessagesGetByIdExtendedResponse::class.java) } @@ -410,7 +413,7 @@ class MessagesService { fun messagesGetConversationMembers( peerId: Int, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getConversationMembers") { GsonHolder.gson.fromJson(it, MessagesGetConversationMembersResponse::class.java) @@ -429,7 +432,7 @@ class MessagesService { * * @param offset - Offset needed to return a specific subset of conversations. * @param count - Number of conversations to return. - * @param filter - Filter to apply: 'all' - all conversations, 'unread' - conversations with + * @param filter - Filter to apply_ 'all' - all conversations, 'unread' - conversations with * unread messages, 'important' - conversations, marked as important (only for community messages), * 'unanswered' - conversations, marked as unanswered (only for community messages) * @param startMessageId - ID of the message from what to return dialogs. @@ -440,10 +443,10 @@ class MessagesService { fun messagesGetConversations( offset: Int? = null, count: Int? = null, - filter: FilterParam? = null, + filter: MessagesGetConversationsFilter? = null, startMessageId: Int? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getConversations") { GsonHolder.gson.fromJson(it, MessagesGetConversationsResponse::class.java) } @@ -462,8 +465,8 @@ class MessagesService { /** * Returns conversations by their IDs * - * @param peerIds - Destination IDs. "For user: 'User ID', e.g. '12345'. For chat: - * '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerIds - Destination IDs. "For user_ 'User ID', e.g. '12345'. For chat_ + * '2000000000' + 'chat_id', e.g. '2000000001'. For community_ '- community ID', e.g. '-12345'. " * @param fields - Profile and communities fields to return. * @param groupId - Group ID (for group messages with group access token) * @return [VKRequest] with [MessagesGetConversationById] @@ -471,7 +474,7 @@ class MessagesService { fun messagesGetConversationsById( peerIds: List, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getConversationsById") { GsonHolder.gson.fromJson(it, MessagesGetConversationById::class.java) } @@ -487,8 +490,8 @@ class MessagesService { /** * Returns conversations by their IDs * - * @param peerIds - Destination IDs. "For user: 'User ID', e.g. '12345'. For chat: - * '2000000000' + 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerIds - Destination IDs. "For user_ 'User ID', e.g. '12345'. For chat_ + * '2000000000' + 'chat_id', e.g. '2000000001'. For community_ '- community ID', e.g. '-12345'. " * @param fields - Profile and communities fields to return. * @param groupId - Group ID (for group messages with group access token) * @return [VKRequest] with [Any] @@ -496,7 +499,7 @@ class MessagesService { fun messagesGetConversationsByIdExtended( peerIds: List, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getConversationsById") { GsonHolder.gson.fromJson(it, Any::class.java) } @@ -518,7 +521,7 @@ class MessagesService { * @param userId - ID of the user whose message history you want to return. * @param peerId * @param startMessageId - Starting message ID from which to return history. - * @param rev - Sort order: '1' - return messages in chronological order. '0' - return messages + * @param rev - Sort order_ '1' - return messages in chronological order. '0' - return messages * in reverse chronological order. * @param fields - Profile fields to return. * @param groupId - Group ID (for group messages with group access token) @@ -530,9 +533,9 @@ class MessagesService { userId: Int? = null, peerId: Int? = null, startMessageId: Int? = null, - rev: RevParam? = null, + rev: MessagesGetHistoryRev? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getHistory") { GsonHolder.gson.fromJson(it, MessagesGetHistoryResponse::class.java) } @@ -558,7 +561,7 @@ class MessagesService { * @param userId - ID of the user whose message history you want to return. * @param peerId * @param startMessageId - Starting message ID from which to return history. - * @param rev - Sort order: '1' - return messages in chronological order. '0' - return messages + * @param rev - Sort order_ '1' - return messages in chronological order. '0' - return messages * in reverse chronological order. * @param fields - Profile fields to return. * @param groupId - Group ID (for group messages with group access token) @@ -570,9 +573,9 @@ class MessagesService { userId: Int? = null, peerId: Int? = null, startMessageId: Int? = null, - rev: RevParam? = null, + rev: MessagesGetHistoryExtendedRev? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getHistory") { GsonHolder.gson.fromJson(it, MessagesGetHistoryExtendedResponse::class.java) } @@ -594,9 +597,9 @@ class MessagesService { /** * Returns media files from the dialog or group chat. * - * @param peerId - Peer ID. ", For group chat: '2000000000 + chat ID' , , For community: + * @param peerId - Peer ID. ", For group chat_ '2000000000 + chat ID' , , For community_ * '-community ID'" - * @param mediaType - Type of media files to return: *'photo',, *'video',, *'audio',, *'doc',, + * @param mediaType - Type of media files to return_ *'photo',, *'video',, *'audio',, *'doc',, * *'link'.,*'market'.,*'wall'.,*'share' * @param startFrom - Message ID to start return results from. * @param count - Number of objects to return. @@ -609,12 +612,12 @@ class MessagesService { */ fun messagesGetHistoryAttachments( peerId: Int, - mediaType: MediaTypeParam? = null, + mediaType: MessagesGetHistoryAttachmentsMediaType? = null, startFrom: String? = null, count: Int? = null, photoSizes: Boolean? = null, fields: List? = null, - groupId: Int? = null, + groupId: UserId? = null, preserveOrder: Boolean? = null, maxForwardsLevel: Int? = null ): VKRequest = @@ -653,7 +656,7 @@ class MessagesService { startMessageId: Int? = null, previewLength: Int? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getImportantMessages") { GsonHolder.gson.fromJson(it, MessagesGetImportantMessagesResponse::class.java) @@ -687,7 +690,7 @@ class MessagesService { startMessageId: Int? = null, previewLength: Int? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getImportantMessages") { GsonHolder.gson.fromJson(it, MessagesGetImportantMessagesExtendedResponse::class.java) @@ -715,7 +718,7 @@ class MessagesService { * @return [VKRequest] with [MessagesGetIntentUsersResponse] */ fun messagesGetIntentUsers( - intent: IntentParam, + intent: MessagesGetIntentUsersIntent, subscribeId: Int? = null, offset: Int? = null, count: Int? = null, @@ -742,7 +745,7 @@ class MessagesService { fun messagesGetInviteLink( peerId: Int, reset: Boolean? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.getInviteLink") { GsonHolder.gson.fromJson(it, MessagesGetInviteLinkResponse::class.java) } @@ -758,7 +761,7 @@ class MessagesService { * @param userId - User ID. * @return [VKRequest] with [MessagesLastActivity] */ - fun messagesGetLastActivity(userId: Int): VKRequest = + fun messagesGetLastActivity(userId: UserId): VKRequest = NewApiRequest("messages.getLastActivity") { GsonHolder.gson.fromJson(it, MessagesLastActivity::class.java) } @@ -774,7 +777,7 @@ class MessagesService { * @param pts - Lsat value of 'pts' parameter returned from the Long Poll server or by using * [vk.com/dev/messages.getLongPollHistory|messages.getLongPollHistory] method. * @param previewLength - Number of characters after which to truncate a previewed message. To - * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * preview the full message, specify '0'. "NOTE_ Messages are not truncated by default. Messages * are truncated by words." * @param onlines - '1' - to return history with online users only. * @param fields - Additional profile [vk.com/dev/fields|fields] to return. @@ -798,7 +801,7 @@ class MessagesService { eventsLimit: Int? = null, msgsLimit: Int? = null, maxMsgId: Int? = null, - groupId: Int? = null, + groupId: UserId? = null, lpVersion: Int? = null, lastN: Int? = null, credentials: Boolean? = null @@ -835,7 +838,7 @@ class MessagesService { */ fun messagesGetLongPollServer( needPts: Boolean? = null, - groupId: Int? = null, + groupId: UserId? = null, lpVersion: Int? = null ): VKRequest = NewApiRequest("messages.getLongPollServer") { GsonHolder.gson.fromJson(it, MessagesLongpollParams::class.java) @@ -853,7 +856,7 @@ class MessagesService { * @param userId - User ID. * @return [VKRequest] with [MessagesIsMessagesFromGroupAllowedResponse] */ - fun messagesIsMessagesFromGroupAllowed(groupId: Int, userId: Int): + fun messagesIsMessagesFromGroupAllowed(groupId: UserId, userId: UserId): VKRequest = NewApiRequest("messages.isMessagesFromGroupAllowed") { GsonHolder.gson.fromJson(it, MessagesIsMessagesFromGroupAllowedResponse::class.java) @@ -886,7 +889,7 @@ class MessagesService { fun messagesMarkAsAnsweredConversation( peerId: Int, answered: Boolean? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.markAsAnsweredConversation") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -924,7 +927,7 @@ class MessagesService { fun messagesMarkAsImportantConversation( peerId: Int, important: Boolean? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.markAsImportantConversation") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -938,8 +941,8 @@ class MessagesService { * Marks messages as read. * * @param messageIds - IDs of messages to mark as read. - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'chat_id', e.g. '2000000001'. For community_ '- community ID', e.g. '-12345'. " * @param startMessageId - Message ID to start from. * @param groupId - Group ID (for group messages with user access token) * @param markConversationAsRead @@ -949,7 +952,7 @@ class MessagesService { messageIds: List? = null, peerId: Int? = null, startMessageId: Int? = null, - groupId: Int? = null, + groupId: UserId? = null, markConversationAsRead: Boolean? = null ): VKRequest = NewApiRequest("messages.markAsRead") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) @@ -965,8 +968,8 @@ class MessagesService { /** * Pin a message. * - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'Chat ID', e.g. '2000000001'. For community: '- Community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'Chat ID', e.g. '2000000001'. For community_ '- Community ID', e.g. '-12345'. " * @param messageId - Message ID * @param conversationMessageId - Conversation message ID * @return [VKRequest] with [MessagesPinnedMessage] @@ -1013,7 +1016,7 @@ class MessagesService { * @param groupId - Group ID (for group messages with user access token) * @return [VKRequest] with [BaseOkResponse] */ - fun messagesRestore(messageId: Int, groupId: Int? = null): VKRequest = + fun messagesRestore(messageId: Int, groupId: UserId? = null): VKRequest = NewApiRequest("messages.restore") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1026,11 +1029,11 @@ class MessagesService { * Returns a list of the current user's private messages that match search criteria. * * @param q - Search query string. - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'chat_id', e.g. '2000000001'. For community_ '- community ID', e.g. '-12345'. " * @param date - Date to search message before in Unixtime. * @param previewLength - Number of characters after which to truncate a previewed message. To - * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * preview the full message, specify '0'. "NOTE_ Messages are not truncated by default. Messages * are truncated by words." * @param offset - Offset needed to return a specific subset of messages. * @param count - Number of messages to return. @@ -1046,7 +1049,7 @@ class MessagesService { offset: Int? = null, count: Int? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.search") { GsonHolder.gson.fromJson(it, MessagesSearchResponse::class.java) } @@ -1065,11 +1068,11 @@ class MessagesService { * Returns a list of the current user's private messages that match search criteria. * * @param q - Search query string. - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'chat_id', e.g. '2000000001'. For community_ '- community ID', e.g. '-12345'. " * @param date - Date to search message before in Unixtime. * @param previewLength - Number of characters after which to truncate a previewed message. To - * preview the full message, specify '0'. "NOTE: Messages are not truncated by default. Messages + * preview the full message, specify '0'. "NOTE_ Messages are not truncated by default. Messages * are truncated by words." * @param offset - Offset needed to return a specific subset of messages. * @param count - Number of messages to return. @@ -1085,7 +1088,7 @@ class MessagesService { offset: Int? = null, count: Int? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.search") { GsonHolder.gson.fromJson(it, MessagesSearchExtendedResponse::class.java) } @@ -1114,7 +1117,7 @@ class MessagesService { q: String? = null, count: Int? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.searchConversations") { GsonHolder.gson.fromJson(it, MessagesSearchConversationsResponse::class.java) @@ -1142,7 +1145,7 @@ class MessagesService { q: String? = null, count: Int? = null, fields: List? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.searchConversations") { GsonHolder.gson.fromJson(it, MessagesSearchConversationsExtendedResponse::class.java) @@ -1163,8 +1166,8 @@ class MessagesService { * * @param userId - User ID (by default - current user). * @param randomId - Unique identifier to avoid resending the message. - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'chat_id', e.g. '2000000001'. For community_ '- community ID', e.g. '-12345'. " * @param peerIds - IDs of message recipients. (See peer_id) * @param domain - User's short address (for example, 'illarionov'). * @param chatId - ID of conversation the message will relate to. @@ -1173,13 +1176,13 @@ class MessagesService { * @param lat - Geographical latitude of a check-in, in degrees (from -90 to 90). * @param long - Geographical longitude of a check-in, in degrees (from -180 to 180). * @param attachment - (Required if 'message' is not set.) List of objects attached to the - * message, separated by commas, in the following format: "_", '' - Type of - * media attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'wall' - + * message, separated by commas, in the following format_ "_", '' - Type of + * media attachment_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'wall' - * wall post, '' - ID of the media attachment owner. '' - media attachment ID. - * Example: "photo100172_166443618" + * Example_ "photo100172_166443618" * @param replyTo * @param forwardMessages - ID of forwarded messages, separated with a comma. Listed messages of - * the sender will be shown in the message body at the recipient's. Example: "123,431,544" + * the sender will be shown in the message body at the recipient's. Example_ "123,431,544" * @param forward - JSON describing the forwarded message or reply * @param stickerId - Sticker id. * @param groupId - Group ID (for group messages with group access token) @@ -1209,14 +1212,14 @@ class MessagesService { forwardMessages: List? = null, forward: String? = null, stickerId: Int? = null, - groupId: Int? = null, + groupId: UserId? = null, keyboard: String? = null, template: String? = null, payload: String? = null, contentSource: String? = null, dontParseLinks: Boolean? = null, disableMentions: Boolean? = null, - intent: IntentParam? = null, + intent: MessagesSendIntent? = null, subscribeId: Int? = null ): VKRequest = NewApiRequest("messages.send") { GsonHolder.gson.fromJson(it, Int::class.java) @@ -1257,7 +1260,7 @@ class MessagesService { */ fun messagesSendMessageEventAnswer( eventId: String, - userId: Int, + userId: UserId, peerId: Int, eventData: String? = null ): VKRequest = NewApiRequest("messages.sendMessageEventAnswer") { @@ -1275,16 +1278,16 @@ class MessagesService { * * @param userId - User ID. * @param type - 'typing' - user has started to type. - * @param peerId - Destination ID. "For user: 'User ID', e.g. '12345'. For chat: '2000000000' + - * 'chat_id', e.g. '2000000001'. For community: '- community ID', e.g. '-12345'. " + * @param peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'chat_id', e.g. '2000000001'. For community_ '- community ID', e.g. '-12345'. " * @param groupId - Group ID (for group messages with group access token) * @return [VKRequest] with [BaseOkResponse] */ fun messagesSetActivity( userId: Int? = null, - type: TypeParam? = null, + type: MessagesSetActivityType? = null, peerId: Int? = null, - groupId: Int? = null + groupId: UserId? = null ): VKRequest = NewApiRequest("messages.setActivity") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1316,7 +1319,7 @@ class MessagesService { * @param groupId * @return [VKRequest] with [BaseOkResponse] */ - fun messagesUnpin(peerId: Int, groupId: Int? = null): VKRequest = + fun messagesUnpin(peerId: Int, groupId: UserId? = null): VKRequest = NewApiRequest("messages.unpin") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/FilterParam.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsFilter.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/messages/dto/FilterParam.kt rename to api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsFilter.kt index f0811a2b2b..860b7941b7 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/FilterParam.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetConversationsFilter.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FilterParam( +enum class MessagesGetConversationsFilter( val value: String ) { @SerializedName("all") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MediaTypeParam.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsMediaType.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/messages/dto/MediaTypeParam.kt rename to api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsMediaType.kt index 9a9012b825..973119971d 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/MediaTypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryAttachmentsMediaType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class MediaTypeParam( +enum class MessagesGetHistoryAttachmentsMediaType( val value: String ) { @SerializedName("audio") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryExtendedRev.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryExtendedRev.kt new file mode 100644 index 0000000000..48975deaf3 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryExtendedRev.kt @@ -0,0 +1,41 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class MessagesGetHistoryExtendedRev( + val value: Int +) { + @SerializedName("1") + CHRONOLOGICAL(1), + + @SerializedName("0") + REVERSE_CHRONOLOGICAL(0); +} diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/RevParam.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryRev.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/messages/dto/RevParam.kt rename to api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryRev.kt index 120626d011..9f780c2fcb 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/RevParam.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetHistoryRev.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class RevParam( +enum class MessagesGetHistoryRev( val value: Int ) { @SerializedName("1") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/IntentParam.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersIntent.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/messages/dto/IntentParam.kt rename to api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersIntent.kt index deac747fd2..73c52c034f 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/IntentParam.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesGetIntentUsersIntent.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class IntentParam( +enum class MessagesGetIntentUsersIntent( val value: String ) { @SerializedName("confirmed_notification") diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSendIntent.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSendIntent.kt new file mode 100644 index 0000000000..0503b4cc22 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSendIntent.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.messages.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class MessagesSendIntent( + val value: String +) { + @SerializedName("account_update") + ACCOUNT_UPDATE("account_update"), + + @SerializedName("bot_ad_invite") + BOT_AD_INVITE("bot_ad_invite"), + + @SerializedName("bot_ad_promo") + BOT_AD_PROMO("bot_ad_promo"), + + @SerializedName("confirmed_notification") + CONFIRMED_NOTIFICATION("confirmed_notification"), + + @SerializedName("customer_support") + CUSTOMER_SUPPORT("customer_support"), + + @SerializedName("default") + DEFAULT("default"), + + @SerializedName("game_notification") + GAME_NOTIFICATION("game_notification"), + + @SerializedName("moderated_newsletter") + MODERATED_NEWSLETTER("moderated_newsletter"), + + @SerializedName("non_promo_newsletter") + NON_PROMO_NEWSLETTER("non_promo_newsletter"), + + @SerializedName("promo_newsletter") + PROMO_NEWSLETTER("promo_newsletter"), + + @SerializedName("purchase_update") + PURCHASE_UPDATE("purchase_update"); +} diff --git a/api/src/main/java/com/vk/sdk/api/messages/dto/TypeParam.kt b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSetActivityType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/messages/dto/TypeParam.kt rename to api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSetActivityType.kt index 27438ae499..fa56304b91 100644 --- a/api/src/main/java/com/vk/sdk/api/messages/dto/TypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/messages/dto/MessagesSetActivityType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.messages.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class TypeParam( +enum class MessagesSetActivityType( val value: String ) { @SerializedName("audiomessage") 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 d6484c1ec7..5c0c921de1 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 @@ -28,14 +28,16 @@ package com.vk.sdk.api.newsfeed 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.BaseOkResponse import com.vk.sdk.api.base.dto.BaseUserGroupFields -import com.vk.sdk.api.newsfeed.dto.NameCaseParam import com.vk.sdk.api.newsfeed.dto.NewsfeedCommentsFilters import com.vk.sdk.api.newsfeed.dto.NewsfeedFilters +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedExtendedNameCase import com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedExtendedResponse +import com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedNameCase import com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedResponse import com.vk.sdk.api.newsfeed.dto.NewsfeedGetCommentsResponse import com.vk.sdk.api.newsfeed.dto.NewsfeedGetListsExtendedResponse @@ -46,7 +48,7 @@ import com.vk.sdk.api.newsfeed.dto.NewsfeedGetResponse import com.vk.sdk.api.newsfeed.dto.NewsfeedGetSuggestedSourcesResponse import com.vk.sdk.api.newsfeed.dto.NewsfeedSearchExtendedResponse import com.vk.sdk.api.newsfeed.dto.NewsfeedSearchResponse -import com.vk.sdk.api.newsfeed.dto.TypeParam +import com.vk.sdk.api.newsfeed.dto.NewsfeedUnsubscribeType import com.vk.sdk.api.users.dto.UsersFields import kotlin.Boolean import kotlin.Float @@ -104,7 +106,7 @@ class NewsfeedService { /** * Returns data required to show newsfeed for the current user. * - * @param filters - Filters to apply: 'post' - new wall posts, 'photo' - new photos, + * @param filters - Filters to apply_ 'post' - new wall posts, 'photo' - new photos, * 'photo_tag' - new photo tags, 'wall_photo' - new wall photos, 'friend' - new friends * @param returnBanned - '1' - to return news items from banned sources * @param startTime - Earliest timestamp (in Unix time) of a news item to return. By default, 24 @@ -163,13 +165,13 @@ class NewsfeedService { * Returns a list of users and communities banned from the current user's newsfeed. * * @param fields - Profile fields to return. - * @param nameCase - Case for declension of user name and surname: 'nom' - nominative (default), + * @param nameCase - Case for declension of user name and surname_ 'nom' - nominative (default), * 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - * prepositional * @return [VKRequest] with [NewsfeedGetBannedResponse] */ - fun newsfeedGetBanned(fields: List? = null, nameCase: NameCaseParam? = null): - VKRequest = NewApiRequest("newsfeed.getBanned") { + fun newsfeedGetBanned(fields: List? = null, nameCase: NewsfeedGetBannedNameCase? = + null): VKRequest = NewApiRequest("newsfeed.getBanned") { GsonHolder.gson.fromJson(it, NewsfeedGetBannedResponse::class.java) } .apply { @@ -184,14 +186,14 @@ class NewsfeedService { * Returns a list of users and communities banned from the current user's newsfeed. * * @param fields - Profile fields to return. - * @param nameCase - Case for declension of user name and surname: 'nom' - nominative (default), + * @param nameCase - Case for declension of user name and surname_ 'nom' - nominative (default), * 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - * prepositional * @return [VKRequest] with [NewsfeedGetBannedExtendedResponse] */ - fun newsfeedGetBannedExtended(fields: List? = null, nameCase: NameCaseParam? = - null): VKRequest = - NewApiRequest("newsfeed.getBanned") { + fun newsfeedGetBannedExtended(fields: List? = null, + nameCase: NewsfeedGetBannedExtendedNameCase? = null): + VKRequest = NewApiRequest("newsfeed.getBanned") { GsonHolder.gson.fromJson(it, NewsfeedGetBannedExtendedResponse::class.java) } .apply { @@ -208,7 +210,7 @@ class NewsfeedService { * * @param count - Number of comments to return. For auto feed, you can use the 'new_offset' * parameter returned by this method. - * @param filters - Filters to apply: 'post' - new comments on wall posts, 'photo' - new + * @param filters - Filters to apply_ 'post' - new comments on wall posts, 'photo' - new * comments on photos, 'video' - new comments on videos, 'topic' - new comments on discussions, * 'note' - new comments on notes, * @param reposts - Object ID, comments on repost of which shall be returned, e.g. @@ -295,7 +297,7 @@ class NewsfeedService { * @return [VKRequest] with [NewsfeedGetMentionsResponse] */ fun newsfeedGetMentions( - ownerId: Int? = null, + ownerId: UserId? = null, startTime: Int? = null, endTime: Int? = null, offset: Int? = null, @@ -379,7 +381,7 @@ class NewsfeedService { /** * Hides an item from the newsfeed. * - * @param type - Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a + * @param type - Item type. Possible values_ *'wall' - post on the wall,, *'tag' - tag on a * photo,, *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. * @param ownerId - Item owner's identifier (user or community), "Note that community id must be * negative. 'owner_id=1' - user , 'owner_id=-1' - community " @@ -388,7 +390,7 @@ class NewsfeedService { */ fun newsfeedIgnoreItem( type: String, - ownerId: Int? = null, + ownerId: UserId? = null, itemId: Int? = null ): VKRequest = NewApiRequest("newsfeed.ignoreItem") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) @@ -514,7 +516,7 @@ class NewsfeedService { /** * Returns a hidden item to the newsfeed. * - * @param type - Item type. Possible values: *'wall' - post on the wall,, *'tag' - tag on a + * @param type - Item type. Possible values_ *'wall' - post on the wall,, *'tag' - tag on a * photo,, *'profilephoto' - profile photo,, *'video' - video,, *'audio' - audio. * @param ownerId - Item owner's identifier (user or community), "Note that community id must be * negative. 'owner_id=1' - user , 'owner_id=-1' - community " @@ -524,7 +526,7 @@ class NewsfeedService { */ fun newsfeedUnignoreItem( type: String, - ownerId: Int, + ownerId: UserId, itemId: Int, trackCode: String? = null ): VKRequest = NewApiRequest("newsfeed.unignoreItem") { @@ -540,16 +542,16 @@ class NewsfeedService { /** * Unsubscribes the current user from specified newsfeeds. * - * @param type - Type of object from which to unsubscribe: 'note' - note, 'photo' - photo, + * @param type - Type of object from which to unsubscribe_ 'note' - note, 'photo' - photo, * 'post' - post on user wall or community wall, 'topic' - topic, 'video' - video * @param itemId - Object ID. * @param ownerId - Object owner ID. * @return [VKRequest] with [BaseOkResponse] */ fun newsfeedUnsubscribe( - type: TypeParam, + type: NewsfeedUnsubscribeType, itemId: Int, - ownerId: Int? = null + ownerId: UserId? = null ): VKRequest = NewApiRequest("newsfeed.unsubscribe") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedExtendedNameCase.kt b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedExtendedNameCase.kt new file mode 100644 index 0000000000..86d62df3da --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedExtendedNameCase.kt @@ -0,0 +1,53 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.newsfeed.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class NewsfeedGetBannedExtendedNameCase( + val value: String +) { + @SerializedName("nom") + NOMINATIVE("nom"), + + @SerializedName("gen") + GENITIVE("gen"), + + @SerializedName("dat") + DATIVE("dat"), + + @SerializedName("acc") + ACCUSATIVE("acc"), + + @SerializedName("ins") + INSTRUMENTAL("ins"), + + @SerializedName("abl") + PREPOSITIONAL("abl"); +} diff --git a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NameCaseParam.kt b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedNameCase.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/newsfeed/dto/NameCaseParam.kt rename to api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedNameCase.kt index 730497c499..ffec2cac1b 100644 --- a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NameCaseParam.kt +++ b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedGetBannedNameCase.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.newsfeed.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class NameCaseParam( +enum class NewsfeedGetBannedNameCase( val value: String ) { @SerializedName("nom") diff --git a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/TypeParam.kt b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedUnsubscribeType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/newsfeed/dto/TypeParam.kt rename to api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedUnsubscribeType.kt index e31ec337c3..fac7c5f823 100644 --- a/api/src/main/java/com/vk/sdk/api/newsfeed/dto/TypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/newsfeed/dto/NewsfeedUnsubscribeType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.newsfeed.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class TypeParam( +enum class NewsfeedUnsubscribeType( val value: String ) { @SerializedName("note") 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 41991ab75a..14a7d26cc2 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 @@ -28,13 +28,15 @@ package com.vk.sdk.api.notes 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.BaseOkResponse import com.vk.sdk.api.notes.dto.NotesGetCommentsResponse +import com.vk.sdk.api.notes.dto.NotesGetCommentsSort import com.vk.sdk.api.notes.dto.NotesGetResponse +import com.vk.sdk.api.notes.dto.NotesGetSort import com.vk.sdk.api.notes.dto.NotesNote -import com.vk.sdk.api.notes.dto.SortParam import kotlin.Boolean import kotlin.Int import kotlin.String @@ -79,7 +81,7 @@ class NotesService { fun notesCreateComment( noteId: Int, message: String, - ownerId: Int? = null, + ownerId: UserId? = null, replyTo: Int? = null, guid: String? = null ): VKRequest = NewApiRequest("notes.createComment") { @@ -113,7 +115,7 @@ class NotesService { * @param ownerId - Note owner ID. * @return [VKRequest] with [BaseOkResponse] */ - fun notesDeleteComment(commentId: Int, ownerId: Int? = null): VKRequest = + fun notesDeleteComment(commentId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("notes.deleteComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -160,7 +162,7 @@ class NotesService { fun notesEditComment( commentId: Int, message: String, - ownerId: Int? = null + ownerId: UserId? = null ): VKRequest = NewApiRequest("notes.editComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -182,10 +184,10 @@ class NotesService { */ fun notesGet( noteIds: List? = null, - userId: Int? = null, + userId: UserId? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null + sort: NotesGetSort? = null ): VKRequest = NewApiRequest("notes.get") { GsonHolder.gson.fromJson(it, NotesGetResponse::class.java) } @@ -207,7 +209,7 @@ class NotesService { */ fun notesGetById( noteId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, needWiki: Boolean? = null ): VKRequest = NewApiRequest("notes.getById") { GsonHolder.gson.fromJson(it, NotesNote::class.java) @@ -230,8 +232,8 @@ class NotesService { */ fun notesGetComments( noteId: Int, - ownerId: Int? = null, - sort: SortParam? = null, + ownerId: UserId? = null, + sort: NotesGetCommentsSort? = null, offset: Int? = null, count: Int? = null ): VKRequest = NewApiRequest("notes.getComments") { @@ -252,7 +254,7 @@ class NotesService { * @param ownerId - Note owner ID. * @return [VKRequest] with [BaseOkResponse] */ - fun notesRestoreComment(commentId: Int, ownerId: Int? = null): VKRequest = + fun notesRestoreComment(commentId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("notes.restoreComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/notes/dto/NotesGetCommentsSort.kt b/api/src/main/java/com/vk/sdk/api/notes/dto/NotesGetCommentsSort.kt new file mode 100644 index 0000000000..2a1a7dedda --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/notes/dto/NotesGetCommentsSort.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.notes.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class NotesGetCommentsSort( + val value: Int +) { + @SerializedName("0") + ZERO_(0), + + @SerializedName("1") + ONE_(1); +} diff --git a/api/src/main/java/com/vk/sdk/api/notes/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/notes/dto/NotesGetSort.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/notes/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/notes/dto/NotesGetSort.kt index ca2a488e4a..f1f25a82fd 100644 --- a/api/src/main/java/com/vk/sdk/api/notes/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/notes/dto/NotesGetSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.notes.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class SortParam( +enum class NotesGetSort( val value: Int ) { @SerializedName("0") 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 e1226992a3..26f70240ae 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 @@ -29,13 +29,14 @@ package com.vk.sdk.api.notifications import com.google.gson.reflect.TypeToken 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.notifications.dto.FiltersParam +import com.vk.sdk.api.notifications.dto.NotificationsGetFilters import com.vk.sdk.api.notifications.dto.NotificationsGetResponse import com.vk.sdk.api.notifications.dto.NotificationsSendMessageItem -import com.vk.sdk.api.notifications.dto.SendingModeParam +import com.vk.sdk.api.notifications.dto.NotificationsSendMessageSendingMode import kotlin.Int import kotlin.String import kotlin.collections.List @@ -46,7 +47,7 @@ class NotificationsService { * * @param count - Number of notifications to return. * @param startFrom - * @param filters - Type of notifications to return: 'wall' - wall posts, 'mentions' - mentions + * @param filters - Type of notifications to return_ 'wall' - wall posts, 'mentions' - mentions * in wall posts, comments, or topics, 'comments' - comments to wall posts, photos, and videos, * 'likes' - likes, 'reposted' - wall posts that are copied from the current user's wall, * 'followers' - new followers, 'friends' - accepted friend requests @@ -59,7 +60,7 @@ class NotificationsService { fun notificationsGet( count: Int? = null, startFrom: String? = null, - filters: List? = null, + filters: List? = null, startTime: Int? = null, endTime: Int? = null ): VKRequest = NewApiRequest("notifications.get") { @@ -93,7 +94,7 @@ class NotificationsService { * @param fragment * @param groupId * @param randomId - * @param sendingMode - Type of sending (delivering) notifications: 'immediately' - push and + * @param sendingMode - Type of sending (delivering) notifications_ 'immediately' - push and * bell notifications will be delivered as soon as possible, 'delayed' - push and bell * notifications will be delivered in the most comfortable time for the user, 'delayed_push' - only * push notifications will be delivered in the most comfortable time, while the bell notifications @@ -104,9 +105,9 @@ class NotificationsService { userIds: List, message: String, fragment: String? = null, - groupId: Int? = null, + groupId: UserId? = null, randomId: Int? = null, - sendingMode: SendingModeParam? = null + sendingMode: NotificationsSendMessageSendingMode? = null ): VKRequest> = NewApiRequest("notifications.sendMessage") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) diff --git a/api/src/main/java/com/vk/sdk/api/notifications/dto/FiltersParam.kt b/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsGetFilters.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/notifications/dto/FiltersParam.kt rename to api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsGetFilters.kt index f698e26ca2..b029c856fd 100644 --- a/api/src/main/java/com/vk/sdk/api/notifications/dto/FiltersParam.kt +++ b/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsGetFilters.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.notifications.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FiltersParam( +enum class NotificationsGetFilters( val value: String ) { @SerializedName("wall") diff --git a/api/src/main/java/com/vk/sdk/api/notifications/dto/SendingModeParam.kt b/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsSendMessageSendingMode.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/notifications/dto/SendingModeParam.kt rename to api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsSendMessageSendingMode.kt index 5100cc8154..1923252b83 100644 --- a/api/src/main/java/com/vk/sdk/api/notifications/dto/SendingModeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/notifications/dto/NotificationsSendMessageSendingMode.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.notifications.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SendingModeParam( +enum class NotificationsSendMessageSendingMode( val value: String ) { @SerializedName("delayed") 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 3d6f67c6a1..adb5b177be 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 @@ -29,11 +29,12 @@ package com.vk.sdk.api.orders import com.google.gson.reflect.TypeToken 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.orders.dto.ActionParam import com.vk.sdk.api.orders.dto.OrdersAmount +import com.vk.sdk.api.orders.dto.OrdersChangeStateAction import com.vk.sdk.api.orders.dto.OrdersGetUserSubscriptionsResponse import com.vk.sdk.api.orders.dto.OrdersOrder import com.vk.sdk.api.orders.dto.OrdersSubscription @@ -50,7 +51,7 @@ class OrdersService { * @return [VKRequest] with [BaseBoolInt] */ fun ordersCancelSubscription( - userId: Int, + userId: UserId, subscriptionId: Int, pendingCancel: Boolean? = null ): VKRequest = NewApiRequest("orders.cancelSubscription") { @@ -66,7 +67,7 @@ class OrdersService { * Changes order status. * * @param orderId - order ID. - * @param action - action to be done with the order. Available actions: *cancel - to cancel + * @param action - action to be done with the order. Available actions_ *cancel - to cancel * unconfirmed order. *charge - to confirm unconfirmed order. Applies only if processing of * [vk.com/dev/payments_status|order_change_state] notification failed. *refund - to cancel * confirmed order. @@ -77,7 +78,7 @@ class OrdersService { */ fun ordersChangeState( orderId: Int, - action: ActionParam, + action: OrdersChangeStateAction, appOrderId: Int? = null, testMode: Boolean? = null ): VKRequest = NewApiRequest("orders.changeState") { @@ -116,11 +117,12 @@ class OrdersService { /** * @param userId * @param votes - * @return [VKRequest] with [OrdersAmount] + * @return [VKRequest] with [Unit] */ - fun ordersGetAmount(userId: Int, votes: List): VKRequest = + fun ordersGetAmount(userId: UserId, votes: List): VKRequest> = NewApiRequest("orders.getAmount") { - GsonHolder.gson.fromJson(it, OrdersAmount::class.java) + val typeToken = object: TypeToken>() {}.type + GsonHolder.gson.fromJson>(it, typeToken) } .apply { addParam("user_id", userId) @@ -155,7 +157,7 @@ class OrdersService { * @param subscriptionId * @return [VKRequest] with [OrdersSubscription] */ - fun ordersGetUserSubscriptionById(userId: Int, subscriptionId: Int): + fun ordersGetUserSubscriptionById(userId: UserId, subscriptionId: Int): VKRequest = NewApiRequest("orders.getUserSubscriptionById") { GsonHolder.gson.fromJson(it, OrdersSubscription::class.java) } @@ -168,7 +170,7 @@ class OrdersService { * @param userId * @return [VKRequest] with [OrdersGetUserSubscriptionsResponse] */ - fun ordersGetUserSubscriptions(userId: Int): VKRequest = + fun ordersGetUserSubscriptions(userId: UserId): VKRequest = NewApiRequest("orders.getUserSubscriptions") { GsonHolder.gson.fromJson(it, OrdersGetUserSubscriptionsResponse::class.java) } @@ -183,7 +185,7 @@ class OrdersService { * @return [VKRequest] with [BaseBoolInt] */ fun ordersUpdateSubscription( - userId: Int, + userId: UserId, subscriptionId: Int, price: Int ): VKRequest = NewApiRequest("orders.updateSubscription") { diff --git a/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersAmountItem.kt b/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersAmountItem.kt index 4adc76b2aa..7c9af0f196 100644 --- a/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersAmountItem.kt +++ b/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersAmountItem.kt @@ -28,7 +28,7 @@ package com.vk.sdk.api.orders.dto import com.google.gson.annotations.SerializedName -import kotlin.Int +import kotlin.Float import kotlin.String /** @@ -38,7 +38,7 @@ import kotlin.String */ data class OrdersAmountItem( @SerializedName("amount") - val amount: Int? = null, + val amount: Float? = null, @SerializedName("description") val description: String? = null, @SerializedName("votes") diff --git a/api/src/main/java/com/vk/sdk/api/orders/dto/ActionParam.kt b/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersChangeStateAction.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/orders/dto/ActionParam.kt rename to api/src/main/java/com/vk/sdk/api/orders/dto/OrdersChangeStateAction.kt index cbe91b1450..0da03242c1 100644 --- a/api/src/main/java/com/vk/sdk/api/orders/dto/ActionParam.kt +++ b/api/src/main/java/com/vk/sdk/api/orders/dto/OrdersChangeStateAction.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.orders.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class ActionParam( +enum class OrdersChangeStateAction( val value: String ) { @SerializedName("cancel") 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 e7c334ed2b..7bd9df4c6e 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 @@ -29,14 +29,15 @@ package com.vk.sdk.api.pages import com.google.gson.reflect.TypeToken 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.BaseOkResponse -import com.vk.sdk.api.pages.dto.EditParam +import com.vk.sdk.api.pages.dto.PagesSaveAccessEdit +import com.vk.sdk.api.pages.dto.PagesSaveAccessView import com.vk.sdk.api.pages.dto.PagesWikipage import com.vk.sdk.api.pages.dto.PagesWikipageFull import com.vk.sdk.api.pages.dto.PagesWikipageHistory -import com.vk.sdk.api.pages.dto.ViewParam import kotlin.Boolean import kotlin.Int import kotlin.String @@ -70,7 +71,7 @@ class PagesService { * @return [VKRequest] with [PagesWikipageFull] */ fun pagesGet( - ownerId: Int? = null, + ownerId: UserId? = null, pageId: Int? = null, global: Boolean? = null, sitePreview: Boolean? = null, @@ -100,8 +101,8 @@ class PagesService { */ fun pagesGetHistory( pageId: Int, - groupId: Int? = null, - userId: Int? = null + groupId: UserId? = null, + userId: UserId? = null ): VKRequest> = NewApiRequest("pages.getHistory") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -118,7 +119,7 @@ class PagesService { * @param groupId - ID of the community that owns the wiki page. * @return [VKRequest] with [Unit] */ - fun pagesGetTitles(groupId: Int? = null): VKRequest> = + fun pagesGetTitles(groupId: UserId? = null): VKRequest> = NewApiRequest("pages.getTitles") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -138,8 +139,8 @@ class PagesService { */ fun pagesGetVersion( versionId: Int, - groupId: Int? = null, - userId: Int? = null, + groupId: UserId? = null, + userId: UserId? = null, needHtml: Boolean? = null ): VKRequest = NewApiRequest("pages.getVersion") { GsonHolder.gson.fromJson(it, PagesWikipageFull::class.java) @@ -158,7 +159,7 @@ class PagesService { * @param groupId - ID of the group in the context of which this markup is interpreted. * @return [VKRequest] with [String] */ - fun pagesParseWiki(text: String, groupId: Int? = null): VKRequest = + fun pagesParseWiki(text: String, groupId: UserId? = null): VKRequest = NewApiRequest("pages.parseWiki") { GsonHolder.gson.fromJson(it, String::class.java) } @@ -180,8 +181,8 @@ class PagesService { fun pagesSave( text: String? = null, pageId: Int? = null, - groupId: Int? = null, - userId: Int? = null, + groupId: UserId? = null, + userId: UserId? = null, title: String? = null ): VKRequest = NewApiRequest("pages.save") { GsonHolder.gson.fromJson(it, Int::class.java) @@ -200,18 +201,18 @@ class PagesService { * @param pageId - Wiki page ID. * @param groupId - ID of the community that owns the wiki page. * @param userId - * @param view - Who can view the wiki page: '1' - only community members, '2' - all users can + * @param view - Who can view the wiki page_ '1' - only community members, '2' - all users can * view the page, '0' - only community managers - * @param edit - Who can edit the wiki page: '1' - only community members, '2' - all users can + * @param edit - Who can edit the wiki page_ '1' - only community members, '2' - all users can * edit the page, '0' - only community managers * @return [VKRequest] with [Int] */ fun pagesSaveAccess( pageId: Int, - groupId: Int? = null, - userId: Int? = null, - view: ViewParam? = null, - edit: EditParam? = null + groupId: UserId? = null, + userId: UserId? = null, + view: PagesSaveAccessView? = null, + edit: PagesSaveAccessEdit? = null ): VKRequest = NewApiRequest("pages.saveAccess") { GsonHolder.gson.fromJson(it, Int::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/pages/dto/EditParam.kt b/api/src/main/java/com/vk/sdk/api/pages/dto/PagesSaveAccessEdit.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/pages/dto/EditParam.kt rename to api/src/main/java/com/vk/sdk/api/pages/dto/PagesSaveAccessEdit.kt index 0c164e6e2a..d77fce8f71 100644 --- a/api/src/main/java/com/vk/sdk/api/pages/dto/EditParam.kt +++ b/api/src/main/java/com/vk/sdk/api/pages/dto/PagesSaveAccessEdit.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.pages.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class EditParam( +enum class PagesSaveAccessEdit( val value: Int ) { @SerializedName("0") diff --git a/api/src/main/java/com/vk/sdk/api/pages/dto/ViewParam.kt b/api/src/main/java/com/vk/sdk/api/pages/dto/PagesSaveAccessView.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/pages/dto/ViewParam.kt rename to api/src/main/java/com/vk/sdk/api/pages/dto/PagesSaveAccessView.kt index 9654cde984..577b038383 100644 --- a/api/src/main/java/com/vk/sdk/api/pages/dto/ViewParam.kt +++ b/api/src/main/java/com/vk/sdk/api/pages/dto/PagesSaveAccessView.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.pages.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class ViewParam( +enum class PagesSaveAccessView( val value: Int ) { @SerializedName("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 98de7b71d8..93a275eab0 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 @@ -29,6 +29,7 @@ package com.vk.sdk.api.photos import com.google.gson.reflect.TypeToken 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 @@ -40,7 +41,9 @@ import com.vk.sdk.api.photos.dto.PhotosGetAllCommentsResponse import com.vk.sdk.api.photos.dto.PhotosGetAllExtendedResponse import com.vk.sdk.api.photos.dto.PhotosGetAllResponse import com.vk.sdk.api.photos.dto.PhotosGetCommentsExtendedResponse +import com.vk.sdk.api.photos.dto.PhotosGetCommentsExtendedSort import com.vk.sdk.api.photos.dto.PhotosGetCommentsResponse +import com.vk.sdk.api.photos.dto.PhotosGetCommentsSort import com.vk.sdk.api.photos.dto.PhotosGetExtendedResponse import com.vk.sdk.api.photos.dto.PhotosGetNewTagsResponse import com.vk.sdk.api.photos.dto.PhotosGetResponse @@ -51,10 +54,10 @@ import com.vk.sdk.api.photos.dto.PhotosPhotoAlbumFull import com.vk.sdk.api.photos.dto.PhotosPhotoFull 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.PhotosSaveOwnerPhotoResponse import com.vk.sdk.api.photos.dto.PhotosSearchResponse -import com.vk.sdk.api.photos.dto.ReasonParam -import com.vk.sdk.api.photos.dto.SortParam import com.vk.sdk.api.users.dto.UsersFields import kotlin.Boolean import kotlin.Float @@ -74,7 +77,7 @@ class PhotosService { fun photosConfirmTag( photoId: String, tagId: Int, - ownerId: Int? = null + ownerId: UserId? = null ): VKRequest = NewApiRequest("photos.confirmTag") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -93,7 +96,7 @@ class PhotosService { * @return [VKRequest] with [Int] */ fun photosCopy( - ownerId: Int, + ownerId: UserId, photoId: Int, accessKey: String? = null ): VKRequest = NewApiRequest("photos.copy") { @@ -119,7 +122,7 @@ class PhotosService { */ fun photosCreateAlbum( title: String, - groupId: Int? = null, + groupId: UserId? = null, description: String? = null, privacyView: List? = null, privacyComment: List? = null, @@ -145,9 +148,9 @@ class PhotosService { * @param ownerId - ID of the user or community that owns the photo. * @param message - Comment text. * @param attachments - (Required if 'message' is not set.) List of objects attached to the - * post, in the following format: "_,_", '' - Type of media - * attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - - * Media attachment owner ID. '' - Media attachment ID. Example: + * post, in the following format_ "_,_", '' - Type of media + * attachment_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - + * Media attachment owner ID. '' - Media attachment ID. Example_ * "photo100172_166443618,photo66748_265827614" * @param fromGroup - '1' - to post a comment from the community * @param replyToComment @@ -158,7 +161,7 @@ class PhotosService { */ fun photosCreateComment( photoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, message: String? = null, attachments: List? = null, fromGroup: Boolean? = null, @@ -188,7 +191,7 @@ class PhotosService { * @param ownerId - ID of the user or community that owns the photo. * @return [VKRequest] with [BaseOkResponse] */ - fun photosDelete(photoId: Int, ownerId: Int? = null): VKRequest = + fun photosDelete(photoId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("photos.delete") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -204,7 +207,7 @@ class PhotosService { * @param groupId - ID of the community that owns the album. * @return [VKRequest] with [BaseOkResponse] */ - fun photosDeleteAlbum(albumId: Int, groupId: Int? = null): VKRequest = + fun photosDeleteAlbum(albumId: Int, groupId: UserId? = null): VKRequest = NewApiRequest("photos.deleteAlbum") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -220,7 +223,7 @@ class PhotosService { * @param ownerId - ID of the user or community that owns the photo. * @return [VKRequest] with [BaseBoolInt] */ - fun photosDeleteComment(commentId: Int, ownerId: Int? = null): VKRequest = + fun photosDeleteComment(commentId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("photos.deleteComment") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -245,7 +248,7 @@ class PhotosService { */ fun photosEdit( photoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, caption: String? = null, latitude: Float? = null, longitude: Float? = null, @@ -283,7 +286,7 @@ class PhotosService { albumId: Int, title: String? = null, description: String? = null, - ownerId: Int? = null, + ownerId: UserId? = null, privacyView: List? = null, privacyComment: List? = null, uploadByAdminsOnly: Boolean? = null, @@ -309,15 +312,15 @@ class PhotosService { * @param ownerId - ID of the user or community that owns the photo. * @param message - New text of the comment. * @param attachments - (Required if 'message' is not set.) List of objects attached to the - * post, in the following format: "_,_", '' - Type of media - * attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - - * Media attachment owner ID. '' - Media attachment ID. Example: + * post, in the following format_ "_,_", '' - Type of media + * attachment_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - + * Media attachment owner ID. '' - Media attachment ID. Example_ * "photo100172_166443618,photo66748_265827614" * @return [VKRequest] with [BaseOkResponse] */ fun photosEditComment( commentId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, message: String? = null, attachments: List? = null ): VKRequest = NewApiRequest("photos.editComment") { @@ -336,9 +339,9 @@ class PhotosService { * @param ownerId - ID of the user or community that owns the photos. Use a negative value to * designate a community ID. * @param albumId - Photo album ID. To return information about photos from service albums, use - * the following string values: 'profile, wall, saved'. + * the following string values_ 'profile, wall, saved'. * @param photoIds - Photo IDs. - * @param rev - Sort order: '1' - reverse chronological, '0' - chronological + * @param rev - Sort order_ '1' - reverse chronological, '0' - chronological * @param feedType - Type of feed obtained in 'feed' field of the method. * @param feed - unixtime, that can be obtained with [vk.com/dev/newsfeed.get|newsfeed.get] * method in date field to get all photos uploaded by the user on a specific day, or photos the @@ -350,7 +353,7 @@ class PhotosService { * @return [VKRequest] with [PhotosGetResponse] */ fun photosGet( - ownerId: Int? = null, + ownerId: UserId? = null, albumId: String? = null, photoIds: List? = null, rev: Boolean? = null, @@ -380,9 +383,9 @@ class PhotosService { * @param ownerId - ID of the user or community that owns the photos. Use a negative value to * designate a community ID. * @param albumId - Photo album ID. To return information about photos from service albums, use - * the following string values: 'profile, wall, saved'. + * the following string values_ 'profile, wall, saved'. * @param photoIds - Photo IDs. - * @param rev - Sort order: '1' - reverse chronological, '0' - chronological + * @param rev - Sort order_ '1' - reverse chronological, '0' - chronological * @param feedType - Type of feed obtained in 'feed' field of the method. * @param feed - unixtime, that can be obtained with [vk.com/dev/newsfeed.get|newsfeed.get] * method in date field to get all photos uploaded by the user on a specific day, or photos the @@ -394,7 +397,7 @@ class PhotosService { * @return [VKRequest] with [PhotosGetExtendedResponse] */ fun photosGetExtended( - ownerId: Int? = null, + ownerId: UserId? = null, albumId: String? = null, photoIds: List? = null, rev: Boolean? = null, @@ -432,7 +435,7 @@ class PhotosService { * @return [VKRequest] with [PhotosGetAlbumsResponse] */ fun photosGetAlbums( - ownerId: Int? = null, + ownerId: UserId? = null, albumIds: List? = null, offset: Int? = null, count: Int? = null, @@ -459,7 +462,7 @@ class PhotosService { * @param groupId - Community ID. * @return [VKRequest] with [Int] */ - fun photosGetAlbumsCount(userId: Int? = null, groupId: Int? = null): VKRequest = + fun photosGetAlbumsCount(userId: UserId? = null, groupId: UserId? = null): VKRequest = NewApiRequest("photos.getAlbumsCount") { GsonHolder.gson.fromJson(it, Int::class.java) } @@ -485,7 +488,7 @@ class PhotosService { * @return [VKRequest] with [PhotosGetAllResponse] */ fun photosGetAll( - ownerId: Int? = null, + ownerId: UserId? = null, offset: Int? = null, count: Int? = null, photoSizes: Boolean? = null, @@ -522,7 +525,7 @@ class PhotosService { * @return [VKRequest] with [PhotosGetAllExtendedResponse] */ fun photosGetAllExtended( - ownerId: Int? = null, + ownerId: UserId? = null, offset: Int? = null, count: Int? = null, photoSizes: Boolean? = null, @@ -556,7 +559,7 @@ class PhotosService { * @return [VKRequest] with [PhotosGetAllCommentsResponse] */ fun photosGetAllComments( - ownerId: Int? = null, + ownerId: UserId? = null, albumId: Int? = null, needLikes: Boolean? = null, offset: Int? = null, @@ -577,7 +580,7 @@ class PhotosService { * * @param photos - IDs separated with a comma, that are IDs of users who posted photos and IDs * of photos themselves with an underscore character between such IDs. To get information about a - * photo in the group album, you shall specify group ID instead of user ID. Example: + * photo in the group album, you shall specify group ID instead of user ID. Example_ * "1_129207899,6492_135055734, , -20629724_271945303" * @param photoSizes - '1' - to return photo sizes in a * @return [VKRequest] with [Unit] @@ -597,7 +600,7 @@ class PhotosService { * * @param photos - IDs separated with a comma, that are IDs of users who posted photos and IDs * of photos themselves with an underscore character between such IDs. To get information about a - * photo in the group album, you shall specify group ID instead of user ID. Example: + * photo in the group album, you shall specify group ID instead of user ID. Example_ * "1_129207899,6492_135055734, , -20629724_271945303" * @param photoSizes - '1' - to return photo sizes in a * @return [VKRequest] with [Unit] @@ -646,19 +649,19 @@ class PhotosService { * @param startCommentId * @param offset - Offset needed to return a specific subset of comments. By default, '0'. * @param count - Number of comments to return. - * @param sort - Sort order: 'asc' - old first, 'desc' - new first + * @param sort - Sort order_ 'asc' - old first, 'desc' - new first * @param accessKey * @param fields * @return [VKRequest] with [PhotosGetCommentsResponse] */ fun photosGetComments( photoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, needLikes: Boolean? = null, startCommentId: Int? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null, + sort: PhotosGetCommentsSort? = null, accessKey: String? = null, fields: List? = null ): VKRequest = NewApiRequest("photos.getComments") { @@ -688,19 +691,19 @@ class PhotosService { * @param startCommentId * @param offset - Offset needed to return a specific subset of comments. By default, '0'. * @param count - Number of comments to return. - * @param sort - Sort order: 'asc' - old first, 'desc' - new first + * @param sort - Sort order_ 'asc' - old first, 'desc' - new first * @param accessKey * @param fields * @return [VKRequest] with [PhotosGetCommentsExtendedResponse] */ fun photosGetCommentsExtended( photoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, needLikes: Boolean? = null, startCommentId: Int? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null, + sort: PhotosGetCommentsExtendedSort? = null, accessKey: String? = null, fields: List? = null ): VKRequest = NewApiRequest("photos.getComments") { @@ -728,7 +731,7 @@ class PhotosService { * @param groupId - Community ID. * @return [VKRequest] with [BaseUploadServer] */ - fun photosGetMarketAlbumUploadServer(groupId: Int): VKRequest = + fun photosGetMarketAlbumUploadServer(groupId: UserId): VKRequest = NewApiRequest("photos.getMarketAlbumUploadServer") { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } @@ -747,7 +750,7 @@ class PhotosService { * @return [VKRequest] with [BaseUploadServer] */ fun photosGetMarketUploadServer( - groupId: Int, + groupId: UserId, mainPhoto: Boolean? = null, cropX: Int? = null, cropY: Int? = null, @@ -766,8 +769,8 @@ class PhotosService { /** * Returns the server address for photo upload in a private message for a user. * - * @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 peerId - Destination ID. "For user_ 'User ID', e.g. '12345'. For chat_ '2000000000' + + * 'Chat ID', e.g. '2000000001'. For community_ '- Community ID', e.g. '-12345'. " * @return [VKRequest] with [PhotosPhotoUpload] */ fun photosGetMessagesUploadServer(peerId: Int? = null): VKRequest = @@ -806,7 +809,7 @@ class PhotosService { * @return [VKRequest] with [BaseUploadServer] */ fun photosGetOwnerCoverPhotoUploadServer( - groupId: Int, + groupId: UserId, cropX: Int? = null, cropY: Int? = null, cropX2: Int? = null, @@ -829,7 +832,7 @@ class PhotosService { * negative. 'owner_id=1' - user, 'owner_id=-1' - community, " * @return [VKRequest] with [BaseUploadServer] */ - fun photosGetOwnerPhotoUploadServer(ownerId: Int? = null): VKRequest = + fun photosGetOwnerPhotoUploadServer(ownerId: UserId? = null): VKRequest = NewApiRequest("photos.getOwnerPhotoUploadServer") { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } @@ -847,7 +850,7 @@ class PhotosService { */ fun photosGetTags( photoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, accessKey: String? = null ): VKRequest> = NewApiRequest("photos.getTags") { val typeToken = object: TypeToken>() {}.type @@ -867,7 +870,7 @@ class PhotosService { * @param albumId * @return [VKRequest] with [PhotosPhotoUpload] */ - fun photosGetUploadServer(groupId: Int? = null, albumId: Int? = null): + fun photosGetUploadServer(groupId: UserId? = null, albumId: Int? = null): VKRequest = NewApiRequest("photos.getUploadServer") { GsonHolder.gson.fromJson(it, PhotosPhotoUpload::class.java) } @@ -882,12 +885,12 @@ class PhotosService { * @param userId - User ID. * @param offset - Offset needed to return a specific subset of photos. By default, '0'. * @param count - Number of photos to return. Maximum value is 1000. - * @param sort - Sort order: '1' - by date the tag was added in ascending order, '0' - by date + * @param sort - Sort order_ '1' - by date the tag was added in ascending order, '0' - by date * the tag was added in descending order * @return [VKRequest] with [PhotosGetUserPhotosResponse] */ fun photosGetUserPhotos( - userId: Int? = null, + userId: UserId? = null, offset: Int? = null, count: Int? = null, sort: String? = null @@ -907,12 +910,12 @@ class PhotosService { * @param userId - User ID. * @param offset - Offset needed to return a specific subset of photos. By default, '0'. * @param count - Number of photos to return. Maximum value is 1000. - * @param sort - Sort order: '1' - by date the tag was added in ascending order, '0' - by date + * @param sort - Sort order_ '1' - by date the tag was added in ascending order, '0' - by date * the tag was added in descending order * @return [VKRequest] with [PhotosGetUserPhotosExtendedResponse] */ fun photosGetUserPhotosExtended( - userId: Int? = null, + userId: UserId? = null, offset: Int? = null, count: Int? = null, sort: String? = null @@ -951,7 +954,7 @@ class PhotosService { */ fun photosMakeCover( photoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, albumId: Int? = null ): VKRequest = NewApiRequest("photos.makeCover") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) @@ -973,7 +976,7 @@ class PhotosService { fun photosMove( targetAlbumId: Int, photoId: Int, - ownerId: Int? = null + ownerId: UserId? = null ): VKRequest = NewApiRequest("photos.move") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1001,8 +1004,8 @@ class PhotosService { */ fun photosPutTag( photoId: Int, - userId: Int, - ownerId: Int? = null, + userId: UserId, + ownerId: UserId? = null, x: Float? = null, y: Float? = null, x2: Float? = null, @@ -1031,7 +1034,7 @@ class PhotosService { fun photosRemoveTag( photoId: Int, tagId: Int, - ownerId: Int? = null + ownerId: UserId? = null ): VKRequest = NewApiRequest("photos.removeTag") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1052,7 +1055,7 @@ class PhotosService { */ fun photosReorderAlbums( albumId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, before: Int? = null, after: Int? = null ): VKRequest = NewApiRequest("photos.reorderAlbums") { @@ -1076,7 +1079,7 @@ class PhotosService { */ fun photosReorderPhotos( photoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, before: Int? = null, after: Int? = null ): VKRequest = NewApiRequest("photos.reorderPhotos") { @@ -1094,14 +1097,14 @@ class PhotosService { * * @param ownerId - ID of the user or community that owns the photo. * @param photoId - Photo ID. - * @param reason - Reason for the complaint: '0' - spam, '1' - child pornography, '2' - + * @param reason - Reason for the complaint_ '0' - spam, '1' - child pornography, '2' - * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse * @return [VKRequest] with [BaseOkResponse] */ fun photosReport( - ownerId: Int, + ownerId: UserId, photoId: Int, - reason: ReasonParam? = null + reason: PhotosReportReason? = null ): VKRequest = NewApiRequest("photos.report") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1116,14 +1119,14 @@ class PhotosService { * * @param ownerId - ID of the user or community that owns the photo. * @param commentId - ID of the comment being reported. - * @param reason - Reason for the complaint: '0' - spam, '1' - child pornography, '2' - + * @param reason - Reason for the complaint_ '0' - spam, '1' - child pornography, '2' - * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse * @return [VKRequest] with [BaseOkResponse] */ fun photosReportComment( - ownerId: Int, + ownerId: UserId, commentId: Int, - reason: ReasonParam? = null + reason: PhotosReportCommentReason? = null ): VKRequest = NewApiRequest("photos.reportComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1140,7 +1143,7 @@ class PhotosService { * @param ownerId - ID of the user or community that owns the photo. * @return [VKRequest] with [BaseOkResponse] */ - fun photosRestore(photoId: Int, ownerId: Int? = null): VKRequest = + fun photosRestore(photoId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("photos.restore") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -1156,7 +1159,7 @@ class PhotosService { * @param ownerId - ID of the user or community that owns the photo. * @return [VKRequest] with [BaseBoolInt] */ - fun photosRestoreComment(commentId: Int, ownerId: Int? = null): VKRequest = + fun photosRestoreComment(commentId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("photos.restoreComment") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -1183,7 +1186,7 @@ class PhotosService { */ fun photosSave( albumId: Int? = null, - groupId: Int? = null, + groupId: UserId? = null, server: Int? = null, photosList: String? = null, hash: String? = null, @@ -1218,7 +1221,7 @@ class PhotosService { * @return [VKRequest] with [Unit] */ fun photosSaveMarketAlbumPhoto( - groupId: Int, + groupId: UserId, photo: String, server: Int, hash: String @@ -1253,7 +1256,7 @@ class PhotosService { photo: String, server: Int, hash: String, - groupId: Int? = null, + groupId: UserId? = null, cropData: String? = null, cropHash: String? = null ): VKRequest> = NewApiRequest("photos.saveMarketPhoto") { @@ -1350,8 +1353,8 @@ class PhotosService { */ fun photosSaveWallPhoto( photo: String, - userId: Int? = null, - groupId: Int? = null, + userId: UserId? = null, + groupId: UserId? = null, server: Int? = null, hash: String? = null, latitude: Float? = null, @@ -1380,10 +1383,10 @@ class PhotosService { * @param long - Geographical longitude, in degrees (from '-180' to '180'). * @param startTime * @param endTime - * @param sort - Sort order: + * @param sort - Sort order_ * @param offset - Offset needed to return a specific subset of photos. * @param count - Number of photos to return. - * @param radius - Radius of search in meters (works very approximately). Available values: + * @param radius - Radius of search in meters (works very approximately). Available values_ * '10', '100', '800', '6000', '50000'. * @return [VKRequest] with [PhotosSearchResponse] */ diff --git a/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetCommentsExtendedSort.kt b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetCommentsExtendedSort.kt new file mode 100644 index 0000000000..6fde3bc266 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetCommentsExtendedSort.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.photos.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class PhotosGetCommentsExtendedSort( + val value: String +) { + @SerializedName("asc") + OLD_FIRST("asc"), + + @SerializedName("desc") + NEW_FIRST("desc"); +} diff --git a/api/src/main/java/com/vk/sdk/api/photos/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetCommentsSort.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/photos/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetCommentsSort.kt index 6181fa6e4b..7d2d8f32cd 100644 --- a/api/src/main/java/com/vk/sdk/api/photos/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosGetCommentsSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.photos.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SortParam( +enum class PhotosGetCommentsSort( val value: String ) { @SerializedName("asc") diff --git a/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosReportCommentReason.kt b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosReportCommentReason.kt new file mode 100644 index 0000000000..3e8b658954 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosReportCommentReason.kt @@ -0,0 +1,56 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.photos.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class PhotosReportCommentReason( + val value: Int +) { + @SerializedName("0") + SPAM(0), + + @SerializedName("1") + CHILD_PORNOGRAPHY(1), + + @SerializedName("2") + EXTREMISM(2), + + @SerializedName("3") + VIOLENCE(3), + + @SerializedName("4") + DRUG_PROPAGANDA(4), + + @SerializedName("5") + ADULT_MATERIAL(5), + + @SerializedName("6") + INSULT_ABUSE(6); +} diff --git a/api/src/main/java/com/vk/sdk/api/photos/dto/ReasonParam.kt b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosReportReason.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/photos/dto/ReasonParam.kt rename to api/src/main/java/com/vk/sdk/api/photos/dto/PhotosReportReason.kt index d70e6d179a..7afaeda1bd 100644 --- a/api/src/main/java/com/vk/sdk/api/photos/dto/ReasonParam.kt +++ b/api/src/main/java/com/vk/sdk/api/photos/dto/PhotosReportReason.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.photos.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class ReasonParam( +enum class PhotosReportReason( val value: Int ) { @SerializedName("0") 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 1fe2e9d221..8ef9f7cbcf 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 @@ -29,14 +29,17 @@ package com.vk.sdk.api.polls import com.google.gson.reflect.TypeToken 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.base.dto.BaseUploadServer -import com.vk.sdk.api.polls.dto.BackgroundIdParam -import com.vk.sdk.api.polls.dto.NameCaseParam import com.vk.sdk.api.polls.dto.PollsBackground +import com.vk.sdk.api.polls.dto.PollsCreateBackgroundId +import com.vk.sdk.api.polls.dto.PollsEditBackgroundId +import com.vk.sdk.api.polls.dto.PollsGetByIdNameCase +import com.vk.sdk.api.polls.dto.PollsGetVotersNameCase import com.vk.sdk.api.polls.dto.PollsPoll import com.vk.sdk.api.polls.dto.PollsVoters import com.vk.sdk.api.users.dto.UsersFields @@ -59,7 +62,7 @@ class PollsService { fun pollsAddVote( pollId: Int, answerIds: List, - ownerId: Int? = null, + ownerId: UserId? = null, isBoard: Boolean? = null ): VKRequest = NewApiRequest("polls.addVote") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) @@ -82,7 +85,7 @@ class PollsService { * @param ownerId - If a poll will be added to a communty it is required to send a negative * group identifier. Current user by default. * @param appId - * @param addAnswers - available answers list, for example: " ["yes","no","maybe"]", There can + * @param addAnswers - available answers list, for example_ " ["yes","no","maybe"]", There can * be from 1 to 10 answers. * @param photoId * @param backgroundId @@ -94,11 +97,11 @@ class PollsService { isAnonymous: Boolean? = null, isMultiple: Boolean? = null, endDate: Int? = null, - ownerId: Int? = null, + ownerId: UserId? = null, appId: Int? = null, addAnswers: String? = null, photoId: Int? = null, - backgroundId: BackgroundIdParam? = null, + backgroundId: PollsCreateBackgroundId? = null, disableUnvote: Boolean? = null ): VKRequest = NewApiRequest("polls.create") { GsonHolder.gson.fromJson(it, PollsPoll::class.java) @@ -129,7 +132,7 @@ class PollsService { fun pollsDeleteVote( pollId: Int, answerId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, isBoard: Boolean? = null ): VKRequest = NewApiRequest("polls.deleteVote") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) @@ -147,10 +150,10 @@ class PollsService { * @param pollId - edited poll's id * @param ownerId - poll owner id * @param question - new question text - * @param addAnswers - answers list, for example: , "["yes","no","maybe"]" + * @param addAnswers - answers list, for example_ , "["yes","no","maybe"]" * @param editAnswers - object containing answers that need to be edited,, key - answer id, - * value - new answer text. Example: {"382967099":"option1", "382967103":"option2"}" - * @param deleteAnswers - list of answer ids to be deleted. For example: "[382967099, + * value - new answer text. Example_ {"382967099"_"option1", "382967103"_"option2"}" + * @param deleteAnswers - list of answer ids to be deleted. For example_ "[382967099, * 382967103]" * @param endDate * @param photoId @@ -159,14 +162,14 @@ class PollsService { */ fun pollsEdit( pollId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, question: String? = null, addAnswers: String? = null, editAnswers: String? = null, deleteAnswers: String? = null, endDate: Int? = null, photoId: Int? = null, - backgroundId: BackgroundIdParam? = null + backgroundId: PollsEditBackgroundId? = null ): VKRequest = NewApiRequest("polls.edit") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -205,11 +208,11 @@ class PollsService { */ fun pollsGetById( pollId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, isBoard: Boolean? = null, friendsCount: Int? = null, fields: List? = null, - nameCase: NameCaseParam? = null + nameCase: PollsGetByIdNameCase? = null ): VKRequest = NewApiRequest("polls.getById") { GsonHolder.gson.fromJson(it, PollsPoll::class.java) } @@ -226,7 +229,7 @@ class PollsService { * @param ownerId * @return [VKRequest] with [BaseUploadServer] */ - fun pollsGetPhotoUploadServer(ownerId: Int? = null): VKRequest = + fun pollsGetPhotoUploadServer(ownerId: UserId? = null): VKRequest = NewApiRequest("polls.getPhotoUploadServer") { GsonHolder.gson.fromJson(it, BaseUploadServer::class.java) } @@ -247,10 +250,10 @@ class PollsService { * @param offset - Offset needed to return a specific subset of voters. '0' - (default) * @param count - Number of user IDs to return (if the 'friends_only' parameter is not set, * maximum '1000', otherwise '10'). '100' - (default) - * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * @param fields - Profile fields to return. Sample values_ 'nickname', 'screen_name', 'sex', * 'bdate (birthdate)', 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', * 'has_mobile', 'rate', 'contacts', 'education', 'online', 'counters'. - * @param nameCase - Case for declension of user name and surname: , 'nom' - nominative + * @param nameCase - Case for declension of user name and surname_ , 'nom' - nominative * (default) , 'gen' - genitive , 'dat' - dative , 'acc' - accusative , 'ins' - instrumental , * 'abl' - prepositional * @return [VKRequest] with [Unit] @@ -258,13 +261,13 @@ class PollsService { fun pollsGetVoters( pollId: Int, answerIds: List, - ownerId: Int? = null, + ownerId: UserId? = null, isBoard: Boolean? = null, friendsOnly: Boolean? = null, offset: Int? = null, count: Int? = null, fields: List? = null, - nameCase: NameCaseParam? = null + nameCase: PollsGetVotersNameCase? = null ): VKRequest> = NewApiRequest("polls.getVoters") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) diff --git a/api/src/main/java/com/vk/sdk/api/polls/dto/BackgroundIdParam.kt b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsCreateBackgroundId.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/polls/dto/BackgroundIdParam.kt rename to api/src/main/java/com/vk/sdk/api/polls/dto/PollsCreateBackgroundId.kt index 515df04658..8cee707535 100644 --- a/api/src/main/java/com/vk/sdk/api/polls/dto/BackgroundIdParam.kt +++ b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsCreateBackgroundId.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.polls.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class BackgroundIdParam( +enum class PollsCreateBackgroundId( val value: String ) { @SerializedName("1") diff --git a/api/src/main/java/com/vk/sdk/api/polls/dto/PollsEditBackgroundId.kt b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsEditBackgroundId.kt new file mode 100644 index 0000000000..556f20a726 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsEditBackgroundId.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.polls.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class PollsEditBackgroundId( + val value: String +) { + @SerializedName("0") + ZERO_("0"), + + @SerializedName("1") + ONE_("1"), + + @SerializedName("2") + TWO_("2"), + + @SerializedName("3") + THREE_("3"), + + @SerializedName("4") + FOUR_("4"), + + @SerializedName("6") + SIX_("6"), + + @SerializedName("8") + EIGHT_("8"), + + @SerializedName("9") + NINE_("9"); +} diff --git a/api/src/main/java/com/vk/sdk/api/polls/dto/NameCaseParam.kt b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsGetByIdNameCase.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/polls/dto/NameCaseParam.kt rename to api/src/main/java/com/vk/sdk/api/polls/dto/PollsGetByIdNameCase.kt index b2f378eff6..6c418346b1 100644 --- a/api/src/main/java/com/vk/sdk/api/polls/dto/NameCaseParam.kt +++ b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsGetByIdNameCase.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.polls.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class NameCaseParam( +enum class PollsGetByIdNameCase( val value: String ) { @SerializedName("abl") diff --git a/api/src/main/java/com/vk/sdk/api/polls/dto/PollsGetVotersNameCase.kt b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsGetVotersNameCase.kt new file mode 100644 index 0000000000..20d4201ad0 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/polls/dto/PollsGetVotersNameCase.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.polls.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class PollsGetVotersNameCase( + val value: String +) { + @SerializedName("nom") + NOMINATIVE("nom"), + + @SerializedName("gen") + GENITIVE("gen"), + + @SerializedName("dat") + DATIVE("dat"), + + @SerializedName("acc") + ACCUSATIVE("acc"), + + @SerializedName("ins") + INSTRUMENTAL("ins"), + + @SerializedName("abl") + PREPOSITIONAL("abl"); +} diff --git a/api/src/main/java/com/vk/sdk/api/secure/SecureService.kt b/api/src/main/java/com/vk/sdk/api/secure/SecureService.kt index 3b02a38ba1..74cff37505 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 @@ -29,6 +29,7 @@ package com.vk.sdk.api.secure import com.google.gson.reflect.TypeToken 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.BaseOkResponse @@ -47,14 +48,14 @@ class SecureService { * Adds user activity information to an application * * @param userId - ID of a user to save the data - * @param activityId - there are 2 default activities: , * 1 - level. Works similar to ,, * 2 - + * @param activityId - there are 2 default activities_ , * 1 - level. Works similar to ,, * 2 - * points, saves points amount, Any other value is for saving completed missions - * @param value - depends on activity_id: * 1 - number, current level number,, * 2 - number, + * @param value - depends on activity_id_ * 1 - number, current level number,, * 2 - number, * current user's points amount, , Any other value is ignored * @return [VKRequest] with [BaseOkResponse] */ fun secureAddAppEvent( - userId: Int, + userId: UserId, activityId: Int, value: Int? = null ): VKRequest = NewApiRequest("secure.addAppEvent") { @@ -105,7 +106,7 @@ class SecureService { * @return [VKRequest] with [Unit] */ fun secureGetSMSHistory( - userId: Int? = null, + userId: UserId? = null, dateFrom: Int? = null, dateTo: Int? = null, limit: Int? = null @@ -195,7 +196,7 @@ class SecureService { fun secureSendNotification( message: String, userIds: List? = null, - userId: Int? = null + userId: UserId? = null ): VKRequest> = NewApiRequest("secure.sendNotification") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -215,7 +216,7 @@ class SecureService { * are allowed. Maximum size is '160' characters. * @return [VKRequest] with [BaseOkResponse] */ - fun secureSendSMSNotification(userId: Int, message: String): VKRequest = + fun secureSendSMSNotification(userId: UserId, message: String): VKRequest = NewApiRequest("secure.sendSMSNotification") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -235,7 +236,7 @@ class SecureService { */ fun secureSetCounter( counters: List? = null, - userId: Int? = null, + userId: UserId? = null, counter: Int? = null, increment: Boolean? = null ): VKRequest = NewApiRequest("secure.setCounter") { 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 83fee37b3f..dcb98bd47a 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 @@ -29,10 +29,11 @@ package com.vk.sdk.api.stats import com.google.gson.reflect.TypeToken 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.BaseOkResponse -import com.vk.sdk.api.stats.dto.IntervalParam +import com.vk.sdk.api.stats.dto.StatsGetInterval import com.vk.sdk.api.stats.dto.StatsPeriod import com.vk.sdk.api.stats.dto.StatsWallpostStat import kotlin.Int @@ -54,11 +55,11 @@ class StatsService { * @return [VKRequest] with [Unit] */ fun statsGet( - groupId: Int? = null, + groupId: UserId? = null, appId: Int? = null, timestampFrom: Int? = null, timestampTo: Int? = null, - interval: IntervalParam? = null, + interval: StatsGetInterval? = null, intervalsCount: Int? = null, filters: List? = null, statsGroups: List? = null diff --git a/api/src/main/java/com/vk/sdk/api/stats/dto/IntervalParam.kt b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsGetInterval.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/stats/dto/IntervalParam.kt rename to api/src/main/java/com/vk/sdk/api/stats/dto/StatsGetInterval.kt index fb7f96444b..98f719acb4 100644 --- a/api/src/main/java/com/vk/sdk/api/stats/dto/IntervalParam.kt +++ b/api/src/main/java/com/vk/sdk/api/stats/dto/StatsGetInterval.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.stats.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class IntervalParam( +enum class StatsGetInterval( val value: String ) { @SerializedName("all") 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 524b391e90..46e8e0851f 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 @@ -28,11 +28,11 @@ package com.vk.sdk.api.status 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.BaseOkResponse import com.vk.sdk.api.status.dto.StatusStatus -import kotlin.Int import kotlin.String class StatusService { @@ -43,7 +43,7 @@ class StatusService { * @param groupId * @return [VKRequest] with [StatusStatus] */ - fun statusGet(userId: Int? = null, groupId: Int? = null): VKRequest = + fun statusGet(userId: UserId? = null, groupId: UserId? = null): VKRequest = NewApiRequest("status.get") { GsonHolder.gson.fromJson(it, StatusStatus::class.java) } @@ -60,7 +60,7 @@ class StatusService { * set to current user. * @return [VKRequest] with [BaseOkResponse] */ - fun statusSet(text: String? = null, groupId: Int? = null): VKRequest = + fun statusSet(text: String? = null, groupId: UserId? = null): VKRequest = NewApiRequest("status.set") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } 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 8681f38499..d8b336363c 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 @@ -29,6 +29,7 @@ package com.vk.sdk.api.storage import com.google.gson.reflect.TypeToken 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.BaseOkResponse @@ -49,7 +50,7 @@ class StorageService { fun storageGet( key: String? = null, keys: List? = null, - userId: Int? = null + userId: UserId? = null ): VKRequest> = NewApiRequest("storage.get") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -70,7 +71,7 @@ class StorageService { * @return [VKRequest] with [Unit] */ fun storageGetKeys( - userId: Int? = null, + userId: UserId? = null, offset: Int? = null, count: Int? = null ): VKRequest> = NewApiRequest("storage.getKeys") { @@ -94,7 +95,7 @@ class StorageService { fun storageSet( key: String, value: String? = null, - userId: Int? = null + userId: UserId? = null ): VKRequest = NewApiRequest("storage.set") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } 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 e42554b59d..ba68d63fe4 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 @@ -28,6 +28,7 @@ package com.vk.sdk.api.stories 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.BaseOkResponse @@ -72,7 +73,7 @@ class StoriesService { * @return [VKRequest] with [BaseOkResponse] */ fun storiesDelete( - ownerId: Int? = null, + ownerId: UserId? = null, storyId: Int? = null, stories: List? = null ): VKRequest = NewApiRequest("stories.delete") { @@ -91,7 +92,7 @@ class StoriesService { * @param fields * @return [VKRequest] with [StoriesGetV5113Response] */ - fun storiesGet(ownerId: Int? = null, fields: List? = null): + fun storiesGet(ownerId: UserId? = null, fields: List? = null): VKRequest = NewApiRequest("stories.get") { GsonHolder.gson.fromJson(it, StoriesGetV5113Response::class.java) } @@ -186,7 +187,7 @@ class StoriesService { * @param userIds - List of users IDs who can see the story. * @param replyToStory - ID of the story to reply with the current. * @param linkText - Link text (for community's stories only). - * @param linkUrl - Link URL. Internal links on https://vk.com only. + * @param linkUrl - Link URL. Internal links on https_//vk.com only. * @param groupId - ID of the community to upload the story (should be verified or with the * "fire" icon). * @param clickableStickers @@ -198,7 +199,7 @@ class StoriesService { replyToStory: String? = null, linkText: String? = null, linkUrl: String? = null, - groupId: Int? = null, + groupId: UserId? = null, clickableStickers: String? = null ): VKRequest = NewApiRequest("stories.getPhotoUploadServer") { @@ -224,7 +225,7 @@ class StoriesService { * @return [VKRequest] with [StoriesGetV5113Response] */ fun storiesGetReplies( - ownerId: Int, + ownerId: UserId, storyId: Int, accessKey: String? = null, fields: List? = null @@ -248,7 +249,7 @@ class StoriesService { * @param storyId - Story ID. * @return [VKRequest] with [StoriesStoryStats] */ - fun storiesGetStats(ownerId: Int, storyId: Int): VKRequest = + fun storiesGetStats(ownerId: UserId, storyId: Int): VKRequest = NewApiRequest("stories.getStats") { GsonHolder.gson.fromJson(it, StoriesStoryStats::class.java) } @@ -264,7 +265,7 @@ class StoriesService { * @param userIds - List of users IDs who can see the story. * @param replyToStory - ID of the story to reply with the current. * @param linkText - Link text (for community's stories only). - * @param linkUrl - Link URL. Internal links on https://vk.com only. + * @param linkUrl - Link URL. Internal links on https_//vk.com only. * @param groupId - ID of the community to upload the story (should be verified or with the * "fire" icon). * @param clickableStickers @@ -276,7 +277,7 @@ class StoriesService { replyToStory: String? = null, linkText: String? = null, linkUrl: String? = null, - groupId: Int? = null, + groupId: UserId? = null, clickableStickers: String? = null ): VKRequest = NewApiRequest("stories.getVideoUploadServer") { @@ -302,7 +303,7 @@ class StoriesService { * @return [VKRequest] with [StoriesGetViewersExtendedV5115Response] */ fun storiesGetViewers( - ownerId: Int, + ownerId: UserId, storyId: Int, count: Int? = null, offset: Int? = null @@ -326,7 +327,7 @@ class StoriesService { * @return [VKRequest] with [StoriesGetViewersExtendedV5115Response] */ fun storiesGetViewersExtended( - ownerId: Int, + ownerId: UserId, storyId: Int, count: Int? = null, offset: Int? = null @@ -348,7 +349,7 @@ class StoriesService { * @param groupId * @return [VKRequest] with [BaseOkResponse] */ - fun storiesHideAllReplies(ownerId: Int, groupId: Int? = null): VKRequest = + fun storiesHideAllReplies(ownerId: UserId, groupId: UserId? = null): VKRequest = NewApiRequest("stories.hideAllReplies") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -364,7 +365,7 @@ class StoriesService { * @param storyId - Story ID. * @return [VKRequest] with [BaseOkResponse] */ - fun storiesHideReply(ownerId: Int, storyId: Int): VKRequest = + fun storiesHideReply(ownerId: UserId, storyId: Int): VKRequest = NewApiRequest("stories.hideReply") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } 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 abab89e129..b40d850d1a 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 @@ -31,10 +31,10 @@ import com.vk.api.sdk.requests.VKRequest import com.vk.sdk.api.GsonHolder import com.vk.sdk.api.NewApiRequest import com.vk.sdk.api.base.dto.BaseOkResponse -import com.vk.sdk.api.streaming.dto.IntervalParam -import com.vk.sdk.api.streaming.dto.MonthlyTierParam import com.vk.sdk.api.streaming.dto.StreamingGetServerUrlResponse -import com.vk.sdk.api.streaming.dto.TypeParam +import com.vk.sdk.api.streaming.dto.StreamingGetStatsInterval +import com.vk.sdk.api.streaming.dto.StreamingGetStatsType +import com.vk.sdk.api.streaming.dto.StreamingSetSettingsMonthlyTier import kotlin.Int import kotlin.String import kotlin.Unit @@ -64,8 +64,8 @@ class StreamingService { * @return [VKRequest] with [Unit] */ fun streamingGetStats( - type: TypeParam? = null, - interval: IntervalParam? = null, + type: StreamingGetStatsType? = null, + interval: StreamingGetStatsInterval? = null, startTime: Int? = null, endTime: Int? = null ): VKRequest = NewApiRequest("streaming.getStats") { @@ -91,8 +91,8 @@ class StreamingService { * @param monthlyTier * @return [VKRequest] with [BaseOkResponse] */ - fun streamingSetSettings(monthlyTier: MonthlyTierParam? = null): VKRequest = - NewApiRequest("streaming.setSettings") { + fun streamingSetSettings(monthlyTier: StreamingSetSettingsMonthlyTier? = null): + VKRequest = NewApiRequest("streaming.setSettings") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } .apply { diff --git a/api/src/main/java/com/vk/sdk/api/streaming/dto/IntervalParam.kt b/api/src/main/java/com/vk/sdk/api/streaming/dto/StreamingGetStatsInterval.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/streaming/dto/IntervalParam.kt rename to api/src/main/java/com/vk/sdk/api/streaming/dto/StreamingGetStatsInterval.kt index 5757d21877..94c79edfd2 100644 --- a/api/src/main/java/com/vk/sdk/api/streaming/dto/IntervalParam.kt +++ b/api/src/main/java/com/vk/sdk/api/streaming/dto/StreamingGetStatsInterval.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.streaming.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class IntervalParam( +enum class StreamingGetStatsInterval( val value: String ) { @SerializedName("1h") diff --git a/api/src/main/java/com/vk/sdk/api/streaming/dto/TypeParam.kt b/api/src/main/java/com/vk/sdk/api/streaming/dto/StreamingGetStatsType.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/streaming/dto/TypeParam.kt rename to api/src/main/java/com/vk/sdk/api/streaming/dto/StreamingGetStatsType.kt index 232f5168bb..1250dc0bbd 100644 --- a/api/src/main/java/com/vk/sdk/api/streaming/dto/TypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/streaming/dto/StreamingGetStatsType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.streaming.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class TypeParam( +enum class StreamingGetStatsType( val value: String ) { @SerializedName("prepared") diff --git a/api/src/main/java/com/vk/sdk/api/streaming/dto/MonthlyTierParam.kt b/api/src/main/java/com/vk/sdk/api/streaming/dto/StreamingSetSettingsMonthlyTier.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/streaming/dto/MonthlyTierParam.kt rename to api/src/main/java/com/vk/sdk/api/streaming/dto/StreamingSetSettingsMonthlyTier.kt index 4f2feb3aa2..c8f1688eab 100644 --- a/api/src/main/java/com/vk/sdk/api/streaming/dto/MonthlyTierParam.kt +++ b/api/src/main/java/com/vk/sdk/api/streaming/dto/StreamingSetSettingsMonthlyTier.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.streaming.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class MonthlyTierParam( +enum class StreamingSetSettingsMonthlyTier( val value: String ) { @SerializedName("tier_1") 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 2c23be0431..f427623b7a 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 @@ -29,19 +29,21 @@ package com.vk.sdk.api.users import com.google.gson.reflect.TypeToken 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.BaseOkResponse -import com.vk.sdk.api.users.dto.NameCaseParam -import com.vk.sdk.api.users.dto.SexParam -import com.vk.sdk.api.users.dto.SortParam -import com.vk.sdk.api.users.dto.StatusParam -import com.vk.sdk.api.users.dto.TypeParam import com.vk.sdk.api.users.dto.UsersFields import com.vk.sdk.api.users.dto.UsersGetFollowersFieldsResponse +import com.vk.sdk.api.users.dto.UsersGetFollowersNameCase +import com.vk.sdk.api.users.dto.UsersGetNameCase import com.vk.sdk.api.users.dto.UsersGetSubscriptionsExtendedResponse import com.vk.sdk.api.users.dto.UsersGetSubscriptionsResponse +import com.vk.sdk.api.users.dto.UsersReportType 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 kotlin.Boolean import kotlin.Int @@ -53,12 +55,12 @@ class UsersService { * Returns detailed information on users. * * @param userIds - User IDs or screen names ('screen_name'). By default, current user ID. - * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * @param fields - Profile fields to return. Sample values_ 'nickname', 'screen_name', 'sex', * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', * 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', * 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities', * 'can_invite_to_chats' - * @param nameCase - Case for declension of user name and surname: 'nom' - nominative (default), + * @param nameCase - Case for declension of user name and surname_ 'nom' - nominative (default), * 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - * prepositional * @return [VKRequest] with [Unit] @@ -66,7 +68,7 @@ class UsersService { fun usersGet( userIds: List? = null, fields: List? = null, - nameCase: NameCaseParam? = null + nameCase: UsersGetNameCase? = null ): VKRequest> = NewApiRequest("users.get") { val typeToken = object: TypeToken>() {}.type GsonHolder.gson.fromJson>(it, typeToken) @@ -87,20 +89,20 @@ class UsersService { * @param userId - User ID. * @param offset - Offset needed to return a specific subset of followers. * @param count - Number of followers to return. - * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * @param fields - Profile fields to return. Sample values_ 'nickname', 'screen_name', 'sex', * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', * 'has_mobile', 'rate', 'contacts', 'education', 'online'. - * @param nameCase - Case for declension of user name and surname: 'nom' - nominative (default), + * @param nameCase - Case for declension of user name and surname_ 'nom' - nominative (default), * 'gen' - genitive , 'dat' - dative, 'acc' - accusative , 'ins' - instrumental , 'abl' - * prepositional * @return [VKRequest] with [UsersGetFollowersFieldsResponse] */ fun usersGetFollowers( - userId: Int? = null, + userId: UserId? = null, offset: Int? = null, count: Int? = null, fields: List? = null, - nameCase: NameCaseParam? = null + nameCase: UsersGetFollowersNameCase? = null ): VKRequest = NewApiRequest("users.getFollowers") { GsonHolder.gson.fromJson(it, UsersGetFollowersFieldsResponse::class.java) } @@ -125,7 +127,7 @@ class UsersService { * @return [VKRequest] with [UsersGetSubscriptionsResponse] */ fun usersGetSubscriptions( - userId: Int? = null, + userId: UserId? = null, offset: Int? = null, count: Int? = null, fields: List? = null @@ -152,7 +154,7 @@ class UsersService { * @return [VKRequest] with [UsersGetSubscriptionsExtendedResponse] */ fun usersGetSubscriptionsExtended( - userId: Int? = null, + userId: UserId? = null, offset: Int? = null, count: Int? = null, fields: List? = null @@ -174,14 +176,14 @@ class UsersService { * Reports (submits a complain about) a user. * * @param userId - ID of the user about whom a complaint is being made. - * @param type - Type of complaint: 'porn' - pornography, 'spam' - spamming, 'insult' - abusive + * @param type - Type of complaint_ 'porn' - pornography, 'spam' - spamming, 'insult' - abusive * behavior, 'advertisement' - disruptive advertisements * @param comment - Comment describing the complaint. * @return [VKRequest] with [BaseOkResponse] */ fun usersReport( - userId: Int, - type: TypeParam, + userId: UserId, + type: UsersReportType, comment: String? = null ): VKRequest = NewApiRequest("users.report") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) @@ -196,10 +198,10 @@ class UsersService { * Returns a list of users matching the search criteria. * * @param q - Search query string (e.g., 'Vasya Babich'). - * @param sort - Sort order: '1' - by date registered, '0' - by rating + * @param sort - Sort order_ '1' - by date registered, '0' - by rating * @param offset - Offset needed to return a specific subset of users. * @param count - Number of users to return. - * @param fields - Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', + * @param fields - Profile fields to return. Sample values_ 'nickname', 'screen_name', 'sex', * 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', * 'has_mobile', 'rate', 'contacts', 'education', 'online', * @param city - City ID. @@ -211,7 +213,7 @@ class UsersService { * @param universityFaculty - Faculty ID. * @param universityChair - Chair ID. * @param sex - '1' - female, '2' - male, '0' - any (default) - * @param status - Relationship status: '1' - Not married, '2' - In a relationship, '3' - + * @param status - Relationship status_ '1' - Not married, '2' - In a relationship, '3' - * Engaged, '4' - Married, '5' - It's complicated, '6' - Actively searching, '7' - In love * @param ageFrom - Minimum age. * @param ageTo - Maximum age. @@ -234,7 +236,7 @@ class UsersService { */ fun usersSearch( q: String? = null, - sort: SortParam? = null, + sort: UsersSearchSort? = null, offset: Int? = null, count: Int? = null, fields: List? = null, @@ -246,8 +248,8 @@ class UsersService { universityYear: Int? = null, universityFaculty: Int? = null, universityChair: Int? = null, - sex: SexParam? = null, - status: StatusParam? = null, + sex: UsersSearchSex? = null, + status: UsersSearchStatus? = null, ageFrom: Int? = null, ageTo: Int? = null, birthDay: Int? = null, @@ -263,7 +265,7 @@ class UsersService { religion: String? = null, company: String? = null, position: String? = null, - groupId: Int? = null, + groupId: UserId? = null, fromList: List? = null ): VKRequest = NewApiRequest("users.search") { GsonHolder.gson.fromJson(it, UsersSearchResponse::class.java) diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/UsersGetFollowersNameCase.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersGetFollowersNameCase.kt new file mode 100644 index 0000000000..e867d409e8 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersGetFollowersNameCase.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.users.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class UsersGetFollowersNameCase( + val value: String +) { + @SerializedName("nom") + NOMINATIVE("nom"), + + @SerializedName("gen") + GENITIVE("gen"), + + @SerializedName("dat") + DATIVE("dat"), + + @SerializedName("acc") + ACCUSATIVE("acc"), + + @SerializedName("ins") + INSTRUMENTAL("ins"), + + @SerializedName("abl") + PREPOSITIONAL("abl"); +} diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/NameCaseParam.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersGetNameCase.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/users/dto/NameCaseParam.kt rename to api/src/main/java/com/vk/sdk/api/users/dto/UsersGetNameCase.kt index 15909a166e..07bac95a75 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/NameCaseParam.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersGetNameCase.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.users.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class NameCaseParam( +enum class UsersGetNameCase( val value: String ) { @SerializedName("nom") diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/TypeParam.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersReportType.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/users/dto/TypeParam.kt rename to api/src/main/java/com/vk/sdk/api/users/dto/UsersReportType.kt index 967d1a12a2..ad85d1d325 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/TypeParam.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersReportType.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.users.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class TypeParam( +enum class UsersReportType( val value: String ) { @SerializedName("porn") diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/SexParam.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchSex.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/users/dto/SexParam.kt rename to api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchSex.kt index d5452772db..8b5ad5ca3c 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/SexParam.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchSex.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.users.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class SexParam( +enum class UsersSearchSex( val value: Int ) { @SerializedName("0") diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchSort.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/users/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchSort.kt index 789d69b9da..f66ce71bff 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.users.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class SortParam( +enum class UsersSearchSort( val value: Int ) { @SerializedName("0") diff --git a/api/src/main/java/com/vk/sdk/api/users/dto/StatusParam.kt b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchStatus.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/users/dto/StatusParam.kt rename to api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchStatus.kt index 34c901da01..6955319e48 100644 --- a/api/src/main/java/com/vk/sdk/api/users/dto/StatusParam.kt +++ b/api/src/main/java/com/vk/sdk/api/users/dto/UsersSearchStatus.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.users.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class StatusParam( +enum class UsersSearchStatus( val value: Int ) { @SerializedName("0") 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 62e692fb38..2dd708cd74 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 @@ -41,7 +41,6 @@ import com.vk.sdk.api.base.dto.BaseSex import com.vk.sdk.api.friends.dto.FriendsFriendStatusStatus import com.vk.sdk.api.friends.dto.FriendsRequestsMutual import com.vk.sdk.api.groups.dto.GroupsAddressesInfo -import com.vk.sdk.api.groups.dto.GroupsAppButton import com.vk.sdk.api.groups.dto.GroupsContactsItem import com.vk.sdk.api.groups.dto.GroupsCountersGroup import com.vk.sdk.api.groups.dto.GroupsCover @@ -215,13 +214,8 @@ sealed class UsersSubscriptionsItem { * @param estDate - Established date * @param publicDateLabel - Public date label * @param photoMaxSize - * @param appButton - * @param appButtons * @param isVideoLiveNotificationsBlocked * @param videoLive - * @param hadTorch - * @param audioArtistId - * @param audioCuratorId */ data class GroupsGroupFull( @SerializedName("market") @@ -382,20 +376,10 @@ sealed class UsersSubscriptionsItem { val publicDateLabel: String? = null, @SerializedName("photo_max_size") val photoMaxSize: GroupsPhotoSize? = null, - @SerializedName("app_button") - val appButton: GroupsAppButton? = null, - @SerializedName("app_buttons") - val appButtons: List? = null, @SerializedName("is_video_live_notifications_blocked") val isVideoLiveNotificationsBlocked: BaseBoolInt? = null, @SerializedName("video_live") - val videoLive: VideoLiveInfo? = null, - @SerializedName("had_torch") - val hadTorch: Boolean? = null, - @SerializedName("audio_artist_id") - val audioArtistId: String? = null, - @SerializedName("audio_curator_id") - val audioCuratorId: Int? = null + val videoLive: VideoLiveInfo? = null ) : UsersSubscriptionsItem() { enum class Wall( val value: Int 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 c691094469..989077290a 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 @@ -31,10 +31,12 @@ import com.vk.api.sdk.requests.VKRequest import com.vk.sdk.api.GsonHolder import com.vk.sdk.api.NewApiRequest import com.vk.sdk.api.base.dto.BaseOkResponse -import com.vk.sdk.api.utils.dto.IntervalParam -import com.vk.sdk.api.utils.dto.SourceParam import com.vk.sdk.api.utils.dto.UtilsDomainResolved import com.vk.sdk.api.utils.dto.UtilsGetLastShortenedLinksResponse +import com.vk.sdk.api.utils.dto.UtilsGetLinkStatsExtendedInterval +import com.vk.sdk.api.utils.dto.UtilsGetLinkStatsExtendedSource +import com.vk.sdk.api.utils.dto.UtilsGetLinkStatsInterval +import com.vk.sdk.api.utils.dto.UtilsGetLinkStatsSource import com.vk.sdk.api.utils.dto.UtilsLinkChecked import com.vk.sdk.api.utils.dto.UtilsLinkStats import com.vk.sdk.api.utils.dto.UtilsLinkStatsExtended @@ -47,7 +49,7 @@ class UtilsService { /** * Checks whether a link is blocked in VK. * - * @param url - Link to check (e.g., 'http://google.com'). + * @param url - Link to check (e.g., 'http_//google.com'). * @return [VKRequest] with [UtilsLinkChecked] */ fun utilsCheckLink(url: String): VKRequest = @@ -101,9 +103,9 @@ class UtilsService { */ fun utilsGetLinkStats( key: String, - source: SourceParam? = null, + source: UtilsGetLinkStatsSource? = null, accessKey: String? = null, - interval: IntervalParam? = null, + interval: UtilsGetLinkStatsInterval? = null, intervalsCount: Int? = null ): VKRequest = NewApiRequest("utils.getLinkStats") { GsonHolder.gson.fromJson(it, UtilsLinkStats::class.java) @@ -128,9 +130,9 @@ class UtilsService { */ fun utilsGetLinkStatsExtended( key: String, - source: SourceParam? = null, + source: UtilsGetLinkStatsExtendedSource? = null, accessKey: String? = null, - interval: IntervalParam? = null, + interval: UtilsGetLinkStatsExtendedInterval? = null, intervalsCount: Int? = null ): VKRequest = NewApiRequest("utils.getLinkStats") { GsonHolder.gson.fromJson(it, UtilsLinkStatsExtended::class.java) diff --git a/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsExtendedInterval.kt b/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsExtendedInterval.kt new file mode 100644 index 0000000000..d9a9a73876 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsExtendedInterval.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.utils.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class UtilsGetLinkStatsExtendedInterval( + val value: String +) { + @SerializedName("day") + DAY("day"), + + @SerializedName("forever") + FOREVER("forever"), + + @SerializedName("hour") + HOUR("hour"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"); +} diff --git a/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsExtendedSource.kt b/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsExtendedSource.kt new file mode 100644 index 0000000000..0aff81ae7b --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsExtendedSource.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.utils.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class UtilsGetLinkStatsExtendedSource( + val value: String +) { + @SerializedName("vk_cc") + VK_CC("vk_cc"), + + @SerializedName("vk_link") + VK_LINK("vk_link"); +} diff --git a/api/src/main/java/com/vk/sdk/api/utils/dto/IntervalParam.kt b/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsInterval.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/utils/dto/IntervalParam.kt rename to api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsInterval.kt index a5d9f0760a..9bf4cfaed7 100644 --- a/api/src/main/java/com/vk/sdk/api/utils/dto/IntervalParam.kt +++ b/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsInterval.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.utils.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class IntervalParam( +enum class UtilsGetLinkStatsInterval( val value: String ) { @SerializedName("day") diff --git a/api/src/main/java/com/vk/sdk/api/utils/dto/SourceParam.kt b/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsSource.kt similarity index 97% rename from api/src/main/java/com/vk/sdk/api/utils/dto/SourceParam.kt rename to api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsSource.kt index d5c5e8b015..1e34357d2f 100644 --- a/api/src/main/java/com/vk/sdk/api/utils/dto/SourceParam.kt +++ b/api/src/main/java/com/vk/sdk/api/utils/dto/UtilsGetLinkStatsSource.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.utils.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SourceParam( +enum class UtilsGetLinkStatsSource( val value: String ) { @SerializedName("vk_cc") 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 2979fb8b62..0d6db99cbd 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 @@ -29,24 +29,31 @@ package com.vk.sdk.api.video import com.google.gson.reflect.TypeToken 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.video.dto.FiltersParam -import com.vk.sdk.api.video.dto.PrivacyParam -import com.vk.sdk.api.video.dto.ReasonParam -import com.vk.sdk.api.video.dto.SortParam +import com.vk.sdk.api.video.dto.VideoAddAlbumPrivacy import com.vk.sdk.api.video.dto.VideoAddAlbumResponse +import com.vk.sdk.api.video.dto.VideoEditAlbumPrivacy import com.vk.sdk.api.video.dto.VideoGetAlbumsByVideoExtendedResponse import com.vk.sdk.api.video.dto.VideoGetAlbumsExtendedResponse import com.vk.sdk.api.video.dto.VideoGetAlbumsResponse import com.vk.sdk.api.video.dto.VideoGetCommentsExtendedResponse +import com.vk.sdk.api.video.dto.VideoGetCommentsExtendedSort import com.vk.sdk.api.video.dto.VideoGetCommentsResponse +import com.vk.sdk.api.video.dto.VideoGetCommentsSort import com.vk.sdk.api.video.dto.VideoGetResponse +import com.vk.sdk.api.video.dto.VideoReportCommentReason +import com.vk.sdk.api.video.dto.VideoReportReason import com.vk.sdk.api.video.dto.VideoSaveResult +import com.vk.sdk.api.video.dto.VideoSearchExtendedFilters import com.vk.sdk.api.video.dto.VideoSearchExtendedResponse +import com.vk.sdk.api.video.dto.VideoSearchExtendedSort +import com.vk.sdk.api.video.dto.VideoSearchFilters import com.vk.sdk.api.video.dto.VideoSearchResponse +import com.vk.sdk.api.video.dto.VideoSearchSort import com.vk.sdk.api.video.dto.VideoVideoAlbumFull import kotlin.Boolean import kotlin.Int @@ -66,7 +73,7 @@ class VideoService { */ fun videoAdd( videoId: Int, - ownerId: Int, + ownerId: UserId, targetId: Int? = null ): VKRequest = NewApiRequest("video.add") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) @@ -82,14 +89,14 @@ class VideoService { * * @param groupId - Community ID (if the album will be created in a community). * @param title - Album title. - * @param privacy - new access permissions for the album. Possible values: , *'0' - all users,, + * @param privacy - new access permissions for the album. Possible values_ , *'0' - all users,, * *'1' - friends only,, *'2' - friends and friends of friends,, *'3' - "only me". * @return [VKRequest] with [VideoAddAlbumResponse] */ fun videoAddAlbum( - groupId: Int? = null, + groupId: UserId? = null, title: String? = null, - privacy: List? = null + privacy: List? = null ): VKRequest = NewApiRequest("video.addAlbum") { GsonHolder.gson.fromJson(it, VideoAddAlbumResponse::class.java) } @@ -111,7 +118,7 @@ class VideoService { * @return [VKRequest] with [BaseOkResponse] */ fun videoAddToAlbum( - ownerId: Int, + ownerId: UserId, videoId: Int, targetId: Int? = null, albumId: Int? = null, @@ -133,10 +140,10 @@ class VideoService { * @param videoId - Video ID. * @param ownerId - ID of the user or community that owns the video. * @param message - New comment text. - * @param attachments - List of objects attached to the comment, in the following format: - * "_,_", '' - Type of media attachment: 'photo' - photo, + * @param attachments - List of objects attached to the comment, in the following format_ + * "_,_", '' - Type of media attachment_ 'photo' - photo, * 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media attachment - * owner. '' - Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * owner. '' - Media attachment ID. Example_ "photo100172_166443618,photo66748_265827614" * @param fromGroup - '1' - to post the comment from a community name (only if 'owner_id'<0) * @param replyToComment * @param stickerId @@ -145,7 +152,7 @@ class VideoService { */ fun videoCreateComment( videoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, message: String? = null, attachments: List? = null, fromGroup: Boolean? = null, @@ -176,7 +183,7 @@ class VideoService { */ fun videoDelete( videoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, targetId: Int? = null ): VKRequest = NewApiRequest("video.delete") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) @@ -194,7 +201,7 @@ class VideoService { * @param groupId - Community ID (if the album is owned by a community). * @return [VKRequest] with [BaseOkResponse] */ - fun videoDeleteAlbum(albumId: Int, groupId: Int? = null): VKRequest = + fun videoDeleteAlbum(albumId: Int, groupId: UserId? = null): VKRequest = NewApiRequest("video.deleteAlbum") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -210,7 +217,7 @@ class VideoService { * @param ownerId - ID of the user or community that owns the video. * @return [VKRequest] with [BaseOkResponse] */ - fun videoDeleteComment(commentId: Int, ownerId: Int? = null): VKRequest = + fun videoDeleteComment(commentId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("video.deleteComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -236,7 +243,7 @@ class VideoService { */ fun videoEdit( videoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, name: String? = null, desc: String? = null, privacyView: List? = null, @@ -263,15 +270,15 @@ class VideoService { * @param albumId - Album ID. * @param title - New album title. * @param groupId - Community ID (if the album edited is owned by a community). - * @param privacy - new access permissions for the album. Possible values: , *'0' - all users,, + * @param privacy - new access permissions for the album. Possible values_ , *'0' - all users,, * *'1' - friends only,, *'2' - friends and friends of friends,, *'3' - "only me". * @return [VKRequest] with [BaseOkResponse] */ fun videoEditAlbum( albumId: Int, title: String, - groupId: Int? = null, - privacy: List? = null + groupId: UserId? = null, + privacy: List? = null ): VKRequest = NewApiRequest("video.editAlbum") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -291,15 +298,15 @@ class VideoService { * @param commentId - Comment ID. * @param ownerId - ID of the user or community that owns the video. * @param message - New comment text. - * @param attachments - List of objects attached to the comment, in the following format: - * "_,_", '' - Type of media attachment: 'photo' - photo, + * @param attachments - List of objects attached to the comment, in the following format_ + * "_,_", '' - Type of media attachment_ 'photo' - photo, * 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media attachment - * owner. '' - Media attachment ID. Example: "photo100172_166443618,photo66748_265827614" + * owner. '' - Media attachment ID. Example_ "photo100172_166443618,photo66748_265827614" * @return [VKRequest] with [BaseOkResponse] */ fun videoEditComment( commentId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, message: String? = null, attachments: List? = null ): VKRequest = NewApiRequest("video.editComment") { @@ -316,9 +323,9 @@ class VideoService { * Returns detailed information about videos. * * @param ownerId - ID of the user or community that owns the video(s). - * @param videos - Video IDs, in the following format: + * @param videos - Video IDs, in the following format_ * "_,_", Use a negative value to designate a community ID. - * Example: "-4363_136089719,13245770_137352259" + * Example_ "-4363_136089719,13245770_137352259" * @param albumId - ID of the album containing the video(s). * @param count - Number of videos to return. * @param offset - Offset needed to return a specific subset of videos. @@ -326,7 +333,7 @@ class VideoService { * @return [VKRequest] with [VideoGetResponse] */ fun videoGet( - ownerId: Int? = null, + ownerId: UserId? = null, videos: List? = null, albumId: Int? = null, count: Int? = null, @@ -352,7 +359,7 @@ class VideoService { * designate a community ID. * @return [VKRequest] with [VideoVideoAlbumFull] */ - fun videoGetAlbumById(albumId: Int, ownerId: Int? = null): VKRequest = + fun videoGetAlbumById(albumId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("video.getAlbumById") { GsonHolder.gson.fromJson(it, VideoVideoAlbumFull::class.java) } @@ -371,7 +378,7 @@ class VideoService { * @return [VKRequest] with [VideoGetAlbumsResponse] */ fun videoGetAlbums( - ownerId: Int? = null, + ownerId: UserId? = null, offset: Int? = null, count: Int? = null, needSystem: Boolean? = null @@ -395,7 +402,7 @@ class VideoService { * @return [VKRequest] with [VideoGetAlbumsExtendedResponse] */ fun videoGetAlbumsExtended( - ownerId: Int? = null, + ownerId: UserId? = null, offset: Int? = null, count: Int? = null, needSystem: Boolean? = null @@ -417,7 +424,7 @@ class VideoService { * @return [VKRequest] with [Unit] */ fun videoGetAlbumsByVideo( - ownerId: Int, + ownerId: UserId, videoId: Int, targetId: Int? = null ): VKRequest> = NewApiRequest("video.getAlbumsByVideo") { @@ -437,7 +444,7 @@ class VideoService { * @return [VKRequest] with [VideoGetAlbumsByVideoExtendedResponse] */ fun videoGetAlbumsByVideoExtended( - ownerId: Int, + ownerId: UserId, videoId: Int, targetId: Int? = null ): VKRequest = NewApiRequest("video.getAlbumsByVideo") { @@ -459,18 +466,18 @@ class VideoService { * @param startCommentId * @param offset - Offset needed to return a specific subset of comments. * @param count - Number of comments to return. - * @param sort - Sort order: 'asc' - oldest comment first, 'desc' - newest comment first + * @param sort - Sort order_ 'asc' - oldest comment first, 'desc' - newest comment first * @param fields * @return [VKRequest] with [VideoGetCommentsResponse] */ fun videoGetComments( videoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, needLikes: Boolean? = null, startCommentId: Int? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null, + sort: VideoGetCommentsSort? = null, fields: List? = null ): VKRequest = NewApiRequest("video.getComments") { GsonHolder.gson.fromJson(it, VideoGetCommentsResponse::class.java) @@ -495,18 +502,18 @@ class VideoService { * @param startCommentId * @param offset - Offset needed to return a specific subset of comments. * @param count - Number of comments to return. - * @param sort - Sort order: 'asc' - oldest comment first, 'desc' - newest comment first + * @param sort - Sort order_ 'asc' - oldest comment first, 'desc' - newest comment first * @param fields * @return [VKRequest] with [VideoGetCommentsExtendedResponse] */ fun videoGetCommentsExtended( videoId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, needLikes: Boolean? = null, startCommentId: Int? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null, + sort: VideoGetCommentsExtendedSort? = null, fields: List? = null ): VKRequest = NewApiRequest("video.getComments") { GsonHolder.gson.fromJson(it, VideoGetCommentsExtendedResponse::class.java) @@ -532,7 +539,7 @@ class VideoService { * @return [VKRequest] with [BaseOkResponse] */ fun videoRemoveFromAlbum( - ownerId: Int, + ownerId: UserId, videoId: Int, targetId: Int? = null, albumId: Int? = null, @@ -559,7 +566,7 @@ class VideoService { */ fun videoReorderAlbums( albumId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, before: Int? = null, after: Int? = null ): VKRequest = NewApiRequest("video.reorderAlbums") { @@ -588,7 +595,7 @@ class VideoService { * @return [VKRequest] with [BaseOkResponse] */ fun videoReorderVideos( - ownerId: Int, + ownerId: UserId, videoId: Int, targetId: Int? = null, albumId: Int? = null, @@ -615,16 +622,16 @@ class VideoService { * * @param ownerId - ID of the user or community that owns the video. * @param videoId - Video ID. - * @param reason - Reason for the complaint: '0' - spam, '1' - child pornography, '2' - + * @param reason - Reason for the complaint_ '0' - spam, '1' - child pornography, '2' - * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse * @param comment - Comment describing the complaint. * @param searchQuery - (If the video was found in search results.) Search query string. * @return [VKRequest] with [BaseOkResponse] */ fun videoReport( - ownerId: Int, + ownerId: UserId, videoId: Int, - reason: ReasonParam? = null, + reason: VideoReportReason? = null, comment: String? = null, searchQuery: String? = null ): VKRequest = NewApiRequest("video.report") { @@ -643,14 +650,14 @@ class VideoService { * * @param ownerId - ID of the user or community that owns the video. * @param commentId - ID of the comment being reported. - * @param reason - Reason for the complaint: , 0 - spam , 1 - child pornography , 2 - extremism + * @param reason - Reason for the complaint_ , 0 - spam , 1 - child pornography , 2 - extremism * , 3 - violence , 4 - drug propaganda , 5 - adult material , 6 - insult, abuse * @return [VKRequest] with [BaseOkResponse] */ fun videoReportComment( - ownerId: Int, + ownerId: UserId, commentId: Int, - reason: ReasonParam? = null + reason: VideoReportCommentReason? = null ): VKRequest = NewApiRequest("video.reportComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -667,7 +674,7 @@ class VideoService { * @param ownerId - ID of the user or community that owns the video. * @return [VKRequest] with [BaseOkResponse] */ - fun videoRestore(videoId: Int, ownerId: Int? = null): VKRequest = + fun videoRestore(videoId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("video.restore") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -683,7 +690,7 @@ class VideoService { * @param ownerId - ID of the user or community that owns the video. * @return [VKRequest] with [BaseBoolInt] */ - fun videoRestoreComment(commentId: Int, ownerId: Int? = null): VKRequest = + fun videoRestoreComment(commentId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("video.restoreComment") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -719,7 +726,7 @@ class VideoService { isPrivate: Boolean? = null, wallpost: Boolean? = null, link: String? = null, - groupId: Int? = null, + groupId: UserId? = null, albumId: Int? = null, privacyView: List? = null, privacyComment: List? = null, @@ -748,11 +755,11 @@ class VideoService { * Returns a list of videos under the set search criterion. * * @param q - Search query string (e.g., 'The Beatles'). - * @param sort - Sort order: '1' - by duration, '2' - by relevance, '0' - by date added + * @param sort - Sort order_ '1' - by duration, '2' - by relevance, '0' - by date added * @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 filters - Filters to apply: 'youtube' - return YouTube videos only, 'vimeo' - return + * @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 * @param offset - Offset needed to return a specific subset of videos. @@ -763,10 +770,10 @@ class VideoService { */ fun videoSearch( q: String, - sort: SortParam? = null, + sort: VideoSearchSort? = null, hd: Int? = null, adult: Boolean? = null, - filters: List? = null, + filters: List? = null, searchOwn: Boolean? = null, offset: Int? = null, longer: Int? = null, @@ -795,11 +802,11 @@ class VideoService { * Returns a list of videos under the set search criterion. * * @param q - Search query string (e.g., 'The Beatles'). - * @param sort - Sort order: '1' - by duration, '2' - by relevance, '0' - by date added + * @param sort - Sort order_ '1' - by duration, '2' - by relevance, '0' - by date added * @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 filters - Filters to apply: 'youtube' - return YouTube videos only, 'vimeo' - return + * @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 * @param offset - Offset needed to return a specific subset of videos. @@ -810,10 +817,10 @@ class VideoService { */ fun videoSearchExtended( q: String, - sort: SortParam? = null, + sort: VideoSearchExtendedSort? = null, hd: Int? = null, adult: Boolean? = null, - filters: List? = null, + filters: List? = null, searchOwn: Boolean? = null, offset: Int? = null, longer: Int? = null, diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/PrivacyParam.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoAddAlbumPrivacy.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/video/dto/PrivacyParam.kt rename to api/src/main/java/com/vk/sdk/api/video/dto/VideoAddAlbumPrivacy.kt index ee9a92ac49..c9c5dc5db5 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/PrivacyParam.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoAddAlbumPrivacy.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.video.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class PrivacyParam( +enum class VideoAddAlbumPrivacy( val value: String ) { @SerializedName("0") diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoEditAlbumPrivacy.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoEditAlbumPrivacy.kt new file mode 100644 index 0000000000..d17904140a --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoEditAlbumPrivacy.kt @@ -0,0 +1,47 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.video.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class VideoEditAlbumPrivacy( + val value: String +) { + @SerializedName("0") + ALL("0"), + + @SerializedName("1") + FRIENDS("1"), + + @SerializedName("2") + FRIENDS_OF_FRIENDS("2"), + + @SerializedName("3") + ONLY_ME("3"); +} diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsExtendedSort.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsExtendedSort.kt new file mode 100644 index 0000000000..b43e298862 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsExtendedSort.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.video.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class VideoGetCommentsExtendedSort( + val value: String +) { + @SerializedName("asc") + OLDEST_COMMENT_FIRST("asc"), + + @SerializedName("desc") + NEWEST_COMMENT_FIRST("desc"); +} diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsSort.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/video/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsSort.kt index 656d770e91..51f139e8ee 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoGetCommentsSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.video.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SortParam( +enum class VideoGetCommentsSort( val value: String ) { @SerializedName("asc") diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoReportCommentReason.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoReportCommentReason.kt new file mode 100644 index 0000000000..ec217b587f --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoReportCommentReason.kt @@ -0,0 +1,56 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.video.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class VideoReportCommentReason( + val value: Int +) { + @SerializedName("0") + SPAM(0), + + @SerializedName("1") + CHILD_PORNOGRAPHY(1), + + @SerializedName("2") + EXTREMISM(2), + + @SerializedName("3") + VIOLENCE(3), + + @SerializedName("4") + DRUG_PROPAGANDA(4), + + @SerializedName("5") + ADULT_MATERIAL(5), + + @SerializedName("6") + INSULT_ABUSE(6); +} diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/ReasonParam.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoReportReason.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/video/dto/ReasonParam.kt rename to api/src/main/java/com/vk/sdk/api/video/dto/VideoReportReason.kt index 2175709997..e42deaaf39 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/ReasonParam.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoReportReason.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.video.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class ReasonParam( +enum class VideoReportReason( val value: Int ) { @SerializedName("0") diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchExtendedFilters.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchExtendedFilters.kt new file mode 100644 index 0000000000..7aec54c6c5 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchExtendedFilters.kt @@ -0,0 +1,47 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.video.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class VideoSearchExtendedFilters( + val value: String +) { + @SerializedName("youtube") + YOUTUBE("youtube"), + + @SerializedName("vimeo") + VIMEO("vimeo"), + + @SerializedName("short") + SHORT("short"), + + @SerializedName("long") + LONG("long"); +} diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchExtendedSort.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchExtendedSort.kt new file mode 100644 index 0000000000..1ca3632e4d --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchExtendedSort.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.video.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class VideoSearchExtendedSort( + val value: Int +) { + @SerializedName("1") + DURATION(1), + + @SerializedName("2") + RELEVANCE(2), + + @SerializedName("0") + DATE_ADDED(0); +} diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/FiltersParam.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchFilters.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/video/dto/FiltersParam.kt rename to api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchFilters.kt index 73b70c23f3..d0c3bce9e0 100644 --- a/api/src/main/java/com/vk/sdk/api/video/dto/FiltersParam.kt +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchFilters.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.video.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class FiltersParam( +enum class VideoSearchFilters( val value: String ) { @SerializedName("youtube") diff --git a/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchSort.kt b/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchSort.kt new file mode 100644 index 0000000000..36cc51fc18 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/video/dto/VideoSearchSort.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.video.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class VideoSearchSort( + val value: Int +) { + @SerializedName("1") + DURATION(1), + + @SerializedName("2") + RELEVANCE(2), + + @SerializedName("0") + DATE_ADDED(0); +} 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 915aa0a970..083f09b738 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 @@ -29,26 +29,30 @@ package com.vk.sdk.api.wall import com.google.gson.reflect.TypeToken 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.base.dto.BaseUserGroupFields -import com.vk.sdk.api.wall.dto.ReasonParam -import com.vk.sdk.api.wall.dto.SortParam -import com.vk.sdk.api.wall.dto.TopicIdParam import com.vk.sdk.api.wall.dto.WallCreateCommentResponse import com.vk.sdk.api.wall.dto.WallEditResponse +import com.vk.sdk.api.wall.dto.WallEditTopicId import com.vk.sdk.api.wall.dto.WallGetByIdExtendedResponse import com.vk.sdk.api.wall.dto.WallGetCommentExtendedResponse import com.vk.sdk.api.wall.dto.WallGetCommentResponse import com.vk.sdk.api.wall.dto.WallGetCommentsExtendedResponse +import com.vk.sdk.api.wall.dto.WallGetCommentsExtendedSort import com.vk.sdk.api.wall.dto.WallGetCommentsResponse +import com.vk.sdk.api.wall.dto.WallGetCommentsSort import com.vk.sdk.api.wall.dto.WallGetExtendedResponse import com.vk.sdk.api.wall.dto.WallGetRepostsResponse import com.vk.sdk.api.wall.dto.WallGetResponse import com.vk.sdk.api.wall.dto.WallPostAdsStealthResponse import com.vk.sdk.api.wall.dto.WallPostResponse +import com.vk.sdk.api.wall.dto.WallPostTopicId +import com.vk.sdk.api.wall.dto.WallReportCommentReason +import com.vk.sdk.api.wall.dto.WallReportPostReason import com.vk.sdk.api.wall.dto.WallRepostResponse import com.vk.sdk.api.wall.dto.WallSearchExtendedResponse import com.vk.sdk.api.wall.dto.WallSearchResponse @@ -77,7 +81,7 @@ class WallService { * @param postId * @return [VKRequest] with [BaseBoolInt] */ - fun wallCloseComments(ownerId: Int, postId: Int): VKRequest = + fun wallCloseComments(ownerId: UserId, postId: Int): VKRequest = NewApiRequest("wall.closeComments") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -95,9 +99,9 @@ class WallService { * @param message - (Required if 'attachments' is not set.) Text of the comment. * @param replyToComment - ID of comment to reply. * @param attachments - (Required if 'message' is not set.) List of media objects attached to - * the comment, in the following format: "_,_", '' - Type - * of media ojbect: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, - * '' - ID of the media owner. '' - Media ID. For example: + * the comment, in the following format_ "_,_", '' - Type + * of media ojbect_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, + * '' - ID of the media owner. '' - Media ID. For example_ * "photo100172_166443618,photo66748_265827614" * @param stickerId - Sticker ID. * @param guid - Unique identifier to avoid repeated comments. @@ -105,7 +109,7 @@ class WallService { */ fun wallCreateComment( postId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, fromGroup: Int? = null, message: String? = null, replyToComment: Int? = null, @@ -133,7 +137,7 @@ class WallService { * @param postId - ID of the post to be deleted. * @return [VKRequest] with [BaseOkResponse] */ - fun wallDelete(ownerId: Int? = null, postId: Int? = null): VKRequest = + fun wallDelete(ownerId: UserId? = null, postId: Int? = null): VKRequest = NewApiRequest("wall.delete") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -149,7 +153,7 @@ class WallService { * @param ownerId - User ID or community ID. Use a negative value to designate a community ID. * @return [VKRequest] with [BaseOkResponse] */ - fun wallDeleteComment(commentId: Int, ownerId: Int? = null): VKRequest = + fun wallDeleteComment(commentId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("wall.deleteComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -166,11 +170,11 @@ class WallService { * @param friendsOnly * @param message - (Required if 'attachments' is not set.) Text of the post. * @param attachments - (Required if 'message' is not set.) List of objects attached to the - * post, in the following format: "_,_", '' - Type of media - * attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - - * ID of the media application owner. '' - Media application ID. Example: + * post, in the following format_ "_,_", '' - Type of media + * attachment_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, '' - + * ID of the media application owner. '' - Media application ID. Example_ * "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include - * in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link + * in the post. Example_ "photo66748_265827614,http_//habrahabr.ru", "NOTE_ If more than one link * is being attached, an error is thrown." * @param services * @param signed @@ -190,7 +194,7 @@ class WallService { */ fun wallEdit( postId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, friendsOnly: Boolean? = null, message: String? = null, attachments: List? = null, @@ -207,7 +211,7 @@ class WallService { posterBkgOwnerId: Int? = null, posterBkgAccessHash: String? = null, copyright: String? = null, - topicId: TopicIdParam? = null + topicId: WallEditTopicId? = null ): VKRequest = NewApiRequest("wall.edit") { GsonHolder.gson.fromJson(it, WallEditResponse::class.java) } @@ -240,14 +244,14 @@ class WallService { * @param ownerId - User ID or community ID. Use a negative value to designate a community ID. * @param message - (Required if 'attachments' is not set.) Text of the post. * @param attachments - (Required if 'message' is not set.) List of objects attached to the - * post, in the following format: "_,_", '' - Type of media - * attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'page' - + * post, in the following format_ "_,_", '' - Type of media + * attachment_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'page' - * wiki-page, 'note' - note, 'poll' - poll, 'album' - photo album, '' - ID of the media - * application owner. '' - Media application ID. Example: + * application owner. '' - Media application ID. Example_ * "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include - * in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link + * in the post. Example_ "photo66748_265827614,http_//habrahabr.ru", "NOTE_ If more than one link * is being attached, an error will be thrown." - * @param signed - Only for posts in communities with 'from_group' set to '1': '1' - post will + * @param signed - Only for posts in communities with 'from_group' set to '1'_ '1' - post will * be signed with the name of the posting user, '0' - post will not be signed (default) * @param lat - Geographical latitude of a check-in, in degrees (from -90 to 90). * @param long - Geographical longitude of a check-in, in degrees (from -180 to 180). @@ -260,7 +264,7 @@ class WallService { */ fun wallEditAdsStealth( postId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, message: String? = null, attachments: List? = null, signed: Boolean? = null, @@ -295,16 +299,16 @@ class WallService { * @param commentId - Comment ID. * @param ownerId - User ID or community ID. Use a negative value to designate a community ID. * @param message - New comment text. - * @param attachments - List of objects attached to the comment, in the following format: , - * "_,_", '' - Type of media attachment: 'photo' - photo, + * @param attachments - List of objects attached to the comment, in the following format_ , + * "_,_", '' - Type of media attachment_ 'photo' - photo, * 'video' - video, 'audio' - audio, 'doc' - document, '' - ID of the media attachment - * owner. '' - Media attachment ID. For example: + * owner. '' - Media attachment ID. For example_ * "photo100172_166443618,photo66748_265827614" * @return [VKRequest] with [BaseOkResponse] */ fun wallEditComment( commentId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, message: String? = null, attachments: List? = null ): VKRequest = NewApiRequest("wall.editComment") { @@ -330,7 +334,7 @@ class WallService { * @return [VKRequest] with [WallGetResponse] */ fun wallGet( - ownerId: Int? = null, + ownerId: UserId? = null, domain: String? = null, offset: Int? = null, count: Int? = null, @@ -364,7 +368,7 @@ class WallService { * @return [VKRequest] with [WallGetExtendedResponse] */ fun wallGetExtended( - ownerId: Int? = null, + ownerId: UserId? = null, domain: String? = null, offset: Int? = null, count: Int? = null, @@ -390,7 +394,7 @@ class WallService { * Returns a list of posts from user or community walls by their IDs. * * @param posts - User or community IDs and post IDs, separated by underscores. Use a negative - * value to designate a community ID. Example: "93388_21539,93388_20904,2943_4276,-1_1" + * value to designate a community ID. Example_ "93388_21539,93388_20904,2943_4276,-1_1" * @param copyHistoryDepth - Sets the number of parent elements to include in the array * 'copy_history' that is returned if the post is a repost from another wall. * @param fields @@ -417,7 +421,7 @@ class WallService { * Returns a list of posts from user or community walls by their IDs. * * @param posts - User or community IDs and post IDs, separated by underscores. Use a negative - * value to designate a community ID. Example: "93388_21539,93388_20904,2943_4276,-1_1" + * value to designate a community ID. Example_ "93388_21539,93388_20904,2943_4276,-1_1" * @param copyHistoryDepth - Sets the number of parent elements to include in the array * 'copy_history' that is returned if the post is a repost from another wall. * @param fields @@ -450,7 +454,7 @@ class WallService { */ fun wallGetComment( commentId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, fields: List? = null ): VKRequest = NewApiRequest("wall.getComment") { GsonHolder.gson.fromJson(it, WallGetCommentResponse::class.java) @@ -474,7 +478,7 @@ class WallService { */ fun wallGetCommentExtended( commentId: Int, - ownerId: Int? = null, + ownerId: UserId? = null, fields: List? = null ): VKRequest = NewApiRequest("wall.getComment") { GsonHolder.gson.fromJson(it, WallGetCommentExtendedResponse::class.java) @@ -499,7 +503,7 @@ class WallService { * @param startCommentId * @param offset - Offset needed to return a specific subset of comments. * @param count - Number of comments to return (maximum 100). - * @param sort - Sort order: 'asc' - chronological, 'desc' - reverse chronological + * @param sort - Sort order_ 'asc' - chronological, 'desc' - reverse chronological * @param previewLength - Number of characters at which to truncate comments when previewed. By * default, '90'. Specify '0' if you do not want to truncate comments. * @param fields @@ -508,13 +512,13 @@ class WallService { * @return [VKRequest] with [WallGetCommentsResponse] */ fun wallGetComments( - ownerId: Int? = null, + ownerId: UserId? = null, postId: Int? = null, needLikes: Boolean? = null, startCommentId: Int? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null, + sort: WallGetCommentsSort? = null, previewLength: Int? = null, fields: List? = null, commentId: Int? = null, @@ -549,7 +553,7 @@ class WallService { * @param startCommentId * @param offset - Offset needed to return a specific subset of comments. * @param count - Number of comments to return (maximum 100). - * @param sort - Sort order: 'asc' - chronological, 'desc' - reverse chronological + * @param sort - Sort order_ 'asc' - chronological, 'desc' - reverse chronological * @param previewLength - Number of characters at which to truncate comments when previewed. By * default, '90'. Specify '0' if you do not want to truncate comments. * @param fields @@ -558,13 +562,13 @@ class WallService { * @return [VKRequest] with [WallGetCommentsExtendedResponse] */ fun wallGetCommentsExtended( - ownerId: Int? = null, + ownerId: UserId? = null, postId: Int? = null, needLikes: Boolean? = null, startCommentId: Int? = null, offset: Int? = null, count: Int? = null, - sort: SortParam? = null, + sort: WallGetCommentsExtendedSort? = null, previewLength: Int? = null, fields: List? = null, commentId: Int? = null, @@ -601,7 +605,7 @@ class WallService { * @return [VKRequest] with [WallGetRepostsResponse] */ fun wallGetReposts( - ownerId: Int? = null, + ownerId: UserId? = null, postId: Int? = null, offset: Int? = null, count: Int? = null @@ -620,7 +624,7 @@ class WallService { * @param postId * @return [VKRequest] with [BaseBoolInt] */ - fun wallOpenComments(ownerId: Int, postId: Int): VKRequest = + fun wallOpenComments(ownerId: UserId, postId: Int): VKRequest = NewApiRequest("wall.openComments") { GsonHolder.gson.fromJson(it, BaseBoolInt::class.java) } @@ -637,7 +641,7 @@ class WallService { * Use a negative value to designate a community ID. * @return [VKRequest] with [BaseOkResponse] */ - fun wallPin(postId: Int, ownerId: Int? = null): VKRequest = + fun wallPin(postId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("wall.pin") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -653,20 +657,20 @@ class WallService { * @param ownerId - User ID or community ID. Use a negative value to designate a community ID. * @param friendsOnly - '1' - post will be available to friends only, '0' - post will be * available to all users (default) - * @param fromGroup - For a community: '1' - post will be published by the community, '0' - post + * @param fromGroup - For a community_ '1' - post will be published by the community, '0' - post * will be published by the user (default) * @param message - (Required if 'attachments' is not set.) Text of the post. * @param attachments - (Required if 'message' is not set.) List of objects attached to the - * post, in the following format: "_,_", '' - Type of media - * attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'page' - + * post, in the following format_ "_,_", '' - Type of media + * attachment_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'page' - * wiki-page, 'note' - note, 'poll' - poll, 'album' - photo album, '' - ID of the media - * application owner. '' - Media application ID. Example: + * application owner. '' - Media application ID. Example_ * "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include - * in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link + * in the post. Example_ "photo66748_265827614,http_//habrahabr.ru", "NOTE_ If more than one link * is being attached, an error will be thrown." * @param services - List of services or websites the update will be exported to, if the user - * has so requested. Sample values: 'twitter', 'facebook'. - * @param signed - Only for posts in communities with 'from_group' set to '1': '1' - post will + * has so requested. Sample values_ 'twitter', 'facebook'. + * @param signed - Only for posts in communities with 'from_group' set to '1'_ '1' - post will * be signed with the name of the posting user, '0' - post will not be signed (default) * @param publishDate - Publication date (in Unix time). If used, posting will be delayed until * the set time. @@ -684,7 +688,7 @@ class WallService { * @return [VKRequest] with [WallPostResponse] */ fun wallPost( - ownerId: Int? = null, + ownerId: UserId? = null, friendsOnly: Boolean? = null, fromGroup: Boolean? = null, message: String? = null, @@ -702,7 +706,7 @@ class WallService { donutPaidDuration: Int? = null, muteNotifications: Boolean? = null, copyright: String? = null, - topicId: TopicIdParam? = null + topicId: WallPostTopicId? = null ): VKRequest = NewApiRequest("wall.post") { GsonHolder.gson.fromJson(it, WallPostResponse::class.java) } @@ -735,14 +739,14 @@ class WallService { * @param ownerId - User ID or community ID. Use a negative value to designate a community ID. * @param message - (Required if 'attachments' is not set.) Text of the post. * @param attachments - (Required if 'message' is not set.) List of objects attached to the - * post, in the following format: "_,_", '' - Type of media - * attachment: 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'page' - + * post, in the following format_ "_,_", '' - Type of media + * attachment_ 'photo' - photo, 'video' - video, 'audio' - audio, 'doc' - document, 'page' - * wiki-page, 'note' - note, 'poll' - poll, 'album' - photo album, '' - ID of the media - * application owner. '' - Media application ID. Example: + * application owner. '' - Media application ID. Example_ * "photo100172_166443618,photo66748_265827614", May contain a link to an external page to include - * in the post. Example: "photo66748_265827614,http://habrahabr.ru", "NOTE: If more than one link + * in the post. Example_ "photo66748_265827614,http_//habrahabr.ru", "NOTE_ If more than one link * is being attached, an error will be thrown." - * @param signed - Only for posts in communities with 'from_group' set to '1': '1' - post will + * @param signed - Only for posts in communities with 'from_group' set to '1'_ '1' - post will * be signed with the name of the posting user, '0' - post will not be signed (default) * @param lat - Geographical latitude of a check-in, in degrees (from -90 to 90). * @param long - Geographical longitude of a check-in, in degrees (from -180 to 180). @@ -755,7 +759,7 @@ class WallService { * @return [VKRequest] with [WallPostAdsStealthResponse] */ fun wallPostAdsStealth( - ownerId: Int, + ownerId: UserId, message: String? = null, attachments: List? = null, signed: Boolean? = null, @@ -790,14 +794,14 @@ class WallService { * * @param ownerId - ID of the user or community that owns the wall. * @param commentId - Comment ID. - * @param reason - Reason for the complaint: '0' - spam, '1' - child pornography, '2' - + * @param reason - Reason for the complaint_ '0' - spam, '1' - child pornography, '2' - * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse * @return [VKRequest] with [BaseOkResponse] */ fun wallReportComment( - ownerId: Int, + ownerId: UserId, commentId: Int, - reason: ReasonParam? = null + reason: WallReportCommentReason? = null ): VKRequest = NewApiRequest("wall.reportComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -812,14 +816,14 @@ class WallService { * * @param ownerId - ID of the user or community that owns the wall. * @param postId - Post ID. - * @param reason - Reason for the complaint: '0' - spam, '1' - child pornography, '2' - + * @param reason - Reason for the complaint_ '0' - spam, '1' - child pornography, '2' - * extremism, '3' - violence, '4' - drug propaganda, '5' - adult material, '6' - insult, abuse * @return [VKRequest] with [BaseOkResponse] */ fun wallReportPost( - ownerId: Int, + ownerId: UserId, postId: Int, - reason: ReasonParam? = null + reason: WallReportPostReason? = null ): VKRequest = NewApiRequest("wall.reportPost") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -832,7 +836,7 @@ class WallService { /** * Reposts (copies) an object to a user wall or community wall. * - * @param objectValue - ID of the object to be reposted on the wall. Example: "wall66748_3675" + * @param objectValue - ID of the object to be reposted on the wall. Example_ "wall66748_3675" * @param message - Comment to be added along with the reposted object. * @param groupId - Target community ID when reposting to a community. * @param markAsAds @@ -842,7 +846,7 @@ class WallService { fun wallRepost( objectValue: String, message: String? = null, - groupId: Int? = null, + groupId: UserId? = null, markAsAds: Boolean? = null, muteNotifications: Boolean? = null ): VKRequest = NewApiRequest("wall.repost") { @@ -864,7 +868,7 @@ class WallService { * @param postId - ID of the post to be restored. * @return [VKRequest] with [BaseOkResponse] */ - fun wallRestore(ownerId: Int? = null, postId: Int? = null): VKRequest = + fun wallRestore(ownerId: UserId? = null, postId: Int? = null): VKRequest = NewApiRequest("wall.restore") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -880,7 +884,7 @@ class WallService { * @param ownerId - User ID or community ID. Use a negative value to designate a community ID. * @return [VKRequest] with [BaseOkResponse] */ - fun wallRestoreComment(commentId: Int, ownerId: Int? = null): VKRequest = + fun wallRestoreComment(commentId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("wall.restoreComment") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } @@ -903,7 +907,7 @@ class WallService { * @return [VKRequest] with [WallSearchResponse] */ fun wallSearch( - ownerId: Int? = null, + ownerId: UserId? = null, domain: String? = null, query: String? = null, ownersOnly: Boolean? = null, @@ -940,7 +944,7 @@ class WallService { * @return [VKRequest] with [WallSearchExtendedResponse] */ fun wallSearchExtended( - ownerId: Int? = null, + ownerId: UserId? = null, domain: String? = null, query: String? = null, ownersOnly: Boolean? = null, @@ -972,7 +976,7 @@ class WallService { * Use a negative value to designate a community ID. * @return [VKRequest] with [BaseOkResponse] */ - fun wallUnpin(postId: Int, ownerId: Int? = null): VKRequest = + fun wallUnpin(postId: Int, ownerId: UserId? = null): VKRequest = NewApiRequest("wall.unpin") { GsonHolder.gson.fromJson(it, BaseOkResponse::class.java) } diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/TopicIdParam.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallEditTopicId.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/wall/dto/TopicIdParam.kt rename to api/src/main/java/com/vk/sdk/api/wall/dto/WallEditTopicId.kt index 7856c333e4..607bf308e1 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/TopicIdParam.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallEditTopicId.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.wall.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class TopicIdParam( +enum class WallEditTopicId( val value: Int ) { @SerializedName("0") diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsExtendedSort.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsExtendedSort.kt new file mode 100644 index 0000000000..510e22cba1 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsExtendedSort.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.wall.dto + +import com.google.gson.annotations.SerializedName +import kotlin.String + +enum class WallGetCommentsExtendedSort( + val value: String +) { + @SerializedName("asc") + CHRONOLOGICAL("asc"), + + @SerializedName("desc") + REVERSE_CHRONOLOGICAL("desc"); +} diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/SortParam.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsSort.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/wall/dto/SortParam.kt rename to api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsSort.kt index 1a770d4f75..a62c44d57b 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/SortParam.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallGetCommentsSort.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.wall.dto import com.google.gson.annotations.SerializedName import kotlin.String -enum class SortParam( +enum class WallGetCommentsSort( val value: String ) { @SerializedName("asc") diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostTopicId.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostTopicId.kt new file mode 100644 index 0000000000..071afb6072 --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallPostTopicId.kt @@ -0,0 +1,71 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.wall.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class WallPostTopicId( + 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); +} diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/WallReportCommentReason.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallReportCommentReason.kt new file mode 100644 index 0000000000..6ff29c97fa --- /dev/null +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallReportCommentReason.kt @@ -0,0 +1,56 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2019 vk.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +// ********************************************************************* +// THIS FILE IS AUTO GENERATED! +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING. +// ********************************************************************* +package com.vk.sdk.api.wall.dto + +import com.google.gson.annotations.SerializedName +import kotlin.Int + +enum class WallReportCommentReason( + val value: Int +) { + @SerializedName("0") + SPAM(0), + + @SerializedName("1") + CHILD_PORNOGRAPHY(1), + + @SerializedName("2") + EXTREMISM(2), + + @SerializedName("3") + VIOLENCE(3), + + @SerializedName("4") + DRUG_PROPAGANDA(4), + + @SerializedName("5") + ADULT_MATERIAL(5), + + @SerializedName("6") + INSULT_ABUSE(6); +} diff --git a/api/src/main/java/com/vk/sdk/api/wall/dto/ReasonParam.kt b/api/src/main/java/com/vk/sdk/api/wall/dto/WallReportPostReason.kt similarity index 98% rename from api/src/main/java/com/vk/sdk/api/wall/dto/ReasonParam.kt rename to api/src/main/java/com/vk/sdk/api/wall/dto/WallReportPostReason.kt index 855e000a71..d6504b7d08 100644 --- a/api/src/main/java/com/vk/sdk/api/wall/dto/ReasonParam.kt +++ b/api/src/main/java/com/vk/sdk/api/wall/dto/WallReportPostReason.kt @@ -30,7 +30,7 @@ package com.vk.sdk.api.wall.dto import com.google.gson.annotations.SerializedName import kotlin.Int -enum class ReasonParam( +enum class WallReportPostReason( val value: Int ) { @SerializedName("0") 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 b21fbbaa88..e33712fadf 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 @@ -94,5 +94,8 @@ enum class WallWallpostAttachmentType( TEXTLIVE("textlive"), @SerializedName("textpost") - TEXTPOST("textpost"); + TEXTPOST("textpost"), + + @SerializedName("situational_theme") + SITUATIONAL_THEME("situational_theme"); } 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 156eba3ca2..ce275c3317 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 @@ -52,6 +52,7 @@ import kotlin.collections.List * @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 carouselOffset - Index of current carousel element * @param accessKey - Access key to private object * @param isDeleted @@ -99,6 +100,8 @@ data class WallWallpostFull( val topicId: WallWallpostFull.TopicId? = null, @SerializedName("short_text_rate") val shortTextRate: Float? = null, + @SerializedName("hash") + val hash: String? = null, @SerializedName("carousel_offset") val carouselOffset: Int? = null, @SerializedName("access_key") diff --git a/core/build.gradle b/core/build.gradle index 5e20765acd..d34e072563 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -38,6 +38,18 @@ android { targetSdkVersion "$sdkVersions.targetSdk" versionCode "$sdkVersions.code".toInteger() versionName "$sdkVersions.name" + manifestPlaceholders = [VKSdkVersion: version, VKSdkVersionCode: sdkVersions.code] + } + + packagingOptions { + exclude("builddef.lst") + exclude("**/com/**") + exclude("META-INF/*.kotlin_module") + exclude("META-INF/*.version") + exclude("autoTest/**") + exclude("META-INF/spring.*") + exclude("META-INF/notice.txt") + exclude("mockito-extensions/org.mockito.plugins.MockMaker") } lintOptions { @@ -58,6 +70,8 @@ dependencies { testImplementation testLibraries.junit testImplementation testLibraries.mockito + + implementation project(":id") } apply from: "../publish.gradle" \ No newline at end of file diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml index 6012b79215..857c7974b5 100644 --- a/core/src/main/AndroidManifest.xml +++ b/core/src/main/AndroidManifest.xml @@ -54,6 +54,8 @@ android:name="com.vk.api.sdk.internal.VKInitProvider" android:exported="false" android:enabled="@bool/com_vk_sdk_init_provider_enabled"/> + + \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/VK.kt b/core/src/main/java/com/vk/api/sdk/VK.kt index f28d529bfe..b51e493afc 100644 --- a/core/src/main/java/com/vk/api/sdk/VK.kt +++ b/core/src/main/java/com/vk/api/sdk/VK.kt @@ -28,6 +28,8 @@ import android.annotation.SuppressLint import android.app.Activity import android.content.Context import android.content.Intent +import android.widget.Toast +import android.content.pm.PackageManager import com.vk.api.sdk.auth.VKAccessToken import com.vk.api.sdk.auth.VKAuthCallback import com.vk.api.sdk.auth.VKAuthManager @@ -38,6 +40,7 @@ import com.vk.api.sdk.internal.ApiCommand import com.vk.api.sdk.requests.VKBooleanRequest import com.vk.api.sdk.utils.VKUrlResolver import com.vk.api.sdk.utils.VKUtils +import com.vk.api.sdk.utils.DefaultUserAgent import java.io.IOException /** @@ -45,6 +48,9 @@ import java.io.IOException */ object VK { private const val SDK_APP_ID = "com_vk_sdk_AppId" + private const val SDK_UA_PREFIX = "VKAndroidSDK" + private const val SDK_VERSION = "VKSdkVersion" + private const val SDK_VERSION_CODE = "VKSdkVersionCode" @SuppressLint("StaticFieldLeak") private lateinit var config: VKApiConfig @@ -147,8 +153,15 @@ object VK { * Use this method to handle authorization result from your activity */ @JvmStatic - fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?, callback: VKAuthCallback): Boolean { - val result = authManager.onActivityResult(requestCode, resultCode, data, callback) + @JvmOverloads + fun onActivityResult( + requestCode: Int, + resultCode: Int, + data: Intent?, + callback: VKAuthCallback, + showErrorToast: Boolean = true + ): Boolean { + val result = authManager.onActivityResult(config.context, requestCode, resultCode, data, callback, showErrorToast) if (result && isLoggedIn()) { trackVisitor() } @@ -252,6 +265,20 @@ object VK { } } + internal fun getSDKUserAgent(): DefaultUserAgent { + if (!::config.isInitialized) { + throw RuntimeException("please call VK.initialize first!") + } + val metaData = config.context.packageManager + .getApplicationInfo(config.context.packageName, PackageManager.GET_META_DATA) + return DefaultUserAgent( + SDK_UA_PREFIX, + metaData.metaData[SDK_VERSION].toString(), + metaData.metaData[SDK_VERSION_CODE].toString(), + VKUtils.getPhysicalDisplaySize(config.context) + ) + } + private fun trackVisitor() { execute(VKBooleanRequest("stats.trackVisitor")) } diff --git a/core/src/main/java/com/vk/api/sdk/VKApiConfig.kt b/core/src/main/java/com/vk/api/sdk/VKApiConfig.kt index 29b101d375..bfb68f8e81 100644 --- a/core/src/main/java/com/vk/api/sdk/VKApiConfig.kt +++ b/core/src/main/java/com/vk/api/sdk/VKApiConfig.kt @@ -51,15 +51,18 @@ data class VKApiConfig( val debugCycleCalls: Lazy = lazy { false }, val callsPerSecondLimit: Int = 3, val httpApiHostProvider: () -> String = { DEFAULT_API_DOMAIN }, - val lang: String = "en", + val langProvider: () -> String = { DEFAULT_LANGUAGE }, val keyValueStorage: VKKeyValueStorage = VKPreferencesKeyValueStorage(context), val customApiEndpoint: Lazy = lazy { DEFAULT_API_ENDPOINT }, val rateLimitBackoffTimeoutMs: Long = TimeUnit.HOURS.toMillis(1), val apiMethodPriorityBackoff: ApiMethodPriorityBackoff = ApiMethodPriorityBackoff.DEFAULT, val externalDeviceId: Lazy = lazy { null }, - val enableAnonymousToken: Boolean = true + val enableAnonymousToken: Boolean = true, + val responseValidator: VKApiResponseValidator? = null ) { + val lang get() = langProvider() + fun builder(context: Context) = Builder(VKApiConfig(context, validationHandler = VKDefaultValidationHandler(context))) fun buildUpon() = Builder(this) @@ -94,8 +97,8 @@ data class VKApiConfig( config = config.copy(keyValueStorage = storage) } - fun setLang(lang: String) = apply { - config = config.copy(lang = lang) + fun setLangProvider(langProvider: () -> String) = apply { + config = config.copy(langProvider = langProvider) } fun setHttpApiHostProvider(hostProvider: () -> String) = apply { @@ -145,6 +148,7 @@ data class VKApiConfig( companion object { const val DEFAULT_DOMAIN = "vk.com" + const val DEFAULT_LANGUAGE = "en" const val DEFAULT_API_VERSION = "5.131" const val DEFAULT_API_DOMAIN = "api.vk.com" const val DEFAULT_OAUTH_DOMAIN = "oauth.vk.com" diff --git a/core/src/main/java/com/vk/api/sdk/VKApiResponseValidator.kt b/core/src/main/java/com/vk/api/sdk/VKApiResponseValidator.kt new file mode 100644 index 0000000000..ca25e1678b --- /dev/null +++ b/core/src/main/java/com/vk/api/sdk/VKApiResponseValidator.kt @@ -0,0 +1,12 @@ +package com.vk.api.sdk + +import okhttp3.Headers + +interface VKApiResponseValidator { + fun validateResponse( + method: String, + extended: Boolean, + response: String, + headers: Headers + ) +} \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/VKOkHttpProvider.kt b/core/src/main/java/com/vk/api/sdk/VKOkHttpProvider.kt index 4f214d1a32..be42d10043 100644 --- a/core/src/main/java/com/vk/api/sdk/VKOkHttpProvider.kt +++ b/core/src/main/java/com/vk/api/sdk/VKOkHttpProvider.kt @@ -24,6 +24,7 @@ package com.vk.api.sdk +import com.vk.api.sdk.okhttp.UserAgentInterceptor import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -50,6 +51,7 @@ abstract class VKOkHttpProvider { .writeTimeout(20, TimeUnit.SECONDS) .followRedirects(true) .followSslRedirects(true) + .addInterceptor(UserAgentInterceptor(VK.getSDKUserAgent())) .build() } return okHttpClient!! diff --git a/core/src/main/java/com/vk/api/sdk/auth/VKAuthCallback.kt b/core/src/main/java/com/vk/api/sdk/auth/VKAuthCallback.kt index e3a17e42f4..402a86d13b 100644 --- a/core/src/main/java/com/vk/api/sdk/auth/VKAuthCallback.kt +++ b/core/src/main/java/com/vk/api/sdk/auth/VKAuthCallback.kt @@ -24,12 +24,9 @@ package com.vk.api.sdk.auth +import com.vk.api.sdk.exceptions.VKAuthException + interface VKAuthCallback { fun onLogin(token: VKAccessToken) - fun onLoginFailed(errorCode: Int) - - companion object { - const val AUTH_CANCELED = 1 - const val UNKNOWN_ERROR = 2 - } + fun onLoginFailed(authException: VKAuthException) } \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/auth/VKAuthManager.kt b/core/src/main/java/com/vk/api/sdk/auth/VKAuthManager.kt index 4f75462253..7c4bde2956 100644 --- a/core/src/main/java/com/vk/api/sdk/auth/VKAuthManager.kt +++ b/core/src/main/java/com/vk/api/sdk/auth/VKAuthManager.kt @@ -25,17 +25,22 @@ package com.vk.api.sdk.auth import android.app.Activity +import android.content.Context import android.content.Intent import android.util.Log +import com.vk.api.sdk.R import com.vk.api.sdk.VK import com.vk.api.sdk.VKKeyValueStorage +import com.vk.api.sdk.exceptions.VKApiCodes +import com.vk.api.sdk.exceptions.VKAuthException +import com.vk.api.sdk.extensions.showToast import com.vk.api.sdk.ui.VKWebViewAuthActivity import com.vk.api.sdk.utils.VKUtils import java.util.* internal class VKAuthManager(private val keyValueStorage: VKKeyValueStorage) { fun login(activity: Activity, scopes: Collection) { - val params = VKAuthParams(VK.getAppId(activity), scope = scopes) + val params = VKAuthParams(VK.getAppId(activity), scope = prepareScopes(scopes)) if (VKUtils.isIntentAvailable(activity, VK_APP_AUTH_ACTION, null, VK_APP_PACKAGE_ID)) { startAuthActivity(activity, params) } else { @@ -56,19 +61,33 @@ internal class VKAuthManager(private val keyValueStorage: VKKeyValueStorage) { VKWebViewAuthActivity.startForAuth(activity, params, VK_APP_AUTH_CODE) } - fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?, callback: VKAuthCallback): Boolean { + fun onActivityResult( + context: Context, + requestCode: Int, + resultCode: Int, + data: Intent?, + callback: VKAuthCallback, + showErrorToast: Boolean + ): Boolean { if (requestCode != VK_APP_AUTH_CODE) { return false } if (data == null) { - callback.onLoginFailed(VKAuthCallback.AUTH_CANCELED) + callback.onLoginFailed(VKAuthException()) return true } val result = processResult(data) if (resultCode != Activity.RESULT_OK || result == null || result.isError) { - callback.onLoginFailed(VKAuthCallback.AUTH_CANCELED) + val webViewError = data.extras?.getInt(VKApiCodes.EXTRA_VW_LOGIN_ERROR) ?: 0 + val authError = data.extras?.getString(VKApiCodes.EXTRA_AUTH_ERROR) + + val loginError = VKAuthException(webViewError, authError) + callback.onLoginFailed(loginError) + if (showErrorToast && !loginError.isCanceled) { + context.showToast(R.string.vk_message_login_error) + } } else { result.accessToken!!.save(keyValueStorage) VK.apiManager.setCredentials(result.accessToken.accessToken, result.accessToken.secret) @@ -106,6 +125,12 @@ internal class VKAuthManager(private val keyValueStorage: VKKeyValueStorage) { } else null } + private fun prepareScopes(scopes: Collection): Collection { + if (!scopes.contains(VKScope.OFFLINE)) { + return scopes + VKScope.OFFLINE + } + return scopes + } fun isLoggedIn(): Boolean { val token = getCurrentToken() diff --git a/core/src/main/java/com/vk/api/sdk/chain/MethodChainCall.kt b/core/src/main/java/com/vk/api/sdk/chain/MethodChainCall.kt index 03ae34771d..f65f1d2eee 100644 --- a/core/src/main/java/com/vk/api/sdk/chain/MethodChainCall.kt +++ b/core/src/main/java/com/vk/api/sdk/chain/MethodChainCall.kt @@ -44,6 +44,8 @@ open class MethodChainCall( val defaultLang: String, val parser: VKApiResponseParser?) : ChainCall(manager) { + private val responseValidator = manager.config.responseValidator + @Throws(Exception::class) override fun call(args: ChainArgs): T? { if (args.hasCaptcha()) { @@ -71,15 +73,28 @@ open class MethodChainCall( return runRequest(callBuilder.build()) } - open fun runRequest(mc: OkHttpMethodCall) = parseResult(okHttpExecutor.execute(mc), mc.method, null) + open fun runRequest(mc: OkHttpMethodCall): T? { + return parseResult(okHttpExecutor.execute(mc), mc.method, mc.isExtended(), null) + } - fun parseResult(methodResponse: OkHttpExecutor.MethodResponse, methodName: String, ignoredExecuteErrors: IntArray?): T? { + fun parseResult( + methodResponse: OkHttpExecutor.MethodResponse, + methodName: String, + extended: Boolean, + ignoredExecuteErrors: IntArray? + ): T? { val response = methodResponse.response return when { response == null -> throw VKApiException("Response returned null instead of valid string response") response.hasSimpleError() -> throw response.toSimpleError(methodName, methodResponse.executorRequestAccessToken) response.hasExecuteError(ignoredExecuteErrors) -> throw response.toExecuteError(methodName, ignoredExecuteErrors) - else -> parser?.parse(response) + else -> { + try { + responseValidator?.validateResponse(methodName, extended, response, methodResponse.headers) + } catch (ignore: Throwable) {} + + parser?.parse(response) + } } } } \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/chain/TooManyRequestRetryChainCall.kt b/core/src/main/java/com/vk/api/sdk/chain/TooManyRequestRetryChainCall.kt index e65a7e8fb6..3a660b60c5 100644 --- a/core/src/main/java/com/vk/api/sdk/chain/TooManyRequestRetryChainCall.kt +++ b/core/src/main/java/com/vk/api/sdk/chain/TooManyRequestRetryChainCall.kt @@ -60,7 +60,7 @@ class TooManyRequestRetryChainCall( companion object { private const val TIMEOUT: Long = 1000 - private const val MAX_CALLS_PER_SECOND = 4 + private const val MAX_CALLS_PER_SECOND = 3 private const val MAX_LIMIT = 1000L private val errorBackoff = ExponentialBackoff( diff --git a/core/src/main/java/com/vk/api/sdk/exceptions/VKApiCodes.kt b/core/src/main/java/com/vk/api/sdk/exceptions/VKApiCodes.kt index efc332812a..9b8e977474 100644 --- a/core/src/main/java/com/vk/api/sdk/exceptions/VKApiCodes.kt +++ b/core/src/main/java/com/vk/api/sdk/exceptions/VKApiCodes.kt @@ -112,6 +112,7 @@ object VKApiCodes { const val CODE_CALL_REQUIRES_AUTH = 960 const val CODE_CALL_LINK_OUTDATED = 961 + const val CODE_CHAT_STYLE_ALREADY_SET = 964 const val CODE_PHONE_PARAM_PHONE = 1000 const val CODE_PHONE_ALREADY_USED = 1004 @@ -143,6 +144,7 @@ object VKApiCodes { const val CODE_ERROR_ALREADY_HAS_EXTERNAL_BINDING = 3612 const val CODE_ERROR_UNAVAILABLE_REGISTRATION = 5400 + const val CODE_ERROR_CANNOT_TRANSFER_MONEY_YOURSELF = 5800 const val EXTRA_CAPTCHA_SID = "captcha_sid" const val EXTRA_CAPTCHA_KEY = "captcha_key" @@ -153,6 +155,8 @@ object VKApiCodes { const val EXTRA_CONFIRMATION_TEXT = "confirmation_text" const val EXTRA_EXTENSION_HASH = "extend_hash" const val EXTRA_ACCESS_TOKEN = "access_token" + const val EXTRA_AUTH_ERROR = "error" + const val EXTRA_VW_LOGIN_ERROR = "vw_login_error" const val PARAM_DEVICE_ID = "device_id" const val PARAM_LANG = "lang" diff --git a/core/src/main/java/com/vk/api/sdk/exceptions/VKAuthException.kt b/core/src/main/java/com/vk/api/sdk/exceptions/VKAuthException.kt new file mode 100644 index 0000000000..db28ec82ff --- /dev/null +++ b/core/src/main/java/com/vk/api/sdk/exceptions/VKAuthException.kt @@ -0,0 +1,14 @@ +package com.vk.api.sdk.exceptions + +/** + * @param webViewError error code according to one of [android.webkit.WebView].ERROR_#; 0 if no WebView errors occurred + * @param authError error name returned on authentication. + * @see VK Authorization Code Flow + **/ +class VKAuthException( + val webViewError: Int = 0, + val authError: String? = null +) : Exception("Auth canceled") { + val isCanceled: Boolean + get() = webViewError == 0 && authError.isNullOrEmpty() +} \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/extensions/ContextExt.kt b/core/src/main/java/com/vk/api/sdk/extensions/ContextExt.kt index e3d53c88db..6cb07674f8 100644 --- a/core/src/main/java/com/vk/api/sdk/extensions/ContextExt.kt +++ b/core/src/main/java/com/vk/api/sdk/extensions/ContextExt.kt @@ -3,9 +3,14 @@ package com.vk.api.sdk.extensions import android.app.Activity import android.content.Context import android.content.ContextWrapper +import android.widget.Toast internal fun Context.toActivitySafe(): Activity? { var context = this while (context !is Activity && context is ContextWrapper) context = context.baseContext return if (context is Activity) context else null +} + +internal fun Context.showToast(resId: Int) { + Toast.makeText(this, resId, Toast.LENGTH_SHORT).show() } \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/okhttp/OkHttpExecutor.kt b/core/src/main/java/com/vk/api/sdk/okhttp/OkHttpExecutor.kt index f9c034460c..c6d80bb490 100644 --- a/core/src/main/java/com/vk/api/sdk/okhttp/OkHttpExecutor.kt +++ b/core/src/main/java/com/vk/api/sdk/okhttp/OkHttpExecutor.kt @@ -102,7 +102,8 @@ open class OkHttpExecutor(protected val config: OkHttpExecutorConfig) { .tag(Map::class.java, call.tag?.toMap()) .build() val executorAccessToken = accessToken - return MethodResponse(readResponse(executeRequest(request)), executorAccessToken) + val okHttpResponse = executeRequest(request) + return MethodResponse(readResponse(okHttpResponse), okHttpResponse.headers, executorAccessToken) } @Throws(InterruptedException::class, IOException::class, VKApiException::class) @@ -226,6 +227,7 @@ open class OkHttpExecutor(protected val config: OkHttpExecutorConfig) { data class MethodResponse( val response: String?, + val headers: Headers, val executorRequestAccessToken: String?) companion object { diff --git a/core/src/main/java/com/vk/api/sdk/okhttp/OkHttpMethodCall.kt b/core/src/main/java/com/vk/api/sdk/okhttp/OkHttpMethodCall.kt index d4cd281d87..41036ea00c 100644 --- a/core/src/main/java/com/vk/api/sdk/okhttp/OkHttpMethodCall.kt +++ b/core/src/main/java/com/vk/api/sdk/okhttp/OkHttpMethodCall.kt @@ -87,4 +87,6 @@ open class OkHttpMethodCall { this.allowNoAuth= b.allowNoAuth this.retryCount = b.retryCount } + + fun isExtended() = args["extended"] == "true" || args["extended"] == "1" } \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/okhttp/UserAgentInterceptor.kt b/core/src/main/java/com/vk/api/sdk/okhttp/UserAgentInterceptor.kt new file mode 100644 index 0000000000..86e864f585 --- /dev/null +++ b/core/src/main/java/com/vk/api/sdk/okhttp/UserAgentInterceptor.kt @@ -0,0 +1,17 @@ +package com.vk.api.sdk.okhttp + +import com.vk.api.sdk.utils.UserAgentProvider +import okhttp3.Interceptor +import okhttp3.Response + +class UserAgentInterceptor(private val userAgent: UserAgentProvider) : Interceptor { + + override fun intercept(chain: Interceptor.Chain): Response { + val originalRequest = chain.request() + val requestWithUserAgent = originalRequest.newBuilder() + .header("User-Agent", userAgent.getUserAgent()) + .build() + return chain.proceed(requestWithUserAgent) + } + +} \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/requests/VKRequest.kt b/core/src/main/java/com/vk/api/sdk/requests/VKRequest.kt index 7600cf95b3..c198112423 100644 --- a/core/src/main/java/com/vk/api/sdk/requests/VKRequest.kt +++ b/core/src/main/java/com/vk/api/sdk/requests/VKRequest.kt @@ -31,6 +31,7 @@ import com.vk.api.sdk.VKMethodCall import com.vk.api.sdk.exceptions.VKApiException import com.vk.api.sdk.exceptions.VKApiExecutionException import com.vk.api.sdk.internal.ApiCommand +import com.vk.dto.common.id.UserId import org.json.JSONObject import java.io.IOException import java.util.* @@ -62,6 +63,8 @@ open class VKRequest(var method: String, val requestApiVersion: String? = nul fun addParam(name: CharSequence, values: Array<*>) = addParam(name.toString(), values.joinToString(",")) fun addParam(name: CharSequence, values: Iterable<*>) = addParam(name.toString(), values.joinToString(",")) fun addParam(name: CharSequence, values: IntArray) = addParam(name.toString(), values.joinToString(",")) + fun addParam(name: String, value: UserId?) = apply { if (value != null) params[name] = value.value.toString() } + fun addParam(name: CharSequence, values: List) = addParam(name.toString(), values.joinToString(",", transform = { it.value.toString() })) @Throws(VKApiException::class) override fun parse(response: String): T { diff --git a/core/src/main/java/com/vk/api/sdk/ui/VKWebViewAuthActivity.kt b/core/src/main/java/com/vk/api/sdk/ui/VKWebViewAuthActivity.kt index eaa259a145..fd02189881 100644 --- a/core/src/main/java/com/vk/api/sdk/ui/VKWebViewAuthActivity.kt +++ b/core/src/main/java/com/vk/api/sdk/ui/VKWebViewAuthActivity.kt @@ -26,7 +26,6 @@ package com.vk.api.sdk.ui import android.annotation.SuppressLint import android.app.Activity -import android.app.AlertDialog import android.content.Context import android.content.Intent import android.graphics.Bitmap @@ -45,6 +44,7 @@ import com.vk.api.sdk.VK import com.vk.api.sdk.VKApiValidationHandler import com.vk.api.sdk.auth.VKAuthManager import com.vk.api.sdk.auth.VKAuthParams +import com.vk.api.sdk.exceptions.VKApiCodes import com.vk.api.sdk.extensions.toActivitySafe import com.vk.api.sdk.utils.VKUtils import com.vk.api.sdk.utils.VKValidationLocker @@ -191,36 +191,26 @@ open class VKWebViewAuthActivity: Activity() { @RequiresApi(Build.VERSION_CODES.LOLLIPOP) override fun onReceivedError(view: WebView?, request: WebResourceRequest?, error: WebResourceError?) { super.onReceivedError(view, request, error) - val description = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) error?.description?.toString() else null - showError(view, description) + val errorCode = + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) error?.errorCode ?: ERROR_UNKNOWN + else ERROR_UNKNOWN + onError(errorCode) } @Suppress("DEPRECATION") override fun onReceivedError(view: WebView?, errorCode: Int, description: String?, failingUrl: String?) { super.onReceivedError(view, errorCode, description, failingUrl) - showError(view, description) + onError(errorCode) } - private fun showError(view: WebView?, description: String?) { + private fun onError(errorCode: Int) { hasError = true - val builder = AlertDialog.Builder(view?.context) - .setMessage(description) - .setPositiveButton(R.string.vk_retry) { _, _ -> - hasError = false - loadUrl() - } - .setNegativeButton(android.R.string.cancel) { _, _ -> - setResult(RESULT_CANCELED) - finish() - } - - try { - builder.show() - } catch (e: Exception) { - setResult(RESULT_CANCELED) - finish() + val intent = Intent().apply { + putExtra(VKApiCodes.EXTRA_VW_LOGIN_ERROR, errorCode) } + setResult(RESULT_CANCELED, intent) + finish() } } diff --git a/core/src/main/java/com/vk/api/sdk/utils/DefaultUserAgent.kt b/core/src/main/java/com/vk/api/sdk/utils/DefaultUserAgent.kt new file mode 100644 index 0000000000..9e7d1f6d39 --- /dev/null +++ b/core/src/main/java/com/vk/api/sdk/utils/DefaultUserAgent.kt @@ -0,0 +1,25 @@ +package com.vk.api.sdk.utils + +import android.graphics.Point +import android.os.Build +import okio.Buffer +import java.util.* + +data class DefaultUserAgent( + val prefix: String, + val appVersion: String, + val appBuild: String, + val displaySize: Point +) : UserAgentProvider { + private val stringify: String by lazy { + VKUtils.toHumanReadableAscii( + String.format(Locale.US, "%s/%s-%s (Android %s; SDK %d; %s; %s %s; %s; %dx%d)", + prefix, appVersion, appBuild, Build.VERSION.RELEASE, Build.VERSION.SDK_INT, + Build.CPU_ABI, Build.MANUFACTURER, Build.MODEL, System.getProperty("user.language"), + Math.max(displaySize.x, displaySize.y), Math.min(displaySize.x, displaySize.y) + ) + ) + } + + override fun getUserAgent(): String = stringify +} \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/utils/UserAgentProvider.kt b/core/src/main/java/com/vk/api/sdk/utils/UserAgentProvider.kt new file mode 100644 index 0000000000..e7ba01e028 --- /dev/null +++ b/core/src/main/java/com/vk/api/sdk/utils/UserAgentProvider.kt @@ -0,0 +1,5 @@ +package com.vk.api.sdk.utils + +interface UserAgentProvider { + fun getUserAgent(): String +} \ No newline at end of file diff --git a/core/src/main/java/com/vk/api/sdk/utils/VKUtils.kt b/core/src/main/java/com/vk/api/sdk/utils/VKUtils.kt index 1989c8a803..0db4b1d715 100644 --- a/core/src/main/java/com/vk/api/sdk/utils/VKUtils.kt +++ b/core/src/main/java/com/vk/api/sdk/utils/VKUtils.kt @@ -31,11 +31,16 @@ import android.content.Context import android.content.Intent import android.content.pm.PackageManager import android.content.res.Resources +import android.graphics.Point import android.net.Uri import android.os.Build import android.util.DisplayMetrics +import android.view.Display +import android.view.WindowManager import android.webkit.CookieManager import android.webkit.CookieSyncManager +import androidx.annotation.RequiresApi +import okio.Buffer import java.math.BigInteger import java.security.MessageDigest import java.util.* @@ -150,6 +155,50 @@ object VKUtils { return context.resources.displayMetrics.widthPixels } + fun getPhysicalDisplaySize(context: Context): Point { + val size = Point() + val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager + val display = wm.defaultDisplay + if (Build.VERSION.SDK_INT >= 23) { + getDisplaySizeV23(display, size) + } else { + getDisplaySizePreV23(display, size) + } + return size + } + + private fun getDisplaySizePreV23(display: Display?, size: Point) { + display?.getRealSize(size) + } + + @RequiresApi(Build.VERSION_CODES.M) + private fun getDisplaySizeV23(display: Display?, size: Point) { + val mode = display?.mode + size.x = mode?.physicalWidth ?: 0 + size.y = mode?.physicalHeight ?: 0 + } + + @JvmStatic + fun toHumanReadableAscii(string: String?): String { + if (string == null) return "" + var i = 0 + while (i < string.length) { + var c = string.codePointAt(i) + i += Character.charCount(c) + if (c in 0x20 .. 0x7e) continue + + val buffer = Buffer() + buffer.writeUtf8(string, 0, i) + while (i < string.length) { + c = string.codePointAt(i) + buffer.writeUtf8CodePoint(if (c in 0x20 .. 0x7e) c else '?'.toInt()) + i += Character.charCount(c) + } + return buffer.readUtf8() + } + return string + } + object MD5 { private val hex = charArrayOf('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f') private val tmpBuilder by threadLocal { StringBuilder() } diff --git a/core/src/main/res/values-ru/string.xml b/core/src/main/res/values-ru/string.xml index 089c4608e6..f738fba6ed 100644 --- a/core/src/main/res/values-ru/string.xml +++ b/core/src/main/res/values-ru/string.xml @@ -3,4 +3,5 @@ Повторить Введите код с картинки Подтверждение + Произошла ошибка авторизации \ 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 e26c9221c1..3c2a061617 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -3,4 +3,5 @@ Retry Please enter the code from the picture Please confirm + Login error occurred \ No newline at end of file diff --git a/dependencies.gradle b/dependencies.gradle index 73a268b0e8..5154122601 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -23,23 +23,25 @@ SOFTWARE. */ ext.sdkVersions = [ - code : '27', - name : '3.2.2', + code : '28', + name : '3.3.0', minSdk : 21, targetSdk : 29, compileSdk : '29', buildTools : '29.0.3', - kotlin : '1.4.30', - androidX : '1.1.0', - okHttp : '4.5.0', + kotlin : '1.5.21', + androidXAppCompat : '1.3.1', + androidXRV : '1.2.1', + androidXCollection : '1.1.0', + okHttp : '4.9.1', picasso : '2.71828', - androidGradlePlugin : '3.6.0', + androidGradlePlugin : '4.2.2', - gson : '2.8.6', + gson : '2.8.8', junit : '4.12', mockito : '1.6.0', @@ -55,9 +57,9 @@ ext.sdkLibraries = [ ] ext.sdkLibrariesSupport = [ - appCompat : "androidx.appcompat:appcompat:$sdkVersions.androidX", - recyclerView : "androidx.recyclerview:recyclerview:$sdkVersions.androidX", - collection : "androidx.collection:collection:$sdkVersions.androidX", + appCompat : "androidx.appcompat:appcompat:$sdkVersions.androidXAppCompat", + recyclerView : "androidx.recyclerview:recyclerview:$sdkVersions.androidXRV", + collection : "androidx.collection:collection:$sdkVersions.androidXCollection", ] ext.testLibraries = [ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8422670206..1f3fdbc528 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/id/build.gradle b/id/build.gradle index cff5774835..1524d06936 100644 --- a/id/build.gradle +++ b/id/build.gradle @@ -25,6 +25,17 @@ android { versionName "$sdkVersions.name" } + packagingOptions { + exclude("builddef.lst") + exclude("**/com/**") + exclude("META-INF/*.kotlin_module") + exclude("META-INF/*.version") + exclude("autoTest/**") + exclude("META-INF/spring.*") + exclude("META-INF/notice.txt") + exclude("mockito-extensions/org.mockito.plugins.MockMaker") + } + kotlinOptions { jvmTarget = '1.8' } @@ -38,6 +49,8 @@ configurations { dependencies { implementation sdkLibraries.kotlin implementation sdkLibraries.gson + + testImplementation testLibraries.junit } apply from: "../publish.gradle" diff --git a/id/src/main/java/com/vk/sdk/id/UserId.kt b/id/src/main/java/com/vk/sdk/id/UserId.kt index ed483d7624..4f0952cf43 100644 --- a/id/src/main/java/com/vk/sdk/id/UserId.kt +++ b/id/src/main/java/com/vk/sdk/id/UserId.kt @@ -25,18 +25,45 @@ data class UserId(val value: Long): Parcelable { dest.writeLong(value) } - class GsonSerializer : JsonSerializer, JsonDeserializer { + class GsonSerializer( + private val shiftByMaxInt: Boolean = false + ) : JsonSerializer, JsonDeserializer { override fun serialize( src: UserId?, typeOfSrc: Type?, context: JsonSerializationContext? - ): JsonElement = JsonPrimitive(src?.value ?: -1) + ): JsonElement { + val value = when { + src == null -> -1 + !shiftByMaxInt -> src.value + else -> if (src.value < 0) { // is group + src.value - Int.MAX_VALUE + } else { // is user + src.value + Int.MAX_VALUE + } + } + return JsonPrimitive(value) + } override fun deserialize( json: JsonElement?, typeOfT: Type?, context: JsonDeserializationContext? - ): UserId? = if (json != null && !json.isJsonNull) json.asLong.toUserId() else null + ): UserId? { + return if (json != null && !json.isJsonNull) { + val long = json.asLong + if (!shiftByMaxInt) return UserId(long) + + val isGroup = long < 0 + val absLong = long.absoluteValue + // Если не нужно сдвигать на максимальный инт, то возвращаем как есть + if (absLong < Int.MAX_VALUE) throw IllegalStateException("abs of owner id should be >= MAX_INT") + val shifted = absLong - Int.MAX_VALUE + return UserId(if (isGroup) -shifted else shifted) + } else { + null + } + } } companion object { diff --git a/id/src/test/java/com/vk/sdk/id/UserIdGsonSerializerTest.kt b/id/src/test/java/com/vk/sdk/id/UserIdGsonSerializerTest.kt new file mode 100644 index 0000000000..ecb3780617 --- /dev/null +++ b/id/src/test/java/com/vk/sdk/id/UserIdGsonSerializerTest.kt @@ -0,0 +1,95 @@ +package com.vk.sdk.id + +import com.google.gson.JsonNull +import com.google.gson.JsonPrimitive +import com.vk.dto.common.id.UserId +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Test + +class UserIdGsonSerializerTest { + + // --------------------------------------------------------------------------------------------- + // Deserialize tests: + + @Test + fun `When json is null - Then deserialize should return null`() { + val deserialized = gson().deserialize(null, null, null) + assertNull(deserialized) + } + + @Test + fun `When json is JsonNull - Then deserialize should return null`() { + val deserialized = gson().deserialize(JsonNull.INSTANCE, null, null) + assertNull(deserialized) + } + + @Test + fun `When not shifted - Then deserialize should return UserId with json value`() { + val deserialized = gson(false).deserialize(JsonPrimitive(Long.MAX_VALUE), null, null) + assertEquals(UserId(Long.MAX_VALUE), deserialized) + } + + @Test + fun `When shifted - Then deserialize should return UserId with decreased by INT_MAX value`() { + val value = Long.MAX_VALUE + val deserialized = gson(true).deserialize(JsonPrimitive(value), null, null) + assertEquals(UserId(value - Int.MAX_VALUE), deserialized) + } + + @Test + fun `When shifted and is group - Then deserialize should UserId with increased by INT_MAX value`() { + val value = -Long.MAX_VALUE + val deserialized = gson(true).deserialize(JsonPrimitive(value), null, null) + assertEquals(UserId(value + Int.MAX_VALUE), deserialized) + } + + @Test(expected = IllegalStateException::class) + fun `When shifted, is user and value is 0 - Then IllegalStateException should be thrown`() { + gson(true).deserialize(JsonPrimitive(0), null, null) + } + + @Test(expected = IllegalStateException::class) + fun `When shifted, is user and value is less then MAX_INT - Then IllegalStateException should be thrown`() { + gson(true).deserialize(JsonPrimitive(1), null, null) + } + + @Test(expected = IllegalStateException::class) + fun `When shifted, is group and value is greater then -MAX_INT - Then IllegalStateException should be thrown`() { + gson(true).deserialize(JsonPrimitive(-1), null, null) + } + + // --------------------------------------------------------------------------------------------- + // Serialize tests: + + @Test + fun `When UserId is null - Then serialize should return -1 primitive`() { + val serialized = gson().serialize(null, null, null) + assertEquals(JsonPrimitive(-1), serialized) + } + + @Test + fun `When not shifted - Then serialize should return primitive with original value`() { + val value = Long.MAX_VALUE + val serialized = gson().serialize(UserId(value), null, null) + assertEquals(JsonPrimitive(value), serialized) + } + + @Test + fun `When shifted - Then serialize should return primitive with increased by INT_MAX value`() { + val value = Int.MAX_VALUE.toLong() + val serialized = gson(true).serialize(UserId(value), null, null) + assertEquals(JsonPrimitive(value + Int.MAX_VALUE), serialized) + } + + @Test + fun `When shifted and is group - Then serialize should return primitive with decreased by INT_MAX value`() { + val value = Int.MIN_VALUE.toLong() + val serialized = gson(true).serialize(UserId(value), null, null) + assertEquals(JsonPrimitive(value - Int.MAX_VALUE), serialized) + } + + companion object { + private fun gson(shift: Boolean = false) = UserId.GsonSerializer(shift) + } +} \ No newline at end of file diff --git a/samples/app/src/main/java/com/vk/sdk/sample/WelcomeActivity.kt b/samples/app/src/main/java/com/vk/sdk/sample/WelcomeActivity.kt index 37f246bdf3..7f4843f9d0 100644 --- a/samples/app/src/main/java/com/vk/sdk/sample/WelcomeActivity.kt +++ b/samples/app/src/main/java/com/vk/sdk/sample/WelcomeActivity.kt @@ -25,13 +25,16 @@ package com.vk.sdk.sample import android.app.Activity +import android.app.AlertDialog import android.content.Context import android.content.Intent import android.os.Bundle +import android.webkit.WebViewClient import android.widget.Button import com.vk.api.sdk.VK import com.vk.api.sdk.auth.VKAccessToken import com.vk.api.sdk.auth.VKAuthCallback +import com.vk.api.sdk.exceptions.VKAuthException import com.vk.api.sdk.auth.VKScope class WelcomeActivity: Activity() { @@ -58,7 +61,24 @@ class WelcomeActivity: Activity() { finish() } - override fun onLoginFailed(errorCode: Int) { + override fun onLoginFailed(authException: VKAuthException) { + if (!authException.isCanceled) { + val descriptionResource = + if (authException.webViewError == WebViewClient.ERROR_HOST_LOOKUP) R.string.message_connection_error + else R.string.message_unknown_error + AlertDialog.Builder(this@WelcomeActivity) + .setMessage(descriptionResource) + .setPositiveButton(R.string.vk_retry) { _, _ -> + VK.login( + this@WelcomeActivity, + arrayListOf(VKScope.WALL, VKScope.PHOTOS) + ) + } + .setNegativeButton(android.R.string.cancel) { dialog, _ -> + dialog.dismiss() + } + .show() + } } } if (!VK.onActivityResult(requestCode, resultCode, data, callback)) { diff --git a/samples/app/src/main/res/values-es/strings.xml b/samples/app/src/main/res/values-es/strings.xml deleted file mode 100644 index 3d25d4fda2..0000000000 --- a/samples/app/src/main/res/values-es/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - Войти - Выйти - Отправить на стену - Ваше сообщение - Запись опубликована - diff --git a/samples/app/src/main/res/values-kk/strings.xml b/samples/app/src/main/res/values-kk/strings.xml deleted file mode 100644 index 30daba69f7..0000000000 --- a/samples/app/src/main/res/values-kk/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - Кіру - Шығу - Қабырғаға жіберу - Хабарламаңыз - Жазба жарияланды - diff --git a/samples/app/src/main/res/values-pt/strings.xml b/samples/app/src/main/res/values-pt/strings.xml deleted file mode 100644 index 3d25d4fda2..0000000000 --- a/samples/app/src/main/res/values-pt/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - Войти - Выйти - Отправить на стену - Ваше сообщение - Запись опубликована - diff --git a/samples/app/src/main/res/values-ru/strings.xml b/samples/app/src/main/res/values-ru/strings.xml deleted file mode 100644 index d4d2d695f0..0000000000 --- a/samples/app/src/main/res/values-ru/strings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - Войти - Выйти - Отправить на стену - Ваше сообщение - Запись опубликована - VK SDK sample - diff --git a/samples/app/src/main/res/values-uk/strings.xml b/samples/app/src/main/res/values-uk/strings.xml deleted file mode 100644 index 3d25d4fda2..0000000000 --- a/samples/app/src/main/res/values-uk/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - Войти - Выйти - Отправить на стену - Ваше сообщение - Запись опубликована - diff --git a/samples/app/src/main/res/values/strings.xml b/samples/app/src/main/res/values/strings.xml index 3d25d4fda2..08ef791f66 100644 --- a/samples/app/src/main/res/values/strings.xml +++ b/samples/app/src/main/res/values/strings.xml @@ -5,4 +5,7 @@ Отправить на стену Ваше сообщение Запись опубликована + Ошибка подключения + Неизвестная ошибка, попробуйте позже + VK SDK sample