api

package
v0.1.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package api represents Fluent API for SharePoint object model

Index

Constants

This section is empty.

Variables

View Source
var CheckInTypes = func() *checkInTypes {
	return &checkInTypes{
		Minor:     0,
		Major:     1,
		Overwrite: 2,
	}
}()

CheckInTypes - available check in types

View Source
var HeadersPresets = struct {
	Verbose         *RequestConfig
	Minimalmetadata *RequestConfig
	Nometadata      *RequestConfig
}{
	Verbose: &RequestConfig{
		Headers: map[string]string{
			"Accept":          "application/json;odata=verbose",
			"Content-Type":    "application/json;odata=verbose;charset=utf-8",
			"Accept-Language": "en-US,en;q=0.9",
		},
	},
	Minimalmetadata: &RequestConfig{
		Headers: map[string]string{
			"Accept":          "application/json;odata=minimalmetadata",
			"Content-Type":    "application/json;odata=verbose;charset=utf-8",
			"Accept-Language": "en-US,en;q=0.9",
		},
	},
	Nometadata: &RequestConfig{
		Headers: map[string]string{
			"Accept":          "application/json;odata=nometadata",
			"Content-Type":    "application/json;odata=verbose;charset=utf-8",
			"Accept-Language": "en-US,en;q=0.9",
		},
	},
}

HeadersPresets : SP REST OData headers presets

View Source
var PermissionKind = struct {
	// Has no permissions on the Site. Not available through the user interface
	EmptyMask int64

	// View items in lists, documents in document libraries, and Web discussion comments
	ViewListItems int64

	// Add items to lists, documents to document libraries, and Web discussion comments
	AddListItems int64

	// Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries
	EditListItems int64

	// Delete items from a list, documents from a document library, and Web discussion comments in documents
	DeleteListItems int64

	// Approve a minor version of a list item or document
	ApproveItems int64

	// View the source of documents with server-side file handlers
	OpenItems int64

	// View past versions of a list item or document
	ViewVersions int64

	// Delete past versions of a list item or document
	DeleteVersions int64

	// Discard or check in a document which is checked out to another user
	CancelCheckout int64

	// Create, change, and delete personal views of lists
	ManagePersonalViews int64

	// Create and delete lists, add or remove columns in a list, and add or remove public views of a list
	ManageLists int64

	// View forms, views, and application pages, and enumerate lists
	ViewFormPages int64

	/**
	* Make content of a list or document library retrievable for anonymous users through SharePoint search.
	* The list permissions in the site do not change.
	 */
	AnonymousSearchAccessList int64

	// Allow users to open a Site, list, or folder to access items inside that container
	Open int64

	// View pages in a Site
	ViewPages int64

	// Add, change, or delete HTML pages or Web Part Pages, and edit the Site using a Windows SharePoint Services compatible editor
	AddAndCustomizePages int64

	// Apply a theme or borders to the entire Site
	ApplyThemeAndBorder int64

	// Apply a style sheet (.css file) to the Site
	ApplyStyleSheets int64

	// View reports on Site usage
	ViewUsageData int64

	// Create a Site using Self-Service Site Creation
	CreateSSCSite int64

	// Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites
	ManageSubwebs int64

	// Create a group of users that can be used anywhere within the site collection
	CreateGroups int64

	// Create and change permission levels on the Site and assign permissions to users and groups
	ManagePermissions int64

	// Enumerate files and folders in a Site using Microsoft Office SharePoint Designer and WebDAV interfaces
	BrowseDirectories int64

	// View information about users of the Site
	BrowseUserInfo int64

	// Add or remove personal Web Parts on a Web Part Page
	AddDelPrivateWebParts int64

	// Update Web Parts to display personalized information
	UpdatePersonalWebParts int64

	/**
	* Grant the ability to perform all administration tasks for the Site as well as
	* manage content, activate, deactivate, or edit properties of Site scoped Features
	* through the object model or through the user interface (UI). When granted on the
	* root Site of a Site Collection, activate, deactivate, or edit properties of
	* site collection scoped Features through the object model. To browse to the Site
	* Collection Features page and activate or deactivate Site Collection scoped Features
	* through the UI, you must be a Site Collection administrator.
	 */
	ManageWeb int64

	/**
	* Content of lists and document libraries in the Web site will be retrievable for anonymous users through
	* SharePoint search if the list or document library has AnonymousSearchAccessList set
	 */
	AnonymousSearchAccessWebLists int64

	// Use features that launch client applications. Otherwise, users must work on documents locally and upload changes
	UseClientIntegration int64

	// Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site
	UseRemoteAPIs int64

	// Manage alerts for all users of the Site
	ManageAlerts int64

	// Create e-mail alerts
	CreateAlerts int64

	// Allows a user to change his or her user information, such as adding a picture
	EditMyUserInfo int64

	// Enumerate permissions on Site, list, folder, document, or list item
	EnumeratePermissions int64

	// Has all permissions on the Site. Not available through the user interface
	FullMask int64
}{
	EmptyMask:                     0,
	ViewListItems:                 1,
	AddListItems:                  2,
	EditListItems:                 3,
	DeleteListItems:               4,
	ApproveItems:                  5,
	OpenItems:                     6,
	ViewVersions:                  7,
	DeleteVersions:                8,
	CancelCheckout:                9,
	ManagePersonalViews:           10,
	ManageLists:                   12,
	ViewFormPages:                 13,
	AnonymousSearchAccessList:     14,
	Open:                          17,
	ViewPages:                     18,
	AddAndCustomizePages:          19,
	ApplyThemeAndBorder:           20,
	ApplyStyleSheets:              21,
	ViewUsageData:                 22,
	CreateSSCSite:                 23,
	ManageSubwebs:                 24,
	CreateGroups:                  25,
	ManagePermissions:             26,
	BrowseDirectories:             27,
	BrowseUserInfo:                28,
	AddDelPrivateWebParts:         29,
	UpdatePersonalWebParts:        30,
	ManageWeb:                     31,
	AnonymousSearchAccessWebLists: 32,
	UseClientIntegration:          37,
	UseRemoteAPIs:                 38,
	ManageAlerts:                  39,
	CreateAlerts:                  40,
	EditMyUserInfo:                41,
	EnumeratePermissions:          63,
	FullMask:                      65,
}

PermissionKind enumerator

View Source
var RoleTypeKinds = struct {
	None          int
	Guest         int
	Reader        int
	Contributor   int
	WebDesigner   int
	Administrator int
	Editor        int
	System        int
}{
	None:          0,
	Guest:         1,
	Reader:        2,
	Contributor:   3,
	WebDesigner:   4,
	Administrator: 5,
	Editor:        6,
	System:        7,
}

RoleTypeKinds defined standard role type kinds

Functions

func ExtractEntityURI

func ExtractEntityURI(payload []byte) string

ExtractEntityURI extracts REST entity URI from payload

func HasPermissions

func HasPermissions(basePermissions BasePermissions, permissionsKind int64) bool

HasPermissions checks if base permissions include permissions kind mask permissionsKind is represented with in64 value (use PermissionKind struct helper as enumerator)

func NormalizeODataCollection

func NormalizeODataCollection(payload []byte) ([]byte, string)

NormalizeODataCollection parses OData resp taking care of OData mode

func NormalizeODataItem

func NormalizeODataItem(payload []byte) []byte

NormalizeODataItem parses OData resp taking care of OData mode

func TrimMultiline

func TrimMultiline(multi string) string

TrimMultiline trims multiline string converting to a single line friendly for payloads

Types

type AddChunkedOptions

type AddChunkedOptions struct {
	Overwrite bool                                    // should overwrite existing file
	Progress  func(data *FileUploadProgressData) bool // on progress callback, execute custom logic on each chunk, if the Progress is used it should return "true" to continue upload otherwise upload is canceled
	ChunkSize int                                     // chunk size in bytes
}

AddChunkedOptions provides optional settings for AddChunked method

type AddValidateFieldResult added in v0.1.30

type AddValidateFieldResult struct {
	ErrorCode    int
	ErrorMessage string
	FieldName    string
	FieldValue   string
	HasException bool
	ItemID       int `json:"ItemId"`
}

AddValidateFieldResult field result struct

type AddValidateResp

type AddValidateResp []byte

AddValidateResp - add validate using path response type with helper processor methods

func (*AddValidateResp) Data

func (avResp *AddValidateResp) Data() []AddValidateFieldResult

Data unmarshals AddValidate response

func (*AddValidateResp) ID

func (avResp *AddValidateResp) ID() int

ID gets created item's ID from the response

func (*AddValidateResp) Value added in v0.1.30

func (avResp *AddValidateResp) Value(fieldName string) string

Value gets created item's value from the response

type AssociatedGroups

type AssociatedGroups struct {
	// contains filtered or unexported fields
}

AssociatedGroups web associated groups scope constructor Always use NewAssociatedGroups constructor instead of &AssociatedGroups{}

func NewAssociatedGroups

func NewAssociatedGroups(client *gosip.SPClient, endpoint string, config *RequestConfig) *AssociatedGroups

NewAssociatedGroups - AssociatedGroups struct constructor function

func (*AssociatedGroups) Conf

func (associatedGroups *AssociatedGroups) Conf(config *RequestConfig) *AssociatedGroups

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*AssociatedGroups) Members

func (associatedGroups *AssociatedGroups) Members() *Group

Members gets web associated members group API object

func (*AssociatedGroups) Owners

func (associatedGroups *AssociatedGroups) Owners() *Group

Owners gets web associated owners group API object

func (*AssociatedGroups) Visitors

func (associatedGroups *AssociatedGroups) Visitors() *Group

Visitors gets web associated visitors group API object

type Attachment

type Attachment struct {
	// contains filtered or unexported fields
}

Attachment represents SharePoint List Items Attachment API queryable object struct Always use NewAttachment constructor instead of &Attachment{}

func NewAttachment

func NewAttachment(client *gosip.SPClient, endpoint string, config *RequestConfig) *Attachment

NewAttachment - Attachment struct constructor function

func (*Attachment) Delete

func (attachment *Attachment) Delete() error

Delete delete an attachment skipping recycle bin

func (*Attachment) Download

func (attachment *Attachment) Download() ([]byte, error)

Download downloads attachment's as byte array

func (*Attachment) Get

func (attachment *Attachment) Get() (AttachmentResp, error)

Get gets attachment data object

func (*Attachment) GetReader

func (attachment *Attachment) GetReader() (io.ReadCloser, error)

GetReader gets attachment body data reader

func (*Attachment) Recycle

func (attachment *Attachment) Recycle() error

Recycle moves an attachment to the recycle bin

type AttachmentInfo

type AttachmentInfo struct {
	FileName          string `json:"FileName"`
	ServerRelativeURL string `json:"ServerRelativeUrl"`
}

AttachmentInfo - attachment API response payload structure

type AttachmentResp

type AttachmentResp []byte

AttachmentResp - attachment response type with helper processor methods

func (*AttachmentResp) Data

func (attachmentResp *AttachmentResp) Data() *AttachmentInfo

Data response helper

func (*AttachmentResp) Normalized

func (attachmentResp *AttachmentResp) Normalized() []byte

Normalized returns normalized body

type Attachments

type Attachments struct {
	// contains filtered or unexported fields
}

Attachments represent SharePoint List Items Attachments API queryable collection struct Always use NewAttachments constructor instead of &Attachments{}

func NewAttachments

func NewAttachments(client *gosip.SPClient, endpoint string, config *RequestConfig) *Attachments

NewAttachments - Attachments struct constructor function

func (*Attachments) Add

func (attachments *Attachments) Add(name string, content io.Reader) (AttachmentResp, error)

Add uploads new attachment to the item

func (*Attachments) Get

func (attachments *Attachments) Get() (AttachmentsResp, error)

Get gets attachments collection response

func (*Attachments) GetByName

func (attachments *Attachments) GetByName(fileName string) *Attachment

GetByName gets an attachment by its name

type AttachmentsResp

type AttachmentsResp []byte

AttachmentsResp - attachments response type with helper processor methods

func (*AttachmentsResp) Data

func (attachmentsResp *AttachmentsResp) Data() []AttachmentResp

Data response helper

func (*AttachmentsResp) Normalized

func (attachmentsResp *AttachmentsResp) Normalized() []byte

Normalized returns normalized body

type BasePermissions

type BasePermissions struct {
	High int64 `json:"High,string"`
	Low  int64 `json:"Low,string"`
}

BasePermissions - Low/High pair of base permissions

type ChangeInfo

type ChangeInfo struct {
	ChangeToken       *StringValue `json:"ChangeToken"`
	ChangeType        int          `json:"ChangeType"` // see more https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-csom/ee543793(v%3Doffice.15)
	Editor            string       `json:"Editor"`
	EditorEmailHint   string       `json:"EditorEmailHint"`
	ItemID            int          `json:"ItemId"`
	ListID            string       `json:"ListId"`
	ServerRelativeURL string       `json:"ServerRelativeUrl"`
	SharedByUser      string       `json:"SharedByUser"`
	SharedWithUsers   string       `json:"SharedWithUsers"`
	SiteID            string       `json:"SiteId"`
	Time              time.Time    `json:"Time"`
	UniqueID          string       `json:"UniqueId"`
	WebID             string       `json:"WebId"`
}

ChangeInfo - changes API response payload structure

type ChangeQuery

type ChangeQuery struct {
	ChangeTokenStart      string // Specifies the start date and start time for changes that are returned through the query
	ChangeTokenEnd        string // Specifies the end date and end time for changes that are returned through the query
	Add                   bool   // Specifies whether add changes are included in the query
	Alert                 bool   // Specifies whether changes to alerts are included in the query
	ContentType           bool   // Specifies whether changes to content types are included in the query
	DeleteObject          bool   // Specifies whether deleted objects are included in the query
	Field                 bool   // Specifies whether changes to fields are included in the query
	File                  bool   // Specifies whether changes to files are included in the query
	Folder                bool   // Specifies whether changes to folders are included in the query
	Group                 bool   // Specifies whether changes to groups are included in the query
	GroupMembershipAdd    bool   // Specifies whether adding users to groups is included in the query
	GroupMembershipDelete bool   // Specifies whether deleting users from the groups is included in the query
	Item                  bool   // Specifies whether general changes to list items are included in the query
	List                  bool   // Specifies whether changes to lists are included in the query
	Move                  bool   // Specifies whether move changes are included in the query
	Navigation            bool   // Specifies whether changes to the navigation structure of a site collection are included in the query
	Rename                bool   // Specifies whether renaming changes are included in the query
	Restore               bool   // Specifies whether restoring items from the recycle bin or from backups is included in the query
	RoleAssignmentAdd     bool   // Specifies whether adding role assignments is included in the query
	RoleAssignmentDelete  bool   // Specifies whether adding role assignments is included in the query
	RoleDefinitionAdd     bool   // Specifies whether adding role assignments is included in the query
	RoleDefinitionDelete  bool   // Specifies whether adding role assignments is included in the query
	RoleDefinitionUpdate  bool   // Specifies whether adding role assignments is included in the query
	SecurityPolicy        bool   // Specifies whether modifications to security policies are included in the query
	Site                  bool   // Specifies whether changes to site collections are included in the query
	SystemUpdate          bool   // Specifies whether updates made using the item SystemUpdate method are included in the query
	Update                bool   // Specifies whether update changes are included in the query
	User                  bool   // Specifies whether changes to users are included in the query
	View                  bool   // Specifies whether changes to views are included in the query
	Web                   bool   // Specifies whether changes to Web sites are included in the query
}

ChangeQuery ...

type Changes

type Changes struct {
	// contains filtered or unexported fields
}

Changes represent SharePoint Changes API queryable collection struct Always use NewChanges constructor instead of &Changes{}

func NewChanges

func NewChanges(client *gosip.SPClient, endpoint string, config *RequestConfig) *Changes

NewChanges - Changes struct constructor function

func (*Changes) Conf

func (changes *Changes) Conf(config *RequestConfig) *Changes

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Changes) GetChangeType

func (changes *Changes) GetChangeType(changeType int) string

GetChangeType gets verbose change type https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-csom/ee543793(v%3Doffice.15)

func (*Changes) GetChanges

func (changes *Changes) GetChanges(changeQuery *ChangeQuery) (*ChangesResp, error)

GetChanges gets changes in scope of the parent container using provided change query

func (*Changes) GetCurrentToken

func (changes *Changes) GetCurrentToken() (string, error)

GetCurrentToken gets current change token for this parent entity

func (*Changes) Top

func (changes *Changes) Top(oDataTop int) *Changes

Top adds $top OData modifier

type ChangesResp

type ChangesResp struct {
	Data        func() []*ChangeInfo         // gets change info collection
	GetNextPage func() (*ChangesResp, error) // gets next page changes collection
	// contains filtered or unexported fields
}

ChangesResp - changes response type with helper processor methods

type ContentType

type ContentType struct {
	// contains filtered or unexported fields
}

ContentType represents SharePoint Content Types API queryable object struct Always use NewContentType constructor instead of &ContentType{}

func NewContentType

func NewContentType(client *gosip.SPClient, endpoint string, config *RequestConfig) *ContentType

