func (v Messages) MarkAsImportant(params MessagesMarkAsImportantParams) (MessagesMarkAsImportantResponse, error) {
	r, err := v.API.Request("messages.markAsImportant", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesMarkAsImportantResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
MarkAsImportant Marks and unmarks messages as important (starred).
package vkapi
import (
	"encoding/json"
	"strconv"
	"github.com/stek29/vk"
)
type Messages struct {
	API vk.API
}
type MessagesJoinChatByInviteLinkParams struct {
	Link string `url:"link"`
}
type MessagesJoinChatByInviteLinkResponse struct {
	ChatID int `json:"chat_id,omitempty"`
}
func (v Messages) JoinChatByInviteLink(params MessagesJoinChatByInviteLinkParams) (*MessagesJoinChatByInviteLinkResponse, error) {
	r, err := v.API.Request("messages.joinChatByInviteLink", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesJoinChatByInviteLinkResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesGetInviteLinkParams struct {
	PeerID int `url:"peer_id"`
	Reset bool `url:"reset,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
type MessagesGetInviteLinkResponse struct {
	Link string `json:"link,omitempty"`
}
func (v Messages) GetInviteLink(params MessagesGetInviteLinkParams) (*MessagesGetInviteLinkResponse, error) {
	r, err := v.API.Request("messages.getInviteLink", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesGetInviteLinkResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesGetConversationsParams struct {
	Offset int `url:"offset,omitempty"`
	Count int `url:"count,omitempty"`
	Filter string `url:"filter,omitempty"`
	Extended bool `url:"extended,omitempty"`
	StartMessageID int `url:"start_message_id,omitempty"`
	Fields CSVStringSlice `url:"fields,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
type MessagesGetConversationsResponse struct {
	Count int `json:"count,omitempty"`
	UnreadCount int `json:"unread_count,omitempty"`
	Items       []struct {
		Conversation vk.Conversation `json:"conversation,omitempty"`
		LastMessage  vk.Message      `json:"last_message,omitempty"`
	} `json:"items,omitempty"`
	Profiles []vk.User  `json:"profiles,omitempty"`
	Groups   []vk.Group `json:"groups,omitempty"`
}
func (v Messages) GetConversations(params MessagesGetConversationsParams) (*MessagesGetConversationsResponse, error) {
	r, err := v.API.Request("messages.getConversations", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesGetConversationsResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesGetConversationsByIDParams struct {
	PeerIDs CSVIntSlice `url:"peer_ids"`
	Extended bool `url:"extended,omitempty"`
	Fields CSVStringSlice `url:"fields,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
type MessagesGetConversationsByIDResponse struct {
	Count int `json:"count,omitempty"`
	Items []struct {
		Conversation vk.Conversation `json:"conversation,omitempty"`
		LastMessage  vk.Message      `json:"last_message,omitempty"`
	} `json:"items,omitempty"`
}
func (v Messages) GetConversationsByID(params MessagesGetConversationsByIDParams) (*MessagesGetConversationsByIDResponse, error) {
	r, err := v.API.Request("messages.getConversationsById", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesGetConversationsByIDResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesGetByIDParams struct {
	MessageIDs CSVIntSlice `url:"message_ids"`
	PreviewLength int `url:"preview_length,omitempty"`
	Extended bool `url:"extended,omitempty"`
	Fields CSVStringSlice `url:"fields,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
type MessagesGetByIDResponse struct {
	Count int          `json:"count,omitempty"`
	Items []vk.Message `json:"items,omitempty"`
}
func (v Messages) GetByID(params MessagesGetByIDParams) (*MessagesGetByIDResponse, error) {
	r, err := v.API.Request("messages.getById", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesGetByIDResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesGetByConversationMessageIDParams struct {
	PeerID int `url:"peer_id"`
	ConversationMessageIDs CSVIntSlice `url:"conversation_message_ids"`
	Extended bool `url:"extended,omitempty"`
	Fields CSVStringSlice `url:"fields,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
type MessagesGetByConversationMessageIDResponse struct {
	Count int          `json:"count,omitempty"`
	Items []vk.Message `json:"items,omitempty"`
}
func (v Messages) GetByConversationMessageID(params MessagesGetByConversationMessageIDParams) (*MessagesGetByConversationMessageIDResponse, error) {
	r, err := v.API.Request("messages.getByConversationMessageId", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesGetByConversationMessageIDResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesSearchParams struct {
	Q string `url:"q,omitempty"`
	PeerID int `url:"peer_id,omitempty"`
	Date int `url:"date,omitempty"`
	PreviewLength int `url:"preview_length,omitempty"`
	Offset int `url:"offset,omitempty"`
	Count    int            `url:"count,omitempty"`
	Extended bool           `url:"extended,omitempty"`
	Fields   CSVStringSlice `url:"fields,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
type MessagesSearchResponse struct {
	Count int          `json:"count,omitempty"`
	Items []vk.Message `json:"items,omitempty"`
}
func (v Messages) Search(params MessagesSearchParams) (*MessagesSearchResponse, error) {
	r, err := v.API.Request("messages.search", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesSearchResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesGetHistoryParams struct {
	Offset int `url:"offset,omitempty"`
	Count int `url:"count,omitempty"`
	UserID int `url:"user_id,omitempty"`
	PeerID int `url:"peer_id,omitempty"`
	StartMessageID int `url:"start_message_id,omitempty"`
	Rev int `url:"rev,omitempty"`
	Extended bool `url:"extended,omitempty"`
	Fields CSVStringSlice `url:"fields,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
type MessagesGetHistoryResponse struct {
	Count    int          `json:"count,omitempty"`
	Items    []vk.Message `json:"items,omitempty"`
	Profiles []vk.User    `json:"profiles,omitempty"`
	Groups   []vk.Group   `json:"groups,omitempty"`
}
func (v Messages) GetHistory(params MessagesGetHistoryParams) (*MessagesGetHistoryResponse, error) {
	r, err := v.API.Request("messages.getHistory", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesGetHistoryResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesGetHistoryAttachmentsParams struct {
	PeerID int `url:"peer_id"`
	MediaType string `url:"media_type,omitempty"`
	StartFrom string `url:"start_from,omitempty"`
	Count int `url:"count,omitempty"`
	PhotoSizes bool `url:"photo_sizes,omitempty"`
	Fields CSVStringSlice `url:"fields,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
type MessagesGetHistoryAttachmentsResponse struct {
	Items []struct {
		MessageID  int           `json:"message_id,omitempty"`
		Attachment vk.Attachment `json:"attachment,omitempty"`
	} `json:"items,omitempty"`
	NextFrom string `json:"next_from,omitempty"`
}
func (v Messages) GetHistoryAttachments(params MessagesGetHistoryAttachmentsParams) (*MessagesGetHistoryAttachmentsResponse, error) {
	r, err := v.API.Request("messages.getHistoryAttachments", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesGetHistoryAttachmentsResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesSendParams struct {
	UserID int `url:"user_id,omitempty"`
	RandomID int `url:"random_id,omitempty"`
	PeerID int `url:"peer_id,omitempty"`
	Domain string `url:"domain,omitempty"`
	ChatID int `url:"chat_id,omitempty"`
	UserIDs CSVIntSlice `url:"user_ids,omitempty"`
	Message string `url:"message,omitempty"`
	Lat float32 `url:"lat,omitempty"`
	Long float32 `url:"long,omitempty"`
	Attachment CSVStringSlice `url:"attachment,omitempty"`
	ReplyTo    int            `url:"reply_to,omitempty"`
	ForwardMessages CSVIntSlice `url:"forward_messages,omitempty"`
	StickerID int `url:"sticker_id,omitempty"`
	GroupID        int    `url:"group_id,omitempty"`
	Keyboard       string `url:"keyboard,omitempty"`
	Payload        string `url:"payload,omitempty"`
	DontParseLinks bool   `url:"dont_parse_links,omitempty"`
}
type MessagesSendResponse int
func (v Messages) Send(params MessagesSendParams) (MessagesSendResponse, error) {
	r, err := v.API.Request("messages.send", params)
	if err != nil {
		return 0, err
	}
	var resp MessagesSendResponse
	var cnv int
	cnv, err = strconv.Atoi(string(r))
	resp = MessagesSendResponse(cnv)
	if err != nil {
		return 0, err
	}
	return resp, nil
}
type MessagesEditParams struct {
	PeerID int `url:"peer_id"`
	Message   string `url:"message,omitempty"`
	MessageID int    `url:"message_id"`
	Lat float32 `url:"lat,omitempty"`
	Long float32 `url:"long,omitempty"`
	Attachment CSVStringSlice `url:"attachment,omitempty"`
	KeepForwardMessages bool `url:"keep_forward_messages,omitempty"`
	KeepSnippets bool `url:"keep_snippets,omitempty"`
	GroupID        int  `url:"group_id,omitempty"`
	DontParseLinks bool `url:"dont_parse_links,omitempty"`
}
func (v Messages) Edit(params MessagesEditParams) (bool, error) {
	r, err := v.API.Request("messages.edit", params)
	if err != nil {
		return false, err
	}
	return decodeBoolIntResponse(r)
}
type MessagesDeleteParams struct {
	MessageIDs CSVIntSlice `url:"message_ids,omitempty"`
	Spam bool `url:"spam,omitempty"`
	GroupID int `url:"group_id,omitempty"`
	DeleteForAll bool `url:"delete_for_all,omitempty"`
}
type MessagesDeleteResponse ArrayOnMeth
func (v Messages) Delete(params MessagesDeleteParams) (*MessagesDeleteResponse, error) {
	r, err := v.API.Request("messages.delete", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesDeleteResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesDeleteConversationParams struct {
	UserID int `url:"user_id,omitempty"`
	PeerID int `url:"peer_id,omitempty"`
	Offset int `url:"offset,omitempty"`
	Count int `url:"count,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
type MessagesDeleteConversationResponse struct {
	LastDeletedID int `json:"last_deleted_id,omitempty"`
}
func (v Messages) DeleteConversation(params MessagesDeleteConversationParams) (*MessagesDeleteConversationResponse, error) {
	r, err := v.API.Request("messages.deleteConversation", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesDeleteConversationResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesPinParams struct {
	PeerID    int `url:"peer_id"`
	MessageID int `url:"message_id,omitempty"`
}
type MessagesPinResponse vk.Message
func (v Messages) Pin(params MessagesPinParams) (*MessagesPinResponse, error) {
	r, err := v.API.Request("messages.pin", params)
	if err != nil {
		return nil, err
	}
	var resp MessagesPinResponse
	err = json.Unmarshal(r, &resp)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}
type MessagesRestoreParams struct {
	MessageID int `url:"message_id"`
	GroupID int `url:"group_id,omitempty"`
}
func (v Messages) Restore(params MessagesRestoreParams) (bool, error) {
	r, err := v.API.Request("messages.restore", params)
	if err != nil {
		return false, err
	}
	return decodeBoolIntResponse(r)
}
type MessagesMarkAsReadParams struct {
	PeerID int `url:"peer_id,omitempty"`
	StartMessageID int `url:"start_message_id,omitempty"`
	GroupID int `url:"group_id,omitempty"`
}
func (v Messages) MarkAsRead(params MessagesMarkAsReadParams) (bool, error) {
	r, err := v.API.Request("messages.markAsRead", params)
	if err != nil {
		return false, err
	}
	return decodeBoolIntResponse(r)
}
type MessagesMarkAsImportantParams struct {
	MessageIDs CSVIntSlice `url:"message_ids,omitempty"`
	Important int `url:"important,omitempty"`
}
type MessagesMarkAsImportantResponse []int