func (item *Item) Roles() *Roles {
	return NewRoles(item.client, item.endpoint, item.config)
}
Roles gets Roles API instance queryable collection for this Item
package api
import (
	"bytes"
	"encoding/json"
	"fmt"
	"strings"
	"time"
	"github.com/koltyakov/gosip"
)
type Item struct {
	client    *gosip.SPClient
	config    *RequestConfig
	endpoint  string
	modifiers *ODataMods
}
type GenericItemInfo struct {
	ID            int       `json:"Id"`
	Title         string    `json:"Title"`
	ContentTypeID string    `json:"ContentTypeId"`
	Attachments   bool      `json:"Attachments"`
	AuthorID      int       `json:"AuthorId"`
	EditorID      int       `json:"EditorId"`
	Created       time.Time `json:"Created"`
	Modified      time.Time `json:"Modified"`
}
type ItemResp []byte
type ListItemAllFieldsResp []byte
func NewItem(client *gosip.SPClient, endpoint string, config *RequestConfig) *Item {
	return &Item{
		client:    client,
		endpoint:  endpoint,
		config:    config,
		modifiers: NewODataMods(),
	}
}
func (item *Item) ToURL() string {
	return toURL(item.endpoint, item.modifiers)
}
func (item *Item) Get() (ItemResp, error) {
	client := NewHTTPClient(item.client)
	return client.Get(item.ToURL(), item.config)
}
func (item *Item) Delete() error {
	client := NewHTTPClient(item.client)
	_, err := client.Delete(item.endpoint, item.config)
	return err
}
func (item *Item) Recycle() error {
	endpoint := fmt.Sprintf("%s/Recycle", item.endpoint)
	client := NewHTTPClient(item.client)
	_, err := client.Post(endpoint, nil, item.config)
	return err
}
func (item *Item) Update(body []byte) (ItemResp, error) {
	body = patchMetadataTypeCB(body, func() string {
		endpoint := getPriorEndpoint(item.endpoint, "/Items")
		cacheKey := strings.ToLower(endpoint + "@entitytype")
		if oDataType, found := storage.Get(cacheKey); found {
			return oDataType.(string)
		}
		list := NewList(item.client, endpoint, nil)
		oDataType, _ := list.GetEntityType()
		storage.Set(cacheKey, oDataType, 0)
		return oDataType
	})
	client := NewHTTPClient(item.client)
	return client.Update(item.endpoint, bytes.NewBuffer(body), item.config)
}
type ValidateUpdateOptions struct {
	NewDocumentUpdate bool
	CheckInComment    string
}
func (item *Item) UpdateValidate(formValues map[string]string, options *ValidateUpdateOptions) ([]byte, error) {
	endpoint := fmt.Sprintf("%s/ValidateUpdateListItem", item.endpoint)
	client := NewHTTPClient(item.client)
	type formValue struct {
		FieldName  string `json:"FieldName"`
		FieldValue string `json:"FieldValue"`
	}
	var formValuesArray []*formValue
	for n, v := range formValues {
		formValuesArray = append(formValuesArray, &formValue{
			FieldName:  n,
			FieldValue: v,
		})
	}
	payload := map[string]interface{}{"formValues": formValuesArray}
	if options != nil {
		payload["bNewDocumentUpdate"] = options.NewDocumentUpdate
		payload["checkInComment"] = options.CheckInComment
	}
	body, _ := json.Marshal(payload)
	return client.Post(endpoint, bytes.NewBuffer(body), item.config)
}