NewContentType - ContentType struct constructor function

func (*ContentType) Conf

func (contentType *ContentType) Conf(config *RequestConfig) *ContentType

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*ContentType) Delete

func (contentType *ContentType) Delete() error

Delete deletes a content type skipping recycle bin

func (*ContentType) Expand

func (contentType *ContentType) Expand(oDataExpand string) *ContentType

Expand adds $expand OData modifier

func (contentType *ContentType) FieldLinks() *FieldLinks

FieldLinks gets FieldLinks API instance queryable collection

func (*ContentType) Get

func (contentType *ContentType) Get() (ContentTypeResp, error)

Get gets content type data object

func (*ContentType) Select

func (contentType *ContentType) Select(oDataSelect string) *ContentType

Select adds $select OData modifier

func (*ContentType) ToURL

func (contentType *ContentType) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*ContentType) Update

func (contentType *ContentType) Update(body []byte) (ContentTypeResp, error)

Update updates Content Types's metadata with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.ContentType object

type ContentTypeCreationInfo

type ContentTypeCreationInfo struct {
	ID                  string // Content type ID, e.g. 0x010000BE397685D43B428513CD9CC1E75CE4, optional is ParentContentTypeID is provided
	Name                string // Content type display name
	Group               string // Content type group name
	Description         string // Description text
	ParentContentTypeID string // Parent content type ID, e.g. 0x01, optional is ID is provided
}

ContentTypeCreationInfo new content type metadata

type ContentTypeInfo

type ContentTypeInfo struct {
	Description string `json:"Description"`
	Group       string `json:"Group"`
	Hidden      bool   `json:"Hidden"`
	JSLink      string `json:"JSLink"`
	Name        string `json:"Name"`
	ReadOnly    bool   `json:"Read"`
	SchemaXML   string `json:"SchemaXml"`
	Scope       string `json:"Scope"`
	Sealed      bool   `json:"Sealed"`
	ID          string `json:"StringId"`
}

ContentTypeInfo - content type API response payload structure

type ContentTypeResp

type ContentTypeResp []byte

ContentTypeResp - content type response type with helper processor methods

func (*ContentTypeResp) Data

func (contentTypeResp *ContentTypeResp) Data() *ContentTypeInfo

Data response helper

func (*ContentTypeResp) Normalized

func (contentTypeResp *ContentTypeResp) Normalized() []byte

Normalized returns normalized body

type ContentTypes

type ContentTypes struct {
	// contains filtered or unexported fields
}

ContentTypes represent SharePoint Content Types API queryable collection struct Always use NewContentTypes constructor instead of &ContentTypes{}

func NewContentTypes

func NewContentTypes(client *gosip.SPClient, endpoint string, config *RequestConfig) *ContentTypes

NewContentTypes - ContentTypes struct constructor function

func (*ContentTypes) Add

func (contentTypes *ContentTypes) Add(body []byte) (ContentTypeResp, error)

Add adds Content Types with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.ContentType object

func (*ContentTypes) Conf

func (contentTypes *ContentTypes) Conf(config *RequestConfig) *ContentTypes

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*ContentTypes) Create

func (contentTypes *ContentTypes) Create(contentTypeInfo *ContentTypeCreationInfo) (string, error)

Create adds Content Type using CSOM polyfill as REST's Add method is limited (https://github.com/pnp/pnpjs/issues/457)

func (*ContentTypes) Expand

func (contentTypes *ContentTypes) Expand(oDataExpand string) *ContentTypes

Expand adds $expand OData modifier

func (*ContentTypes) Filter

func (contentTypes *ContentTypes) Filter(oDataFilter string) *ContentTypes

Filter adds $filter OData modifier

func (*ContentTypes) Get

func (contentTypes *ContentTypes) Get() (ContentTypesResp, error)

Get gets content typed queryable collection response

func (*ContentTypes) GetByID

func (contentTypes *ContentTypes) GetByID(contentTypeID string) *ContentType

GetByID gets a content type by its ID (GUID)

func (*ContentTypes) OrderBy

func (contentTypes *ContentTypes) OrderBy(oDataOrderBy string, ascending bool) *ContentTypes

OrderBy adds $orderby OData modifier

func (*ContentTypes) Select

func (contentTypes *ContentTypes) Select(oDataSelect string) *ContentTypes

Select adds $select OData modifier

func (*ContentTypes) ToURL

func (contentTypes *ContentTypes) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*ContentTypes) Top

func (contentTypes *ContentTypes) Top(oDataTop int) *ContentTypes

Top adds $top OData modifier

type ContentTypesResp

type ContentTypesResp []byte

ContentTypesResp - content types response type with helper processor methods

func (*ContentTypesResp) Data

func (contentTypesResp *ContentTypesResp) Data() []ContentTypeResp

Data response helper

func (*ContentTypesResp) Normalized

func (contentTypesResp *ContentTypesResp) Normalized() []byte

Normalized returns normalized body

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context represents SharePoint Content Info API object struct Always use NewContext constructor instead of &Context{}

func NewContext

func NewContext(client *gosip.SPClient, endpoint string, config *RequestConfig) *Context

NewContext - Context struct constructor function

func (*Context) Get

func (context *Context) Get() (*ContextInfo, error)

Get gets context info data object

type ContextInfo

type ContextInfo struct {
	FormDigestTimeoutSeconds int      `json:"FormDigestTimeoutSeconds"`
	FormDigestValue          string   `json:"FormDigestValue"`
	LibraryVersion           string   `json:"LibraryVersion"` // "16.0.19520.12058",
	SiteFullURL              string   `json:"SiteFullUrl"`
	SupportedSchemaVersions  []string `json:"SupportedSchemaVersions"`
	WebFullURL               string   `json:"WebFullUrl"`
}

ContextInfo - context info response payload structure

type CustomAction

type CustomAction struct {
	// contains filtered or unexported fields
}

CustomAction represent SharePoint CustomAction API object Always use NewCustomAction constructor instead of &CustomAction{}

func NewCustomAction

func NewCustomAction(client *gosip.SPClient, endpoint string, config *RequestConfig) *CustomAction

NewCustomAction - CustomActions struct constructor function

func (*CustomAction) Delete

func (customAction *CustomAction) Delete() error

Delete deletes this custom action

func (*CustomAction) Get

func (customAction *CustomAction) Get() (*CustomActionInfo, error)

Get gets this action metadata

type CustomActionInfo

type CustomActionInfo struct {
	ClientSideComponentID         string           `json:"ClientSideComponentId"`
	ClientSideComponentProperties string           `json:"ClientSideComponentProperties"`
	CommandUIExtension            string           `json:"CommandUIExtension"`
	Description                   string           `json:"Description"`
	Group                         string           `json:"Group"`
	HostProperties                string           `json:"HostProperties"`
	ID                            string           `json:"Id"`
	ImageURL                      string           `json:"ImageUrl"`
	Location                      string           `json:"Location"`
	Name                          string           `json:"Name"`
	RegistrationID                string           `json:"RegistrationId"`
	RegistrationType              int              `json:"RegistrationType"`
	Scope                         int              `json:"Scope"`
	ScriptBlock                   string           `json:"ScriptBlock"`
	ScriptSrc                     string           `json:"ScriptSrc"`
	Sequence                      int              `json:"Sequence"`
	Title                         string           `json:"Title"`
	URL                           string           `json:"Url"`
	VersionOfUserCustomAction     string           `json:"VersionOfUserCustomAction"`
	Rights                        *BasePermissions `json:"Rights"`
}

CustomActionInfo - user custom actions API response payload structure

type CustomActions

type CustomActions struct {
	// contains filtered or unexported fields
}

CustomActions represent SharePoint CustomActions API queryable collection struct Always use NewCustomActions constructor instead of &CustomActions{}

func NewCustomActions

func NewCustomActions(client *gosip.SPClient, endpoint string, config *RequestConfig) *CustomActions

NewCustomActions - CustomActions struct constructor function

func (*CustomActions) Add

func (customActions *CustomActions) Add(payload []byte) (*CustomActionInfo, error)

Add register new user custom action

func (*CustomActions) Conf

func (customActions *CustomActions) Conf(config *RequestConfig) *CustomActions

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*CustomActions) Filter

func (customActions *CustomActions) Filter(oDataFilter string) *CustomActions

Filter adds $filter OData modifier

func (*CustomActions) Get

func (customActions *CustomActions) Get() ([]*CustomActionInfo, error)

Get gets event customActions collection

func (*CustomActions) GetByID

func (customActions *CustomActions) GetByID(actionID string) *CustomAction

GetByID gets action API object by ID (GUID)

func (*CustomActions) OrderBy

func (customActions *CustomActions) OrderBy(oDataOrderBy string, ascending bool) *CustomActions

OrderBy adds $orderby OData modifier

func (*CustomActions) Select

func (customActions *CustomActions) Select(oDataSelect string) *CustomActions

Select adds $select OData modifier

func (*CustomActions) ToURL

func (customActions *CustomActions) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*CustomActions) Top

func (customActions *CustomActions) Top(oDataTop int) *CustomActions

Top adds $top OData modifier

type DecodedURL

type DecodedURL struct {
	DecodedURL string `json:"DecodedUrl"`
}

DecodedURL decode URL prop type

type EmailProps

type EmailProps struct {
	Subject string   // Email subject
	Body    string   // Email text or HTML body
	To      []string // Slice of To email addresses to whom Email is intended to be sent
	CC      []string // Slice of CC email addresses (optional)
	BCC     []string // Slice of BCC email addresses (optional)
	From    string   // Sender email addresses (optional)
}

EmailProps struct for SendEmail method parameters

type EventReceiverInfo

type EventReceiverInfo struct {
	EventType        int    `json:"EventType"`
	ReceiverAssembly string `json:"ReceiverAssembly"`
	ReceiverClass    string `json:"ReceiverClass"`
	ReceiverID       string `json:"ReceiverId"`
	ReceiverName     string `json:"ReceiverName"`
	ReceiverURL      string `json:"ReceiverUrl"`
	SequenceNumber   int    `json:"SequenceNumber"`
	Synchronization  int    `json:"Synchronization"`
}

EventReceiverInfo - event receivers API response payload structure

type EventReceivers

type EventReceivers struct {
	// contains filtered or unexported fields
}

EventReceivers represent SharePoint EventReceivers API queryable collection struct Always use NewEventReceivers constructor instead of &EventReceivers{}

func NewEventReceivers

func NewEventReceivers(client *gosip.SPClient, endpoint string, config *RequestConfig) *EventReceivers

NewEventReceivers - EventReceivers struct constructor function

func (*EventReceivers) Conf

func (eventReceivers *EventReceivers) Conf(config *RequestConfig) *EventReceivers

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*EventReceivers) Filter

func (eventReceivers *EventReceivers) Filter(oDataFilter string) *EventReceivers

Filter adds $filter OData modifier

func (*EventReceivers) Get

func (eventReceivers *EventReceivers) Get() ([]*EventReceiverInfo, error)

Get gets event receivers collection

func (*EventReceivers) OrderBy

func (eventReceivers *EventReceivers) OrderBy(oDataOrderBy string, ascending bool) *EventReceivers

OrderBy adds $orderby OData modifier

func (*EventReceivers) Select

func (eventReceivers *EventReceivers) Select(oDataSelect string) *EventReceivers

Select adds $select OData modifier

func (*EventReceivers) ToURL

func (eventReceivers *EventReceivers) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*EventReceivers) Top

func (eventReceivers *EventReceivers) Top(oDataTop int) *EventReceivers

Top adds $top OData modifier

type FeatureInfo

type FeatureInfo struct {
	DefinitionID string `json:"DefinitionId"`
}

FeatureInfo - features API response payload structure

type Features

type Features struct {
	// contains filtered or unexported fields
}

Features represent SharePoint Webs & Site Features API queryable collection struct Always use NewFeatures constructor instead of &Features{}

func NewFeatures

func NewFeatures(client *gosip.SPClient, endpoint string, config *RequestConfig) *Features

NewFeatures - Features struct constructor function

func (*Features) Add

func (features *Features) Add(featureID string, force bool) error

Add activates a feature by its ID (GUID) in the parent container (Site or Web)

func (*Features) Get

func (features *Features) Get() ([]*FeatureInfo, error)

Get gets features collection (IDs)

func (*Features) Remove

func (features *Features) Remove(featureID string, force bool) error

Remove deactivates a feature by its ID (GUID) in the parent container (Site or Web)

type Field

type Field struct {
	// contains filtered or unexported fields
}

Field represents SharePoint Field (Site Column) API queryable object struct Always use NewField constructor instead of &Field{}

func NewField

func NewField(client *gosip.SPClient, endpoint string, config *RequestConfig) *Field

NewField - Field struct constructor function

func (*Field) Conf

func (field *Field) Conf(config *RequestConfig) *Field

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Field) Delete

func (field *Field) Delete() error

Delete deletes a field skipping recycle bin

func (*Field) Expand

func (field *Field) Expand(oDataExpand string) *Field

Expand adds $expand OData modifier

func (*Field) Get

func (field *Field) Get() (FieldResp, error)

Get gets field data object

func (*Field) Select

func (field *Field) Select(oDataSelect string) *Field

Select adds $select OData modifier

func (*Field) ToURL

func (field *Field) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Field) Update

func (field *Field) Update(body []byte) (FieldResp, error)

Update updates Field's metadata with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.Field object

type FieldInfo

type FieldInfo struct {
	AutoIndexed          bool   `json:"AutoIndexed"`
	CanBeDeleted         bool   `json:"CanBeDeleted"`
	DefaultValue         string `json:"DefaultValue"`
	Description          string `json:"Description"`
	EnforceUniqueValues  bool   `json:"EnforceUniqueValues"`
	EntityPropertyName   string `json:"EntityPropertyName"`
	FieldTypeKind        int    `json:"FieldTypeKind"`
	Filterable           bool   `json:"Filterable"`
	FromBaseType         bool   `json:"FromBaseType"`
	Group                string `json:"Group"`
	Hidden               bool   `json:"Hidden"`
	ID                   string `json:"Id"`
	IndexStatus          int    `json:"IndexStatus"`
	Indexed              bool   `json:"Indexed"`
	InternalName         string `json:"InternalName"`
	JSLink               string `json:"JSLink"`
	ReadOnlyField        bool   `json:"ReadOnlyField"`
	Required             bool   `json:"Required"`
	SchemaXML            string `json:"SchemaXml"`
	Scope                string `json:"Scope"`
	Sealed               bool   `json:"Sealed"`
	ShowInFiltersPane    int    `json:"ShowInFiltersPane"`
	Sortable             bool   `json:"Sortable"`
	StaticName           string `json:"StaticName"`
	Title                string `json:"Title"`
	TypeAsString         string `json:"TypeAsString"`
	TypeDisplayName      string `json:"TypeDisplayName"`
	TypeShortDescription string `json:"TypeShortDescription"`
}

FieldInfo - generic field API response payload structure

type FieldLink struct {
	// contains filtered or unexported fields
}

FieldLink represent SharePoint content type FieldLink API Always use NewFieldLink constructor instead of &FieldLink{}

func NewFieldLink(client *gosip.SPClient, endpoint string, config *RequestConfig) *FieldLink

NewFieldLink - FieldLink struct constructor function

func (*FieldLink) Delete

func (fieldLink *FieldLink) Delete() error

Delete deletes a field link by its ID (GUID)

type FieldLinkInfo

type FieldLinkInfo struct {
	ID                string `json:"Id"`
	Name              string `json:"Name"`
	FieldInternalName string `json:"FieldInternalName"`
	Hidden            bool   `json:"Hidden"`
	Required          bool   `json:"Required"`
}

FieldLinkInfo field link info

type FieldLinkResp

type FieldLinkResp []byte

FieldLinkResp - fieldLinks response type with helper processor methods

func (*FieldLinkResp) Data

func (fieldLinkResp *FieldLinkResp) Data() *FieldLinkInfo

Data response helper

func (*FieldLinkResp) Normalized

func (fieldLinkResp *FieldLinkResp) Normalized() []byte

Normalized returns normalized body

type FieldLinks struct {
	// contains filtered or unexported fields
}

FieldLinks represent SharePoint content type FieldLinks API queryable collection struct Always use NewFieldLinks constructor instead of &FieldLinks{}

func NewFieldLinks(client *gosip.SPClient, endpoint string, config *RequestConfig) *FieldLinks

NewFieldLinks - FieldLinks struct constructor function

func (*FieldLinks) Add

func (fieldLinks *FieldLinks) Add(name string) (string, error)

Add adds field link

func (*FieldLinks) Conf

func (fieldLinks *FieldLinks) Conf(config *RequestConfig) *FieldLinks

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*FieldLinks) Filter

func (fieldLinks *FieldLinks) Filter(oDataFilter string) *FieldLinks

Filter adds $filter OData modifier

func (*FieldLinks) Get

func (fieldLinks *FieldLinks) Get() (FieldLinksResp, error)

Get gets fields response collection

func (*FieldLinks) GetByID

func (fieldLinks *FieldLinks) GetByID(fieldLinkID string) *FieldLink

GetByID gets a field link by its ID (GUID)

func (*FieldLinks) GetFields

