Documentation ¶
Index ¶
- Constants
- type AccessEmail
- type Client
- func (c *Client) CollaborationService() *CollaborationService
- func (c *Client) CommentService() *CommentService
- func (c *Client) Do(req *http.Request, respStr interface{}) (*http.Response, error)
- func (c *Client) DoAndGetReader(req *http.Request) (*http.Response, io.ReadCloser, error)
- func (c *Client) EventService() *EventService
- func (c *Client) FileService() *FileService
- func (c *Client) FolderService() *FolderService
- func (c *Client) GroupService() *GroupService
- func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
- func (c *Client) SharedService() *SharedService
- func (c *Client) TaskService() *TaskService
- func (c *Client) UserService() *UserService
- type Collaboration
- type CollaborationService
- func (c *CollaborationService) AddCollaboration(itemId, itemType, accessibleId, accessibleType, accessibleEmail, role string) (*http.Response, *Collaboration, error)
- func (c *CollaborationService) EditCollaboration(collaborationId, role, status string) (*http.Response, *Collaboration, error)
- func (c *CollaborationService) GetPendingCollaborations() (*http.Response, *Collaborations, error)
- func (c *CollaborationService) RemoveCollaboration(collaborationId string) (*http.Response, error)
- func (c *CollaborationService) RetrieveCollaboration(collaborationId string) (*http.Response, *Collaboration, error)
- type Collaborations
- type CollectionInfo
- type Comment
- type CommentCollection
- type CommentService
- func (c *CommentService) AddComment(itemType, id, message, taggedMessage string) (*http.Response, *Comment, error)
- func (c *CommentService) ChangeCommentsMessage(commendId, message string) (*http.Response, *Comment, error)
- func (c *CommentService) DeleteComment(commentId string) (*http.Response, error)
- func (c *CommentService) GetComment(commentId string) (*http.Response, *Comment, error)
- type ConfigSource
- type CountedEmailAliases
- type EmailAlias
- type Event
- type EventCollection
- type EventQueryOptions
- type EventService
- func (e *EventService) Channel(size int) chan *Event
- func (e *EventService) Events(options EventQueryOptions) (*http.Response, *EventCollection, error)
- func (e *EventService) ListenForEvent(i LongPollConnInfo, lastSync string) (*http.Response, []*Event, error)
- func (e *EventService) LongPollURL() (*http.Response, *LongPollInfo, error)
- type File
- type FileCollection
- type FileService
- func (c *FileService) CopyFile(fileId, parent, name string) (*http.Response, *File, error)
- func (c *FileService) CreateSharedLinkForFile(fileId, access, unsharedAt string, canDownload, canPreview bool) (*http.Response, *File, error)
- func (c *FileService) DeleteFile(fileId string) (*http.Response, error)
- func (f *FileService) DeleteVersion(fileID, fileVersion string) (*http.Response, bool, error)
- func (c *FileService) DownloadFile(fileId string) (*http.Response, error)
- func (c *FileService) DownloadVersion(fileId, version string) (*http.Response, io.ReadCloser, error)
- func (c *FileService) GetFile(fileId string) (*http.Response, *File, error)
- func (c *FileService) GetTasksForFile(fileId string) (*http.Response, *TaskCollection, error)
- func (c *FileService) GetThumbnail(fileId string) (*http.Response, error)
- func (c *FileService) GetTrashedFile(fileId string) (*http.Response, *File, error)
- func (f *FileService) Lock(fileID string, lock *Lock) (*http.Response, error)
- func (c *FileService) PermanentlyDeleteTrashedFile(fileId string) (*http.Response, error)
- func (f *FileService) PreflightCheck(file *File) (*http.Response, bool, error)
- func (f *FileService) PromoteVersion(fileID, fileVersion string) (*http.Response, *FileVersion, error)
- func (c *FileService) RestoreTrashedItem(fileId, name, parentId string) (*http.Response, *File, error)
- func (f *FileService) Update(file *File) (*http.Response, *File, error)
- func (c *FileService) UploadFile(filePath, parentId string) (*http.Response, *FileCollection, error)
- func (f *FileService) UploadFileVersion(path, fileID string) (*http.Response, *FileCollection, error)
- func (c *FileService) ViewCommentsOnFile(fileId string) (*http.Response, *CommentCollection, error)
- func (c *FileService) ViewVersionsOfFile(fileId string) (*http.Response, *FileCollection, error)
- type FileVersion
- type Folder
- type FolderService
- func (c *FolderService) CopyFolder(src, dest, name string) (*http.Response, *Folder, error)
- func (c *FolderService) CreateFolder(name string, parent int) (*http.Response, *Folder, error)
- func (f *FolderService) CreateSharedLink(folderID string, options *SharedLinkOptions) (*http.Response, *Folder, error)
- func (c *FolderService) DeleteFolder(folderId string, recursive bool) (*http.Response, error)
- func (c *FolderService) GetCollaborations(folderId string) (*http.Response, *Collaborations, error)
- func (c *FolderService) GetFolder(folderId string) (*http.Response, *Folder, error)
- func (c *FolderService) GetFolderItems(folderId string) (*http.Response, *ItemCollection, error)
- func (c *FolderService) GetTrashedFolder(folderId string) (*http.Response, *Folder, error)
- func (c *FolderService) ItemsInTrash(fields []string, limit, offset int) (*http.Response, *ItemCollection, error)
- func (c *FolderService) PermanentlyDeleteTrashedFolder(folderId string) (*http.Response, error)
- func (c *FolderService) RestoreTrashedFolder(folderId, name, parent string) (*http.Response, *Folder, error)
- func (f *FolderService) Update(folder *Folder) (*http.Response, *Folder, error)
- type Group
- type GroupCollection
- type GroupService
- func (g *GroupService) AddUserToGroup(uID, gID, role string) (*http.Response, *Membership, error)
- func (c *GroupService) CreateGroup(name string) (*http.Response, *Group, error)
- func (c *GroupService) DeleteGroup(groupID string) (*http.Response, bool, error)
- func (g *GroupService) DeleteMembership(membershipID string) (*http.Response, error)
- func (g *GroupService) GroupCollaborations(groupID string) (*http.Response, *Collaborations, error)
- func (c *GroupService) Groups() (*http.Response, []Group, error)
- func (g *GroupService) ListMembership(groupID string) (*http.Response, *MembershipCollection, error)
- func (g *GroupService) Membership(membershipEntryID string) (*http.Response, *Membership, error)
- func (c *GroupService) UpdateGroup(groupID, name string) (*http.Response, *Group, error)
- func (g *GroupService) UpdateMembership(membershipID, role string) (*http.Response, *Membership, error)
- type Item
- type ItemCollection
- type Link
- type Lock
- type LongPollConnInfo
- type LongPollInfo
- type Membership
- type MembershipCollection
- type Order
- type PathCollection
- type Permissions
- type SharedItem
- type SharedLinkOptions
- type SharedLinkPermissions
- type SharedService
- type Task
- type TaskAssignment
- type TaskAssignmentCollection
- type TaskCollection
- type TaskService
- func (c *TaskService) CreateTask(itemId, itemType, action, message, due_at string) (*http.Response, *Task, error)
- func (c *TaskService) CreateTaskAssignment(taskId, taskType, assignToId, assignToLogin string) (*http.Response, *TaskAssignment, error)
- func (c *TaskService) DeleteTask(taskId string) (*http.Response, error)
- func (c *TaskService) DeleteTaskAssignment(taskAssignmentId string) (*http.Response, error)
- func (c *TaskService) GetAssignmentsForTask(taskId string) (*http.Response, *TaskAssignmentCollection, error)
- func (c *TaskService) GetTask(taskId string) (*http.Response, *Task, error)
- func (c *TaskService) GetTaskAssignment(taskAssignmentId string) (*http.Response, *TaskAssignment, error)
- func (c *TaskService) UpdateTask(taskId, action, message, due_at string) (*http.Response, *Task, error)
- func (c *TaskService) UpdateTaskAssignment(taskAssignmentId, message, resolution_state string) (*http.Response, *TaskAssignment, error)
- type User
- type UserService
- func (c *UserService) AddEmailAlias(userID, email string) (*http.Response, *EmailAlias, error)
- func (c *UserService) ChangePrimaryLogin(userID, newLogin string) (*http.Response, *User, error)
- func (c *UserService) CreateUser(user *User) (*http.Response, *User, error)
- func (c *UserService) DeletEmailAlias(userID, emailAliasID string) (*http.Response, bool, error)
- func (u *UserService) DeleteUser(userID string) (*http.Response, error)
- func (c *UserService) EmailAliases(userID string) (*http.Response, []EmailAlias, error)
- func (c *UserService) GetEnterpriseUsers() (*http.Response, *Users, error)
- func (c *UserService) Me() (*http.Response, *User, error)
- func (c *UserService) Membership(userID string) (*http.Response, *MembershipCollection, error)
- func (u *UserService) UpdateUser(user *User) (*http.Response, *User, error)
- func (u *UserService) User(userID string) (*http.Response, *User, error)
- type Users
Constants ¶
const ( BASE_URL = "https://api.box.com/2.0" UPLOAD_URL = "https://upload.box.com/api/2.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessEmail ¶
type AccessEmail struct { // TODO(ttacon): these may change... Access string `json:"access,omitempty"` Email string `json:"email,omitempty"` }
TODO(ttacon): go through and clean up pointer vs non-pointer TODO(ttacon): go through and see where omitempty is appropriate
type Client ¶
func (*Client) CollaborationService ¶
func (c *Client) CollaborationService() *CollaborationService
func (*Client) CommentService ¶
func (c *Client) CommentService() *CommentService
func (*Client) Do ¶
Do "makes" the request, and if there are no errors and resp is not nil, it attempts to unmarshal the (json) response body into resp.
func (*Client) DoAndGetReader ¶
Do "makes" the request, and if there are no errors and resp is not nil, it returns the resp without reading or closing the resp.Body.
func (*Client) EventService ¶
func (c *Client) EventService() *EventService
func (*Client) FileService ¶
func (c *Client) FileService() *FileService
FileService returns an interface to interact with all of the API methods available for manipulating or querying files.
func (*Client) FolderService ¶
func (c *Client) FolderService() *FolderService
FolderService returns an interface through which one can interact with all the folder manipulation and querying functionality Box exposes in their API.
func (*Client) GroupService ¶
func (c *Client) GroupService() *GroupService
func (*Client) NewRequest ¶
NewRequest creates an *http.Request with the given method, url and request body (if one is passed).
func (*Client) SharedService ¶
func (c *Client) SharedService() *SharedService
func (*Client) TaskService ¶
func (c *Client) TaskService() *TaskService
func (*Client) UserService ¶
func (c *Client) UserService() *UserService
type Collaboration ¶
type Collaboration struct { Type string `json:"type"` ID string `json:"id"` CreatedBy *Item `json:"created_by"` // TODO(ttacon): this should be user CreatedAt string `json:"created_at"` // TODO(ttacon): transition this to time.Time ModifiedAt string `json:"modified_at"` // TODO(ttacon): transition to time.Time ExpiresAt *string `json:"expires_at"` // TODO(ttacon): *time.Time Status string `json:"status"` AccessibleBy *Item `json:"accessible_by"` // TODO(ttacon): turn into user Role string `json:"role"` // TODO(ttacon): enum (own file?) AcknowledgedAt string `json:"acknowledged_at"` // TODO(ttacon): time.Time Item *Item `json:"item"` // TODO(ttacon): mini-folder struct }
TODO(ttacon):some of these fields pop up everywhere, make common struct and anonymously extend the others with it? Documentation: https://developers.box.com/docs/#collaborations
type CollaborationService ¶
type CollaborationService struct {
*Client
}
func (*CollaborationService) AddCollaboration ¶
func (c *CollaborationService) AddCollaboration( itemId, itemType, accessibleId, accessibleType, accessibleEmail, role string) (*http.Response, *Collaboration, error)
Documentation: https://developers.box.com/docs/#collaborations-add-a-collaboration
func (*CollaborationService) EditCollaboration ¶
func (c *CollaborationService) EditCollaboration(collaborationId, role, status string) (*http.Response, *Collaboration, error)
Documentation: https://developers.box.com/docs/#collaborations-edit-a-collaboration
func (*CollaborationService) GetPendingCollaborations ¶
func (c *CollaborationService) GetPendingCollaborations() (*http.Response, *Collaborations, error)
Documentation: https://developers.box.com/docs/#collaborations-get-pending-collaborations NOTE(ttacon): not doing to add param since it's just calling the first url with an explicit query string (that never changes, why isn't it an actual route then, or bundled into the documentation of the first one?)
func (*CollaborationService) RemoveCollaboration ¶
func (c *CollaborationService) RemoveCollaboration(collaborationId string) (*http.Response, error)
Documentation: https://developers.box.com/docs/#collaborations-remove-a-collaboration
func (*CollaborationService) RetrieveCollaboration ¶
func (c *CollaborationService) RetrieveCollaboration(collaborationId string) (*http.Response, *Collaboration, error)
Documentation: https://developers.box.com/docs/#collaborations-retrieve-a-collaboration
type Collaborations ¶
type Collaborations struct { TotalCount int `json:"total_count"` Offset int `json:"offset"` Limit int `json:"limit"` Entries []*Collaboration }
type CollectionInfo ¶
type Comment ¶
type Comment struct { Type string `json:"type"` Id string `json:"id"` IsReplyComment bool `json:"is_reply_comment"` Message string `json:"message"` CreatedBy *Item `json:"created_by"` // TODO(ttacon): change this to user, this needs to be a mini-user struct Item *Item `json:"item"` CreatedAt string `json:"created_at"` // TODO(ttacon): change to time.Time ModifiedAt string `json:"modified_at"` // TODO(ttacon): change to time.Time }
type CommentCollection ¶
type CommentService ¶
type CommentService struct {
*Client
}
func (*CommentService) AddComment ¶
func (c *CommentService) AddComment(itemType, id, message, taggedMessage string) (*http.Response, *Comment, error)
Documentation: https://developers.box.com/docs/#comments-add-a-comment-to-an-item
func (*CommentService) ChangeCommentsMessage ¶
func (c *CommentService) ChangeCommentsMessage(commendId, message string) (*http.Response, *Comment, error)
Documentation: https://developers.box.com/docs/#comments-change-a-comments-message
func (*CommentService) DeleteComment ¶
func (c *CommentService) DeleteComment(commentId string) (*http.Response, error)
Documentation: https://developers.box.com/docs/#comments-delete-a-comment
func (*CommentService) GetComment ¶
Documentation: https://developers.box.com/docs/#comments-get-information-about-a-comment
type ConfigSource ¶
type ConfigSource struct {
// contains filtered or unexported fields
}
func NewConfigSource ¶
func NewConfigSource(cfg *oauth2.Config) *ConfigSource
type CountedEmailAliases ¶
type CountedEmailAliases struct { TotalCount int `json:"total_count"` Entries []EmailAlias `json:"entries"` }
type EmailAlias ¶
type Event ¶
type Event struct { Type string `json:"type"` EventID string `json:"event_id"` CreatedBy *User `json:"created_by"` EventType string `json:"event_type"` SessionID string `json:"session_id"` Source json.RawMessage `json:"source"` File *File `json:"-"` Folder *Folder `json:"-"` Comment *Comment `json:"-"` Collaboration *Collaboration `json:"-"` }
type EventCollection ¶
type EventQueryOptions ¶
type EventService ¶
type EventService struct {
*Client
}
func (*EventService) Channel ¶
func (e *EventService) Channel(size int) chan *Event
func (*EventService) Events ¶
func (e *EventService) Events(options EventQueryOptions) (*http.Response, *EventCollection, error)
Events retrieves events for the currently authenticated user.
See: https://developers.box.com/docs/#events-get-events-for-a-user
func (*EventService) ListenForEvent ¶
func (e *EventService) ListenForEvent(i LongPollConnInfo, lastSync string) (*http.Response, []*Event, error)
func (*EventService) LongPollURL ¶
func (e *EventService) LongPollURL() (*http.Response, *LongPollInfo, error)
type File ¶
type File struct { ID string `json:"id,omitempty"` FolderUploadEmail *AccessEmail `json:"folder_upload_email,omitempty"` Parent *Item `json:"parent,omitempty"` ItemStatus string `json:"item_status"` ItemCollection *ItemCollection `json:"item_collection"` Type string `json:"type"` // TODO(ttacon): enum Description string `json:"description"` Size int `json:"size"` CreatedBy *Item `json:"created_by"` ModifiedBy *Item `json:"modified_by"` TrashedAt *string `json:"trashed_at"` // TODO(ttacon): change to time.Time ContentModifiedAt *string `json:"content_modified_at"` // TODO(ttacon): change to time.Time PurgedAt *string `json:"purged_at"` // TODO(ttacon): change to time.Time, this field isn't documented but I keep getting it back... SequenceId string `json:"sequence_id"` ETag *string `json:"etag"` Name string `json:"name"` CreatedAt *string `json:"created_at"` // TODO(ttacon): change to time.Time OwnedBy *Item `json:"owned_by"` ModifiedAt *string `json:"modified_at"` // TODO(ttacon): change to time.Time ContentCreatedAt *string `json:"content_created_at"` // TODO(ttacon): change to time.Time PathCollection *PathCollection `json:"path_collection"` // TODO(ttacon): make sure this is the correct kind of struct(ure) SHA1 string `json:"sha1"` }
TODO(ttacon): reconcile this with Folder for one common struct?
type FileCollection ¶
type FileService ¶
type FileService struct {
*Client
}
func (*FileService) CopyFile ¶
Documentation: https://developers.box.com/docs/#files-copy-a-file
func (*FileService) CreateSharedLinkForFile ¶
func (c *FileService) CreateSharedLinkForFile(fileId, access, unsharedAt string, canDownload, canPreview bool) (*http.Response, *File, error)
Documentation: https://developers.box.com/docs/#files-create-a-shared-link-for-a-file
func (*FileService) DeleteFile ¶
func (c *FileService) DeleteFile(fileId string) (*http.Response, error)
Documentation: https://developers.box.com/docs/#files-delete-a-file
func (*FileService) DeleteVersion ¶
Documentation: https://developers.box.com/docs/#files-delete-version
func (*FileService) DownloadFile ¶
func (c *FileService) DownloadFile(fileId string) (*http.Response, error)
NOTE: we return the http.Response as Box may return a 202 if there is not yet a download link, or a 302 with the link - this allows the user to decide what to do. Documentation: https://developers.box.com/docs/#files-download-a-file
func (*FileService) DownloadVersion ¶
func (c *FileService) DownloadVersion(fileId, version string) (*http.Response, io.ReadCloser, error)
Documentation: https://developers.box.com/docs/#files-download-old-version
func (*FileService) GetFile ¶
Documentation: https://developer.box.com/docs/#files-get
func (*FileService) GetTasksForFile ¶
func (c *FileService) GetTasksForFile(fileId string) (*http.Response, *TaskCollection, error)
Documentation: https://developers.box.com/docs/#files-get-the-tasks-for-a-file
func (*FileService) GetThumbnail ¶
func (c *FileService) GetThumbnail(fileId string) (*http.Response, error)
NOTE: we only return the response as there are many possible responses that we feel the user should have control over Documentation: https://developers.box.com/docs/#files-get-a-thumbnail-for-a-file
func (*FileService) GetTrashedFile ¶
Documentation: https://developers.box.com/docs/#files-get-a-trashed-file
func (*FileService) Lock ¶
Documentation: https://developers.box.com/docs/#files-lock-and-unlock
func (*FileService) PermanentlyDeleteTrashedFile ¶
func (c *FileService) PermanentlyDeleteTrashedFile(fileId string) (*http.Response, error)
Documentation: https://developers.box.com/docs/#files-permanently-delete-a-trashed-file
func (*FileService) PreflightCheck ¶
Documentation: https://developers.box.com/docs/#files-preflight-check
func (*FileService) PromoteVersion ¶
func (f *FileService) PromoteVersion(fileID, fileVersion string) (*http.Response, *FileVersion, error)
Documentation: https://developers.box.com/docs/#files-promote-old-version
func (*FileService) RestoreTrashedItem ¶
func (c *FileService) RestoreTrashedItem(fileId, name, parentId string) (*http.Response, *File, error)
Documentation: https://developers.box.com/docs/#files-restore-a-trashed-item
func (*FileService) Update ¶
Documentation: https://developers.box.com/docs/#files-update-a-files-information
func (*FileService) UploadFile ¶
func (c *FileService) UploadFile(filePath, parentId string) (*http.Response, *FileCollection, error)
Documentation https://developer.box.com/docs/#files-upload-a-file TODO(ttacon): deal with handling SHA1 headers
func (*FileService) UploadFileVersion ¶
func (f *FileService) UploadFileVersion(path, fileID string) (*http.Response, *FileCollection, error)
Documentation: https://developers.box.com/docs/#files-upload-a-new-version-of-a-file
func (*FileService) ViewCommentsOnFile ¶
func (c *FileService) ViewCommentsOnFile(fileId string) (*http.Response, *CommentCollection, error)
Documentation: https://developers.box.com/docs/#files-view-the-comments-on-a-file
func (*FileService) ViewVersionsOfFile ¶
func (c *FileService) ViewVersionsOfFile(fileId string) (*http.Response, *FileCollection, error)
Documentation: https://developers.box.com/docs/#files-view-versions-of-a-file TODO(ttacon): don't use file collection, make actual structs specific to file versions
type FileVersion ¶
type Folder ¶
type Folder struct { ID string `json:"id,omitempty"` FolderUploadEmail *AccessEmail `json:"folder_upload_email,omitempty"` Parent *Item `json:"parent,omitempty"` ItemStatus string `json:"item_status"` ItemCollection *ItemCollection `json:"item_collection"` Type string `json:"type"` Description string `json:"description"` Size int `json:"size"` CreatedBy *Item `json:"created_by"` ModifiedBy *Item `json:"modified_by"` TrashedAt *string `json:"trashed_at"` // TODO(ttacon): change to time.Time ContentModifiedAt *string `json:"content_modified_at"` // TODO(ttacon): change to time.Time PurgedAt *string `json:"purged_at"` // TODO(ttacon): change to time.Time, this field isn't documented but I keep getting it back... SequenceId string `json:"sequence_id"` ETag *string `json:"etag"` Name string `json:"name"` CreatedAt *string `json:"created_at"` // TODO(ttacon): change to time.Time OwnedBy *Item `json:"owned_by"` ModifiedAt *string `json:"modified_at"` // TODO(ttacon): change to time.Time ContentCreatedAt *string `json:"content_created_at"` // TODO(ttacon): change to time.Time PathCollection *PathCollection `json:"path_collection"` // TODO(ttacon): make sure this is the correct kind of struct(ure) }
Documentation: https://developers.box.com/docs/#folders-folder-object
type FolderService ¶
type FolderService struct {
*Client
}
func (*FolderService) CopyFolder ¶
Documentation: https://developers.box.com/docs/#folders-copy-a-folder
func (*FolderService) CreateFolder ¶
TODO(ttacon): return the response so the user can check the status code or we should check it? it's more flexible if we let the user decide what they view as an error Documentation: https://developers.box.com/docs/#folders-create-a-new-folder
func (*FolderService) CreateSharedLink ¶
func (f *FolderService) CreateSharedLink(folderID string, options *SharedLinkOptions) (*http.Response, *Folder, error)
Documentation: https://developers.box.com/docs/#folders-permanently-delete-a-trashed-folder
func (*FolderService) DeleteFolder ¶
TODO(ttacon): https://developers.box.com/docs/#folders-update-information-about-a-folder Documentation: https://developers.box.com/docs/#folders-delete-a-folder
func (*FolderService) GetCollaborations ¶
func (c *FolderService) GetCollaborations(folderId string) (*http.Response, *Collaborations, error)
TODO(ttacon): https://developers.box.com/docs/#folders-create-a-shared-link-for-a-folder Documentation: https://developers.box.com/docs/#folders-view-a-folders-collaborations
func (*FolderService) GetFolder ¶
TODO(ttacon): can these ids be non-integer? if not, why are they returned as strings in the API TODO(ttacon): return the response for the user to play with if they want Documentation: https://developers.box.com/docs/#folders-get-information-about-a-folder
func (*FolderService) GetFolderItems ¶
func (c *FolderService) GetFolderItems(folderId string) (*http.Response, *ItemCollection, error)
TODO(ttacon): return the response for the user to play with if they want Documentation: https://developers.box.com/docs/#folders-retrieve-a-folders-items
func (*FolderService) GetTrashedFolder ¶
Documentation: https://developers.box.com/docs/#folders-get-a-trashed-folder
func (*FolderService) ItemsInTrash ¶
func (c *FolderService) ItemsInTrash(fields []string, limit, offset int) (*http.Response, *ItemCollection, error)
Documentation: https://developers.box.com/docs/#folders-get-the-items-in-the-trash
func (*FolderService) PermanentlyDeleteTrashedFolder ¶
func (c *FolderService) PermanentlyDeleteTrashedFolder(folderId string) (*http.Response, error)
Documentation: https://developers.box.com/docs/#folders-permanently-delete-a-trashed-folder
func (*FolderService) RestoreTrashedFolder ¶
func (c *FolderService) RestoreTrashedFolder(folderId, name, parent string) (*http.Response, *Folder, error)
Documentation: https://developers.box.com/docs/#folders-restore-a-trashed-folder NOTES:
-name and parent id are not required unless the previous parent folder no longer exists or a folder with the previous name exists
func (*FolderService) Update ¶
Documentation: https://developers.box.com/docs/#folders-update-information-about-a-folder
type GroupCollection ¶
type GroupService ¶
type GroupService struct {
*Client
}
func (*GroupService) AddUserToGroup ¶
func (g *GroupService) AddUserToGroup(uID, gID, role string) (*http.Response, *Membership, error)
Documentation: https://developers.box.com/docs/#groups-add-a-member-to-a-group
func (*GroupService) CreateGroup ¶
Docs: https://developers.box.com/docs/#groups-create-a-group TODO(ttacon): test it
func (*GroupService) DeleteGroup ¶
Docs: https://developers.box.com/docs/#delete-a-group TODO(ttacon): test it
func (*GroupService) DeleteMembership ¶
func (g *GroupService) DeleteMembership(membershipID string) (*http.Response, error)
Documentation: https://developers.box.com/docs/#groups-delete-a-group-membership
func (*GroupService) GroupCollaborations ¶
func (g *GroupService) GroupCollaborations(groupID string) (*http.Response, *Collaborations, error)
Documentation: https://developers.box.com/docs/#get-all-collaborations-for-a-group
func (*GroupService) Groups ¶
func (c *GroupService) Groups() (*http.Response, []Group, error)
Docs: https://developers.box.com/docs/#groups-get-all-groups TODO(ttacon): test it
func (*GroupService) ListMembership ¶
func (g *GroupService) ListMembership(groupID string) (*http.Response, *MembershipCollection, error)
Documentation: https://developers.box.com/docs/#groups-get-the-membership-list-for-a-group
func (*GroupService) Membership ¶
func (g *GroupService) Membership(membershipEntryID string) (*http.Response, *Membership, error)
func (*GroupService) UpdateGroup ¶
Docs: https://developers.box.com/docs/#update-a-group TODO(ttacon): test it
func (*GroupService) UpdateMembership ¶
func (g *GroupService) UpdateMembership(membershipID, role string) (*http.Response, *Membership, error)
Documentation: https://developers.box.com/docs/#groups-update-a-group-membership
type Item ¶
type Item struct { Type string `json:"type,omitempty"` // TODO(ttacon): make this an enum eventually ID string `json:"id,omitempty"` SequenceId string `json:"sequence_id,omitempty"` // no idea what this is supposed to be ETag *string `json:"etag,omitempty"` // again, not sure what this type is supposed to be Name string `json:"name,omitempty"` Login string `json:"login,omitempty"` SHA1 string `json:"sha"` }
type ItemCollection ¶
type Link ¶
type Link struct { Url string `json:"url"` DownloadUrl *string `json:"download_url"` VanityUrl *string `json:"vanity_url"` IsPasswordEnabled bool `json:"is_password_enabled"` DownloadCount int `json:"download_count"` PreviewCount int `json:"preview_count"` Access string `json:"access"` // TODO(ttacon): consider enums for these types of values? Permissions *Permissions `json:"permissions"` }
type LongPollConnInfo ¶
type LongPollInfo ¶
type LongPollInfo struct { ChunkSize int `json:"chunk_size"` Entries []LongPollConnInfo `json:"entries"` }
type Membership ¶
type MembershipCollection ¶
type MembershipCollection struct { CollectionInfo Entries []*Membership `json:"entries"` }
type PathCollection ¶
type Permissions ¶
type Permissions struct { CanDownload bool `json:"can_download"` CanPreview bool `json:"can_preview"` }
TODO(ttacon): leave plurality?
type SharedItem ¶
type SharedItem struct {
// contains filtered or unexported fields
}
func (*SharedItem) UnmarshalJSON ¶
func (s *SharedItem) UnmarshalJSON(data []byte) error
type SharedLinkOptions ¶
type SharedLinkOptions struct {}
type SharedLinkPermissions ¶
type SharedLinkPermissions struct {}
type SharedService ¶
type SharedService struct {
}func (*SharedService) GetItem ¶
func (s *SharedService) GetItem(link, password string) (*http.Response, *SharedItem, error)
Documentation: https://developers.box.com/docs/#shared-items-get-a-shared-item
type Task ¶
type Task struct { Type string `json:"type"` Id string `json:"id"` Item *Item `json:"item"` DueAt *string `json:"due_at"` // TODO(ttacon): time.Time CreatedAt *string `json:"created_at"` // TODO(ttacon): time.Time CreatedBy *Item `json:"created_by"` // TODO(ttacon): change to user Action *string `json:"action"` //TODO(ttacon): validation as this must be 'review'? Message *string `json:"message"` IsCompleted *bool `json:"is_completed"` TaskAssignmentCollection *TaskAssignmentCollection `json:"task_assignment_collection"` }
Documentation: https://developers.box.com/docs/#tasks-task-object TODO(ttacon): add missing fields
type TaskAssignment ¶
type TaskAssignment struct { Type *string `json:"type"` Id string `json:"id"` Item *Item `json:"item"` AssignedTo *Item `json:"assigned_to"` // TODO(ttacon): change to mini-user Message *string `json:"message"` ResolutionState *string `json:"resolution_state"` AssignedBy *Item `json:"assigned_by"` // TODO(ttacon): change to mini-user CompletedAt *string `json:"completed_at"` // TODO(ttacon): time.Time AssignedAt *string `json:"assigned_at"` // TODO(ttacon): time.Time RemindedAt *string `json:"reminded_at"` // TODO(ttacon): time.Time }
TODO(ttacon): find out where the deuce this is defined in their documentation?!?!?!
type TaskAssignmentCollection ¶
type TaskAssignmentCollection struct { TotalCount int `json:"total_count"` Entries []*TaskAssignment `json:"entries"` }
type TaskCollection ¶
type TaskService ¶
type TaskService struct {
*Client
}
func (*TaskService) CreateTask ¶
func (c *TaskService) CreateTask(itemId, itemType, action, message, due_at string) (*http.Response, *Task, error)
Documentation: https://developers.box.com/docs/#tasks-create-a-task
func (*TaskService) CreateTaskAssignment ¶
func (c *TaskService) CreateTaskAssignment(taskId, taskType, assignToId, assignToLogin string) (*http.Response, *TaskAssignment, error)
Documentation: https://developers.box.com/docs/#tasks-create-a-task-assignment
func (*TaskService) DeleteTask ¶
func (c *TaskService) DeleteTask(taskId string) (*http.Response, error)
Documentation: https://developers.box.com/docs/#tasks-delete-a-task
func (*TaskService) DeleteTaskAssignment ¶
func (c *TaskService) DeleteTaskAssignment(taskAssignmentId string) (*http.Response, error)
Documentation: https://developers.box.com/docs/#tasks-delete-a-task-assignment
func (*TaskService) GetAssignmentsForTask ¶
func (c *TaskService) GetAssignmentsForTask(taskId string) (*http.Response, *TaskAssignmentCollection, error)
Documentation: https://developers.box.com/docs/#tasks-get-the-assignments-for-a-task TODO(ttacon): rename when add per resource services
func (*TaskService) GetTask ¶
Documentation: https://developers.box.com/docs/#tasks-get-a-task
func (*TaskService) GetTaskAssignment ¶
func (c *TaskService) GetTaskAssignment(taskAssignmentId string) (*http.Response, *TaskAssignment, error)
Documentation: https://developers.box.com/docs/#tasks-get-a-task-assignment
func (*TaskService) UpdateTask ¶
func (c *TaskService) UpdateTask(taskId, action, message, due_at string) (*http.Response, *Task, error)
Documentation: https://developers.box.com/docs/#tasks-update-a-task
func (*TaskService) UpdateTaskAssignment ¶
func (c *TaskService) UpdateTaskAssignment(taskAssignmentId, message, resolution_state string) (*http.Response, *TaskAssignment, error)
Documentation: https://developers.box.com/docs/#tasks-update-a-task-assignment
type User ¶
type User struct { Type string `json:"type,omitempty"` // TODO(ttacon): make this an enum eventually ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Login string `json:"login,omitempty"` SHA1 string `json:"sha,omitempty"` CreatedAt *string `json:"created_at,omitempty"` // TODO(ttacon): change to time.Time ModifiedAt *string `json:"modified_at,omitempty"` // TODO(ttacon): change to time.Time Role string `json:"role,omitempty"` Language string `json:"language,omitempty"` Timezone string `json:"timezone,omitempty"` SpaceAmount int `json:"space_amount,omitempty"` SpaceUsed int `json:"space_used,omitempty"` MaxUploadSize int `json:"max_upload_size,omitempty"` TrackingCodes string `json:"tracking_codes,omitempty"` // TODO(ttacon): not sure what this should me CanSeeManagedUsers bool `json:"can_see_managed_users,omitempty"` IsSyncEnabled bool `json:"is_sync_enabled,omitempty"` IsExternalCollabRestricted bool `json:"is_external_collab_restricted,omitempty"` Status string `json:"status,omitempty"` JobTitle string `json:"job_title,omitempty"` Phone string `json:"phone,omitempty"` Address string `json:"address,omitempty"` AvatarUrl string `json:"avatar_url,omitempty"` IsExemptFromDeviceLimits bool `json:"is_exempt_from_device_limits,omitempty"` IsExemptFromLoginVerification bool `json:"is_exempt_from_login_verification,omitempty"` Enterprise *Item `json:"enterprise,omitempty"` MyTags []string `json:"my_tags,omitempty"` }
type UserService ¶
type UserService struct {
*Client
}
func (*UserService) AddEmailAlias ¶
func (c *UserService) AddEmailAlias(userID, email string) (*http.Response, *EmailAlias, error)
Docs: https://developers.box.com/docs/#users-add-an-email-alias-for-a-user
func (*UserService) ChangePrimaryLogin ¶
Docs: https://developers.box.com/docs/#users-changing-a-users-primary-login
func (*UserService) CreateUser ¶
Documentation: https://developers.box.com/docs/#users-create-an-enterprise-user
func (*UserService) DeletEmailAlias ¶
Docs: https://developers.box.com/docs/#users-remove-an-email-alias-from-a-user
func (*UserService) DeleteUser ¶
func (u *UserService) DeleteUser(userID string) (*http.Response, error)
Documentation: https://developers.box.com/docs/#users-delete-an-enterprise-user
func (*UserService) EmailAliases ¶
func (c *UserService) EmailAliases(userID string) (*http.Response, []EmailAlias, error)
Docs: https://developers.box.com/docs/#users-get-all-email-aliases-for-a-user
func (*UserService) GetEnterpriseUsers ¶
func (c *UserService) GetEnterpriseUsers() (*http.Response, *Users, error)
func (*UserService) Me ¶
func (c *UserService) Me() (*http.Response, *User, error)
Documentation: https://developers.box.com/docs/#users-get-the-current-users-information
func (*UserService) Membership ¶
func (c *UserService) Membership(userID string) (*http.Response, *MembershipCollection, error)
func (*UserService) UpdateUser ¶
Documentation: https://developers.box.com/docs/#users-update-a-users-information
func (*UserService) User ¶
Documentation: https://developers.box.com/docs/#users-get-a-users-information