From 8120e09bb328782874638930b1ec9f90c97f1787 Mon Sep 17 00:00:00 2001 From: Suvorov Daniil Date: Mon, 23 Mar 2020 16:41:15 +0300 Subject: [PATCH] feat: more constants --- object/apps.go | 27 +++++ object/friends.go | 13 +++ object/gifts.go | 12 +++ object/groups.go | 264 +++++++++++++++++++++++++++++++++++++++++++++ object/market.go | 16 ++- object/messages.go | 17 +++ object/object.go | 12 +++ object/pages.go | 13 +++ object/users.go | 17 +++ object/utils.go | 23 ++++ object/wall.go | 51 +++++++++ 11 files changed, 463 insertions(+), 2 deletions(-) diff --git a/object/apps.go b/object/apps.go index b38d6b42..f62b8302 100644 --- a/object/apps.go +++ b/object/apps.go @@ -1,5 +1,32 @@ package object // import "github.com/SevereCloud/vksdk/object" +// AppsAppType application type +type AppsAppType string + +// AppsAppType const +// FIXME: v2 AppsAppType +const ( + AppTypeApp = "app" + AppTypeGame = "game" + AppTypeSite = "site" + AppTypeStandalone = "standalone" + AppTypeVkApp = "vk_app" + AppTypeCommunityApp = "community_app" + AppTypeHTML5Game = "html5_game" +) + +// AppsLeaderboardType type +type AppsLeaderboardType int + +// AppsLeaderboardType const +// FIXME: v2 AppsLeaderboardType const +// FIXME: v2 AppsLeaderboardType LeaderboardType +const ( + AppsLeaderboardTypeNotSupported = iota + AppsLeaderboardTypeLevels + AppsLeaderboardTypePoints +) + // AppsApp struct type AppsApp struct { AuthorGroup int `json:"author_group"` // Official community's ID diff --git a/object/friends.go b/object/friends.go index f421bebf..e328b41f 100644 --- a/object/friends.go +++ b/object/friends.go @@ -1,5 +1,18 @@ package object // import "github.com/SevereCloud/vksdk/object" +// FriendsStatus type +type FriendsStatus int + +// FriendStatus const +// FIXME: v2 FriendStatus for const +// FIXME: v2 FriendStatus for FriendsFriendStatus.FriendStatus +const ( + FriendsStatusNotFriend = iota // not a friend + FriendsStatusOutComingRequest // outcoming request + FriendsStatusInComingRequest // incoming request + FriendsStatusIsFriend // is friend +) + // FriendsFriendStatus struct type FriendsFriendStatus struct { FriendStatus int `json:"friend_status"` diff --git a/object/gifts.go b/object/gifts.go index 05e86925..2a9754d9 100644 --- a/object/gifts.go +++ b/object/gifts.go @@ -1,5 +1,17 @@ package object // import "github.com/SevereCloud/vksdk/object" +// GiftsGiftPrivacy type +type GiftsGiftPrivacy int + +// GiftsGiftPrivacy const +// FIXME: v2 GiftsGiftPrivacy for const +// FIXME: v2 GiftsGiftPrivacy for const +const ( + GiftsGiftPrivacyForAll = iota // name and message for all + GiftsGiftPrivacyNameForAll // name for all + GiftsGiftPrivacyRecipientOnly // name and message for recipient only +) + // GiftsGift struct type GiftsGift struct { Date int `json:"date"` // Date when gist has been sent in Unixtime diff --git a/object/groups.go b/object/groups.go index b2fe94f4..dcf25cb4 100644 --- a/object/groups.go +++ b/object/groups.go @@ -5,6 +5,27 @@ import ( "fmt" ) +// GroupsAddressWorkInfoStatus status of information about timetable +type GroupsAddressWorkInfoStatus string + +// GroupsAddressWorkInfoStatus const +// FIXME: v2 GroupsAddressWorkInfoStatus +const ( + WorkStatusNoInformation = "no_information" + WorkStatusTemporarilyClosed = "temporarily_closed" + WorkStatusAlwaysOpened = "always_opened" + WorkStatusTimetable = "timetable" + WorkStatusForeverClosed = "forever_closed" +) + +// GroupsGroupType const +// FIXME: v2 GroupsGroupType +const ( + GroupsTypeGroup = "group" + GroupsTypePage = "page" + GroupsTypeEvent = "event" +) + // GroupsAddress struct type GroupsAddress struct { AdditionalAddress string `json:"additional_address"` // Additional address to the place (6 floor, left door) @@ -48,6 +69,75 @@ type GroupsAddressesInfo struct { MainAddressID int `json:"main_address_id"` // Main address id for group } +// GroupsGroupAdminLevel type +type GroupsGroupAdminLevel int + +// GroupsGroupAdminLevel const +// FIXME: v2 GroupsGroupAdminLevel for const +// FIXME: v2 GroupsGroupAdminLevel for AdminLevel +const ( + GroupsAdminLevelModerator = iota + GroupsAdminLevelEditor + GroupsAdminLevelAdministrator +) + +// GroupsGroupMainSection type +type GroupsGroupMainSection int + +// GroupsGroupMainSection const +// FIXME: v2 GroupsGroupMainSection for const +// FIXME: v2 GroupsGroupMainSection for MainSection +const ( + GroupsMainSectionAbsent = iota + GroupsMainSectionPhotos + GroupsMainSectionTopics + GroupsMainSectionAudio + GroupsMainSectionVideo + GroupsMainSectionMarket +) + +// GroupsGroupMemberStatus type +type GroupsGroupMemberStatus int + +// GroupsGroupMemberStatus const +// FIXME: v2 GroupsGroupMemberStatus for const +// FIXME: v2 GroupsGroupMemberStatus for MemberStatus +// FIXME: v2 GroupsGroupMemberStatus for events_event_attach +// FIXME: v2 GroupsGroupMemberStatus for newsfeed_event_activity +const ( + GroupsMemberStatusNotMember = iota + GroupsMemberStatusMember + GroupsMemberStatusNotSure + GroupsMemberStatusDeclined + GroupsMemberStatusHasSentRequest + GroupsMemberStatusInvited +) + +// GroupsGroupAccess type +type GroupsGroupAccess int + +// GroupsGroupAccess const +// FIXME: v2 GroupsGroupAccess for const +// FIXME: v2 GroupsGroupAccess for IsClosed +// FIXME: v2 GroupsGroupAccess for Access +const ( + GroupsGroupOpen = iota + GroupsGroupClosed + GroupsGroupPrivate +) + +// GroupsGroupAgeLimits type +type GroupsGroupAgeLimits int + +// GroupsGroupAgeLimits const +// FIXME: v2 GroupsGroupAgeLimits for const +// FIXME: v2 GroupsGroupAgeLimits for AgeLimits +const ( + GroupsAgeLimitsNo = iota + GroupsAgeLimitsOver16 + GroupsAgeLimitsOver18 +) + // GroupsGroup struct type GroupsGroup struct { AdminLevel int `json:"admin_level"` @@ -123,6 +213,20 @@ type GroupsLiveCovers struct { StoryIds []string `json:"story_ids"` } +// GroupsBanInfoReason type +type GroupsBanInfoReason int + +// GroupsBanInfoReason const +// FIXME: v2 GroupsBanInfoReason for const +// FIXME: v2 GroupsBanInfoReason for Reason +const ( + GroupsBanReasonOther = iota + GroupsBanReasonSpam + GroupsBanReasonVerbalAbuse + GroupsBanReasonStrongLanguage + GroupsBanReasonFlood +) + // GroupsBanInfo struct type GroupsBanInfo struct { AdminID int `json:"admin_id"` // Administrator ID @@ -220,6 +324,143 @@ type GroupsGroupPublicCategoryList struct { SubtypesList []GroupsGroupCategoryType `json:"subtypes_list"` } +// GroupsGroupPhotos type +type GroupsGroupPhotos int + +// GroupsGroupPhotos const +// FIXME: v2 GroupsGroupPhotos for const +// FIXME: v2 GroupsGroupPhotos for Photos +const ( + GroupsGroupPhotosDisabled = iota + GroupsGroupPhotosOpen + GroupsGroupPhotosLimited +) + +// GroupsGroupSubject type +type GroupsGroupSubject int + +// GroupsGroupSubject const +// FIXME: v2 GroupsGroupSubject for const +// FIXME: v2 GroupsGroupSubject for Subject +const ( + _ = iota + GroupsGroupSubjectAuto + GroupsGroupSubjectActivityHolidays + GroupsGroupSubjectBusiness + GroupsGroupSubjectPets + GroupsGroupSubjectHealth + GroupsGroupSubjectDatingAndCommunication + GroupsGroupSubjectGames + GroupsGroupSubjectIt + GroupsGroupSubjectCinema + GroupsGroupSubjectBeautyAndFashion + GroupsGroupSubjectCooking + GroupsGroupSubjectArtAndCulture + GroupsGroupSubjectLiterature + GroupsGroupSubjectMobileServicesAndInternet + GroupsGroupSubjectMusic + GroupsGroupSubjectScienceAndTechnology + GroupsGroupSubjectRealEstate + GroupsGroupSubjectNewsAndMedia + GroupsGroupSubjectSecurity + GroupsGroupSubjectEducation + GroupsGroupSubjectHomeAndRenovations + GroupsGroupSubjectPolitics + GroupsGroupSubjectFood + GroupsGroupSubjectIndustry + GroupsGroupSubjectTravel + GroupsGroupSubjectWork + GroupsGroupSubjectEntertainment + GroupsGroupSubjectReligion + GroupsGroupSubjectFamily + GroupsGroupSubjectSports + GroupsGroupSubjectInsurance + GroupsGroupSubjectTelevision + GroupsGroupSubjectGoodsAndServices + GroupsGroupSubjectHobbies + GroupsGroupSubjectFinance + GroupsGroupSubjectPhoto + GroupsGroupSubjectEsoterics + GroupsGroupSubjectElectronicsAndAppliances + GroupsGroupSubjectErotic + GroupsGroupSubjectHumor + GroupsGroupSubjectSocietyHumanities + GroupsGroupSubjectDesignAndGraphics +) + +// GroupsGroupTopics type +type GroupsGroupTopics int + +// GroupsGroupTopics const +// FIXME: v2 GroupsGroupTopics for const +// FIXME: v2 GroupsGroupTopics for Topics +const ( + GroupsGroupTopicsDisabled = iota + GroupsGroupTopicsOpen + GroupsGroupTopicsLimited +) + +// GroupsGroupDocs type +type GroupsGroupDocs int + +// GroupsGroupDocs const +// FIXME: v2 GroupsGroupDocs for const +// FIXME: v2 GroupsGroupDocs for Docs +const ( + GroupsGroupDocsDisabled = iota + GroupsGroupDocsOpen + GroupsGroupDocsLimited +) + +// GroupsGroupAudio type +type GroupsGroupAudio int + +// GroupsGroupAudio const +// FIXME: v2 GroupsGroupAudio for const +// FIXME: v2 GroupsGroupAudio for Audio +const ( + GroupsGroupAudioDisabled = iota + GroupsGroupAudioOpen + GroupsGroupAudioLimited +) + +// GroupsGroupVideo type +type GroupsGroupVideo int + +// GroupsGroupVideo const +// FIXME: v2 GroupsGroupVideo for const +// FIXME: v2 GroupsGroupVideo for Video +const ( + GroupsGroupVideoDisabled = iota + GroupsGroupVideoOpen + GroupsGroupVideoLimited +) + +// GroupsGroupWall type +type GroupsGroupWall int + +// GroupsGroupWall const +// FIXME: v2 GroupsGroupWall for const +// FIXME: v2 GroupsGroupWall for Wall +const ( + GroupsGroupWallDisabled = iota + GroupsGroupWallOpen + GroupsGroupWallLimited + GroupsGroupWallClosed +) + +// GroupsGroupWiki type +type GroupsGroupWiki int + +// GroupsGroupWiki const +// FIXME: v2 GroupsGroupWiki for const +// FIXME: v2 GroupsGroupWiki for Wiki +const ( + GroupsGroupWikiDisabled = iota + GroupsGroupWikiOpen + GroupsGroupWikiLimited +) + // GroupsGroupSettings struct type GroupsGroupSettings struct { Access int `json:"access"` // Community access settings @@ -462,6 +703,18 @@ type GroupsMarketInfo struct { PriceMin string `json:"price_min"` // Minimum price } +// GroupsGroupRole type +type GroupsGroupRole string + +// GroupsGroupRole const +// FIXME: v2 GroupsGroupRole +const ( + GroupsGroupRoleModerator = "moderator" + GroupsGroupRoleEditor = "editor" + GroupsGroupRoleAdministrator = "administrator" + GroupsGroupRoleCreator = "creator" +) + // GroupsMemberRole struct type GroupsMemberRole struct { ID int `json:"id"` // User ID @@ -493,6 +746,17 @@ type GroupsMemberStatusFull struct { UserID int `json:"user_id"` // User ID } +// GroupsOnlineStatusType type of online status of group +type GroupsOnlineStatusType string + +// GroupsOnlineStatusType const +// FIXME: v2 GroupsOnlineStatusType +const ( + GroupsOnlineStatusTypeNone = "none" + GroupsOnlineStatusTypeOnline = "online" + GroupsOnlineStatusTypeAnswerMark = "answer_mark" +) + // GroupsOnlineStatus struct type GroupsOnlineStatus struct { Minutes int `json:"minutes"` // Estimated time of answer (for status = answer_mark) diff --git a/object/market.go b/object/market.go index c7ee2bcb..d78951a2 100644 --- a/object/market.go +++ b/object/market.go @@ -4,6 +4,18 @@ import ( "fmt" ) +// MarketMarketItemAvailability information whether the item is available +type MarketMarketItemAvailability int + +// MarketMarketItemAvailability const +// FIXME: v2 MarketMarketItemAvailability for const +// FIXME: v2 MarketMarketItemAvailability for Availability +const ( + MarketItemAvailable = iota + MarketItemRemoved + MarketItemUnavailable +) + // MarketCurrency struct type MarketCurrency struct { ID int `json:"id"` // Currency ID @@ -34,8 +46,8 @@ type MarketMarketCategory struct { // MarketMarketItem struct type MarketMarketItem struct { - AccessKey string `json:"access_key"` // Access key for the market item - Availability int `json:"availability"` + AccessKey string `json:"access_key"` // Access key for the market item + Availability int `json:"availability"` // Information whether the item is available Category MarketMarketCategory `json:"category"` Date int `json:"date"` // Date when the item has been created in Unixtime Description string `json:"description"` // Item description diff --git a/object/messages.go b/object/messages.go index fc25cd04..de0911de 100644 --- a/object/messages.go +++ b/object/messages.go @@ -400,6 +400,23 @@ type MessagesLongpollParams struct { Ts int `json:"ts"` // Timestamp } +// MessagesMessageActionStatus action status +type MessagesMessageActionStatus string + +// MessagesMessageActionStatus const +// FIXME: v2 MessagesMessageActionStatus +const ( + ChatPhotoUpdate = "chat_photo_update" + ChatPhotoRemove = "chat_photo_remove" + ChatCreate = "chat_create" + ChatTitleUpdate = "chat_title_update" + ChatInviteUser = "chat_invite_user" + ChatKickUser = "chat_kick_user" + ChatPinMessage = "chat_pin_message" + ChatUnpinMessage = "chat_unpin_message" + ChatInviteUserByLink = "chat_invite_user_by_link" +) + // MessagesMessageAction struct type MessagesMessageAction struct { ConversationMessageID int `json:"conversation_message_id"` // Message ID diff --git a/object/object.go b/object/object.go index 5b2ad2a6..e2f830e0 100644 --- a/object/object.go +++ b/object/object.go @@ -68,6 +68,18 @@ type BaseRequestParam struct { Value string `json:"value"` } +// BaseSex type +type BaseSex int + +// BaseSex const +// FIXME: v2 BaseSex for const +// FIXME: v2 BaseSex for fields +const ( + SexUnknown = iota + SexFemale + SexMale +) + // GroupEvent struct type GroupEvent struct { Type string `json:"type"` diff --git a/object/pages.go b/object/pages.go index fbe4bd5e..1c141023 100644 --- a/object/pages.go +++ b/object/pages.go @@ -1,5 +1,18 @@ package object // import "github.com/SevereCloud/vksdk/object" +// PagesPrivacySettings type +type PagesPrivacySettings int + +// PagesPrivacySettings const +// +// FIXME: v2 PagesPrivacySettings for const +// FIXME: v2 PagesPrivacySettings for WhoCanEdit and WhoCanView +const ( + PagesPrivacyCommunityManagers = iota // community managers only + PagesPrivacyCommunityMembers // ommunity members only + PagesPrivacyEveryone // everyone +) + // PagesWikipage struct type PagesWikipage struct { CreatorID int `json:"creator_id"` // Page creator ID diff --git a/object/users.go b/object/users.go index a607ad27..49980349 100644 --- a/object/users.go +++ b/object/users.go @@ -4,6 +4,23 @@ import ( "fmt" ) +// UsersUserRelation user relationship status +type UsersUserRelation int + +// UsersUserRelation const +// FIXME: v2 UsersUserRelation +const ( + UserRelationNotSpecified = iota // not specified + UserRelationSingle // single + UserRelationInRelationship // in a relationship + UserRelationEngaged // engaged + UserRelationMarried // married + UserRelationComplicated // complicated + UserRelationActivelySearching // actively searching + UserRelationInLove // in love + UserRelationCivilUnion // in a civil union +) + // UsersUser struct type UsersUser struct { ID int `json:"id"` diff --git a/object/utils.go b/object/utils.go index 4ec625f1..82175178 100644 --- a/object/utils.go +++ b/object/utils.go @@ -1,5 +1,17 @@ package object // import "github.com/SevereCloud/vksdk/object" +// UtilsDomainResolvedType object type +type UtilsDomainResolvedType string + +// UtilsDomainResolvedType const +// FIXME: v2 UtilsDomainResolvedType +const ( + UtilsDomainResolvedTypeUser = "user" + UtilsDomainResolvedTypeGroup = "group" + UtilsDomainResolvedTypeApplication = "application" + UtilsDomainResolvedTypePage = "page" +) + // UtilsDomainResolved struct type UtilsDomainResolved struct { ObjectID int `json:"object_id"` // Object ID @@ -16,6 +28,17 @@ type UtilsLastShortenedLink struct { Views int `json:"views"` // Total views number } +// UtilsLinkCheckedStatus link status +type UtilsLinkCheckedStatus string + +// UtilsLinkCheckedStatus const +// FIXME: v2 UtilsLinkCheckedStatus +const ( + UtilsLinkCheckedStatusNotBanned = "not_banned" + UtilsLinkCheckedStatusBanned = "banned" + UtilsLinkCheckedStatusProcessing = "processing" +) + // UtilsLinkChecked struct type UtilsLinkChecked struct { Link string `json:"link"` // Link URL diff --git a/object/wall.go b/object/wall.go index 8be16d5b..cf738014 100644 --- a/object/wall.go +++ b/object/wall.go @@ -42,6 +42,19 @@ type WallGraffiti struct { Photo586 string `json:"photo_586"` // URL of the preview image with 586 px in width } +// WallPostSourceType type of post source +type WallPostSourceType string + +// WallPostSourceType const +// FIXME: v2 WallPostSourceType +const ( + WallPostSourceTypeVk = "vk" + WallPostSourceTypeWidget = "widget" + WallPostSourceTypeAPI = "api" + WallPostSourceTypeRss = "rss" + WallPostSourceTypeSms = "sms" +) + // WallPostSource struct type WallPostSource struct { Data string `json:"data"` // Additional data @@ -97,6 +110,19 @@ type WallWallComment struct { Thread WallWallCommentThread `json:"thread"` } +// WallPostType post type +type WallPostType string + +// WallPostType const +// FIXME: v2 WallPostType +const ( + WallPostTypePost = "post" + WallPostTypeCopy = "copy" + WallPostTypeReply = "reply" + WallPostTypePostpone = "postpone" + WallPostTypeSuggest = "suggest" +) + // WallWallpost struct type WallWallpost struct { AccessKey string `json:"access_key"` // Access key to private object @@ -150,6 +176,31 @@ type WallWallpostAttached struct { ToID int `json:"to_id"` } +// AttachmentType attachment type +type AttachmentType string + +// AttachmentType const +// FIXME: v2 AttachmentType +// TODO: check this +const ( + AttachmentTypePhoto = "photo" + AttachmentTypePostedPhoto = "posted_photo" + AttachmentTypeAudio = "audio" + AttachmentTypeVideo = "video" + AttachmentTypeDoc = "doc" + AttachmentTypeLink = "link" + AttachmentTypeGraffiti = "graffiti" + AttachmentTypeNote = "note" + AttachmentTypeApp = "app" + AttachmentTypePoll = "poll" + AttachmentTypePage = "page" + AttachmentTypeAlbum = "album" + AttachmentTypePhotosList = "photos_list" + AttachmentTypeMarketAlbum = "market_album" + AttachmentTypeMarket = "market" + AttachmentTypeEvent = "event" +) + // WallWallpostAttachment struct type WallWallpostAttachment struct { AccessKey string `json:"access_key"` // Access key for the audio