func (fieldLinks *FieldLinks) GetFields() (FieldsResp, error)

GetFields gets fields response collection

func (*FieldLinks) Select

func (fieldLinks *FieldLinks) Select(oDataSelect string) *FieldLinks

Select adds $select OData modifier

func (*FieldLinks) ToURL

func (fieldLinks *FieldLinks) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*FieldLinks) Top

func (fieldLinks *FieldLinks) Top(oDataTop int) *FieldLinks

Top adds $top OData modifier

type FieldLinksResp

type FieldLinksResp []byte

FieldLinksResp - fieldLinks response type with helper processor methods

func (*FieldLinksResp) Data

func (fieldLinksResp *FieldLinksResp) Data() []FieldLinkResp

Data response helper

func (*FieldLinksResp) Normalized

func (fieldLinksResp *FieldLinksResp) Normalized() []byte

Normalized returns normalized body

type FieldResp

type FieldResp []byte

FieldResp - field response type with helper processor methods

func (*FieldResp) Data

func (fieldResp *FieldResp) Data() *FieldInfo

Data response helper

func (*FieldResp) Normalized

func (fieldResp *FieldResp) Normalized() []byte

Normalized returns normalized body

type Fields

type Fields struct {
	// contains filtered or unexported fields
}

Fields represent SharePoint Fields (Site Columns) API queryable collection struct Always use NewFields constructor instead of &Fields{}

func NewFields

func NewFields(client *gosip.SPClient, endpoint string, config *RequestConfig, entity string) *Fields

NewFields - Fields struct constructor function

func (*Fields) Add

func (fields *Fields) Add(body []byte) (FieldResp, error)

Add adds field with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.Field object

func (*Fields) Conf

func (fields *Fields) Conf(config *RequestConfig) *Fields

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Fields) CreateFieldAsXML

func (fields *Fields) CreateFieldAsXML(schemaXML string, options int) (FieldResp, error)

CreateFieldAsXML creates a field using XML schema definition `options` parameter (https://github.com/pnp/pnpjs/blob/version-2/packages/sp/fields/types.ts#L553) is only relevant for adding fields in list instances

func (*Fields) Expand

func (fields *Fields) Expand(oDataExpand string) *Fields

Expand adds $expand OData modifier

func (*Fields) Filter

func (fields *Fields) Filter(oDataFilter string) *Fields

Filter adds $filter OData modifier

func (*Fields) Get

func (fields *Fields) Get() (FieldsResp, error)

Get gets fields response collection

func (*Fields) GetByID

func (fields *Fields) GetByID(fieldID string) *Field

GetByID gets a field by its ID (GUID)

func (*Fields) GetByInternalNameOrTitle

func (fields *Fields) GetByInternalNameOrTitle(internalName string) *Field

GetByInternalNameOrTitle gets a field by its Internal or Display name

func (*Fields) GetByTitle

func (fields *Fields) GetByTitle(title string) *Field

GetByTitle gets a field by its Display Name

func (*Fields) OrderBy

func (fields *Fields) OrderBy(oDataOrderBy string, ascending bool) *Fields

OrderBy adds $orderby OData modifier

func (*Fields) Select

func (fields *Fields) Select(oDataSelect string) *Fields

Select adds $select OData modifier

func (*Fields) ToURL

func (fields *Fields) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Fields) Top

func (fields *Fields) Top(oDataTop int) *Fields

Top adds $top OData modifier

type FieldsResp

type FieldsResp []byte

FieldsResp - fields response type with helper processor methods

func (*FieldsResp) Data

func (fieldsResp *FieldsResp) Data() []FieldResp

Data response helper

func (*FieldsResp) Normalized

func (fieldsResp *FieldsResp) Normalized() []byte

Normalized returns normalized body

type File

type File struct {
	// contains filtered or unexported fields
}

File represents SharePoint File API queryable object struct Always use NewFile constructor instead of &File{}

func NewFile

func NewFile(client *gosip.SPClient, endpoint string, config *RequestConfig) *File

NewFile - File struct constructor function

func (*File) CheckIn

func (file *File) CheckIn(comment string, checkInType int) ([]byte, error)

CheckIn checks file in, checkInType: 0 - Minor, 1 - Major, 2 - Overwrite

func (*File) CheckOut

func (file *File) CheckOut() ([]byte, error)

CheckOut checks file out

func (*File) Conf

func (file *File) Conf(config *RequestConfig) *File

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*File) ContextInfo

func (file *File) ContextInfo() (*ContextInfo, error)

ContextInfo ...

func (*File) CopyTo

func (file *File) CopyTo(newURL string, overwrite bool) ([]byte, error)

CopyTo file to new location within the same site

func (*File) Delete

func (file *File) Delete() error

Delete deletes this file skipping recycle bin

func (*File) Download

func (file *File) Download() ([]byte, error)

Download file bytes

func (*File) Expand

func (file *File) Expand(oDataExpand string) *File

Expand adds $expand OData modifier

func (*File) Get

func (file *File) Get() (FileResp, error)

Get gets file data object

func (*File) GetItem

func (file *File) GetItem() (*Item, error)

GetItem gets this folder Item API object metadata

func (*File) GetReader

func (file *File) GetReader() (io.ReadCloser, error)

GetReader gets file io.ReadCloser

func (*File) ListItemAllFields

func (file *File) ListItemAllFields() (ListItemAllFieldsResp, error)

ListItemAllFields gets this file Item data object metadata

func (*File) MoveTo

func (file *File) MoveTo(newURL string, overwrite bool) ([]byte, error)

MoveTo file to new location within the same site

func (*File) Props

func (file *File) Props() *Properties

Props gets Properties API instance queryable collection for this File

func (*File) Publish

func (file *File) Publish(comment string) ([]byte, error)

Publish publishes a file

func (*File) Recycle

func (file *File) Recycle() error

Recycle moves this file to the recycle bin

func (*File) Select

func (file *File) Select(oDataSelect string) *File

Select adds $select OData modifier

func (*File) ToURL

func (file *File) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*File) UnPublish

func (file *File) UnPublish(comment string) ([]byte, error)

UnPublish un-publishes a file

func (*File) UndoCheckOut

func (file *File) UndoCheckOut() ([]byte, error)

UndoCheckOut undoes file check out

type FileInfo

type FileInfo struct {
	CheckInComment       string    `json:"CheckInComment"`
	CheckOutType         int       `json:"CheckOutType"`
	ContentTag           string    `json:"ContentTag"`
	CustomizedPageStatus int       `json:"CustomizedPageStatus"`
	ETag                 string    `json:"ETag"`
	Exists               bool      `json:"Exists"`
	IrmEnabled           bool      `json:"IrmEnabled"`
	Length               int       `json:"Length,string"`
	Level                int       `json:"Level"`
	LinkingURI           string    `json:"LinkingUri"`
	LinkingURL           string    `json:"LinkingUrl"`
	MajorVersion         int       `json:"MajorVersion"`
	MinorVersion         int       `json:"MinorVersion"`
	Name                 string    `json:"Name"`
	ServerRelativeURL    string    `json:"ServerRelativeUrl"`
	TimeCreated          time.Time `json:"TimeCreated"`
	TimeLastModified     time.Time `json:"TimeLastModified"`
	Title                string    `json:"Title"`
	UIVersion            int       `json:"UIVersion"`
	UIVersionLabel       string    `json:"UIVersionLabel"`
	UniqueID             string    `json:"UniqueId"`
}

FileInfo - file API response payload structure

type FileResp

type FileResp []byte

FileResp - file response type with helper processor methods

func (*FileResp) Data

func (fileResp *FileResp) Data() *FileInfo

Data response helper

func (*FileResp) Normalized

func (fileResp *FileResp) Normalized() []byte

Normalized returns normalized body

type FileUploadProgressData

type FileUploadProgressData struct {
	UploadID    string
	Stage       string
	ChunkSize   int
	BlockNumber int
	FileOffset  int
}

FileUploadProgressData describes Progress callback options

type Files

type Files struct {
	// contains filtered or unexported fields
}

Files represent SharePoint Files API queryable collection struct Always use NewFiles constructor instead of &Files{}

func NewFiles

func NewFiles(client *gosip.SPClient, endpoint string, config *RequestConfig) *Files

NewFiles - Files struct constructor function

func (*Files) Add

func (files *Files) Add(name string, content []byte, overwrite bool) (FileResp, error)

Add uploads file into the folder

func (*Files) AddChunked

func (files *Files) AddChunked(name string, stream io.Reader, options *AddChunkedOptions) (FileResp, error)

AddChunked uploads a file in chunks (streaming), is a good fit for large files. Supported starting from SharePoint 2016.

func (*Files) Conf

func (files *Files) Conf(config *RequestConfig) *Files

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Files) Expand

func (files *Files) Expand(oDataExpand string) *Files

Expand adds $expand OData modifier

func (*Files) Filter

func (files *Files) Filter(oDataFilter string) *Files

Filter adds $filter OData modifier

func (*Files) Get

func (files *Files) Get() (FilesResp, error)

Get gets Files collection response

func (*Files) GetByName

func (files *Files) GetByName(fileName string) *File

GetByName gets a file by its name

func (*Files) OrderBy

func (files *Files) OrderBy(oDataOrderBy string, ascending bool) *Files

OrderBy adds $orderby OData modifier

func (*Files) Select

func (files *Files) Select(oDataSelect string) *Files

Select adds $select OData modifier

func (*Files) ToURL

func (files *Files) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Files) Top

func (files *Files) Top(oDataTop int) *Files

Top adds $top OData modifier

type FilesResp

type FilesResp []byte

FilesResp - files response type with helper processor methods

func (*FilesResp) Data

func (filesResp *FilesResp) Data() []FileResp

Data response helper

func (*FilesResp) Normalized

func (filesResp *FilesResp) Normalized() []byte

Normalized returns normalized body

type Folder

type Folder struct {
	// contains filtered or unexported fields
}

Folder represents SharePoint Lists & Document Libraries Folder API queryable object struct Always use NewFolder constructor instead of &Folder{}

func NewFolder

func NewFolder(client *gosip.SPClient, endpoint string, config *RequestConfig) *Folder

NewFolder ...

func (*Folder) Conf

func (folder *Folder) Conf(config *RequestConfig) *Folder

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Folder) ContextInfo

func (folder *Folder) ContextInfo() (*ContextInfo, error)

ContextInfo gets current Context Info object data

func (*Folder) Delete

func (folder *Folder) Delete() error

Delete deletes this folder (can't be restored from a recycle bin)

func (*Folder) Expand

func (folder *Folder) Expand(oDataExpand string) *Folder

Expand adds $expand OData modifier

func (*Folder) Files

func (folder *Folder) Files() *Files

Files gets files queryable collection in this folder

func (*Folder) Folders

func (folder *Folder) Folders() *Folders

Folders gets sub folders queryable collection

func (*Folder) Get

func (folder *Folder) Get() (FolderResp, error)

Get gets this folder data object

func (*Folder) GetItem

func (folder *Folder) GetItem() (*Item, error)

GetItem gets this folder Item API object metadata

func (*Folder) ListItemAllFields

func (folder *Folder) ListItemAllFields() (ListItemAllFieldsResp, error)

ListItemAllFields gets this folder Item data object metadata

func (*Folder) ParentFolder

func (folder *Folder) ParentFolder() *Folder

ParentFolder gets parent folder of this folder

func (*Folder) Props

func (folder *Folder) Props() *Properties

Props gets Properties API instance queryable collection for this Folder

func (*Folder) Recycle

func (folder *Folder) Recycle() error

Recycle moves this folder to the recycle bin

func (*Folder) Select

func (folder *Folder) Select(oDataSelect string) *Folder

Select adds $select OData modifier

func (*Folder) ToURL

func (folder *Folder) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Folder) Update

func (folder *Folder) Update(body []byte) (FolderResp, error)

Update updates Folder's metadata with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.Folder object

type FolderInfo

type FolderInfo struct {
	Exists            bool      `json:"Exists"`
	IsWOPIEnabled     bool      `json:"IsWOPIEnabled"`
	ItemCount         int       `json:"ItemCount"`
	Name              string    `json:"Name"`
	ProgID            string    `json:"ProgID"`
	ServerRelativeURL string    `json:"ServerRelativeUrl"`
	TimeCreated       time.Time `json:"TimeCreated"`
	TimeLastModified  time.Time `json:"TimeLastModified"`
	UniqueID          string    `json:"UniqueId"`
	WelcomePage       string    `json:"WelcomePage"`
}

FolderInfo - folder API response payload structure

type FolderResp

type FolderResp []byte

FolderResp - folder response type with helper processor methods

func (*FolderResp) Data

func (folderResp *FolderResp) Data() *FolderInfo

Data response helper

func (*FolderResp) Normalized

func (folderResp *FolderResp) Normalized() []byte

Normalized returns normalized body

type Folders

type Folders struct {
	// contains filtered or unexported fields
}

Folders represent SharePoint Lists & Document Libraries Folders API queryable collection struct Always use NewFolders constructor instead of &Folders{}

func NewFolders

func NewFolders(client *gosip.SPClient, endpoint string, config *RequestConfig) *Folders

NewFolders - Folders struct constructor function

func (*Folders) Add

func (folders *Folders) Add(folderName string) (FolderResp, error)

Add created a folder with specified name in this folder

func (*Folders) Conf

func (folders *Folders) Conf(config *RequestConfig) *Folders

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Folders) Expand

func (folders *Folders) Expand(oDataExpand string) *Folders

Expand adds $expand OData modifier

func (*Folders) Filter

func (folders *Folders) Filter(oDataFilter string) *Folders

Filter adds $filter OData modifier

func (*Folders) Get

func (folders *Folders) Get() (FoldersResp, error)

Get gets folders collection response in this folder

func (*Folders) GetByName

func (folders *Folders) GetByName(folderName string) *Folder

GetByName gets a folder by its name in this folder

func (*Folders) OrderBy

func (folders *Folders) OrderBy(oDataOrderBy string, ascending bool) *Folders

OrderBy adds $orderby OData modifier

func (*Folders) Select

func (folders *Folders) Select(oDataSelect string) *Folders

Select adds $select OData modifier

func (*Folders) ToURL

func (folders *Folders) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Folders) Top

func (folders *Folders) Top(oDataTop int) *Folders

Top adds $top OData modifier

type FoldersResp

type FoldersResp []byte

FoldersResp - folders response type with helper processor methods

func (*FoldersResp) Data

func (foldersResp *FoldersResp) Data() []FolderResp

Data response helper

func (*FoldersResp) Normalized

func (foldersResp *FoldersResp) Normalized() []byte

Normalized returns normalized body

type GenericItemInfo

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"`
}

GenericItemInfo - list's generic item response payload structure

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group represents SharePoint Site Groups API queryable object struct Always use NewGroup constructor instead of &Group{}

func NewGroup

func NewGroup(client *gosip.SPClient, endpoint string, config *RequestConfig) *Group

NewGroup - Group struct constructor function

func (*Group) AddUser

func (group *Group) AddUser(loginName string) error

AddUser adds a user by login name to this group

func (*Group) AddUserByID

func (group *Group) AddUserByID(userID int) error

AddUserByID adds a user by ID to this group

func (*Group) Conf

func (group *Group) Conf(config *RequestConfig) *Group

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Group) Expand

func (group *Group) Expand(oDataExpand string) *Group

Expand adds $expand OData modifier

func (*Group) Get

func (group *Group) Get() (GroupResp, error)

Get gets group data object

func (*Group) RemoveUser

func (group *Group) RemoveUser(loginName string) error

RemoveUser removes a user from group

func (*Group) RemoveUserByID

func (group *Group) RemoveUserByID(userID int) error

RemoveUserByID removes a user from group

func (*Group) Select

func (group *Group) Select(oDataSelect string) *Group

Select adds $select OData modifier

func (*Group) SetOwner

func (group *Group) SetOwner(ownerID int) error

SetOwner sets a user or group as this group owner

func (*Group) SetUserAsOwner

func (group *Group) SetUserAsOwner(userID int) error

SetUserAsOwner sets a user as owner (available only in SPO)

func (*Group) ToURL

func (group *Group) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Group) Update

func (group *Group) Update(body []byte) (GroupResp, error)

Update updates Group's metadata with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.Group object

func (*Group) Users

func (group *Group) Users() *Users

Users gets Users API queryable collection

type GroupInfo

type GroupInfo struct {
	AllowMembersEditMembership     bool   `json:"AllowMembersEditMembership"`
	AllowRequestToJoinLeave        bool   `json:"AllowRequestToJoinLeave"`
	AutoAcceptRequestToJoinLeave   bool   `json:"AutoAcceptRequestToJoinLeave"`
	Description                    string `json:"Description"`
	ID                             int    `json:"Id"`
	IsHiddenInUI                   bool   `json:"IsHiddenInUI"`
	LoginName                      string `json:"LoginName"`
	OnlyAllowMembersViewMembership bool   `json:"OnlyAllowMembersViewMembership"`
	OwnerTitle                     string `json:"OwnerTitle"`
	PrincipalType                  int    `json:"PrincipalType"`
	RequestToJoinLeaveEmailSetting bool   `json:"RequestToJoinLeaveEmailSetting"`
	Title                          string `json:"Title"`
}

GroupInfo - site group API response payload structure

type GroupResp

type GroupResp []byte

GroupResp - group response type with helper processor methods

func (*GroupResp) Data

func (groupResp *GroupResp) Data() *GroupInfo

Data response helper

func (*GroupResp) Normalized

func (groupResp *GroupResp) Normalized() []byte

Normalized returns normalized body

type Groups

type Groups struct {
	// contains filtered or unexported fields
}

Groups represent SharePoint Site Groups API queryable collection struct Always use NewGroups constructor instead of &Groups{}

func NewGroups

func NewGroups(client *gosip.SPClient, endpoint string, config *RequestConfig) *Groups

NewGroups - Groups struct constructor function

func (*Groups) Add

func (groups *Groups) Add(title string, metadata map[string]interface{}) (GroupResp, error)

Add creates new group with a specified name. Additional metadata can optionally be provided as string map object. `metadata` should correspond to SP.Group type.

func (*Groups) Conf

func (groups *Groups) Conf(config *RequestConfig) *Groups

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Groups) Expand

func (groups *Groups) Expand(oDataExpand string) *Groups

Expand adds $expand OData modifier

func (*Groups) Filter

func (groups *Groups) Filter(oDataFilter string) *Groups

Filter adds $filter OData modifier

func (*Groups) Get

func (groups *Groups) Get() (GroupsResp, error)

Get gets site Groups response - a collection of GroupInfo

func (*Groups) GetByID

func (groups *Groups) GetByID(groupID int) *Group

GetByID gets a group object by its ID

func (*Groups) GetByName

func (groups *Groups) GetByName(groupName string) *Group

GetByName gets a group object by its name

func (*Groups) OrderBy

func (groups *Groups) OrderBy(oDataOrderBy string, ascending bool) *Groups

OrderBy adds $orderby OData modifier

func (*Groups) RemoveByID

func (groups *Groups) RemoveByID(groupID int) error

RemoveByID deletes a group object by its ID

func (*Groups) RemoveByLoginName

func (groups *Groups) RemoveByLoginName(loginName string) error

RemoveByLoginName deletes a group object by its login name

func (*Groups) Select

func (groups *Groups) Select(oDataSelect string) *Groups

Select adds $select OData modifier

func (*Groups) ToURL

func (groups *Groups) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Groups) Top

func (groups *Groups) Top(oDataTop int) *Groups

Top adds $top OData modifier

type GroupsResp

type GroupsResp []byte

GroupsResp - groups response type with helper processor methods

func (*GroupsResp) Data

func (groupsResp *GroupsResp) Data() []GroupResp

Data response helper

func (*GroupsResp) Normalized

func (groupsResp *GroupsResp) Normalized() []byte

Normalized returns normalized body

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

HTTPClient HTTP methods helper

func NewHTTPClient

func NewHTTPClient(spClient *gosip.SPClient) *HTTPClient

NewHTTPClient creates an instance of httpClient

func (*HTTPClient) Delete

func (client *HTTPClient) Delete(endpoint string, conf *RequestConfig) ([]byte, error)

Delete - generic DELETE request wrapper

func (*HTTPClient) Get

func (client *HTTPClient) Get(endpoint string, conf *RequestConfig) ([]byte, error)

Get - generic GET request wrapper

func (*HTTPClient) Post

func (client *HTTPClient) Post(endpoint string, body io.Reader, conf *RequestConfig) ([]byte, error)

Post - generic POST request wrapper

func (*HTTPClient) ProcessQuery

func (client *HTTPClient) ProcessQuery(endpoint string, body io.Reader, conf *RequestConfig) ([]byte, error)

ProcessQuery - CSOM requests helper

func (*HTTPClient) Update

func (client *HTTPClient) Update(endpoint string, body io.Reader, conf *RequestConfig) ([]byte, error)

Update - generic MERGE request wrapper

type Item

type Item struct {
	// contains filtered or unexported fields
}

Item represents SharePoint Lists & Document Libraries Items API queryable object struct Always use NewItem constructor instead of &Item{}

func NewItem

func NewItem(client *gosip.SPClient, endpoint string, config *RequestConfig) *Item

NewItem - Item struct constructor function

func (*Item) Attachments

func (item *Item) Attachments() *Attachments

Attachments gets attachments collection for this Item

func (*Item) Conf

func (item *Item) Conf(config *RequestConfig) *Item

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Item) ContextInfo

func (item *Item) ContextInfo() (*ContextInfo, error)

ContextInfo gets current context information

func (*Item) Delete

func (item *Item) Delete() error

Delete deletes this Item (can't be restored from a recycle bin)

func (*Item) Expand

func (item *Item) Expand(oDataExpand string) *Item

Expand adds $expand OData modifier

func (*Item) Get

func (item *Item) Get() (ItemResp, error)

Get gets this Item info

func (*Item) ParentList

func (item *Item) ParentList() *List

ParentList gets this Item's Lists API object

func (*Item) Records

func (item *Item) Records() *Records

Records gets Records API instance object for this Item (inplace records manipulation)

func (*Item) Recycle

func (item *Item) Recycle() error

Recycle moves this item to the recycle bin

func (*Item) Roles

func (item *Item) Roles() *Roles

Roles gets Roles API instance queryable collection for this Item

func (*Item) Select

func (item *Item) Select(oDataSelect string) *Item

Select adds $select OData modifier

func (*Item) ToURL

func (item *Item) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Item) Update

func (item *Item) Update(body []byte) (ItemResp, error)

Update updates item's metadata. `body` parameter is byte array representation of JSON string payload relevant to item metadata object.

func (*Item) UpdateValidate

func (item *Item) UpdateValidate(formValues map[string]string, options *ValidateUpdateOptions) (UpdateValidateResp, error)

UpdateValidate updates an item in this list using ValidateUpdateListItem method. formValues fingerprints https://github.com/koltyakov/sp-sig-20180705-demo/blob/master/src/03-pnp/FieldTypes.md#field-data-types-fingerprints-sample

type ItemResp

type ItemResp []byte

ItemResp - item response type with helper processor methods

func (*ItemResp) Data

func (itemResp *ItemResp) Data() *GenericItemInfo

Data : to get typed data

func (*ItemResp) Normalized

func (itemResp *ItemResp) Normalized() []byte

Normalized returns normalized body

func (*ItemResp) ToMap

func (itemResp *ItemResp) ToMap() map[string]interface{}

ToMap unmarshals response to generic map

type Items

type Items struct {
	// contains filtered or unexported fields
}

Items represent SharePoint Lists & Document Libraries Items API queryable collection struct Always use NewItems constructor instead of &Items{}

func NewItems

func NewItems(client *gosip.SPClient, endpoint string, config *RequestConfig) *Items

NewItems - Items struct constructor function

func (*Items) Add

func (items *Items) Add(body []byte) (ItemResp, error)

Add adds new item in this list. `body` parameter is byte array representation of JSON string payload relevant to item metadata object.

func (*Items) AddValidate

func (items *Items) AddValidate(formValues map[string]string, options *ValidateAddOptions) (AddValidateResp, error)

AddValidate adds new item in this list using AddValidateUpdateItemUsingPath method. formValues fingerprints https://github.com/koltyakov/sp-sig-20180705-demo/blob/master/src/03-pnp/FieldTypes.md#field-data-types-fingerprints-sample

func (*Items) Conf

func (items *Items) Conf(config *RequestConfig) *Items

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Items) Expand

func (items *Items) Expand(oDataExpand string) *Items

Expand adds $expand OData modifier

func (*Items) Filter

func (items *Items) Filter(oDataFilter string) *Items

Filter adds $filter OData modifier

func (*Items) Get

func (items *Items) Get() (ItemsResp, error)

Get gets Items API queryable collection

func (*Items) GetAll

func (items *Items) GetAll() ([]ItemResp, error)

GetAll gets all items in a list using internal page helper. The use case of the method is getting all the content from large lists. Method ignores custom sorting and filtering as not supported for the large lists due to throttling limitations.

func (*Items) GetByCAML

func (items *Items) GetByCAML(caml string) (ItemsResp, error)

GetByCAML gets items data using CAML query

func (*Items) GetByID

func (items *Items) GetByID(itemID int) *Item

GetByID gets item data object by its ID

func (*Items) GetPaged

func (items *Items) GetPaged() (*ItemsPage, error)

GetPaged gets Paged Items collection

func (*Items) OrderBy

func (items *Items) OrderBy(oDataOrderBy string, ascending bool) *Items

OrderBy adds $orderby OData modifier

func (*Items) Select

func (items *Items) Select(oDataSelect string) *Items

Select adds $select OData modifier

func (*Items) Skip

func (items *Items) Skip(skipToken string) *Items

Skip adds $skiptoken OData modifier

func (*Items) ToURL

func (items *Items) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Items) Top

func (items *Items) Top(oDataTop int) *Items

Top adds $top OData modifier

type ItemsPage

type ItemsPage struct {
	Items       ItemsResp
	HasNextPage func() bool
	GetNextPage func() (*ItemsPage, error)
}

ItemsPage - paged items

type ItemsResp

type ItemsResp []byte

ItemsResp - items response type with helper processor methods

func (*ItemsResp) Data

func (itemsResp *ItemsResp) Data() []ItemResp

Data response helper

func (*ItemsResp) HasNextPage

func (itemsResp *ItemsResp) HasNextPage() bool

HasNextPage returns is true if next page exists

func (*ItemsResp) NextPageURL

func (itemsResp *ItemsResp) NextPageURL() string

NextPageURL gets next page OData collection

func (*ItemsResp) Normalized

func (itemsResp *ItemsResp) Normalized() []byte

Normalized returns normalized body

func (*ItemsResp) ToMap

func (itemsResp *ItemsResp) ToMap() []map[string]interface{}

ToMap unmarshals response to generic map

type List

type List struct {
	// contains filtered or unexported fields
}

List represents SharePoint List API queryable object struct Always use NewList constructor instead of &List{}

func NewList

func NewList(client *gosip.SPClient, endpoint string, config *RequestConfig) *List

NewList - List struct constructor function

func (*List) Changes

func (list *List) Changes() *Changes

Changes gets changes API scoped object

func (*List) Conf

func (list *List) Conf(config *RequestConfig) *List

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*List) ContentTypes

func (list *List) ContentTypes() *ContentTypes

ContentTypes gets list's Content Types API instance queryable collection

func (*List) ContextInfo

func (list *List) ContextInfo() (*ContextInfo, error)

ContextInfo gets context info for a web of current list

func (*List) Delete

func (list *List) Delete() error

Delete deletes a list (can't be restored from a recycle bin)

func (*List) Expand

func (list *List) Expand(oDataExpand string) *List

Expand adds $expand OData modifier

func (*List) Fields

func (list *List) Fields() *Fields

Fields gets list's Fields API instance queryable collection

func (*List) Get

func (list *List) Get() (ListResp, error)

Get gets list's data object

func (*List) GetEntityType

func (list *List) GetEntityType() (string, error)

GetEntityType gets list's ListItemEntityTypeFullName

func (*List) Items

func (list *List) Items() *Items

Items gets Items API instance queryable collection

func (*List) ParentWeb

func (list *List) ParentWeb() *Web

ParentWeb gets list's Parent Web API instance object

func (*List) Recycle

func (list *List) Recycle() error

Recycle moves this list to the recycle bin

func (*List) RenderListData

func (list *List) RenderListData(viewXML string) (RenderListDataResp, error)

RenderListData renders lists content using CAML

func (*List) ReserveListItemID

func (list *List) ReserveListItemID() (int, error)

ReserveListItemID reserves item's ID in this list

func (*List) Roles

func (list *List) Roles() *Roles

Roles gets list's Roles API instance queryable collection

func (*List) RootFolder

func (list *List) RootFolder() *Folder

RootFolder gets list's root folder object

func (*List) Select

func (list *List) Select(oDataSelect string) *List

Select adds $select OData modifier

func (*List) Subscriptions

func (list *List) Subscriptions() *Subscriptions

Subscriptions gets list's subscriptions API instance queryable collection

func (*List) ToURL

func (list *List) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*List) Update

func (list *List) Update(body []byte) (ListResp, error)

Update updates List's metadata with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.List object

func (*List) Views

func (list *List) Views() *Views

Views gets list's Views API instance queryable collection

type ListInfo

type ListInfo struct {
	ID                               string       `json:"Id"`
	Title                            string       `json:"Title"`
	AllowContentTypes                bool         `json:"AllowContentTypes"`
	BaseTemplate                     int          `json:"BaseTemplate"`
	BaseType                         int          `json:"BaseType"`
	ContentTypesEnabled              bool         `json:"ContentTypesEnabled"`
	CrawlNonDefaultViews             bool         `json:"CrawlNonDefaultViews"`
	Created                          time.Time    `json:"Created"`
	DefaultContentApprovalWorkflowID string       `json:"DefaultContentApprovalWorkflowId"`
	DefaultItemOpenUseListSetting    bool         `json:"DefaultItemOpenUseListSetting"`
	Description                      string       `json:"Description"`
	Direction                        string       `json:"Direction"`
	DisableGridEditing               bool         `json:"DisableGridEditing"`
	DocumentTemplateURL              string       `json:"DocumentTemplateUrl"`
	DraftVersionVisibility           int          `json:"DraftVersionVisibility"`
	EnableAttachments                bool         `json:"EnableAttachments"`
	EnableFolderCreation             bool         `json:"EnableFolderCreation"`
	EnableMinorVersions              bool         `json:"EnableMinorVersions"`
	EnableModeration                 bool         `json:"EnableModeration"`
	EnableRequestSignOff             bool         `json:"EnableRequestSignOff"`
	EnableVersioning                 bool         `json:"EnableVersioning"`
	EntityTypeName                   string       `json:"EntityTypeName"`
	FileSavePostProcessingEnabled    bool         `json:"FileSavePostProcessingEnabled"`
	ForceCheckout                    bool         `json:"ForceCheckout"`
	HasExternalDataSource            bool         `json:"HasExternalDataSource"`
	Hidden                           bool         `json:"Hidden"`
	ImageURL                         string       `json:"ImageUrl"`
	IrmEnabled                       bool         `json:"IrmEnabled"`
	IrmExpire                        bool         `json:"IrmExpire"`
	IrmReject                        bool         `json:"IrmReject"`
	IsApplicationList                bool         `json:"IsApplicationList"`
	IsCatalog                        bool         `json:"IsCatalog"`
	IsPrivate                        bool         `json:"IsPrivate"`
	ItemCount                        int          `json:"ItemCount"`
	LastItemDeletedDate              time.Time    `json:"LastItemDeletedDate"`
	LastItemModifiedDate             time.Time    `json:"LastItemModifiedDate"`
	LastItemUserModifiedDate         time.Time    `json:"LastItemUserModifiedDate"`
	ListExperienceOptions            int          `json:"ListExperienceOptions"`
	ListItemEntityTypeFullName       string       `json:"ListItemEntityTypeFullName"`
	MajorVersionLimit                int          `json:"MajorVersionLimit"`
	MajorWithMinorVersionsLimit      int          `json:"MajorWithMinorVersionsLimit"`
	MultipleDataList                 bool         `json:"MultipleDataList"`
	NoCrawl                          bool         `json:"NoCrawl"`
	ParentWebURL                     string       `json:"ParentWebUrl"`
	ParserDisabled                   bool         `json:"ParserDisabled"`
	ServerTemplateCanCreateFolders   bool         `json:"ServerTemplateCanCreateFolders"`
	TemplateFeatureID                string       `json:"TemplateFeatureId"`
	ParentWebPath                    *DecodedURL  `json:"ParentWebPath"`
	ImagePath                        *DecodedURL  `json:"ImagePath"`
	CurrentChangeToken               *StringValue `json:"CurrentChangeToken"`
}

ListInfo - list instance response payload structure

type ListItemAllFieldsResp

type ListItemAllFieldsResp []byte

ListItemAllFieldsResp - item fields response type with helper processor methods

type ListResp

type ListResp []byte

ListResp - list response type with helper processor methods

func (*ListResp) Data

func (listResp *ListResp) Data() *ListInfo

Data : to get typed data

func (*ListResp) Normalized

func (listResp *ListResp) Normalized() []byte

Normalized returns normalized body

type Lists

type Lists struct {
	// contains filtered or unexported fields
}

Lists represent SharePoint Lists API queryable collection struct Always use NewLists constructor instead of &Lists{}

func NewLists

func NewLists(client *gosip.SPClient, endpoint string, config *RequestConfig) *Lists

NewLists - Lists struct constructor function

func (*Lists) Add

func (lists *Lists) Add(title string, metadata map[string]interface{}) (ListResp, error)

Add creates new list on this web with a provided `title`. Along with title additional metadata can be provided in optional `metadata` string map object. `metadata` props should correspond to `SP.List` API type. Some props have defaults as BaseTemplate (100), AllowContentTypes (false), etc.

func (*Lists) AddWithURI

func (lists *Lists) AddWithURI(title string, uri string, metadata map[string]interface{}) ([]byte, error)

AddWithURI creates new list on this web with a provided `title` and `uri`. `url` stands for a system friendly URI (e.g. `custom-list`) while `title` is a human friendly name (e.g. `Custom List`). Along with uri and title additional metadata can be provided in optional `metadata` string map object. `metadata` props should correspond to `SP.List` API type. Some props have defaults as BaseTemplate (100), AllowContentTypes (false), etc.

func (*Lists) Conf

func (lists *Lists) Conf(config *RequestConfig) *Lists

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Lists) Expand

func (lists *Lists) Expand(oDataExpand string) *Lists

Expand adds $expand OData modifier

func (*Lists) Filter

func (lists *Lists) Filter(oDataFilter string) *Lists

Filter adds $filter OData modifier

func (*Lists) Get

func (lists *Lists) Get() (ListsResp, error)

Get gets Lists API queryable collection

func (*Lists) GetByID

func (lists *Lists) GetByID(listGUID string) *List

GetByID gets a list by its ID (GUID)

func (*Lists) GetByTitle

func (lists *Lists) GetByTitle(listTitle string) *List

GetByTitle gets a list by its Display Name (Title)

func (*Lists) OrderBy

func (lists *Lists) OrderBy(oDataOrderBy string, ascending bool) *Lists

OrderBy adds $orderby OData modifier

func (*Lists) Select

func (lists *Lists) Select(oDataSelect string) *Lists

Select adds $select OData modifier

func (*Lists) ToURL

func (lists *Lists) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Lists) Top

func (lists *Lists) Top(oDataTop int) *Lists

Top adds $top OData modifier

type ListsResp

type ListsResp []byte

ListsResp - lists response type with helper processor methods

func (*ListsResp) Data

func (listsResp *ListsResp) Data() []ListResp

Data response helper

func (*ListsResp) Normalized

func (listsResp *ListsResp) Normalized() []byte

Normalized returns normalized body

type ODataMods

type ODataMods struct {
	// contains filtered or unexported fields
}

ODataMods - REST OData Modifiers struct

func NewODataMods

func NewODataMods() *ODataMods

NewODataMods - ODataMods constructor function

func (*ODataMods) AddExpand

func (oData *ODataMods) AddExpand(values string) *ODataMods

AddExpand adds $expand OData modifier

func (*ODataMods) AddFilter

func (oData *ODataMods) AddFilter(values string) *ODataMods

AddFilter adds $filter OData modifier

func (*ODataMods) AddOrderBy

func (oData *ODataMods) AddOrderBy(orderBy string, ascending bool) *ODataMods

AddOrderBy adds $orderby OData modifier

func (*ODataMods) AddSelect

func (oData *ODataMods) AddSelect(values string) *ODataMods

AddSelect adds $select OData modifier

func (*ODataMods) AddSkip

func (oData *ODataMods) AddSkip(value string) *ODataMods

AddSkip adds $skiptoken OData modifier

func (*ODataMods) AddTop

func (oData *ODataMods) AddTop(value int) *ODataMods

AddTop adds $top OData modifier

func (*ODataMods) Get

func (oData *ODataMods) Get() map[string]string

Get retrieves OData modifiers map

type ProfileInfo

type ProfileInfo struct {
	AccountName                     string `json:"AccountName"`
	DisplayName                     string `json:"DisplayName"`
	FollowPersonalSiteURL           string `json:"FollowPersonalSiteUrl"`
	IsDefaultDocumentLibraryBlocked bool   `json:"IsDefaultDocumentLibraryBlocked"`
	IsPeopleListPublic              bool   `json:"IsPeopleListPublic"`
	IsPrivacySettingOn              bool   `json:"IsPrivacySettingOn"`
	IsSelf                          bool   `json:"IsSelf"`
	JobTitle                        string `json:"JobTitle"`
	MySiteFirstRunExperience        int    `json:"MySiteFirstRunExperience"`
	MySiteHostURL                   string `json:"MySiteHostUrl"`
	O15FirstRunExperience           int    `json:"O15FirstRunExperience"`
	PersonalSiteCapabilities        int    `json:"PersonalSiteCapabilities"`
	PersonalSiteFirstCreationError  string `json:"PersonalSiteFirstCreationError"`
	PersonalSiteFirstCreationTime   string `json:"PersonalSiteFirstCreationTime"`
	PersonalSiteInstantiationState  int    `json:"PersonalSiteInstantiationState"`
	PersonalSiteLastCreationTime    string `json:"PersonalSiteLastCreationTime"`
	PersonalSiteNumberOfRetries     int    `json:"PersonalSiteNumberOfRetries"`
	PictureImportEnabled            bool   `json:"PictureImportEnabled"`
	PictureURL                      string `json:"PictureUrl"`
	PublicURL                       string `json:"PublicUrl"`
	SipAddress                      string `json:"SipAddress"`
	URLToCreatePersonalSite         string `json:"UrlToCreatePersonalSite"`
}

ProfileInfo - user profile API response payload structure

type ProfilePropsInto

type ProfilePropsInto struct {
	AccountName           string           `json:"AccountName"`
	DirectReports         []string         `json:"DirectReports"`
	DisplayName           string           `json:"DisplayName"`
	Email                 string           `json:"Email"`
	ExtendedManagers      []string         `json:"ExtendedManagers"`
	ExtendedReports       []string         `json:"ExtendedReports"`
	Peers                 []string         `json:"Peers"`
	IsFollowed            bool             `json:"IsFollowed"`
	PersonalSiteHostURL   string           `json:"PersonalSiteHostUrl"`
	PersonalURL           string           `json:"PersonalUrl"`
	PictureURL            string           `json:"PictureUrl"`
	Title                 string           `json:"Title"`
	UserURL               string           `json:"UserUrl"`
	UserProfileProperties []*TypedKeyValue `json:"UserProfileProperties"`
}

ProfilePropsInto ...

type ProfilePropsResp

type ProfilePropsResp []byte

ProfilePropsResp - user profile props response type with helper processor methods

func (*ProfilePropsResp) Data

func (profilePropsResp *ProfilePropsResp) Data() *ProfilePropsInto

Data : to get typed data

func (*ProfilePropsResp) Normalized

func (profilePropsResp *ProfilePropsResp) Normalized() []byte

Normalized returns normalized body

type ProfileResp

type ProfileResp []byte

ProfileResp - user profile response type with helper processor methods

func (*ProfileResp) Data

func (profileResp *ProfileResp) Data() *ProfileInfo

Data : to get typed data

func (*ProfileResp) Normalized

func (profileResp *ProfileResp) Normalized() []byte

Normalized returns normalized body

type Profiles

type Profiles struct {
	// contains filtered or unexported fields
}

Profiles represent SharePoint User Profiles API queryable collection struct Always use NewProfiles constructor instead of &Profiles{}

func NewProfiles

func NewProfiles(client *gosip.SPClient, endpoint string, config *RequestConfig) *Profiles

NewProfiles - Profiles struct constructor function

func (*Profiles) Conf

func (profiles *Profiles) Conf(config *RequestConfig) *Profiles

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Profiles) GetMyProperties

func (profiles *Profiles) GetMyProperties() (ProfilePropsResp, error)

GetMyProperties gets current context user profile properties

func (*Profiles) GetOwnerUserProfile

func (profiles *Profiles) GetOwnerUserProfile() (ProfileResp, error)

GetOwnerUserProfile gets owner's user profile

func (*Profiles) GetPropertiesFor

func (profiles *Profiles) GetPropertiesFor(loginName string) (ProfilePropsResp, error)

GetPropertiesFor gets properties of a specified user profile (by user login name)

func (*Profiles) GetUserProfilePropertyFor

func (profiles *Profiles) GetUserProfilePropertyFor(loginName string, property string) (string, error)

GetUserProfilePropertyFor gets specific property of a specified user profile (by user login name)

func (*Profiles) HideSuggestion

func (profiles *Profiles) HideSuggestion(loginName string) ([]byte, error)

HideSuggestion removes the specified user from the user's list of suggested people to follow

func (*Profiles) SetMultiValuedProfileProperty

func (profiles *Profiles) SetMultiValuedProfileProperty(loginName string, property string, values []string) error

SetMultiValuedProfileProperty sets a multi value property for the profile by its email

func (*Profiles) SetSingleValueProfileProperty

func (profiles *Profiles) SetSingleValueProfileProperty(loginName string, property string, value string) error

SetSingleValueProfileProperty sets a single value property for the profile by its email

func (*Profiles) UserProfile

func (profiles *Profiles) UserProfile() (ProfileResp, error)

UserProfile gets current context user profile object

type Properties

type Properties struct {
	// contains filtered or unexported fields
}

Properties represent SharePoint Property Bags API queryable collection struct Always use NewProperties constructor instead of &Properties{}

func NewProperties

func NewProperties(client *gosip.SPClient, endpoint string, config *RequestConfig, entity string) *Properties

NewProperties - Properties struct constructor function

func (*Properties) Conf

func (properties *Properties) Conf(config *RequestConfig) *Properties

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Properties) Expand

func (properties *Properties) Expand(oDataExpand string) *Properties

Expand adds $expand OData modifier

func (*Properties) Get

func (properties *Properties) Get() (PropsResp, error)

Get gets properties collection

func (*Properties) GetProps

func (properties *Properties) GetProps(props []string) (map[string]string, error)

GetProps gets specific props values

func (*Properties) Select

func (properties *Properties) Select(oDataSelect string) *Properties

Select adds $select OData modifier

func (*Properties) Set

func (properties *Properties) Set(prop string, value string) error

Set sets a single property (CSOM helper)

func (*Properties) SetProps

func (properties *Properties) SetProps(props map[string]string) error

SetProps sets multiple properties defined in string map object (CSOM helper)

func (*Properties) ToURL

func (properties *Properties) ToURL() string

ToURL gets endpoint with modificators raw URL

type PropsResp

type PropsResp []byte

PropsResp - property bags response type with helper processor methods

func (*PropsResp) Data

func (propsResp *PropsResp) Data() map[string]string

Data : to get typed data

func (*PropsResp) Normalized

func (propsResp *PropsResp) Normalized() []byte

Normalized returns normalized body

type Records

type Records struct {
	// contains filtered or unexported fields
}

Records represents SharePoint Item Records via REST+CSOM API object struct Always use NewRecords constructor instead of &Records{}

func NewRecords

func NewRecords(item *Item) *Records

NewRecords - Records struct constructor function

func (*Records) Declare

func (records *Records) Declare() error

Declare declares this item as a record (CSOM helper)

func (*Records) DeclareWithDate

func (records *Records) DeclareWithDate(date time.Time) error

DeclareWithDate declares this item as a record with record declaration date (CSOM helper)

func (*Records) IsRecord

func (records *Records) IsRecord() (bool, error)

IsRecord checks is current item is declared as a record

func (*Records) RecordDate

func (records *Records) RecordDate() (time.Time, error)

RecordDate checks record declaration date of this item

func (*Records) Undeclare

func (records *Records) Undeclare() error

Undeclare undeclared this item as a record (the item is not a record after an action is done) (CSOM helper)

type RecycleBin

type RecycleBin struct {
	// contains filtered or unexported fields
}

RecycleBin represents SharePoint Recycle Bin API queryable collection struct Always use NewRecycleBin constructor instead of &RecycleBin{}

func NewRecycleBin

func NewRecycleBin(client *gosip.SPClient, endpoint string, config *RequestConfig) *RecycleBin

NewRecycleBin - RecycleBin struct constructor function

func (*RecycleBin) Conf

func (recycleBin *RecycleBin) Conf(config *RequestConfig) *RecycleBin

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*RecycleBin) Expand

func (recycleBin *RecycleBin) Expand(oDataExpand string) *RecycleBin

Expand adds $expand OData modifier

func (*RecycleBin) Filter

func (recycleBin *RecycleBin) Filter(oDataFilter string) *RecycleBin

Filter adds $filter OData modifier

func (*RecycleBin) Get

func (recycleBin *RecycleBin) Get() (RecycleBinResp, error)

Get gets recycled items queryable collection

func (*RecycleBin) GetByID

func (recycleBin *RecycleBin) GetByID(itemID string) *RecycleBinItem

GetByID gets a recycled item by its ID

func (*RecycleBin) OrderBy

func (recycleBin *RecycleBin) OrderBy(oDataOrderBy string, ascending bool) *RecycleBin

OrderBy adds $orderby OData modifier

func (*RecycleBin) Select

func (recycleBin *RecycleBin) Select(oDataSelect string) *RecycleBin

Select adds $select OData modifier

func (*RecycleBin) ToURL

func (recycleBin *RecycleBin) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*RecycleBin) Top

func (recycleBin *RecycleBin) Top(oDataTop int) *RecycleBin

Top adds $top OData modifier

type RecycleBinItem

type RecycleBinItem struct {
	// contains filtered or unexported fields
}

RecycleBinItem represent SharePoint Recycle Bin Item API queryable object struct Always use NewRecycleBinItem constructor instead of &RecycleBinItem{}

func NewRecycleBinItem

func NewRecycleBinItem(client *gosip.SPClient, endpoint string, config *RequestConfig) *RecycleBinItem

NewRecycleBinItem - RecycleBinItem struct constructor function

func (*RecycleBinItem) Get

func (recycleBinItem *RecycleBinItem) Get() (RecycleBinItemResp, error)

Get gets this recycle item data object

func (*RecycleBinItem) Restore

func (recycleBinItem *RecycleBinItem) Restore() error

Restore restores this recycled item

type RecycleBinItemInfo

type RecycleBinItemInfo struct {
	AuthorEmail               string      `json:"AuthorEmail"`
	AuthorName                string      `json:"AuthorName"`
	DeletedByEmail            string      `json:"DeletedByEmail"`
	DeletedByName             string      `json:"DeletedByName"`
	DeletedDate               time.Time   `json:"DeletedDate"`
	DeletedDateLocalFormatted string      `json:"DeletedDateLocalFormatted"`
	DirName                   string      `json:"DirName"`
	ID                        string      `json:"Id"`
	ItemState                 int         `json:"ItemState"`
	ItemType                  int         `json:"ItemType"`
	LeafName                  string      `json:"LeafName"`
	Size                      int         `json:"Size"`
	Title                     string      `json:"Title"`
	LeafNamePath              *DecodedURL `json:"LeafNamePath"`
	DirNamePath               *DecodedURL `json:"DirNamePath"`
}

RecycleBinItemInfo ...

type RecycleBinItemResp

type RecycleBinItemResp []byte

RecycleBinItemResp - recycle bin item response type with helper processor methods

func (*RecycleBinItemResp) Data

func (recycleBinItemResp *RecycleBinItemResp) Data() *RecycleBinItemInfo

Data response helper

func (*RecycleBinItemResp) Normalized

func (recycleBinItemResp *RecycleBinItemResp) Normalized() []byte

Normalized returns normalized body

type RecycleBinResp

type RecycleBinResp []byte

RecycleBinResp - recycle bin response type with helper processor methods

func (*RecycleBinResp) Data

func (recycleBinResp *RecycleBinResp) Data() []RecycleBinItemResp

Data response helper

func (*RecycleBinResp) Normalized

func (recycleBinResp *RecycleBinResp) Normalized() []byte

Normalized returns normalized body

type RenderListDataInfo

type RenderListDataInfo struct {
	Row                    []map[string]interface{} `json:"Row"`
	FirstRow               int                      `json:"FirstRow"`
	FolderPermissions      string                   `json:"FolderPermissions"`
	LastRow                int                      `json:"LastRow"`
	RowLimit               int                      `json:"RowLimit"`
	FilterLink             string                   `json:"FilterLink"`
	ForceNoHierarchy       string                   `json:"ForceNoHierarchy"`
	HierarchyHasIndention  string                   `json:"HierarchyHasIndention"`
	CurrentFolderSpItemURL string                   `json:"CurrentFolderSpItemUrl"`
}

RenderListDataInfo ...

type RenderListDataResp

type RenderListDataResp []byte

RenderListDataResp - renderListData method response type with helper processor methods

func (*RenderListDataResp) Data

func (listData *RenderListDataResp) Data() *RenderListDataInfo

Data : to get typed data

type RequestConfig

type RequestConfig struct {
	Headers map[string]string
	Context context.Context
}

RequestConfig struct

type ResultTable

type ResultTable struct {
	GroupTemplateID              string           `json:"GroupTemplateId"`
	ItemTemplateID               string           `json:"ItemTemplateId"`
	ResultTitle                  string           `json:"ResultTitle"`
	ResultTitleURL               string           `json:"ResultTitleUrl"`
	RowCount                     int              `json:"RowCount"`
	TableType                    string           `json:"TableType"`
	TotalRows                    int              `json:"TotalRows"`
	TotalRowsIncludingDuplicates int              `json:"TotalRowsIncludingDuplicates"`
	Properties                   []*TypedKeyValue `json:"Properties"`
	Table                        *struct {
		Rows []*struct {
			Cells []*TypedKeyValue `json:"Cells"`
		} `json:"Rows"`
	} `json:"Table"`
	Refiners []*struct {
		Name    string `json:"Name"`
		Entries []*struct {
			RefinementCount string `json:"RefinementCount"`
			RefinementName  string `json:"RefinementName"`
			RefinementToken string `json:"RefinementToken"`
			RefinementValue string `json:"RefinementValue"`
		} `json:"Entries"`
	} `json:"Refiners"`
}

ResultTable - search result table type

type ResultTableCollection

type ResultTableCollection struct {
	QueryErrors        map[string]interface{} `json:"QueryErrors"`
	QueryID            string                 `json:"QueryId"`
	QueryRuleID        string                 `json:"QueryRuleId"`
	CustomResults      *ResultTable           `json:"CustomResults"`
	RefinementResults  *ResultTable           `json:"RefinementResults"`
	RelevantResults    *ResultTable           `json:"RelevantResults"`
	SpecialTermResults *ResultTable           `json:"SpecialTermResults"`
}

ResultTableCollection - search results table collection type

type RoleAssigment

type RoleAssigment struct {
	Member *struct {
		LoginName     string
		PrincipalType int
	}
	RoleDefinitionBindings []*RoleDefInfo
}

RoleAssigment role assignments model

type RoleDefInfo

type RoleDefInfo struct {
	BasePermissions *BasePermissions `json:"BasePermissions"`
	Description     string           `json:"Description"`
	Hidden          bool             `json:"Hidden"`
	ID              int              `json:"Id"`
	Name            string           `json:"Name"`
	Order           int              `json:"Order"`
	RoleTypeKind    int              `json:"RoleTypeKind"`
}

RoleDefInfo - permissions role definition API response payload structure

type RoleDefinitions

type RoleDefinitions struct {
	// contains filtered or unexported fields
}

RoleDefinitions represents SharePoint permissions Role Definitions API queryable object struct Always use NewRoleDefinitions constructor instead of &RoleDefinitions{}

func NewRoleDefinitions

func NewRoleDefinitions(client *gosip.SPClient, endpoint string, config *RequestConfig) *RoleDefinitions

NewRoleDefinitions - RoleDefinitions struct constructor function

func (*RoleDefinitions) Get

func (def *RoleDefinitions) Get() ([]*RoleDefInfo, error)

Get gets a collection of available role definitions

func (*RoleDefinitions) GetByID

func (def *RoleDefinitions) GetByID(roleDefID int) (*RoleDefInfo, error)

GetByID gets a role definition by its ID

func (*RoleDefinitions) GetByName

func (def *RoleDefinitions) GetByName(roleDefName string) (*RoleDefInfo, error)

GetByName gets a role definition by its Name

func (*RoleDefinitions) GetByType

func (def *RoleDefinitions) GetByType(roleTypeKind int) (*RoleDefInfo, error)

GetByType gets a role definition by its RoleTypeKinds

type Roles

type Roles struct {
	// contains filtered or unexported fields
}

Roles represent SharePoint Permissions Roles API queryable collection struct Always use NewRoles constructor instead of &Roles{}

func NewRoles

func NewRoles(client *gosip.SPClient, endpoint string, config *RequestConfig) *Roles

NewRoles - Roles struct constructor function

func (*Roles) AddAssigment

func (permissions *Roles) AddAssigment(principalID int, roleDefID int) error

AddAssigment adds role assigment for this securable object. Relevant only for the objects after breaking inheritance. `principalID` - Principal ID - numeric ID from User information list - user or group ID `roleDefID` - Role definition ID, use RoleDefinitions API for getting roleDefID

func (*Roles) BreakInheritance

func (permissions *Roles) BreakInheritance(copyRoleAssignments bool, clearSubScopes bool) error

BreakInheritance breaks permissions inheritance for this securable object `copyRoleAssignments` - if true the permissions are copied from the current parent scope `clearSubScopes` - true to make all child securable objects inherit role assignments from the current object

func (*Roles) HasUniqueAssignments

func (permissions *Roles) HasUniqueAssignments() (bool, error)

HasUniqueAssignments checks is a securable object has unique permissions

func (*Roles) RemoveAssigment

func (permissions *Roles) RemoveAssigment(principalID int, roleDefID int) error

RemoveAssigment removes specified role assigment for a principal for this securable object. `principalID` - Principal ID - numeric ID from User information list - user or group ID `roleDefID` - Role definition ID, use RoleDefinitions API for getting roleDefID

func (*Roles) ResetInheritance

func (permissions *Roles) ResetInheritance() error

ResetInheritance resets permissions inheritance for this securable object

type SP

type SP struct {
	// contains filtered or unexported fields
}

SP represents SharePoint REST+ API root struct Always use NewSP constructor instead of &SP{}

func NewSP

func NewSP(client *gosip.SPClient) *SP

NewSP - SP struct constructor function

func (*SP) Conf

func (sp *SP) Conf(config *RequestConfig) *SP

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*SP) ContextInfo

func (sp *SP) ContextInfo() (*ContextInfo, error)

ContextInfo gets current Context Info object data

func (*SP) Metadata

func (sp *SP) Metadata() ([]byte, error)

Metadata returns $metadata info

func (*SP) Profiles

func (sp *SP) Profiles() *Profiles

Profiles getter

func (*SP) Search

func (sp *SP) Search() *Search

Search getter

func (*SP) Site

func (sp *SP) Site() *Site

Site API object getter

func (*SP) Taxonomy

func (sp *SP) Taxonomy() *Taxonomy

Taxonomy getter

func (*SP) ToURL

func (sp *SP) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*SP) Utility

func (sp *SP) Utility() *Utility

Utility getter

func (*SP) Web

func (sp *SP) Web() *Web

Web API object getter

type Search struct {
	// contains filtered or unexported fields
}

Search represents SharePoint Search API object struct Always use NewSearch constructor instead of &Search{}

func NewSearch

func NewSearch(client *gosip.SPClient, endpoint string, config *RequestConfig) *Search

NewSearch - Search struct constructor function

func (*Search) PostQuery

func (search *Search) PostQuery(query *SearchQuery) (SearchResp, error)

PostQuery gets search results based on a `query`

type SearchProperty

type SearchProperty struct {
	Name  string              `json:"Name"`
	Value SearchPropertyValue `json:"Value"`
}

SearchProperty - search property type

type SearchPropertyValue

type SearchPropertyValue struct {
	StrVal                      string   `json:"StrVal"`
	BoolVal                     bool     `json:"BoolVal"`
	IntVal                      int      `json:"IntVal"`
	StrArray                    []string `json:"StrArray"`
	QueryPropertyValueTypeIndex int      `json:"QueryPropertyValueTypeIndex"` // None = 0, StringType = 1, Int32Type = 2, BooleanType = 3, StringArrayType = 4, UnSupportedType = 5
}

SearchPropertyValue - search property value type

type SearchQuery

type SearchQuery struct {
	QueryText                             string                  `json:"Querytext"`                             // A string that contains the text for the search query
	QueryTemplate                         string                  `json:"QueryTemplate"`                         // A string that contains the text that replaces the query text, as part of a query transform
	EnableInterleaving                    bool                    `json:"EnableInterleaving"`                    // A Boolean value that specifies whether the result tables that are returned for the result block are mixed with the result tables that are returned for the original query
	EnableStemming                        bool                    `json:"EnableStemming"`                        // A Boolean value that specifies whether stemming is enabled
	TrimDuplicates                        bool                    `json:"TrimDuplicates"`                        // A Boolean value that specifies whether duplicate items are removed from the results
	EnableNicknames                       bool                    `json:"EnableNicknames"`                       // A Boolean value that specifies whether the exact terms in the search query are used to find matches, or if nicknames are used also
	EnableFQL                             bool                    `json:"EnableFQL"`                             // A Boolean value that specifies whether the query uses the FAST Query Language (FQL)
	EnablePhonetic                        bool                    `json:"EnablePhonetic"`                        // A Boolean value that specifies whether the phonetic forms of the query terms are used to find matches
	BypassResultTypes                     bool                    `json:"BypassResultTypes"`                     // A Boolean value that specifies whether to perform result type processing for the query
	ProcessBestBets                       bool                    `json:"ProcessBestBets"`                       // A Boolean value that specifies whether to return best bet results for the query. This parameter is used only when EnableQueryRules is set to true, otherwise it is ignored.
	EnableQueryRules                      bool                    `json:"EnableQueryRules"`                      // A Boolean value that specifies whether to enable query rules for the query
	EnableSorting                         bool                    `json:"EnableSorting"`                         // A Boolean value that specifies whether to sort search results
	GenerateBlockRankLog                  bool                    `json:"GenerateBlockRankLog"`                  // Specifies whether to return block rank log information in the BlockRankLog property of the interleaved result table. A block rank log contains the textual information on the block score and the documents that were de-duplicated.
	SourceID                              string                  `json:"SourceId"`                              // The result source ID to use for executing the search query
	RankingModelID                        string                  `json:"RankingModelId"`                        // The ID of the ranking model to use for the query
	StartRow                              int                     `json:"StartRow"`                              // The first row that is included in the search results that are returned. You use this parameter when you want to implement paging for search results.
	RowLimit                              int                     `json:"RowLimit"`                              // The maximum number of rows overall that are returned in the search results. Compared to RowsPerPage, RowLimit is the maximum number of rows returned overall.
	RowsPerPage                           int                     `json:"RowsPerPage"`                           // The maximum number of rows to return per page. Compared to RowLimit, RowsPerPage refers to the maximum number of rows to return per page, and is used primarily when you want to implement paging for search results.
	SelectProperties                      []string                `json:"SelectProperties"`                      // The managed properties to return in the search results
	Culture                               int                     `json:"Culture"`                               // The locale ID (LCID) for the query
	RefinementFilters                     []string                `json:"RefinementFilters"`                     // The set of refinement filters used when issuing a refinement query (FQL)
	Refiners                              string                  `json:"Refiners"`                              // The set of refiners to return in a search result
	HiddenConstraints                     string                  `json:"HiddenConstraints"`                     // The additional query terms to append to the query
	Timeout                               int                     `json:"Timeout"`                               // The amount of time in milliseconds before the query request times out
	HitHighlightedProperties              []string                `json:"HitHighlightedProperties"`              // The properties to highlight in the search result summary when the property value matches the search terms entered by the user
	ClientType                            string                  `json:"ClientType"`                            // The type of the client that issued the query
	PersonalizationData                   string                  `json:"PersonalizationData"`                   // The GUID for the user who submitted the search query
	ResultsURL                            string                  `json:"ResultsUrl"`                            // The URL for the search results page
	QueryTag                              string                  `json:"QueryTag"`                              // Custom tags that identify the query. You can specify multiple query tags
	ProcessPersonalFavorites              bool                    `json:"ProcessPersonalFavorites"`              // A Boolean value that specifies whether to return personal favorites with the search results
	QueryTemplatePropertiesURL            string                  `json:"QueryTemplatePropertiesUrl"`            // The location of the queryparametertemplate.xml file. This file is used to enable anonymous users to make Search REST queries
	HitHighlightedMultivaluePropertyLimit int                     `json:"HitHighlightedMultivaluePropertyLimit"` // The number of properties to show hit highlighting for in the search results
	EnableOrderingHitHighlightedProperty  bool                    `json:"EnableOrderingHitHighlightedProperty"`  // A Boolean value that specifies whether the hit highlighted properties can be ordered
	CollapseSpecification                 string                  `json:"CollapseSpecification"`                 // The managed properties that are used to determine how to collapse individual search results. Results are collapsed into one or a specified number of results if they match any of the individual collapse specifications. In a collapse specification, results are collapsed if their properties match all individual properties in the collapse specification.
	UIlanguage                            int                     `json:"UIlanguage"`                            // The locale identifier (LCID) of the user interface
	DesiredSnippetLength                  int                     `json:"DesiredSnippetLength"`                  // The preferred number of characters to display in the hit-highlighted summary generated for a search result
	MaxSnippetLength                      int                     `json:"MaxSnippetLength"`                      // The maximum number of characters to display in the hit-highlighted summary generated for a search result
	SummaryLength                         int                     `json:"SummaryLength"`                         // The number of characters to display in the result summary for a search result
	SortList                              []*SearchSort           `json:"SortList"`                              // The list of properties by which the search results are ordered
	Properties                            []*SearchProperty       `json:"Properties"`                            // Properties to be used to configure the search query
	ReorderingRules                       []*SearchReorderingRule `json:"ReorderingRules"`                       // Special rules for reordering search results. These rules can specify that documents matching certain conditions are ranked higher or lower in the results. This property applies only when search results are sorted based on rank.
}

SearchQuery - strongly typed struct for search method parameters

type SearchReorderingRule

type SearchReorderingRule struct {
	MatchValue string `json:"MatchValue"`
	Boost      int    `json:"Boost"`
	MatchType  int    `json:"MatchType"` // ResultContainsKeyword = 0, TitleContainsKeyword = 1, TitleMatchesKeyword = 2, UrlStartsWith = 3, UrlExactlyMatches = 4, ContentTypeIs = 5, FileExtensionMatches = 6, ResultHasTag = 7, ManualCondition = 8
}

SearchReorderingRule - search reordering rule type

type SearchResp

type SearchResp []byte

SearchResp - search response type with helper processor methods

func (*SearchResp) Data

func (searchResp *SearchResp) Data() *SearchResults

Data : to get typed data

func (*SearchResp) Normalized

func (searchResp *SearchResp) Normalized() []byte

Normalized returns normalized body

func (*SearchResp) Results

func (searchResp *SearchResp) Results() []map[string]string

Results : to get typed data

type SearchResults

type SearchResults struct {
	ElapsedTime           int                      `json:"ElapsedTime"`
	PrimaryQueryResult    *ResultTableCollection   `json:"PrimaryQueryResult"`
	Properties            []*TypedKeyValue         `json:"Properties"`
	SecondaryQueryResults []*ResultTableCollection `json:"SecondaryQueryResults"`
	SpellingSuggestion    string                   `json:"SpellingSuggestion"`
	TriggeredRules        []interface{}            `json:"TriggeredRules"`
}

SearchResults - search results response type

type SearchSort

type SearchSort struct {
	Property  string `json:"Property"`
	Direction int    `json:"Direction"` // Ascending = 0, Descending = 1, FQLFormula = 2
}

SearchSort - search sort property type

type Site

type Site struct {
	// contains filtered or unexported fields
}

Site represents SharePoint Site API queryable object struct Always use NewSite constructor instead of &Site{}

func NewSite

func NewSite(client *gosip.SPClient, endpoint string, config *RequestConfig) *Site

NewSite - Site struct constructor function

func (*Site) Changes

func (site *Site) Changes() *Changes

Changes gets changes API scoped object

func (*Site) Conf

func (site *Site) Conf(config *RequestConfig) *Site

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Site) CustomActions

func (site *Site) CustomActions() *CustomActions

CustomActions gets CustomActions API scoped object

func (*Site) Delete

func (site *Site) Delete() error

Delete deletes current site (can't be restored from a recycle bin)

func (*Site) EventReceivers

func (site *Site) EventReceivers() *EventReceivers

EventReceivers gets EventReceivers API scoped object

func (*Site) Expand

func (site *Site) Expand(oDataExpand string) *Site

Expand adds $expand OData modifier

func (*Site) Features

func (site *Site) Features() *Features

Features gets Features API instance queryable collection for this Site

func (*Site) FromURL

func (site *Site) FromURL(url string) *Site

FromURL gets Site object using its API URL

func (*Site) Get

func (site *Site) Get() (SiteResp, error)

Get gets this Site data object

func (*Site) OpenWebByID

func (site *Site) OpenWebByID(webID string) (WebResp, error)

OpenWebByID gets a Web data object by its ID (GUID)

func (*Site) Owner

func (site *Site) Owner() *User

Owner gets site's owner user

func (*Site) RecycleBin

func (site *Site) RecycleBin() *RecycleBin

RecycleBin gets RecycleBin API instance object for this Site

func (*Site) RootWeb

func (site *Site) RootWeb() *Web

RootWeb gets Site's root web queryable API object

func (*Site) Select

func (site *Site) Select(oDataSelect string) *Site

Select adds $select OData modifier

func (*Site) ToURL

func (site *Site) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Site) Update

func (site *Site) Update(body []byte) (SiteResp, error)

Update updates Site's metadata with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.Site object

func (*Site) WebByID

func (site *Site) WebByID(webID string) (*Web, error)

WebByID gets a Web API object by its ID (GUID)

type SiteInfo

type SiteInfo struct {
	AllowCreateDeclarativeWorkflow         bool         `json:"AllowCreateDeclarativeWorkflow"`
	AllowDesigner                          bool         `json:"AllowDesigner"`
	AllowMasterPageEditing                 bool         `json:"AllowMasterPageEditing"`
	AllowRevertFromTemplate                bool         `json:"AllowRevertFromTemplate"`
	AllowSaveDeclarativeWorkflowAsTemplate bool         `json:"AllowSaveDeclarativeWorkflowAsTemplate"`
	AllowSavePublishDeclarativeWorkflow    bool         `json:"AllowSavePublishDeclarativeWorkflow"`
	AllowSelfServiceUpgrade                bool         `json:"AllowSelfServiceUpgrade"`
	AllowSelfServiceUpgradeEvaluation      bool         `json:"AllowSelfServiceUpgradeEvaluation"`
	AuditLogTrimmingRetention              int          `json:"AuditLogTrimmingRetention"`
	CompatibilityLevel                     int          `json:"CompatibilityLevel"`
	CurrentChangeToken                     *StringValue `json:"CurrentChangeToken"`
	DisableAppViews                        bool         `json:"DisableAppViews"`
	DisableCompanyWideSharingLinks         bool         `json:"DisableCompanyWideSharingLinks"`
	DisableFlows                           bool         `json:"DisableFlows"`
	ExternalSharingTipsEnabled             bool         `json:"ExternalSharingTipsEnabled"`
	GeoLocation                            string       `json:"GeoLocation"`
	GroupID                                string       `json:"GroupId"`
	HubSiteID                              string       `json:"HubSiteId"`
	ID                                     string       `json:"Id"`
	IsHubSite                              bool         `json:"IsHubSite"`
	MaxItemsPerThrottledOperation          int          `json:"MaxItemsPerThrottledOperation"`
	NeedsB2BUpgrade                        bool         `json:"NeedsB2BUpgrade"`
	PrimaryURI                             string       `json:"PrimaryUri"`
	ReadOnly                               bool         `json:"ReadOnly"`
	RequiredDesignerVersion                string       `json:"RequiredDesignerVersion"`
	ResourcePath                           *DecodedURL  `json:"ResourcePath"`
	SandboxedCodeActivationCapability      int          `json:"SandboxedCodeActivationCapability"`
	SensitivityLabel                       string       `json:"SensitivityLabel"`
	SensitivityLabelID                     string       `json:"SensitivityLabelId"`
	ServerRelativeURL                      string       `json:"ServerRelativeUrl"`
	ShareByEmailEnabled                    bool         `json:"ShareByEmailEnabled"`
	ShareByLinkEnabled                     bool         `json:"ShareByLinkEnabled"`
	ShowURLStructure                       bool         `json:"ShowUrlStructure"`
	TrimAuditLog                           bool         `json:"TrimAuditLog"`
	UIVersionConfigurationEnabled          bool         `json:"UIVersionConfigurationEnabled"`
	UpgradeReminderDate                    string       `json:"UpgradeReminderDate"` // time.Time
	UpgradeScheduled                       bool         `json:"UpgradeScheduled"`
	UpgradeScheduledDate                   string       `json:"UpgradeScheduledDate"` // time.Time
	Upgrading                              bool         `json:"Upgrading"`
	URL                                    string       `json:"Url"`
}

SiteInfo - site API response payload structure

type SiteResp

type SiteResp []byte

SiteResp - site response type with helper processor methods

func (*SiteResp) Data

func (siteResp *SiteResp) Data() *SiteInfo

Data response helper

func (*SiteResp) Normalized

func (siteResp *SiteResp) Normalized() []byte

Normalized returns normalized body

type StringValue

type StringValue struct {
	StringValue string `json:"StringValue"`
}

StringValue single value prop type

type Subscription

type Subscription struct {
	// contains filtered or unexported fields
}

Subscription represent SharePoint lists Subscription API Always use NewSubscription constructor instead of &Subscription{}

func NewSubscription

func NewSubscription(client *gosip.SPClient, endpoint string, config *RequestConfig) *Subscription

NewSubscription - subscription struct constructor function

func (*Subscription) Conf

func (subscription *Subscription) Conf(config *RequestConfig) *Subscription

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Subscription) Delete

func (subscription *Subscription) Delete() error

Delete deletes a subscription by its ID (GUID)

func (*Subscription) Get

func (subscription *Subscription) Get() (*SubscriptionInfo, error)

Get gets subscription info

func (*Subscription) SetClientState

func (subscription *Subscription) SetClientState(clientState string) (*SubscriptionInfo, error)

SetClientState sets new client state

func (*Subscription) SetExpiration

func (subscription *Subscription) SetExpiration(expiration time.Time) (*SubscriptionInfo, error)

SetExpiration sets new expiration datetime

func (*Subscription) SetNotificationURL

func (subscription *Subscription) SetNotificationURL(notificationURL string) (*SubscriptionInfo, error)

SetNotificationURL sets new notification URL state

func (*Subscription) Update

func (subscription *Subscription) Update(metadata map[string]interface{}) (*SubscriptionInfo, error)

Update updates a subscription

type SubscriptionInfo

type SubscriptionInfo struct {
	ID string `json:"id"`
	// The service URL to send notifications to
	NotificationURL string `json:"notificationUrl"`
	// The date the notification will expire and be deleted
	ExpirationDateTime time.Time `json:"expirationDateTime"`
	// The URL of the list to receive notifications from
	Resource string `json:"resource"`
	// Optional. Opaque string passed back to the client on all notifications.
	// You can use this for validating notifications or tagging different subscriptions.
	ClientState  string `json:"clientState"`
	ResourceData string `json:"resourceData"`
}

SubscriptionInfo list subscription info

type Subscriptions

type Subscriptions struct {
	// contains filtered or unexported fields
}

Subscriptions represent SharePoint lists Subscriptions API queryable collection struct Always use NewSubscriptions constructor instead of &Subscriptions{}

func NewSubscriptions

func NewSubscriptions(client *gosip.SPClient, endpoint string, config *RequestConfig) *Subscriptions

NewSubscriptions - Subscriptions struct constructor function

func (*Subscriptions) Add

func (subscriptions *Subscriptions) Add(notificationURL string, expiration time.Time, clientState string) (*SubscriptionInfo, error)

Add adds/updates new subscription to a list

func (*Subscriptions) Conf

func (subscriptions *Subscriptions) Conf(config *RequestConfig) *Subscriptions

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Subscriptions) Get

func (subscriptions *Subscriptions) Get() ([]*SubscriptionInfo, error)

Get gets list subscriptions response collection

func (*Subscriptions) GetByID

func (subscriptions *Subscriptions) GetByID(subscriptionID string) *Subscription

GetByID gets list subscription by its ID (GUID)

type Taxonomy

type Taxonomy struct {
	// contains filtered or unexported fields
}

Taxonomy session struct

func NewTaxonomy

func NewTaxonomy(client *gosip.SPClient, siteURL string, config *RequestConfig) *Taxonomy

NewTaxonomy - taxonomy struct constructor function

func (*Taxonomy) Stores

func (taxonomy *Taxonomy) Stores() *TermStores

Stores gets term stores collection object

type Term

type Term struct {
	// contains filtered or unexported fields
}

Term struct

func (*Term) Delete

func (term *Term) Delete() error

Delete deletes term object

func (*Term) Deprecate

func (term *Term) Deprecate(deprecate bool) error

Deprecate deprecates/activates a term

func (*Term) Get

func (term *Term) Get() (map[string]interface{}, error)

Get gets term metadata

func (*Term) Move

func (term *Term) Move(termSetGUID string, termGUID string) error

Move moves a term to a new location use empty `termGUID` to move to a root term store level

func (*Term) Select

func (term *Term) Select(props string) *Term

Select adds select props to term query

func (*Term) Terms

func (term *Term) Terms() *Terms

Terms gets sub-terms object instance

func (*Term) Update

func (term *Term) Update(properties map[string]interface{}) (map[string]interface{}, error)

Update sets term's properties

type TermGroup

type TermGroup struct {
	// contains filtered or unexported fields
}

TermGroup term group struct

func (*TermGroup) Delete

func (termGroup *TermGroup) Delete() error

Delete deletes group object

func (*TermGroup) Get

func (termGroup *TermGroup) Get() (map[string]interface{}, error)

Get gets term group metadata

func (*TermGroup) Select

func (termGroup *TermGroup) Select(props string) *TermGroup

Select adds select props to term store query

func (*TermGroup) Sets

func (termGroup *TermGroup) Sets() *TermSets

Sets gets term sets object for current term group

type TermGroups

type TermGroups struct {
	// contains filtered or unexported fields
}

TermGroups term groups struct

func (*TermGroups) Add

func (termGroups *TermGroups) Add(name string, guid string) (map[string]interface{}, error)

Add creates new group

func (*TermGroups) Get

func (termGroups *TermGroups) Get() ([]map[string]interface{}, error)

Get gets term groups metadata

func (*TermGroups) GetByID

func (termGroups *TermGroups) GetByID(groupGUID string) *TermGroup

GetByID gets term group object by its GUID

type TermSet

type TermSet struct {
	// contains filtered or unexported fields
}

TermSet term set struct

func (*TermSet) Delete

func (termSet *TermSet) Delete() error

Delete deletes term set object

func (*TermSet) Get

func (termSet *TermSet) Get() (map[string]interface{}, error)

Get gets term set metadata

func (*TermSet) GetAllTerms

func (termSet *TermSet) GetAllTerms() ([]map[string]interface{}, error)

GetAllTerms gets all terms collection metadata

func (*TermSet) Select

func (termSet *TermSet) Select(props string) *TermSet

Select adds select props to term set query

func (*TermSet) Terms

func (termSet *TermSet) Terms() *Terms

Terms gets terms object instance

type TermSets

type TermSets struct {
	// contains filtered or unexported fields
}

TermSets term sets struct

func (*TermSets) Add

func (termSets *TermSets) Add(name string, guid string, lcid int) (map[string]interface{}, error)

Add creates new term set

func (*TermSets) Get

func (termSets *TermSets) Get() ([]map[string]interface{}, error)

Get gets term sets metadata

func (*TermSets) GetByID

func (termSets *TermSets) GetByID(setGUID string) *TermSet

GetByID gets term set object by its GUID

func (*TermSets) GetByName

func (termSets *TermSets) GetByName(termSetName string, lcid int) ([]map[string]interface{}, error)

GetByName gets term sets by a name and LCID, searches within term store

type TermStore

type TermStore struct {
	// contains filtered or unexported fields
}

TermStore term store struct

func (*TermStore) Get

func (termStore *TermStore) Get() (map[string]interface{}, error)

Get gets term store metadata

func (*TermStore) Groups

func (termStore *TermStore) Groups() *TermGroups

Groups gets term groups object

func (*TermStore) Select

func (termStore *TermStore) Select(props string) *TermStore

Select adds select props to term store query

func (*TermStore) Sets

func (termStore *TermStore) Sets() *TermSets

Sets gets term sets object

func (*TermStore) Terms

func (termStore *TermStore) Terms() *Terms

Terms gets terms object

func (*TermStore) UpdateCache

func (termStore *TermStore) UpdateCache() error

UpdateCache updates store cache

type TermStores

type TermStores struct {
	// contains filtered or unexported fields
}

TermStores term stores struct

func (*TermStores) Default

func (termStores *TermStores) Default() *TermStore

Default gets default site collection term store object

func (*TermStores) GetByID

func (termStores *TermStores) GetByID(storeGUID string) *TermStore

GetByID gets term store object by ID

func (*TermStores) GetByName

func (termStores *TermStores) GetByName(storeName string) *TermStore

GetByName gets term store object by Name

type Terms

type Terms struct {
	// contains filtered or unexported fields
}

Terms struct

func (*Terms) Add

func (terms *Terms) Add(name string, guid string, lcid int) (map[string]interface{}, error)

Add creates new term

func (*Terms) Get

func (terms *Terms) Get() ([]map[string]interface{}, error)

Get gets child terms

func (*Terms) GetByID

func (terms *Terms) GetByID(termGUID string) *Term

GetByID gets a term by its GUID

func (*Terms) Select

func (terms *Terms) Select(props string) *Terms

Select adds select props to terms collection query

type TypedKeyValue

type TypedKeyValue struct {
	Key       string `json:"Key"`
	Value     string `json:"Value"`
	ValueType string `json:"ValueType"`
}

TypedKeyValue typed key value prop type

type UpdateValidateFieldResult added in v0.1.30

type UpdateValidateFieldResult struct {
	ErrorCode    int
	ErrorMessage string
	FieldName    string
	FieldValue   string
	HasException bool
	ItemID       int `json:"ItemId"`
}

UpdateValidateFieldResult field result struct

type UpdateValidateResp added in v0.1.30

type UpdateValidateResp []byte

UpdateValidateResp - update validate response type with helper processor methods

func (*UpdateValidateResp) Data added in v0.1.30

Data unmarshals UpdateValidate response

func (*UpdateValidateResp) Value added in v0.1.30

func (uvResp *UpdateValidateResp) Value(fieldName string) string

Value gets updated item's value from the response

type User

type User struct {
	// contains filtered or unexported fields
}

User represents SharePoint Site User API queryable object struct Always use NewUser constructor instead of &User{}

func NewUser

func NewUser(client *gosip.SPClient, endpoint string, config *RequestConfig) *User

NewUser - User struct constructor function

func (*User) Conf

func (user *User) Conf(config *RequestConfig) *User

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*User) Expand

func (user *User) Expand(oDataExpand string) *User

Expand adds $expand OData modifier

func (*User) Get

func (user *User) Get() (UserResp, error)

Get gets this user data object

func (*User) Groups

func (user *User) Groups() *Groups

Groups gets Groups API instance queryable collection for this User

func (*User) Select

func (user *User) Select(oDataSelect string) *User

Select adds $select OData modifier

func (*User) ToURL

func (user *User) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*User) Update

func (user *User) Update(body []byte) (UserResp, error)

Update updates User's metadata with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.User object

type UserInfo

type UserInfo struct {
	Email         string `json:"Email"`
	ID            int    `json:"Id"`
	IsHiddenInUI  bool   `json:"IsHiddenInUI"`
	IsSiteAdmin   bool   `json:"IsSiteAdmin"`
	LoginName     string `json:"LoginName"`
	PrincipalType int    `json:"PrincipalType"`
	Title         string `json:"Title"`
}

UserInfo - site user API response payload structure

type UserResp

type UserResp []byte

UserResp - site user response type with helper processor methods

func (*UserResp) Data

func (userResp *UserResp) Data() *UserInfo

Data response helper

func (*UserResp) Normalized

func (userResp *UserResp) Normalized() []byte

Normalized returns normalized body

type Users

type Users struct {
	// contains filtered or unexported fields
}

Users represent SharePoint Site Users API queryable collection struct Always use NewUsers constructor instead of &Users{}

func NewUsers

func NewUsers(client *gosip.SPClient, endpoint string, config *RequestConfig) *Users

NewUsers - Users struct constructor function

func (*Users) Conf

func (users *Users) Conf(config *RequestConfig) *Users

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Users) Expand

func (users *Users) Expand(oDataExpand string) *Users

Expand adds $expand OData modifier

func (*Users) Filter

func (users *Users) Filter(oDataFilter string) *Users

Filter adds $filter OData modifier

func (*Users) Get

func (users *Users) Get() (UsersResp, error)

Get gets Users queryable collection

func (*Users) GetByEmail

func (users *Users) GetByEmail(email string) *User

GetByEmail gets a user by his/her email address

func (*Users) GetByID

func (users *Users) GetByID(userID int) *User

GetByID gets a user by his/her ID (numeric ID from User Information List)

func (*Users) GetByLoginName

func (users *Users) GetByLoginName(loginName string) *User

GetByLoginName gets a user by his/her login name

func (*Users) OrderBy

func (users *Users) OrderBy(oDataOrderBy string, ascending bool) *Users

OrderBy adds $orderby OData modifier

func (*Users) Select

func (users *Users) Select(oDataSelect string) *Users

Select adds $select OData modifier

func (*Users) ToURL

func (users *Users) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Users) Top

func (users *Users) Top(oDataTop int) *Users

Top adds $top OData modifier

type UsersResp

type UsersResp []byte

UsersResp - site users response type with helper processor methods

func (*UsersResp) Data

func (usersResp *UsersResp) Data() []UserResp

Data response helper

func (*UsersResp) Normalized

func (usersResp *UsersResp) Normalized() []byte

Normalized returns normalized body

type Utility

type Utility struct {
	// contains filtered or unexported fields
}

Utility represents SharePoint Utilities namespace API object struct Always use NewUtility constructor instead of &Utility{}

func NewUtility

func NewUtility(client *gosip.SPClient, endpoint string, config *RequestConfig) *Utility

NewUtility - Utility struct constructor function

func (*Utility) SendEmail

func (utility *Utility) SendEmail(options *EmailProps) error

SendEmail sends an email via REST API due to the provided EmailProps options

type ValidateAddOptions

type ValidateAddOptions struct {
	DecodedPath       string
	NewDocumentUpdate bool
	CheckInComment    string
}

ValidateAddOptions AddValidateUpdateItemUsingPath method options

type ValidateUpdateOptions

type ValidateUpdateOptions struct {
	NewDocumentUpdate bool
	CheckInComment    string
}

ValidateUpdateOptions ValidateUpdateListItem request options

type View

type View struct {
	// contains filtered or unexported fields
}

View represents SharePoint List View API queryable object struct Always use NewView constructor instead of &View{}

func NewView

func NewView(client *gosip.SPClient, endpoint string, config *RequestConfig) *View

NewView - View struct constructor function

func (*View) Conf

func (view *View) Conf(config *RequestConfig) *View

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*View) Delete

func (view *View) Delete() error

Delete deletes this View (can't be restored from a recycle bin)

func (*View) Expand

func (view *View) Expand(oDataExpand string) *View

Expand adds $expand OData modifier

func (*View) Get

func (view *View) Get() (ViewResp, error)

Get gets this View data response

func (*View) Select

func (view *View) Select(oDataSelect string) *View

Select adds $select OData modifier

func (*View) SetViewXML

func (view *View) SetViewXML(viewXML string) (ViewResp, error)

SetViewXML updates view XML

func (*View) ToURL

func (view *View) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*View) Update

func (view *View) Update(body []byte) (ViewResp, error)

Update updates View's metadata with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.View object

type ViewInfo

type ViewInfo struct {
	BaseViewID                string `json:"BaseViewId"`
	DefaultView               bool   `json:"DefaultView"`
	DefaultViewForContentType bool   `json:"DefaultViewForContentType"`
	EditorModified            bool   `json:"EditorModified"`
	Hidden                    bool   `json:"Hidden"`
	HTMLSchemaXML             string `json:"HtmlSchemaXml"`
	ID                        string `json:"Id"`
	ImageURL                  string `json:"ImageUrl"`
	IncludeRootFolder         bool   `json:"IncludeRootFolder"`
	JSLink                    string `json:"JSLink"`
	ListViewXML               string `json:"ListViewXml"`
	MobileDefaultView         bool   `json:"MobileDefaultView"`
	MobileView                bool   `json:"MobileView"`
	OrderedView               bool   `json:"OrderedView"`
	Paged                     bool   `json:"Paged"`
	PersonalView              bool   `json:"PersonalView"`
	ReadOnlyView              bool   `json:"ReadOnlyView"`
	RequiresClientIntegration bool   `json:"RequiresClientIntegration"`
	RowLimit                  int    `json:"RowLimit"`
	Scope                     int    `json:"Scope"`
	ServerRelativeURL         string `json:"ServerRelativeUrl"`
	TabularView               bool   `json:"TabularView"`
	Threaded                  bool   `json:"Threaded"`
	Title                     string `json:"Title"`
	ViewQuery                 string `json:"ViewQuery"`
	ViewType                  string `json:"ViewType"`
	ViewData                  string `json:"ViewData"`
}

ViewInfo - list view API response payload structure

type ViewResp

type ViewResp []byte

ViewResp - list view response type with helper processor methods

func (*ViewResp) Data

func (viewResp *ViewResp) Data() *ViewInfo

Data response helper

func (*ViewResp) Normalized

func (viewResp *ViewResp) Normalized() []byte

Normalized returns normalized body

type Views

type Views struct {
	// contains filtered or unexported fields
}

Views represent SharePoint List Views API queryable collection struct Always use NewViews constructor instead of &Views{}

func NewViews

func NewViews(client *gosip.SPClient, endpoint string, config *RequestConfig) *Views

NewViews - Views struct constructor function

func (*Views) Add

func (views *Views) Add(body []byte) (ViewResp, error)

Add adds view with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.View object

func (*Views) Conf

func (views *Views) Conf(config *RequestConfig) *Views

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Views) DefaultView

func (views *Views) DefaultView() *View

DefaultView gets list's default view

func (*Views) Expand

func (views *Views) Expand(oDataExpand string) *Views

Expand adds $expand OData modifier

func (*Views) Filter

func (views *Views) Filter(oDataFilter string) *Views

Filter adds $filter OData modifier

func (*Views) Get

func (views *Views) Get() (ViewsResp, error)

Get gets this List or Document Library views collection

func (*Views) GetByID

func (views *Views) GetByID(viewID string) *View

GetByID gets a view by its ID (GUID)

func (*Views) GetByTitle

func (views *Views) GetByTitle(title string) *View

GetByTitle gets a view by its Display Name (Title)

func (*Views) OrderBy

func (views *Views) OrderBy(oDataOrderBy string, ascending bool) *Views

OrderBy adds $orderby OData modifier

func (*Views) Select

func (views *Views) Select(oDataSelect string) *Views

Select adds $select OData modifier

func (*Views) ToURL

func (views *Views) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Views) Top

func (views *Views) Top(oDataTop int) *Views

Top adds $top OData modifier

type ViewsResp

type ViewsResp []byte

ViewsResp - list views response type with helper processor methods

func (*ViewsResp) Data

func (viewsResp *ViewsResp) Data() []ViewResp

Data response helper

func (*ViewsResp) Normalized

func (viewsResp *ViewsResp) Normalized() []byte

Normalized returns normalized body

type Web

type Web struct {
	// contains filtered or unexported fields
}

Web represents SharePoint Web API queryable object struct Always use NewWeb constructor instead of &Web{}

func NewWeb

func NewWeb(client *gosip.SPClient, endpoint string, config *RequestConfig) *Web

NewWeb - Web struct constructor function

func (*Web) AllProps

func (web *Web) AllProps() *Properties

AllProps gets Properties API instance queryable collection for this Web

func (*Web) AssociatedGroups

func (web *Web) AssociatedGroups() *AssociatedGroups

AssociatedGroups gets associated groups scoped constructor

func (*Web) AvailableContentTypes

func (web *Web) AvailableContentTypes() *ContentTypes

AvailableContentTypes gets ContentTypes API instance queryable collection for this Web

func (*Web) Changes

func (web *Web) Changes() *Changes

Changes gets changes API scoped object

func (*Web) Conf

func (web *Web) Conf(config *RequestConfig) *Web

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Web) ContentTypes

func (web *Web) ContentTypes() *ContentTypes

ContentTypes gets ContentTypes API instance queryable collection for this Web

func (*Web) ContextInfo

func (web *Web) ContextInfo() (*ContextInfo, error)

ContextInfo gets Context info object for this Web

func (*Web) CurrentUser

func (web *Web) CurrentUser() *User

CurrentUser gets current User API instance object

func (*Web) CustomActions

func (web *Web) CustomActions() *CustomActions

CustomActions gets CustomActions API scoped object

func (*Web) Delete

func (web *Web) Delete() error

Delete deletes this Web

func (*Web) EnsureFolder

func (web *Web) EnsureFolder(serverRelativeURL string) ([]byte, error)

EnsureFolder is a helper to ensure a folder by its relevant URI, when there was no folder it's created

func (*Web) EnsureUser

func (web *Web) EnsureUser(loginName string) (*UserInfo, error)

EnsureUser ensures a user by a `loginName` parameter and returns UserInfo

func (*Web) EventReceivers

func (web *Web) EventReceivers() *EventReceivers

EventReceivers gets EventReceivers API scoped object

func (*Web) Expand

func (web *Web) Expand(oDataExpand string) *Web

Expand adds $expand OData modifier

func (*Web) Features

func (web *Web) Features() *Features

Features gets Features API instance queryable collection for this Web

func (*Web) Fields

func (web *Web) Fields() *Fields

Fields gets Fields API instance queryable collection for this Web (Site Columns)

func (*Web) FromURL

func (web *Web) FromURL(url string) *Web

FromURL gets Web object using its API URL

func (*Web) Get

func (web *Web) Get() (WebResp, error)

Get gets this Web info

func (*Web) GetFile

func (web *Web) GetFile(serverRelativeURL string) *File

GetFile gets File API instance object by its relevant URI File URI can be host relevant (e.g. `/sites/site/lib/folder/file.txt`) or web relevant (e.g. `lib/folder/file.txt`, with web relevant URI there should be no slash at the beginning) A wrapper of `GetFileByServerRelativeUrl`

func (*Web) GetFileByID

func (web *Web) GetFileByID(uniqueID string) *File

GetFileByID gets File API instance object by its unique ID Supported only in modern SharePoint

func (*Web) GetFileByPath

func (web *Web) GetFileByPath(serverRelativeURL string) *File

GetFileByPath gets File API instance object by its relevant URI File URI can be host relevant (e.g. `/sites/site/lib/folder/file.txt`) or web relevant (e.g. `lib/folder/file.txt`, with web relevant URI there should be no slash at the beginning) A wrapper of `GetFileByServerRelativePath` Supported only in modern SharePoint, differs from GetFile with its capability of dealing with special chars in path

func (*Web) GetFolder

func (web *Web) GetFolder(serverRelativeURL string) *Folder

GetFolder gets a folder by its relevant URI, URI can be host relevant (e.g. `/sites/site/lib/folder`) or web relevant (e.g. `lib/folder`, with web relevant URI there should be no slash at the beginning) A wrapper of `GetFolderByServerRelativeUrl`

func (*Web) GetFolderByID

func (web *Web) GetFolderByID(uniqueID string) *Folder

GetFolderByID gets Folder API instance object by its unique ID Supported only in modern SharePoint

func (*Web) GetFolderByPath

func (web *Web) GetFolderByPath(serverRelativeURL string) *Folder

GetFolderByPath gets a folder by its relevant URI, URI can be host relevant (e.g. `/sites/site/lib/folder`) or web relevant (e.g. `lib/folder`, with web relevant URI there should be no slash at the beginning) A wrapper of `GetFolderByServerRelativePath` Supported only in modern SharePoint, differs from GetFile with its capability of dealing with special chars in path

func (*Web) GetList

func (web *Web) GetList(listURI string) *List

GetList gets Lists API instance queryable collection for this Web (Web's Lists)

func (*Web) Lists

func (web *Web) Lists() *Lists

Lists gets Lists API instance object

func (*Web) RecycleBin

func (web *Web) RecycleBin() *RecycleBin

RecycleBin gets RecycleBin API instance object for this Web

func (*Web) RoleDefinitions

func (web *Web) RoleDefinitions() *RoleDefinitions

RoleDefinitions gets RoleDefinitions API instance queryable collection for this Web

func (*Web) Roles

func (web *Web) Roles() *Roles

Roles gets Roles API instance queryable collection for this Web

func (*Web) RootFolder

func (web *Web) RootFolder() *Folder

RootFolder gets web's root folder object

func (*Web) Select

func (web *Web) Select(oDataSelect string) *Web

Select adds $select OData modifier

func (*Web) SiteGroups

func (web *Web) SiteGroups() *Groups

SiteGroups gets Groups API instance queryable collection for this Web (Site Groups)

func (*Web) SiteUsers

func (web *Web) SiteUsers() *Users

SiteUsers gets Users API instance queryable collection for this Web (Site Users)

func (*Web) ToURL

func (web *Web) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Web) Update

func (web *Web) Update(body []byte) (WebResp, error)

Update updates Web's metadata with properties provided in `body` parameter where `body` is byte array representation of JSON string payload relevant to SP.Web object

func (*Web) UserInfoList

func (web *Web) UserInfoList() *List

UserInfoList gets site UIL (User Information List) API instance

func (*Web) Webs

func (web *Web) Webs() *Webs

Webs gets Webs API instance queryable collection for this Web (sub webs)

type WebInfo

type WebInfo struct {
	ID                            string       `json:"Id"`
	Title                         string       `json:"Title"`
	AllowRssFeeds                 bool         `json:"AllowRssFeeds"`
	AlternateCSSURL               string       `json:"AlternateCssUrl"`
	AppInstanceID                 string       `json:"AppInstanceId"`
	ClassicWelcomePage            string       `json:"ClassicWelcomePage"`
	Configuration                 int          `json:"Configuration"`
	Created                       string       `json:"Created"` // time.Time
	CustomMasterURL               string       `json:"CustomMasterUrl"`
	Description                   string       `json:"Description"`
	DesignPackageID               string       `json:"DesignPackageId"`
	EnableMinimalDownload         bool         `json:"EnableMinimalDownload"`
	FooterEmphasis                int          `json:"FooterEmphasis"`
	FooterEnabled                 bool         `json:"FooterEnabled"`
	FooterLayout                  int          `json:"FooterLayout"`
	HeaderEmphasis                int          `json:"HeaderEmphasis"`
	HeaderLayout                  int          `json:"HeaderLayout"`
	HorizontalQuickLaunch         bool         `json:"HorizontalQuickLaunch"`
	IsHomepageModernized          bool         `json:"IsHomepageModernized"`
	IsMultilingual                bool         `json:"IsMultilingual"`
	IsRevertHomepageLinkHidden    bool         `json:"IsRevertHomepageLinkHidden"`
	Language                      int          `json:"Language"`
	LastItemModifiedDate          string       `json:"LastItemModifiedDate"`     // time.Time
	LastItemUserModifiedDate      string       `json:"LastItemUserModifiedDate"` // time.Time
	MasterURL                     string       `json:"MasterUrl"`
	MegaMenuEnabled               bool         `json:"MegaMenuEnabled"`
	NavAudienceTargetingEnabled   bool         `json:"NavAudienceTargetingEnabled"`
	NoCrawl                       bool         `json:"NoCrawl"`
	ObjectCacheEnabled            bool         `json:"ObjectCacheEnabled"`
	OverwriteTranslationsOnChange bool         `json:"OverwriteTranslationsOnChange"`
	QuickLaunchEnabled            bool         `json:"QuickLaunchEnabled"`
	RecycleBinEnabled             bool         `json:"RecycleBinEnabled"`
	SearchScope                   int          `json:"SearchScope"`
	ServerRelativeURL             string       `json:"ServerRelativeUrl"`
	SiteLogoURL                   string       `json:"SiteLogoUrl"`
	SyndicationEnabled            bool         `json:"SyndicationEnabled"`
	TenantAdminMembersCanShare    int          `json:"TenantAdminMembersCanShare"`
	TreeViewEnabled               bool         `json:"TreeViewEnabled"`
	UIVersion                     int          `json:"UIVersion"`
	UIVersionConfigurationEnabled bool         `json:"UIVersionConfigurationEnabled"`
	URL                           string       `json:"Url"`
	WebTemplate                   string       `json:"WebTemplate"`
	WelcomePage                   string       `json:"WelcomePage"`
	CurrentChangeToken            *StringValue `json:"CurrentChangeToken"`
	ResourcePath                  *DecodedURL  `json:"ResourcePath"`
}

WebInfo - web API response payload structure

type WebResp

type WebResp []byte

WebResp - web response type with helper processor methods

func (*WebResp) Data

func (webResp *WebResp) Data() *WebInfo

Data response helper

func (*WebResp) Normalized

func (webResp *WebResp) Normalized() []byte

Normalized returns normalized body

type WebhookInfo

type WebhookInfo struct {
	SubscriptionID string    `json:"subscriptionId"`     // :"1111111111-3ef7-4917-ada1-xxxxxxxxxxxxx",
	ClientState    string    `json:"clientState"`        // :null,
	Expiration     time.Time `json:"expirationDateTime"` // :"2020-06-14T16:22:51.2160000Z",
	Resource       string    `json:"resource"`           // :"xxxxxx-c0ba-4063-a078-xxxxxxxxx",
	TenantID       string    `json:"tenantId"`           // :"4e2a1952-1ed1-4da3-85a6-xxxxxxxxxx",
	SiteURL        string    `json:"siteUrl"`            // :"/sites/webhooktest",
	WebID          string    `json:"webId"`              // :"xxxxx-3a7c-417b-964e-39f421c55d59"
}

WebhookInfo represents webhook payload object structure

type Webs

type Webs struct {
	// contains filtered or unexported fields
}

Webs represent SharePoint Webs API queryable collection struct Always use NewWebs constructor instead of &Webs{}

func NewWebs

func NewWebs(client *gosip.SPClient, endpoint string, config *RequestConfig) *Webs

NewWebs - Webs struct constructor function

func (*Webs) Add

func (webs *Webs) Add(title string, url string, metadata map[string]interface{}) (WebResp, error)

Add creates a sub web for a parent web with provided `title` and `url`. `url` stands for a system friendly URI (e.g. `finances`) while `title` is a human friendly name (e.g. `Financial Department`). Along with title and url additional metadata can be provided in optional `metadata` string map object. `metadata` props should correspond to `SP.WebCreationInformation` API type. Some props have defaults as Language (1033), WebTemplate (STS), etc.

func (*Webs) Conf

func (webs *Webs) Conf(config *RequestConfig) *Webs

Conf receives custom request config definition, e.g. custom headers, custom OData mod

func (*Webs) Expand

func (webs *Webs) Expand(oDataExpand string) *Webs

Expand adds $expand OData modifier

func (*Webs) Filter

func (webs *Webs) Filter(oDataFilter string) *Webs

Filter adds $filter OData modifier

func (*Webs) Get

func (webs *Webs) Get() (WebsResp, error)

Get gets Webs response - a collection of WebInfo for the parent Web

func (*Webs) OrderBy

func (webs *Webs) OrderBy(oDataOrderBy string, ascending bool) *Webs

OrderBy adds $orderby OData modifier

func (*Webs) Select

func (webs *Webs) Select(oDataSelect string) *Webs

Select adds $select OData modifier

func (*Webs) ToURL

func (webs *Webs) ToURL() string

ToURL gets endpoint with modificators raw URL

func (*Webs) Top

func (webs *Webs) Top(oDataTop int) *Webs

Top adds $top OData modifier

type WebsResp

type WebsResp []byte

WebsResp - webs response type with helper processor methods

func (*WebsResp) Data

func (websResp *WebsResp) Data() []WebResp

Data response helper

func (*WebsResp) Normalized

func (websResp *WebsResp) Normalized() []byte

Normalized returns normalized body

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL