goboxer

package module
v0.0.0-...-3e21562 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 23 Imported by: 0

README

goboxer

Build Status Coverage Status

goboxer is UNOFFICIAL Box API(https://developer.box.com/reference) library for golang.

goboxer is UNDER DEVELOPMENT and its API may be destructively changed.

Features

  • Batch request supported.
  • Builtin retry process (HTTP Status Code 429 or 500+)
  • Auto refreshing access_token / refresh_token
NOTICE

JWT auth is not supported currently.

About features for enterprise (Retention policy, Whitelist, etc...), it will not be implemented. ( I have no environment that testing those api! )

Implementation status.
Category SubCategory STATUS Priority
Files Get File Info supported -
Download File supported -
Upload File supported -
Upload File Version supported -
Chunked Upload not yet High
Update File Info supported -
Preflight Check supported -
Delete File supported -
Copy File supported -
Lock and Unlock supported -
Get Thumbnail not yet Low
Get Embed Link not yet Low
Get File Collaborations supported -
Get File Comments not yet Low
Get File Tasks not yet no plan
Representations not yet Low
File Versions Get Versions not yet Low
Get File Version Info not yet Low
Promote Version not yet Low
Delete Old Version not yet Low
Folders Get Folder Info supported -
Get Folder Items supported -
Create Folder supported -
Update Folder supported -
Delete Folder supported -
Copy Folder supported -
Get Folder Collaborations supported -
File and Folder Metadata Get Metadata Template by Name not yet no plan
Get Metadata Template by ID not yet no plan
Create Metadata Template not yet no plan
Update Metadata Template not yet no plan
Delete Metadata Template not yet no plan
Get Enterprise Template not yet no plan
Get all Metadata on File not yet no plan
Get Metadata on File not yet no plan
Create Metadata on File not yet no plan
Update Metadata on File not yet no plan
Delete Metadata on File not yet no plan
Get All Metadata on Folder not yet no plan
Get Metadata on Folder not yet no plan
Create Metadata on Folder not yet no plan
Update Metadata on Folder not yet no plan
Delete Metadata on Folder not yet no plan
Metadata Cascade Policy Get Metadata Cascade Policies not yet no plan
Get Metadata Cascade Policy not yet no plan
Create Metadata Cascade Policy not yet no plan
Delete Metadata Cascade Policy not yet no plan
Force Apply Metadata Cascade Policy not yet no plan
Search Searching for Content not yet Normal
Trash Get Trashed Items not yet Low
Get Trashed Item not yet Low
Restore Item not yet Low
Permanently Delete Item not yet Low
Shared Links Get Shared Link supported -
Create or Update Shared Link supported -
Get Shared Item not yet Normal
Web Links Get Web Link not yet no plan
Create Web Link not yet no plan
Update Web Link not yet no plan
Delete Web Link not yet no plan
Users Get Current User supported -
Get User supported -
Get User Avatar not yet no plan
Create User supported -
Update User supported -
Create App User supported -
Delete User supported -
Get Enterprise Users supported -
Invite User not yet no plan
Move Owned Items not yet no plan
Change User's Login not yet Low
Get Email Aliases not yet Low
Create Email Alias not yet Low
Delete Email Alias not yet Low
Groups Get Group supported -
Create Group supported -
Update Group supported -
Delete Group supported -
Get Enterprise Groups supported -
Groups - Membership Get Membership supported -
Create Membership supported -
Update Membership supported -
Delete Membership supported -
Get Memberships for Group supported -
Get Memberships for User supported -
Get Collaborations for Group supported -
Collaborations Get Collaboration supported -
Create Collaboration supported -
Update Collaboration supported -
Delete Collaboration supported -
Pending Collaborations supported -
Comments Get Comment not yet Low
Create Comment not yet Low
Update Comment not yet Low
Delete Comment not yet Low
Tasks Get Task not yet no plan
Create Task not yet no plan
Update Task not yet no plan
Delete Task not yet no plan
Get Task Assignment not yet no plan
Create Task Assignment not yet no plan
Update Task Assignment not yet no plan
Delete Task Assignment not yet no plan
Get Assignments not yet no plan
Relay Workflow Get List of Published Templates not yet no plan
Get List of Relay Workflows not yet no plan
Launch Relay Workflow not yet no plan
Watermarking Get Watermark on File not yet no plan
Apply Watermark on File not yet no plan
Remove Watermark on File not yet no plan
Get Watermark on Folder not yet no plan
Apply Watermark on Folder not yet no plan
Remove Watermark on Folder not yet no plan
Webhooks Get Webhooks not yet no plan
Get Webhook not yet no plan
Create Weboook not yet no plan
Update Webhook not yet no plan
Delete Webhook not yet no plan
Skills Skill Invocation not yet no plan
Events User Events supported -
Enterprise Events supported -
Long polling not yet no plan
Collections Get Collections not yet no plan
Get Collection Items not yet no plan
Add or Delete Items From a Collection not yet no plan
Recent Items Get Recent Items not yet no plan
Retention Policies Get Retention Policy not yet no plan
Create Retention Policy not yet no plan
Update Retention Policy not yet no plan
Get Retention Policies not yet no plan
Get Retention Policy Assignment not yet no plan
Create Retention Policy Assignment not yet no plan
Get Retention Policy Assignments not yet no plan
Get File Version Retention not yet no plan
Get File Version Retentions not yet no plan
Legal Hold Object Get Legal Hold Policy not yet no plan
Create Legal Hold Policy not yet no plan
Update Legal Hold Policy not yet no plan
Delete Legal Hold Policy not yet no plan
Get Legal Hold Policies not yet no plan
Get Policy Assignment not yet no plan
Create New Policy Assignment not yet no plan
Delete Policy Assignment not yet no plan
Get Policy Assignments not yet no plan
Get File Version Legal Hold not yet no plan
Get File Version Legal Holds not yet no plan
Device Pins Get Device Pin not yet no plan
Delete Device Pin not yet no plan
Get Enterprise Device Pins not yet no plan
Terms of Service Get Terms of Service not yet no plan
Get Terms of Service by ID not yet no plan
Get Terms of Service ID associated with Collaboration object not yet no plan
Create a Terms of Service not yet no plan
Update a Terms of Service not yet no plan
Get Terms of Service User Status not yet no plan
Create Terms of Service User Status not yet no plan
Update Terms of Service User Status not yet no plan
Collaboration Whitelist Get Collaboration Whitelist Entries not yet no plan
Get Collaboration Whitelist Entry by ID not yet no plan
Create Collaboration Whitelist Entry not yet no plan
Delete Collaboration Whitelist Entry not yet no plan
Get Collaboration Whitelist Exempt Users not yet no plan
Get Collaboration Whitelist Exempt Users by ID not yet no plan
Create Collaboration Whitelist Exempt User not yet no plan
Delete Collaboration Whitelist Exempt User not yet no plan
Multi-Zones Get Storage Policy by ID not yet no plan
Get Storage Policies not yet no plan
Get Storage Policy Assignment by ID not yet no plan
Get Storage Policy Assignments not yet no plan
Create Storage Policy Assignment not yet no plan
Update Storage Policy Assignment not yet no plan
Delete Storage Policy Assignment not yet no plan

please refer box's API Reference. https://developer.box.com/reference

Documentation

Index

Constants

View Source
const (
	SharedLinkAccessOpen          = "open"
	SharedLinkAccessCompany       = "company"
	SharedLinkAccessCollaborators = "collaborators"
)
View Source
const (
	ContentTypeApplicationJson = "application/json"
	ContentTypeFormUrlEncoded  = "application/x-www-form-urlencoded"
)
View Source
const (
	HttpHeaderRetryAfter = "Retry-After"
)
View Source
const (
	VERSION = "0.0.1"
)

Variables

View Source
var CollaborationAllFields = []string{"type", "id", "item", "accessible_by", "role", "expires_at",
	"can_view_path", "status", "acknowledged_at", "created_by",
	"created_at", "modified_at", "invite_email"}
View Source
var FilesAllFields = []string{
	"type", "id", "file_version", "sequence_id", "etag", "sha1", "name", "description",
	"size", "path_collection", "created_at", "modified_at", "trashed_at", "purged_at",
	"content_created_at", "content_modified_at", "expires_at", "created_by", "modified_by",
	"owned_by", "shared_link", "parent", "item_status", "version_number", "comment_count",
	"permissions", "tags", "lock", "extension", "is_package", "watermark_info",
	"allowed_invitee_roles", "is_externally_owned", "has_collaborations", "metadata",
}

NOTICE

expiring_embed_link is excluded.

View Source
var FolderAllFields = []string{
	"type", "id", "sequence_id", "etag", "name", "created_at", "modified_at",
	"description", "size", "path_collection", "created_by", "modified_by", "trashed_at", "purged_at",
	"content_created_at", "content_modified_at", "expires_at", "owned_by", "shared_link", "folder_upload_email", "parent",
	"item_status", "item_collection", "sync_state", "has_collaborations", "permissions", "tags",
	"can_non_owners_invite", "collections", "is_externally_owned", "is_collaboration_restricted_to_enterprise",
	"allowed_shared_link_access_levels", "allowed_invitee_roles", "watermark_info", "metadata",
}
View Source
var GroupAllFields = []string{
	"type", "id", "name", "created_at", "modified_at",
	"provenance", "external_sync_identifier", "description",
	"invitability_level", "member_viewability_level",
}
View Source
var UserAllFields = []string{
	"type", "id", "name", "login", "created_at", "modified_at",
	"language", "timezone", "space_amount", "space_used", "max_upload_size",
	"status", "job_title", "phone", "address", "avatar_url", "role",
	"tracking_codes", "can_see_managed_users", "is_sync_enabled",
	"is_external_collab_restricted", "is_exempt_from_device_limits",
	"is_exempt_from_login_verification", "enterprise",
	"my_tags", "hostname", "is_platform_access_only", "external_app_user_id",
}

Functions

func BuildFieldsQueryParams

func BuildFieldsQueryParams(fields []string) string

func NewApiStatusError

func NewApiStatusError(errBody []byte) error

func UnmarshalJSONBoxResourceWrapper

func UnmarshalJSONBoxResourceWrapper(data []byte, v BoxResource) error

func UnmarshalJSONWrapper

func UnmarshalJSONWrapper(data []byte, v interface{}) error

Types

type APIConn

type APIConn struct {
	ClientID           string
	ClientSecret       string
	AccessToken        string
	RefreshToken       string
	TokenURL           string
	RevokeURL          string
	BaseURL            string
	BaseUploadURL      string
	AuthorizationURL   string
	UserAgent          string
	LastRefresh        time.Time
	Expires            float64
	MaxRequestAttempts int

	RestrictedTo []*FileScope `json:"restricted_to"`
	// contains filtered or unexported fields
}

APIConn is the structure for Box API connection

func NewAPIConnWithAccessToken

func NewAPIConnWithAccessToken(accessToken string) *APIConn

NewAPIConnWithAccessToken allocates and returns a new Box API connection from AccessToken.

Instance created by this method can not refresh a AccessToken.

func NewAPIConnWithJwtConfig

func NewAPIConnWithJwtConfig(reader io.Reader, loader JwtConfigLoader) (*APIConn, error)

NewAPIConnWithJwtConfig allocates and returns a new Box API connection from Jwt config.

func NewAPIConnWithJwtConfigForUser

func NewAPIConnWithJwtConfigForUser(reader io.Reader, loader JwtConfigLoader, userId string) (*APIConn, error)

NewAPIConnWithJwtConfigForUser allocates and returns a new Box API connection from Jwt config.

func NewAPIConnWithRefreshToken

func NewAPIConnWithRefreshToken(clientID string, clientSecret string, accessToken string, refreshToken string) *APIConn

NewAPIConnWithRefreshToken allocates and returns a new Box API connection from ClientID,ClientSecret,AccessToken,RefreshToken.

Instance created by this method can refresh a AccessToken.

func (*APIConn) Authenticate

func (ac *APIConn) Authenticate(authCode string) error

Authenticate a user with authCode

func (*APIConn) Refresh

func (ac *APIConn) Refresh() error

Refresh the accessToken and refreshToken

func (*APIConn) RestoreState

func (ac *APIConn) RestoreState(stateData []byte) error

RestoreState deserialize the Box API connection states.

func (*APIConn) SaveState

func (ac *APIConn) SaveState() ([]byte, error)

SaveState serialize the Box API connection states.

func (*APIConn) SetAPIConnRefreshNotifier

func (ac *APIConn) SetAPIConnRefreshNotifier(notifier APIConnRefreshNotifier)

SetAPIConnRefreshNotifier set APIConnRefreshNotifier

type APIConnRefreshNotifier

type APIConnRefreshNotifier interface {
	Success(apiConn *APIConn)
	Fail(apiConn *APIConn, err error)
}

APIConnRefreshNotifier is the interface that notifies the refresh result AccessToken/RefreshToken

type ApiOtherError

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

func (*ApiOtherError) Error

func (e *ApiOtherError) Error() string

func (*ApiOtherError) Format

func (e *ApiOtherError) Format(f fmt.State, c rune)

func (*ApiOtherError) FormatError

func (e *ApiOtherError) FormatError(p xerrors.Printer) error

func (*ApiOtherError) Unwrap

func (e *ApiOtherError) Unwrap() error

type ApiStatusError

type ApiStatusError struct {
	Type        string                 `json:"type"`
	Status      int                    `json:"status,omitempty"`
	Code        string                 `json:"code,omitempty"`
	ContextInfo map[string]interface{} `json:"context_info,omitempty"`
	HelpUrl     string                 `json:"help_url,omitempty"`
	Message     string                 `json:"message,omitempty"`
	RequestId   string                 `json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

Refer https://developer.box.com/reference#errors

func (*ApiStatusError) Error

func (e *ApiStatusError) Error() string

func (*ApiStatusError) Format

func (e *ApiStatusError) Format(f fmt.State, c rune)

func (*ApiStatusError) FormatError

func (e *ApiStatusError) FormatError(p xerrors.Printer) error

func (*ApiStatusError) Unwrap

func (e *ApiStatusError) Unwrap() error

type BatchRequest

type BatchRequest struct {
	Request
}

func NewBatchRequest

func NewBatchRequest(apiConn *APIConn) *BatchRequest

func (*BatchRequest) ExecuteBatch

func (req *BatchRequest) ExecuteBatch(requests []*Request) (*BatchResponse, error)

Execute batch request

type BatchResponse

type BatchResponse struct {
	Response
	Responses []*Response
}

type BoxEvent

type BoxEvent struct {
	Type      string          `json:"type"`
	EventID   string          `json:"event_id"`
	CreatedBy *UserGroupMini  `json:"created_by"`
	EventType EventType       `json:"event_type"`
	SessionID *string         `json:"session_id,omitempty"`
	SourceRaw json.RawMessage `json:"source,omitempty"`

	AdditionalDetails map[string]interface{} `json:"additional_details,omitempty"`
	CreatedAt         time.Time              `json:"created_at"`
	RecordedAt        *time.Time             `json:"recorded_at,omitempty"`
	ActionBy          *UserGroupMini         `json:"action_by"`
	// contains filtered or unexported fields
}

func (*BoxEvent) ResourceType

func (be *BoxEvent) ResourceType() BoxResourceType

func (*BoxEvent) Source

func (be *BoxEvent) Source() BoxResource

func (*BoxEvent) String

func (be *BoxEvent) String() string

type BoxResource

type BoxResource interface {
	ResourceType() BoxResourceType
}

func ParseResource

func ParseResource(jsonEntity []byte) (r BoxResource, err error)

type BoxResourceType

type BoxResourceType int
const (
	FileResource BoxResourceType = iota + 1
	FileVersionResource
	FolderResource
	WebLinkResource
	UserResource
	GroupResource
	MembershipResource
	CollaborationResource
	CommentResource
	TaskResource
	EventResource
	CollectionResource
)

type Collaboration

type Collaboration struct {
	Type           *string              `json:"type,omitempty"`
	ID             *string              `json:"id,omitempty"`
	CreatedBy      *UserGroupMini       `json:"created_by,omitempty"`
	CreatedAt      *time.Time           `json:"created_at,omitempty"`
	ModifiedAt     *time.Time           `json:"modified_at,omitempty"`
	ExpiresAt      *time.Time           `json:"expires_at,omitempty"`
	Status         *CollaborationStatus `json:"status,omitempty"`
	AccessibleBy   *UserGroupMini       `json:"accessible_by"`
	InviteEmail    *string              `json:"invite_email,omitempty"`
	Role           *Role                `json:"role,omitempty"`
	AcknowledgedAt *time.Time           `json:"acknowledged_at,omitempty"`
	Item           *ItemMini            `json:"item,omitempty"`
	CanViewPath    *bool                `json:"can_view_path,omitempty"`
	// contains filtered or unexported fields
}

func NewCollaboration

func NewCollaboration(api *APIConn) *Collaboration

func (*Collaboration) Create

func (c *Collaboration) Create(targetItem ItemMini, grantedTo UserGroupMini, role Role, canViewPath *bool, fields []string, notify bool) (*Collaboration, error)

Create Collaboration

Create a new collaboration that grants a user or group access to a file or folder in a specific role. https://developer.box.com/reference#add-a-collaboration

func (*Collaboration) CreateReq

func (c *Collaboration) CreateReq(targetItem ItemMini, grantedTo UserGroupMini, role Role, canViewPath *bool, fields []string, notify bool) *Request

Create Collaboration

Create a new collaboration that grants a user or group access to a file or folder in a specific role. https://developer.box.com/reference#add-a-collaboration

func (*Collaboration) Delete

func (c *Collaboration) Delete(collaborationId string) error

Delete Collaboration

Delete a collaboration. https://developer.box.com/reference#edit-a-collaboration

func (*Collaboration) DeleteReq

func (c *Collaboration) DeleteReq(collaborationId string) *Request

Delete Collaboration

Delete a collaboration. https://developer.box.com/reference#edit-a-collaboration

func (*Collaboration) GetInfo

func (c *Collaboration) GetInfo(collaborationId string, fields []string) (*Collaboration, error)

Get Collaboration

Get information about a collaboration. https://developer.box.com/reference#get-collabs

func (*Collaboration) GetInfoReq

func (c *Collaboration) GetInfoReq(collaborationId string, fields []string) *Request

Get Collaboration

Get information about a collaboration. https://developer.box.com/reference#get-collabs

func (*Collaboration) PendingCollaborations

func (c *Collaboration) PendingCollaborations(offset int, limit int, fields []string) (pendingList []*Collaboration, outOffset int, outLimit int, outTotalCount int, err error)

Get all pending collaboration invites for a user.

func (*Collaboration) PendingCollaborationsReq

func (c *Collaboration) PendingCollaborationsReq(offset int, limit int, fields []string) *Request

Pending Collaborations

Get all pending collaboration invites for a user. https://developer.box.com/reference#get-pending-collaborations

func (*Collaboration) ResourceType

func (c *Collaboration) ResourceType() BoxResourceType

func (*Collaboration) SetAccessibleByEmailForNewUser

func (c *Collaboration) SetAccessibleByEmailForNewUser(login string) *Collaboration

Set Accessible with email address (for Create) TODO Refactoring. Is this necessary?

func (*Collaboration) SetAccessibleById

func (c *Collaboration) SetAccessibleById(typ UserGroupType, id string) *Collaboration

Set Accessible for box user (for Create) TODO Refactoring. Is this necessary?

func (*Collaboration) SetCanViewPath

func (c *Collaboration) SetCanViewPath(canViewPath bool) *Collaboration

Set CanViewPath (for Create) TODO Refactoring. Is this necessary?

func (*Collaboration) SetItem

func (c *Collaboration) SetItem(typ ItemType, id string) *Collaboration

Set target Item(file or folder) (for Create) TODO Refactoring. Is this necessary?

func (*Collaboration) SetRole

func (c *Collaboration) SetRole(role Role) *Collaboration

Set Role of collaboration (for Create/Update) TODO Refactoring. Is this necessary?

func (*Collaboration) String

func (c *Collaboration) String() string

func (*Collaboration) Update

func (c *Collaboration) Update(collaborationId string, role Role, status *CollaborationStatus, canViewPath *bool, fields []string) (*Collaboration, error)

Update Collaboration

Update a collaboration. https://developer.box.com/reference#edit-a-collaboration

func (*Collaboration) UpdateReq

func (c *Collaboration) UpdateReq(collaborationId string, role Role, status *CollaborationStatus, canViewPath *bool, fields []string) *Request

Update Collaboration

Update a collaboration. https://developer.box.com/reference#edit-a-collaboration

type CollaborationStatus

type CollaborationStatus string
const (
	COLLABORATION_STATUS_ACCEPTED CollaborationStatus = "accepted"
	COLLABORATION_STATUS_PENDING  CollaborationStatus = "pending"
	COLLABORATION_STATUS_REJECTED CollaborationStatus = "rejected"
)

func (*CollaborationStatus) MarshalJSON

func (cs *CollaborationStatus) MarshalJSON() ([]byte, error)

func (*CollaborationStatus) String

func (cs *CollaborationStatus) String() string

type ConfigurablePermissions

type ConfigurablePermissions struct {
	CanRunReports     *bool `json:"can_run_reports,omitempty"`
	CanInstantLogin   *bool `json:"can_instant_login,omitempty"`
	CanCreateAccounts *bool `json:"can_create_accounts,omitempty"`
	CanEditAccounts   *bool `json:"can_edit_accounts,omitempty"`
}

type Enterprise

type Enterprise struct {
	Type EnterpriseType
	Id   string
	Name string
}

func (*Enterprise) MarshalJSON

func (e *Enterprise) MarshalJSON() ([]byte, error)

type EnterpriseType

type EnterpriseType string
const (
	EnterpriseTypeEnterprise EnterpriseType = "enterprise"
	EnterpriseTypeUser       EnterpriseType = "user"
	EnterpriseTypeRolledOut  EnterpriseType = "rolledout"
)

func (*EnterpriseType) MarshalJSON

func (et *EnterpriseType) MarshalJSON() ([]byte, error)

func (*EnterpriseType) String

func (et *EnterpriseType) String() string

type Event

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

func NewEvent

func NewEvent(api *APIConn) *Event

func (*Event) EnterpriseEvent

func (e *Event) EnterpriseEvent(streamPosition string, eventTypes []EventType, createdAfter *time.Time, createdBefore *time.Time, limit int) (events []*BoxEvent, nextStreamPosition string, err error)

Enterprise Events

Retrieves up to a year' events for all users in an enterprise. https://developer.box.com/reference#get-events-in-an-enterprise

func (*Event) UserEvent

func (e *Event) UserEvent(streamType StreamType, streamPosition string, limit int) (events []*BoxEvent, nextStreamPosition string, err error)

User Events

Use this to get events for a given user. A chunk of event objects is returned for the user based on the parameters passed in. Parameters indicating how many chunks are left as well as the next stream_position are also returned. https://developer.box.com/reference#get-events-for-a-user

type EventType

type EventType string
const (
	UNKNOWN_EVENT EventType = "UNKNOWN"

	// User event
	UE_ITEM_CREATE                EventType = "ITEM_CREATE"
	UE_ITEM_UPLOAD                EventType = "ITEM_UPLOAD"
	UE_COMMENT_CREATE             EventType = "COMMENT_CREATE"
	UE_COMMENT_DELETE             EventType = "COMMENT_DELETE"
	UE_ITEM_DOWNLOAD              EventType = "ITEM_DOWNLOAD"
	UE_ITEM_PREVIEW               EventType = "ITEM_PREVIEW"
	UE_ITEM_MOVE                  EventType = "ITEM_MOVE"
	UE_ITEM_COPY                  EventType = "ITEM_COPY"
	UE_TASK_ASSIGNMENT_CREATE     EventType = "TASK_ASSIGNMENT_CREATE"
	UE_TASK_CREATE                EventType = "TASK_CREATE"
	UE_LOCK_CREATE                EventType = "LOCK_CREATE"
	UE_LOCK_DESTROY               EventType = "LOCK_DESTROY"
	UE_ITEM_TRASH                 EventType = "ITEM_TRASH"
	UE_ITEM_UNDELETE_VIA_TRASH    EventType = "ITEM_UNDELETE_VIA_TRASH"
	UE_COLLAB_ADD_COLLABORATOR    EventType = "COLLAB_ADD_COLLABORATOR"
	UE_COLLAB_ROLE_CHANGE         EventType = "COLLAB_ROLE_CHANGE"
	UE_COLLAB_INVITE_COLLABORATOR EventType = "COLLAB_INVITE_COLLABORATOR"
	UE_COLLAB_REMOVE_COLLABORATOR EventType = "COLLAB_REMOVE_COLLABORATOR"
	UE_ITEM_SYNC                  EventType = "ITEM_SYNC"
	UE_ITEM_UNSYNC                EventType = "ITEM_UNSYNC"
	UE_ITEM_RENAME                EventType = "ITEM_RENAME"
	UE_ITEM_SHARED_CREATE         EventType = "ITEM_SHARED_CREATE"
	UE_ITEM_SHARED_UNSHARE        EventType = "ITEM_SHARED_UNSHARE"
	UE_ITEM_SHARED                EventType = "ITEM_SHARED"
	UE_ITEM_MAKE_CURRENT_VERSION  EventType = "ITEM_MAKE_CURRENT_VERSION"
	UE_TAG_ITEM_CREATE            EventType = "TAG_ITEM_CREATE"
	UE_ENABLE_TWO_FACTOR_AUTH     EventType = "ENABLE_TWO_FACTOR_AUTH"
	UE_MASTER_INVITE_ACCEPT       EventType = "MASTER_INVITE_ACCEPT"
	UE_MASTER_INVITE_REJECT       EventType = "MASTER_INVITE_REJECT"
	UE_ACCESS_GRANTED             EventType = "ACCESS_GRANTED"
	UE_ACCESS_REVOKED             EventType = "ACCESS_REVOKED"
	UE_GROUP_ADD_USER             EventType = "GROUP_ADD_USER"
	UE_GROUP_REMOVE_USER          EventType = "GROUP_REMOVE_USER"

	// Enterprise event
	EE_GROUP_ADD_USER                               EventType = "GROUP_ADD_USER"
	EE_NEW_USER                                     EventType = "NEW_USER"
	EE_GROUP_CREATION                               EventType = "GROUP_CREATION"
	EE_GROUP_DELETION                               EventType = "GROUP_DELETION"
	EE_DELETE_USER                                  EventType = "DELETE_USER"
	EE_GROUP_EDITED                                 EventType = "GROUP_EDITED"
	EE_EDIT_USER                                    EventType = "EDIT_USER"
	EE_GROUP_REMOVE_USER                            EventType = "GROUP_REMOVE_USER"
	EE_ADMIN_LOGIN                                  EventType = "ADMIN_LOGIN"
	EE_ADD_DEVICE_ASSOCIATION                       EventType = "ADD_DEVICE_ASSOCIATION"
	EE_CHANGE_FOLDER_PERMISSION                     EventType = "CHANGE_FOLDER_PERMISSION"
	EE_FAILED_LOGIN                                 EventType = "FAILED_LOGIN"
	EE_LOGIN                                        EventType = "LOGIN"
	EE_REMOVE_DEVICE_ASSOCIATION                    EventType = "REMOVE_DEVICE_ASSOCIATION"
	EE_DEVICE_TRUST_CHECK_FAILED                    EventType = "DEVICE_TRUST_CHECK_FAILED"
	EE_TERMS_OF_SERVICE_ACCEPT                      EventType = "TERMS_OF_SERVICE_ACCEPT"
	EE_TERMS_OF_SERVICE_REJECT                      EventType = "TERMS_OF_SERVICE_REJECT"
	EE_FILE_MARKED_MALICIOUS                        EventType = "FILE_MARKED_MALICIOUS"
	EE_COPY                                         EventType = "COPY"
	EE_DELETE                                       EventType = "DELETE"
	EE_DOWNLOAD                                     EventType = "DOWNLOAD"
	EE_EDIT                                         EventType = "EDIT"
	EE_LOCK                                         EventType = "LOCK"
	EE_MOVE                                         EventType = "MOVE"
	EE_PREVIEW                                      EventType = "PREVIEW"
	EE_RENAME                                       EventType = "RENAME"
	EE_STORAGE_EXPIRATION                           EventType = "STORAGE_EXPIRATION"
	EE_UNDELETE                                     EventType = "UNDELETE"
	EE_UNLOCK                                       EventType = "UNLOCK"
	EE_UPLOAD                                       EventType = "UPLOAD"
	EE_SHARE                                        EventType = "SHARE"
	EE_ITEM_SHARED_UPDATE                           EventType = "ITEM_SHARED_UPDATE"
	EE_UPDATE_SHARE_EXPIRATION                      EventType = "UPDATE_SHARE_EXPIRATION"
	EE_SHARE_EXPIRATION                             EventType = "SHARE_EXPIRATION"
	EE_UNSHARE                                      EventType = "UNSHARE"
	EE_COLLABORATION_ACCEPT                         EventType = "COLLABORATION_ACCEPT"
	EE_COLLABORATION_ROLE_CHANGE                    EventType = "COLLABORATION_ROLE_CHANGE"
	EE_UPDATE_COLLABORATION_EXPIRATION              EventType = "UPDATE_COLLABORATION_EXPIRATION"
	EE_COLLABORATION_REMOVE                         EventType = "COLLABORATION_REMOVE"
	EE_COLLABORATION_INVITE                         EventType = "COLLABORATION_INVITE"
	EE_COLLABORATION_EXPIRATION                     EventType = "COLLABORATION_EXPIRATION"
	EE_ITEM_SYNC                                    EventType = "ITEM_SYNC"
	EE_ITEM_UNSYNC                                  EventType = "ITEM_UNSYNC"
	EE_ADD_LOGIN_ACTIVITY_DEVICE                    EventType = "ADD_LOGIN_ACTIVITY_DEVICE"
	EE_REMOVE_LOGIN_ACTIVITY_DEVICE                 EventType = "REMOVE_LOGIN_ACTIVITY_DEVICE"
	EE_USER_AUTHENTICATE_OAUTH2_ACCESS_TOKEN_CREATE EventType = "USER_AUTHENTICATE_OAUTH2_ACCESS_TOKEN_CREATE"
	EE_CHANGE_ADMIN_ROLE                            EventType = "CHANGE_ADMIN_ROLE"
	EE_CONTENT_WORKFLOW_UPLOAD_POLICY_VIOLATION     EventType = "CONTENT_WORKFLOW_UPLOAD_POLICY_VIOLATION"
	EE_METADATA_INSTANCE_CREATE                     EventType = "METADATA_INSTANCE_CREATE"
	EE_METADATA_INSTANCE_UPDATE                     EventType = "METADATA_INSTANCE_UPDATE"
	EE_METADATA_INSTANCE_DELETE                     EventType = "METADATA_INSTANCE_DELETE"
	EE_TASK_ASSIGNMENT_UPDATE                       EventType = "TASK_ASSIGNMENT_UPDATE"
	EE_TASK_ASSIGNMENT_CREATE                       EventType = "TASK_ASSIGNMENT_CREATE"
	EE_TASK_ASSIGNMENT_DELETE                       EventType = "TASK_ASSIGNMENT_DELETE"
	EE_TASK_CREATE                                  EventType = "TASK_CREATE"
	EE_TASK_UPDATE                                  EventType = "TASK_UPDATE"
	EE_COMMENT_CREATE                               EventType = "COMMENT_CREATE"
	EE_COMMENT_DELETE                               EventType = "COMMENT_DELETE"
	EE_DATA_RETENTION_REMOVE_RETENTION              EventType = "DATA_RETENTION_REMOVE_RETENTION"
	EE_DATA_RETENTION_CREATE_RETENTION              EventType = "DATA_RETENTION_CREATE_RETENTION"
	EE_RETENTION_POLICY_ASSIGNMENT_ADD              EventType = "RETENTION_POLICY_ASSIGNMENT_ADD"
	EE_LEGAL_HOLD_ASSIGNMENT_CREATE                 EventType = "LEGAL_HOLD_ASSIGNMENT_CREATE"
	EE_LEGAL_HOLD_ASSIGNMENT_DELETE                 EventType = "LEGAL_HOLD_ASSIGNMENT_DELETE"
	EE_LEGAL_HOLD_POLICY_CREATE                     EventType = "LEGAL_HOLD_POLICY_CREATE"
	EE_LEGAL_HOLD_POLICY_UPDATE                     EventType = "LEGAL_HOLD_POLICY_UPDATE"
	EE_LEGAL_HOLD_POLICY_DELETE                     EventType = "LEGAL_HOLD_POLICY_DELETE"
	EE_CONTENT_WORKFLOW_SHARING_POLICY_VIOLATION    EventType = "CONTENT_WORKFLOW_SHARING_POLICY_VIOLATION"
	EE_APPLICATION_PUBLIC_KEY_ADDED                 EventType = "APPLICATION_PUBLIC_KEY_ADDED"
	EE_APPLICATION_PUBLIC_KEY_DELETED               EventType = "APPLICATION_PUBLIC_KEY_DELETED"
	EE_APPLICATION_CREATED                          EventType = "APPLICATION_CREATED"
	EE_CONTENT_WORKFLOW_POLICY_ADD                  EventType = "CONTENT_WORKFLOW_POLICY_ADD"
	EE_CONTENT_WORKFLOW_AUTOMATION_ADD              EventType = "CONTENT_WORKFLOW_AUTOMATION_ADD"
	EE_CONTENT_WORKFLOW_AUTOMATION_DELETE           EventType = "CONTENT_WORKFLOW_AUTOMATION_DELETE"
	EE_EMAIL_ALIAS_CONFIRM                          EventType = "EMAIL_ALIAS_CONFIRM"
	EE_EMAIL_ALIAS_REMOVE                           EventType = "EMAIL_ALIAS_REMOVE"
	EE_WATERMARK_LABEL_CREATE                       EventType = "WATERMARK_LABEL_CREATE"
	EE_WATERMARK_LABEL_DELETE                       EventType = "WATERMARK_LABEL_DELETE"
	EE_ACCESS_GRANTED                               EventType = "ACCESS_GRANTED"
	EE_ACCESS_REVOKED                               EventType = "ACCESS_REVOKED"
	EE_METADATA_TEMPLATE_CREATE                     EventType = "METADATA_TEMPLATE_CREATE"
	EE_METADATA_TEMPLATE_UPDATE                     EventType = "METADATA_TEMPLATE_UPDATE"
	EE_METADATA_TEMPLATE_DELETE                     EventType = "METADATA_TEMPLATE_DELETE"
	EE_ITEM_OPEN                                    EventType = "ITEM_OPEN"
	EE_ITEM_MODIFY                                  EventType = "ITEM_MODIFY"
	EE_CONTENT_WORKFLOW_ABNORMAL_DOWNLOAD_ACTIVITY  EventType = "CONTENT_WORKFLOW_ABNORMAL_DOWNLOAD_ACTIVITY"
	EE_GROUP_REMOVE_ITEM                            EventType = "GROUP_REMOVE_ITEM"
	EE_GROUP_ADD_ITEM                               EventType = "GROUP_ADD_ITEM"
	EE_FILE_WATERMARKED_DOWNLOAD                    EventType = "FILE_WATERMARKED_DOWNLOAD"
)

type File

type File struct {
	ItemMini

	FileVersion        *FileVersion    `json:"file_version,omitempty"`
	Sha1               *string         `json:"sha1,omitempty"`
	Description        *string         `json:"description,omitempty"`
	Size               float64         `json:"size,omitempty"`
	PathCollection     *PathCollection `json:"path_collection,omitempty"`
	CreatedAt          *time.Time      `json:"created_at,omitempty"`
	ModifiedAt         *time.Time      `json:"modified_at,omitempty"`
	TrashedAt          *time.Time      `json:"trashed_at,omitempty"`
	PurgedAt           *time.Time      `json:"purged_at,omitempty"`
	ContentCreatedAt   *time.Time      `json:"content_created_at,omitempty"`
	ContentModifiedAt  *time.Time      `json:"content_modified_at,omitempty"`
	ExpiresAt          *time.Time      `json:"expires_at,omitempty"`
	CreatedBy          *UserGroupMini  `json:"created_by,omitempty"`
	ModifiedBy         *UserGroupMini  `json:"modified_by,omitempty"`
	OwnedBy            *UserGroupMini  `json:"owned_by,omitempty"`
	SharedLink         *SharedLink     `json:"shared_link,omitempty"`
	Parent             *ItemMini       `json:"parent,omitempty"`
	ItemStatus         *string         `json:"item_status,omitempty"`
	VersionNumber      *string         `json:"version_number,omitempty"`
	CommentCount       *int            `json:"comment_count,omitempty"`
	Permissions        *Permissions    `json:"permissions,omitempty"`
	Tags               []string        `json:"tags,omitempty"`
	Lock               *Lock           `json:"lock,omitempty"`
	Extension          *string         `json:"extension,omitempty"`
	IsPackage          *bool           `json:"is_package,omitempty"`
	ExpiringEmbedLink  *string         `json:"expiring_embed_link,omitempty"`
	WatermarkInfo      *WatermarkInfo  `json:"watermark_info,omitempty"`
	AllowedInviteeRole []string        `json:"allowed_invitee_roles,omitempty"`
	IsExternallyOwned  *bool           `json:"is_externally_owned,omitempty"`
	HasCollaborations  *bool           `json:"has_collaborations,omitempty"`
	Metadata           *Metadata       `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func NewFile

func NewFile(api *APIConn) *File

func (*File) Collaborations

func (f *File) Collaborations(fileId string, marker string, limit int, fields []string) (outCollaborator []*Collaboration, nextMarker string, err error)

Get File Collaborations

Get all of the collaborations on a file (i.e. all of the users that have access to that file). https://developer.box.com/reference#get-file-collaborations

func (*File) CollaborationsReq

func (f *File) CollaborationsReq(fileId string, marker string, limit int, fields []string) *Request

Get File Collaborations

Get all of the collaborations on a file (i.e. all of the users that have access to that file). https://developer.box.com/reference#get-file-collaborations

func (*File) Copy

func (f *File) Copy(fileId string, parentFolderId string, name string, version string, fields []string) (file *File, err error)

Copy File

Used to create a copy of a file in another folder. The original version of the file will not be altered. https://developer.box.com/reference#copy-a-file

func (*File) CopyReq

func (f *File) CopyReq(fileId string, parentFolderId string, name string, version string, fields []string) *Request

Copy File

Used to create a copy of a file in another folder. The original version of the file will not be altered. https://developer.box.com/reference#copy-a-file

func (*File) Delete

func (f *File) Delete(fileId string, ifMatch string) error

Delete File

Discards a file to the trash. The etag of the file can be included as an ‘If-Match’ header to prevent race conditions. https://developer.box.com/reference#delete-a-file

func (*File) DeleteReq

func (f *File) DeleteReq(fileId string, ifMatch string) *Request

Delete File

Discards a file to the trash. The etag of the file can be included as an ‘If-Match’ header to prevent race conditions. https://developer.box.com/reference#delete-a-file

func (*File) DownloadFile

func (f *File) DownloadFile(fileId string, fileVersion string, boxApiHeader string) (*Response, error)

Download File Retrieves the actual data of the file. An optional version parameter can be set to download a previous version of the file. TODO add support for byte-range operation. TODO receive io.Writer ? TODO AS-USER support.

func (*File) GetFileInfo

func (f *File) GetFileInfo(fileId string, needExpiringEmbedLink bool, fields []string) (*File, error)

func (*File) GetFileInfoReq

func (f *File) GetFileInfoReq(fileId string, needExpiringEmbedLink bool, fields []string) *Request

Get File Info Get information about a file.

func (*File) LockFile

func (f *File) LockFile(fileId string, expiresAt *time.Time, isDownloadPrevented *bool, fields []string) (file *File, err error)

Lock https://developer.box.com/reference#lock-and-unlock

TODO consider the receiver type

func (*File) LockFileReq

func (f *File) LockFileReq(fileId string, expiresAt *time.Time, isDownloadPrevented *bool, fields []string) *Request

Lock https://developer.box.com/reference#lock-and-unlock

TODO consider the receiver type

func (*File) PreflightCheck

func (f *File) PreflightCheck(name string, parentFolderId string, size *int) (ok bool, err error)

Preflight Check

func (*File) ResourceType

func (f *File) ResourceType() BoxResourceType

func (*File) SetDescription

func (f *File) SetDescription(description string) *File

func (*File) SetName

func (f *File) SetName(name string) *File

func (*File) SetParent

func (f *File) SetParent(parentFolderId string) *File

func (*File) SetSharedLinkCollaborators

func (f *File) SetSharedLinkCollaborators(unsharedAt time.Time) *File

func (*File) SetSharedLinkCompany

func (f *File) SetSharedLinkCompany(unsharedAt time.Time, canDownload *bool) *File

func (*File) SetSharedLinkOpen

func (f *File) SetSharedLinkOpen(password string, passwordEnabled bool, unsharedAt time.Time, canDownload *bool) *File

func (*File) SetTags

func (f *File) SetTags(tags []string) *File

func (*File) UnlockFile

func (f *File) UnlockFile(fileId string, fields []string) (file *File, err error)

Unlock https://developer.box.com/reference#lock-and-unlock

TODO consider the receiver type

func (*File) UnlockFileReq

func (f *File) UnlockFileReq(fileId string, fields []string) *Request

Unlock https://developer.box.com/reference#lock-and-unlock

TODO consider the receiver type

func (*File) Update

func (f *File) Update(fileId string, ifMatch string, fields []string) (*File, error)

func (*File) UpdateReq

func (f *File) UpdateReq(fileId string, ifMatch string, fields []string) *Request

Update File Info

Update the information about a file, including renaming or moving the file. https://developer.box.com/reference#update-a-files-information TODO Editing passwords is not supported for shared links.(from API Reference)

func (*File) UploadFile

func (f *File) UploadFile(filename string, reader io.Reader, parentFolderId string, contentCreatedAt *time.Time, contentModifiedAt *time.Time, contentMD5 *string) (*File, error)

Upload File Use the Upload API to allow users to add a new file. The user can then upload a file by specifying the destination folder for the file. If the user provides a file name that already exists in the destination folder, the user will receive an error.

TODO AS-USER support. TODO Refactoring

func (*File) UploadFileVersion

func (f *File) UploadFileVersion(fileId string, reader io.Reader, filename *string, contentModifiedAt *time.Time, ifMatch *string, contentMD5 *string) (*File, error)

Upload File Version

Uploading a new file version is performed in the same way as uploading a file. This method is used to upload a new version of an existing file in a user’s account. https://developer.box.com/reference#upload-a-new-version-of-a-file-1 TODO AS-USER support. TODO Refactoring (memory inefficiency, and more)

type FileScope

type FileScope struct {
	Scope     string          `json:"scope"`
	ObjectRaw json.RawMessage `json:"object"`
}

FileScope is a relation between a file and the scopes for which the file can be accessed

func (*FileScope) Object

func (fs *FileScope) Object() BoxResource

Object returns a information of file or folder

type FileVersion

type FileVersion struct {
	Type string `json:"type,omitempty"`
	ID   string `json:"id,omitempty"`
	Sha1 string `json:"sha1,omitempty"`
	// contains filtered or unexported fields
}

func (*FileVersion) ResourceType

func (fv *FileVersion) ResourceType() BoxResourceType

type Folder

type Folder struct {
	ItemMini

	CreatedAt                             *time.Time         `json:"created_at,omitempty"`
	ModifiedAt                            *time.Time         `json:"modified_at,omitempty"`
	Description                           *string            `json:"description,omitempty"`
	Size                                  float64            `json:"size,omitempty"`
	PathCollection                        *PathCollection    `json:"path_collection,omitempty"`
	CreatedBy                             *UserGroupMini     `json:"created_by,omitempty"`
	ModifiedBy                            *UserGroupMini     `json:"modified_by,omitempty"`
	TrashedAt                             *time.Time         `json:"trashed_at,omitempty"`
	PurgedAt                              *time.Time         `json:"purged_at,omitempty"`
	ContentCreatedAt                      *time.Time         `json:"content_created_at,omitempty"`
	ContentModifiedAt                     *time.Time         `json:"content_modified_at,omitempty"`
	ExpiresAt                             *time.Time         `json:"expires_at,omitempty"`
	OwnedBy                               *UserGroupMini     `json:"owned_by,omitempty"`
	SharedLink                            *SharedLink        `json:"shared_link,omitempty"`
	FolderUploadEmail                     *FolderUploadEmail `json:"folder_upload_email,omitempty"`
	Parent                                *ItemMini          `json:"parent,omitempty"`
	ItemStatus                            *string            `json:"item_status,omitempty"`
	ItemCollection                        *ItemCollection    `json:"item_collection,omitempty"`
	SyncState                             *string            `json:"sync_state,omitempty"`
	HasCollaborations                     *bool              `json:"has_collaborations,omitempty"`
	Permissions                           *Permissions       `json:"permissions,omitempty"`
	Tags                                  []string           `json:"tags,omitempty"`
	CanNonOwnersInvite                    *bool              `json:"can_non_owners_invite,omitempty"`
	IsExternallyOwned                     *bool              `json:"is_externally_owned,omitempty"`
	IsCollaborationRestrictedToEnterprise *bool              `json:"is_collaboration_restricted_to_enterprise,omitempty"`
	AllowedSharedLinkAccessLevels         []string           `json:"allowed_shared_link_access_levels,omitempty"`
	AllowedInviteeRole                    []string           `json:"allowed_invitee_roles,omitempty"`
	WatermarkInfo                         *WatermarkInfo     `json:"watermark_info,omitempty"`
	Metadata                              *Metadata          `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func NewFolder

func NewFolder(api *APIConn) *Folder

func (*Folder) Collaborations

func (f *Folder) Collaborations(folderId string, fields []string) ([]*Collaboration, error)

Get Folder Collaborations

Use this to get a list of all the collaborations on a folder i.e. all of the users that have access to that folder. https://developer.box.com/reference#view-a-folders-collaborations

func (*Folder) CollaborationsReq

func (f *Folder) CollaborationsReq(folderId string, fields []string) *Request

Get Folder Collaborations

Use this to get a list of all the collaborations on a folder i.e. all of the users that have access to that folder. https://developer.box.com/reference#view-a-folders-collaborations

func (*Folder) Copy

func (f *Folder) Copy(folderId string, parentFolderId string, newName string, fields []string) (*Folder, error)

Copy Folder

Used to create a copy of a folder in another folder. The original version of the folder will not be altered. https://developer.box.com/reference#copy-a-folder

func (*Folder) CopyReq

func (f *Folder) CopyReq(folderId string, parentFolderId string, newName string, fields []string) *Request

Copy Folder

Used to create a copy of a folder in another folder. The original version of the folder will not be altered. https://developer.box.com/reference#copy-a-folder

func (*Folder) Create

func (f *Folder) Create(parentFolderId string, name string, fields []string) (*Folder, error)

Create Folder

Create a new folder. https://developer.box.com/reference#create-a-new-folder

func (*Folder) CreateReq

func (f *Folder) CreateReq(parentFolderId string, name string, fields []string) *Request

Create Folder

Create a new folder. https://developer.box.com/reference#create-a-new-folder

func (*Folder) Delete

func (f *Folder) Delete(folderId string, recursive bool, ifMatch string) error

Delete Folder

Move a folder to the trash. The recursive parameter must be included in order to delete folders that aren't empty. https://developer.box.com/reference#delete-a-folder

func (*Folder) DeleteReq

func (f *Folder) DeleteReq(folderId string, recursive bool, ifMatch string) *Request

Delete Folder

Move a folder to the trash. The recursive parameter must be included in order to delete folders that aren't empty. https://developer.box.com/reference#delete-a-folder

func (*Folder) FolderItem

func (f *Folder) FolderItem(folderId string, offset int, limit int, sort string, sortDir string, fields []string) (outResources []BoxResource, outOffset, outLimit, outTotalCount int, err error)

Get Folder Items.

Gets all of the files, folders, or web links contained within a folder. https://developer.box.com/reference#get-a-folders-items

sort: "id", "name" or "date"
sortDir: "ASC" or "DESC"

func (*Folder) FolderItemReq

func (f *Folder) FolderItemReq(folderId string, offset int, limit int, sort string, sortDir string, fields []string) *Request

Get Folder Items.

Gets all of the files, folders, or web links contained within a folder. https://developer.box.com/reference#get-a-folders-items

sort: "id", "name" or "date"
sortDir: "ASC" or "DESC"

func (*Folder) GetInfo

func (f *Folder) GetInfo(folderId string, fields []string) (*Folder, error)

Get Folder Info.

Get information about a folder. https://developer.box.com/reference#get-folder-info

func (*Folder) GetInfoReq

func (f *Folder) GetInfoReq(folderId string, fields []string) *Request

Get Folder Info.

Get information about a folder. https://developer.box.com/reference#get-folder-info

func (*Folder) ResourceType

func (f *Folder) ResourceType() BoxResourceType

func (*Folder) SetCanNonOwnersInvite

func (f *Folder) SetCanNonOwnersInvite(b bool) *Folder

Set CanNonOwnersInvite (for Update)

func (*Folder) SetDescription

func (f *Folder) SetDescription(description string) *Folder

Set description (for Update)

func (*Folder) SetFolderUploadEmailAccess

func (f *Folder) SetFolderUploadEmailAccess(fuea FolderUploadEmailAccess) *Folder

func (*Folder) SetIsCollaborationRestrictedToEnterprise

func (f *Folder) SetIsCollaborationRestrictedToEnterprise(b bool) *Folder

Set IsCollaborationRestrictedToEnterprise (for Update)

func (*Folder) SetName

func (f *Folder) SetName(name string) *Folder

Set folder name (for Update)

func (*Folder) SetSharedLinkCollaborators

func (f *Folder) SetSharedLinkCollaborators(unsharedAt time.Time) *Folder

Set SharedLink access level Collaborators (for Update)

func (*Folder) SetSharedLinkCompany

func (f *Folder) SetSharedLinkCompany(unsharedAt time.Time, canDownload *bool) *Folder

Set SharedLink access level Company (for Update)

func (*Folder) SetSharedLinkOpen

func (f *Folder) SetSharedLinkOpen(password string, passwordEnabled bool, unsharedAt time.Time, canDownload *bool) *Folder

Set SharedLink access level Open (for Update)

func (*Folder) SetSyncState

func (f *Folder) SetSyncState(s string) *Folder

Set SyncState (for Update)

func (*Folder) SetTags

func (f *Folder) SetTags(tags []string) *Folder

Set Tags (for Update) Replace current tags to new ones

func (*Folder) String

func (f *Folder) String() string

func (*Folder) Update

func (f *Folder) Update(folderId string, fields []string) (*Folder, error)

Update Folder

Update a folder. https://developer.box.com/reference#update-information-about-a-folder

func (*Folder) UpdateReq

func (f *Folder) UpdateReq(folderId string, fields []string) *Request

Update Folder

Update a folder. https://developer.box.com/reference#update-information-about-a-folder

type FolderUploadEmail

type FolderUploadEmail struct {
	Access *FolderUploadEmailAccess `json:"access,omitempty"`
	Email  *string                  `json:"email,omitempty"`
}

func (*FolderUploadEmail) SetAccess

func (fue *FolderUploadEmail) SetAccess(access FolderUploadEmailAccess)

func (*FolderUploadEmail) String

func (fue *FolderUploadEmail) String() string

type FolderUploadEmailAccess

type FolderUploadEmailAccess string
const (
	FolderUploadEmailAccessOpen          FolderUploadEmailAccess = "open"
	FolderUploadEmailAccessCollaborators FolderUploadEmailAccess = "collaborators"
)

func (*FolderUploadEmailAccess) MarshalJSON

func (f *FolderUploadEmailAccess) MarshalJSON() ([]byte, error)

func (*FolderUploadEmailAccess) String

func (f *FolderUploadEmailAccess) String() string

func (*FolderUploadEmailAccess) UnmarshalJSON

func (f *FolderUploadEmailAccess) UnmarshalJSON(byte []byte) error

type Group

type Group struct {
	UserGroupMini

	CreatedAt              *time.Time              `json:"created_at,omitempty"`
	ModifiedAt             *time.Time              `json:"modified_at,omitempty"`
	Provenance             *string                 `json:"provenance,omitempty"`
	ExternalSyncIdentifier *string                 `json:"external_sync_identifier,omitempty"`
	Description            *string                 `json:"description,omitempty"`
	InvitabilityLevel      *InvitabilityLevel      `json:"invitability_level,omitempty"`
	MemberViewabilityLevel *MemberViewabilityLevel `json:"member_viewability_level,omitempty"`
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(api *APIConn) *Group

func (*Group) CreateGroup

func (g *Group) CreateGroup(fields []string) (*Group, error)

Create Group

Create a new group. Only admin roles can create and manage groups. https://developer.box.com/reference#create-a-group

func (*Group) CreateGroupReq

func (g *Group) CreateGroupReq(fields []string) *Request

Create Group

Create a new group. Only admin roles can create and manage groups. https://developer.box.com/reference#create-a-group

func (*Group) DeleteGroup

func (g *Group) DeleteGroup(groupId string) error

Delete Group

Delete a group. //https://developer.box.com/reference#delete-a-group

func (*Group) DeleteGroupReq

func (g *Group) DeleteGroupReq(groupId string) *Request

Delete Group

Delete a group. //https://developer.box.com/reference#delete-a-group

func (*Group) GetEnterpriseGroups

func (g *Group) GetEnterpriseGroups(name string, offset int32, limit int32, fields []string) (outGroups []*Group, outOffset int, outLimit int, outTotalCount int, err error)

Get Enterprise Groups

Returns all of the groups for given enterprise. Must have permissions to see an enterprise's groups. https://developer.box.com/reference#groups

func (*Group) GetEnterpriseGroupsReq

func (g *Group) GetEnterpriseGroupsReq(name string, offset int32, limit int32, fields []string) *Request

Get Enterprise Groups

Returns all of the groups for given enterprise. Must have permissions to see an enterprise's groups. https://developer.box.com/reference#groups

func (*Group) GetGroup

func (g *Group) GetGroup(groupId string, fields []string) (*Group, error)

Get Group

Get information about a group. https://developer.box.com/reference#get-group

func (*Group) GetGroupReq

func (g *Group) GetGroupReq(groupId string, fields []string) *Request

Get Group

Get information about a group. https://developer.box.com/reference#get-group

func (*Group) ResourceType

func (g *Group) ResourceType() BoxResourceType

func (*Group) SetDescription

func (g *Group) SetDescription(description string) *Group

func (*Group) SetExternalSyncIdentifier

func (g *Group) SetExternalSyncIdentifier(externalSyncIdentifier string) *Group

func (*Group) SetInvitabilityLevel

func (g *Group) SetInvitabilityLevel(invitabilityLevel InvitabilityLevel) *Group

func (*Group) SetMemberViewabiityLevel

func (g *Group) SetMemberViewabiityLevel(memberViewabilityLevel MemberViewabilityLevel) *Group

func (*Group) SetName

func (g *Group) SetName(name string) *Group

func (*Group) SetProvenance

func (g *Group) SetProvenance(provenance string) *Group

func (*Group) UpdateGroup

func (g *Group) UpdateGroup(groupId string, fields []string) (*Group, error)

Update Group

Update a group. https://developer.box.com/reference#update-a-group

func (*Group) UpdateGroupReq

func (g *Group) UpdateGroupReq(groupId string, fields []string) *Request

Update Group

Update a group. https://developer.box.com/reference#update-a-group

type InvitabilityLevel

type InvitabilityLevel string
const (
	InvitabilityAdminsOnly      InvitabilityLevel = "admins_only"
	InvitabilityAdminsMembers   InvitabilityLevel = "admins_and_members"
	InvitabilityAllManagedUsers InvitabilityLevel = "all_managed_users"
)

func (*InvitabilityLevel) MarshalJSON

func (us *InvitabilityLevel) MarshalJSON() ([]byte, error)

func (*InvitabilityLevel) String

func (us *InvitabilityLevel) String() string

type ItemCollection

type ItemCollection struct {
	TotalCount int           `json:"total_count"`
	Entries    []BoxResource `json:"entries,omitempty"`
	Offset     int           `json:"offset"`
	Limit      int           `json:"limit"`
}

func (*ItemCollection) String

func (ic *ItemCollection) String() string

func (*ItemCollection) UnmarshalJSON

func (ic *ItemCollection) UnmarshalJSON(data []byte) error

type ItemMini

type ItemMini struct {
	Type       *ItemType `json:"type,omitempty"`
	ID         *string   `json:"id,omitempty"`
	SequenceId *string   `json:"sequence_id,omitempty"`
	ETag       *string   `json:"etag,omitempty"`
	Name       *string   `json:"name,omitempty"`
}

func (*ItemMini) String

func (m *ItemMini) String() string

type ItemType

type ItemType string
const (
	TYPE_FILE   ItemType = "file"
	TYPE_FOLDER ItemType = "folder"
)

func (*ItemType) MarshalJSON

func (i *ItemType) MarshalJSON() ([]byte, error)

func (*ItemType) String

func (i *ItemType) String() string

type JwtAuthClaim

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

func NewJwtAuthClaim

func NewJwtAuthClaim(config *JwtConfig, pkey interface{}) (*JwtAuthClaim, error)

func NewJwtAuthClaimForUser

func NewJwtAuthClaimForUser(config *JwtConfig, pkey interface{}, userId string) (*JwtAuthClaim, error)

func (*JwtAuthClaim) Claim

func (j *JwtAuthClaim) Claim(tokenUrl string) (string, error)

type JwtConfig

type JwtConfig struct {
	BoxAppSettings struct {
		ClientID     string `json:"clientID"`
		ClientSecret string `json:"clientSecret"`
		AppAuth      struct {
			PublicKeyID string `json:"publicKeyID"`
			PrivateKey  string `json:"privateKey"`
			Passphrase  string `json:"passphrase"`
		} `json:"appAuth"`
	} `json:"boxAppSettings"`
	EnterpriseID string `json:"enterpriseID"`
}

type JwtConfigDefaultLoader

type JwtConfigDefaultLoader struct{}

func (JwtConfigDefaultLoader) DecryptPrivateKey

func (JwtConfigDefaultLoader) DecryptPrivateKey(jwtConfig *JwtConfig) (interface{}, error)

func (JwtConfigDefaultLoader) Load

func (JwtConfigDefaultLoader) Load(reader io.Reader) (*JwtConfig, error)

type JwtConfigLoader

type JwtConfigLoader interface {
	Load(reader io.Reader) (*JwtConfig, error)
	DecryptPrivateKey(jwtConfig *JwtConfig) (interface{}, error)
}

type Lock

type Lock struct {
	Type                *string        `json:"type,omitempty"`
	ID                  *string        `json:"id,omitempty"`
	CreatedBy           *UserGroupMini `json:"created_by,omitempty"`
	CreatedAt           *time.Time     `json:"created_at,omitempty"`
	ExpiresAt           *time.Time     `json:"expires_at,omitempty"`
	IsDownloadPrevented *bool          `json:"is_download_prevented,omitempty"`
}

The lock held on a file.

type Logger

type Logger interface {
	RequestDumpf(format string, args ...interface{})
	ResponseDumpf(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
	EnabledLoggingResponseBody() bool
	EnabledLoggingRequestBody() bool
}
var (
	Log Logger = nil
)

type MemberViewabilityLevel

type MemberViewabilityLevel string
const (
	MemberViewabilityAdminsOnly      MemberViewabilityLevel = "admins_only"
	MemberViewabilityAdminsMembers   MemberViewabilityLevel = "admins_and_members"
	MemberViewabilityAllManagedUsers MemberViewabilityLevel = "all_managed_users"
)

func (*MemberViewabilityLevel) MarshalJSON

func (us *MemberViewabilityLevel) MarshalJSON() ([]byte, error)

func (*MemberViewabilityLevel) String

func (us *MemberViewabilityLevel) String() string

type Membership

type Membership struct {
	Type                    *string                  `json:"type,omitempty"`
	ID                      *string                  `json:"id,omitempty"`
	User                    *UserGroupMini           `json:"user,omitempty"`
	Group                   *UserGroupMini           `json:"group,omitempty"`
	Role                    *MembershipRole          `json:"role,omitempty"`
	CreatedAt               *time.Time               `json:"created_at,omitempty"`
	ModifiedAt              *time.Time               `json:"modified_at,omitempty"`
	ConfigurablePermissions *ConfigurablePermissions `json:"configurable_permissions,omitempty"`
	// contains filtered or unexported fields
}

func NewMembership

func NewMembership(api *APIConn) *Membership

func (*Membership) CreateMembership

func (m *Membership) CreateMembership() (*Membership, error)

Create Membership

Add a member to a group. https://developer.box.com/reference#add-a-member-to-a-group

func (*Membership) CreateMembershipReq

func (m *Membership) CreateMembershipReq() *Request

Create Membership

Add a member to a group. https://developer.box.com/reference#add-a-member-to-a-group

func (*Membership) DeleteMembership

func (m *Membership) DeleteMembership(membershipId string) error

Delete Membership

Delete a group membership. https://developer.box.com/reference#delete-a-group-membership

func (*Membership) DeleteMembershipReq

func (m *Membership) DeleteMembershipReq(membershipId string) *Request

Delete Membership

Delete a group membership. https://developer.box.com/reference#delete-a-group-membership

func (*Membership) GetCollaborationsForGroup

func (m *Membership) GetCollaborationsForGroup(groupId string, offset int32, limit int32) (outCollaborations []*Collaboration, outOffset int, outLimit int, outTotalCount int, err error)

Get Collaborations for Group

Returns all of the group collaborations for a given group. Note this is only available to group admins. https://developer.box.com/reference#get-all-collaborations-for-a-group

func (*Membership) GetCollaborationsForGroupReq

func (m *Membership) GetCollaborationsForGroupReq(groupId string, offset int32, limit int32) *Request

Get Collaborations for Group

Returns all of the group collaborations for a given group. Note this is only available to group admins. https://developer.box.com/reference#get-all-collaborations-for-a-group

func (*Membership) GetMembership

func (m *Membership) GetMembership(membershipId string) (*Membership, error)

Get Membership

Fetches a specific group membership entry. https://developer.box.com/reference#get-a-group-membership-entry

func (*Membership) GetMembershipForGroup

func (m *Membership) GetMembershipForGroup(groupId string, offset int32, limit int32) (outMembership []*Membership, outOffset int, outLimit int, outTotalCount int, err error)

Get Memberships for Group

Returns all of the members for a given group if the requesting user has access. https://developer.box.com/reference#get-the-membership-list-for-a-group

func (*Membership) GetMembershipForGroupReq

func (m *Membership) GetMembershipForGroupReq(groupId string, offset int32, limit int32) *Request

Get Memberships for Group

Returns all of the members for a given group if the requesting user has access. https://developer.box.com/reference#get-the-membership-list-for-a-group

func (*Membership) GetMembershipForUser

func (m *Membership) GetMembershipForUser(userId string, offset int32, limit int32) (outMembership []*Membership, outOffset int, outLimit int, outTotalCount int, err error)

Get Memberships for User

Returns all of the group memberships for a given user. Note this is only available to group admins. To retrieve group memberships for the user making the API request, use the users/me/memberships endpoint. https://developer.box.com/reference#get-all-group-memberships-for-a-user

func (*Membership) GetMembershipForUserReq

func (m *Membership) GetMembershipForUserReq(userId string, offset int32, limit int32) *Request

Get Memberships for User

Returns all of the group memberships for a given user. Note this is only available to group admins. To retrieve group memberships for the user making the API request, use the users/me/memberships endpoint. https://developer.box.com/reference#get-all-group-memberships-for-a-user

func (*Membership) GetMembershipReq

func (m *Membership) GetMembershipReq(membershipId string) *Request

Get Membership

Fetches a specific group membership entry. https://developer.box.com/reference#get-a-group-membership-entry

func (*Membership) ResourceType

func (m *Membership) ResourceType() BoxResourceType

func (*Membership) SetConfigurablePermissions

func (m *Membership) SetConfigurablePermissions(canRunReports, canInstantLogin, canCreateAccounts, canEditAccounts bool) *Membership

func (*Membership) SetGroup

func (m *Membership) SetGroup(groupId string) *Membership

func (*Membership) SetRole

func (m *Membership) SetRole(role MembershipRole) *Membership

func (*Membership) SetUser

func (m *Membership) SetUser(userId string) *Membership

func (*Membership) UpdateMembership

func (m *Membership) UpdateMembership(membershipId string) (*Membership, error)

Update Membership

Update a group membership. https://developer.box.com/reference#update-a-group-membership

func (*Membership) UpdateMembershipReq

func (m *Membership) UpdateMembershipReq(membershipId string) *Request

Update Membership

Update a group membership. https://developer.box.com/reference#update-a-group-membership

type MembershipRole

type MembershipRole string
const (
	MembershipRoleAdmin  MembershipRole = "admin"
	MembershipRoleMember MembershipRole = "member"
)

func (*MembershipRole) MarshalJSON

func (us *MembershipRole) MarshalJSON() ([]byte, error)

func (*MembershipRole) String

func (us *MembershipRole) String() string

type Metadata

type Metadata struct {
}

func (*Metadata) String

func (m *Metadata) String() string

type Method

type Method int
const (
	GET Method = iota + 1
	POST
	PUT
	DELETE
	OPTION
)

type PathCollection

type PathCollection struct {
	TotalCount int         `json:"total_count"`
	Entries    []*ItemMini `json:"entries"`
}

func (*PathCollection) String

func (pc *PathCollection) String() string

type Permissions

type Permissions struct {
	CanDownload           *bool `json:"can_download,omitempty"`
	CanPreview            *bool `json:"can_preview,omitempty"`
	CanUpload             *bool `json:"can_upload,omitempty"`
	CanComment            *bool `json:"can_comment,omitempty"`
	CanAnnotate           *bool `json:"can_annotate,omitempty"`
	CanRename             *bool `json:"can_rename,omitempty"`
	CanDelete             *bool `json:"can_delete,omitempty"`
	CanShare              *bool `json:"can_share,omitempty"`
	CanInviteCollaborator *bool `json:"can_invite_collaborator,omitempty"`
	CanSetShareAccess     *bool `json:"can_set_share_access,omitempty"`
}

func (*Permissions) String

func (p *Permissions) String() string

type Request

type Request struct {
	Url string

	Method Method
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(apiConn *APIConn, url string, method Method, headers http.Header, body io.Reader) *Request

func (*Request) AsUser

func (req *Request) AsUser(userId string) *Request

Execute request as specified user

This functionality required "Perform actions as users" permission. See https://developer.box.com/reference#as-user-1

func (*Request) MarshalJSON

func (req *Request) MarshalJSON() ([]byte, error)

func (*Request) Send

func (req *Request) Send() (*Response, error)

type Response

type Response struct {
	Request      *Request
	ContentType  string
	Headers      http.Header
	Body         []byte
	ResponseCode int
	RTTInMillis  int64
}

type Role

type Role string
const (
	EDITOR             Role = "editor"
	VIEWER             Role = "viewer"
	PREVIEWER          Role = "previewer"
	UPLOADER           Role = "uploader"
	PREVIEWER_UPLOADER Role = "previewer uploader"
	VIEWER_UPLOADER    Role = "viewer uploader"
	CO_OWNER           Role = "co-owner"
	OWNER              Role = "owner"
)

func (*Role) MarshalJSON

func (r *Role) MarshalJSON() ([]byte, error)

func (*Role) String

func (r *Role) String() string
type SharedLink struct {
	Url               *string      `json:"url,omitempty"`
	DownloadUrl       *string      `json:"download_url,omitempty"`
	VanityUrl         *string      `json:"vanity_url,omitempty"`
	IsPasswordEnabled *bool        `json:"is_password_enabled,omitempty"`
	UnsharedAt        *time.Time   `json:"unshared_at,omitempty"`
	DownloadCount     *int         `json:"download_count,omitempty"`
	PreviewCount      *int         `json:"preview_count,omitempty"`
	Access            *string      `json:"access,omitempty"`
	Permissions       *Permissions `json:"permissions,omitempty"`
	Password          *string      `json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*SharedLink) MarshalJSON

func (sl *SharedLink) MarshalJSON() (r []byte, err error)

func (*SharedLink) String

func (sl *SharedLink) String() string

type StreamType

type StreamType string
const (
	All     StreamType = "all"
	Changes StreamType = "changes"
	Sync    StreamType = "sync"
)

type User

type User struct {
	UserGroupMini

	CreatedAt                     *time.Time          `json:"created_at,omitempty"`
	ModifiedAt                    *time.Time          `json:"modified_at,omitempty"`
	Language                      *string             `json:"language,omitempty"`
	Timezone                      *string             `json:"timezone,omitempty"`
	SpaceAmount                   int64               `json:"space_amount,omitempty"`
	SpaceUsed                     int64               `json:"space_used,omitempty"`
	MaxUploadSize                 int                 `json:"max_upload_size,omitempty"`
	Status                        *UserStatus         `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"`
	Role                          *UserRole           `json:"role,omitempty"`
	TrackingCodes                 []map[string]string `json:"tracking_codes,omitempty"`
	CanSeeManagedUsers            *bool               `json:"can_see_managed_users,omitempty"`
	IsSyncEnabled                 *bool               `json:"is_sync_enabled,omitempty"`
	IsExternalCollabRestricted    *bool               `json:"is_external_collab_restricted,omitempty"`
	IsExemptFromDeviceLimits      *bool               `json:"is_exempt_from_device_limits,omitempty"`
	IsExemptFromLoginVerification *bool               `json:"is_exempt_from_login_verification,omitempty"`
	Enterprise                    *Enterprise         `json:"enterprise,omitempty"`
	MyTags                        *[]string           `json:"my_tags,omitempty"`
	Hostname                      *string             `json:"hostname,omitempty"`
	IsPlatformAccessOnly          *bool               `json:"is_platform_access_only,omitempty"`
	ExternalAppUserId             *string             `json:"external_app_user_id,omitempty"`
	IsPasswordResetRequired       *bool               `json:"is_password_reset_required,omitempty"`

	NotifyRolledOut *bool `json:"notify,omitempty"`
	// contains filtered or unexported fields
}

func NewUser

func NewUser(api *APIConn) *User

func (*User) CreateAppUser

func (u *User) CreateAppUser(fields []string) (*User, error)

Create App User

Create a new app user in an enterprise. https://developer.box.com/reference#create-app-user

func (*User) CreateAppUserReq

func (u *User) CreateAppUserReq(fields []string) *Request

Create App User

Create a new app user in an enterprise. https://developer.box.com/reference#create-app-user

func (*User) CreateUser

func (u *User) CreateUser(fields []string) (*User, error)

Create User

Create a new managed user in an enterprise. This method only works for Box admins. https://developer.box.com/reference#create-an-enterprise-user

func (*User) CreateUserReq

func (u *User) CreateUserReq(fields []string) *Request

Create User

Create a new managed user in an enterprise. This method only works for Box admins. https://developer.box.com/reference#create-an-enterprise-user

func (*User) DeleteUser

func (u *User) DeleteUser(userId string, notify bool, force bool) error

Delete User

Delete a user. https://developer.box.com/reference#delete-an-enterprise-user

func (*User) DeleteUserReq

func (u *User) DeleteUserReq(userId string, notify bool, force bool) *Request

Delete User

Delete a user. https://developer.box.com/reference#delete-an-enterprise-user

func (*User) GetCurrentUser

func (u *User) GetCurrentUser(fields []string) (*User, error)

Get User

Get information about a user in the enterprise. Requires enterprise administration authorization. https://developer.box.com/reference#users

func (*User) GetCurrentUserReq

func (u *User) GetCurrentUserReq(fields []string) *Request

Get Current User

Get information about the user who is currently logged in (i.e. the user for whom this access token was generated). https://developer.box.com/reference#get-the-current-users-information

func (*User) GetEnterpriseUsers

func (u *User) GetEnterpriseUsers(filterTerm string, offset int, limit int, fields []string) (outUsers []*User, outOffset int, outLimit int, outTotalCount int, err error)

func (*User) GetEnterpriseUsersReq

func (u *User) GetEnterpriseUsersReq(filterTerm string, offset int, limit int, fields []string) *Request

func (*User) GetUser

func (u *User) GetUser(userId string, fields []string) (*User, error)

Get User

Get information about a user in the enterprise. Requires enterprise administration authorization. https://developer.box.com/reference#users

func (*User) GetUserReq

func (u *User) GetUserReq(userId string, fields []string) *Request

Get User

Get information about a user in the enterprise. Requires enterprise administration authorization. https://developer.box.com/reference#users

func (*User) ResourceType

func (u *User) ResourceType() BoxResourceType

func (*User) SetAddress

func (u *User) SetAddress(address string) *User

func (*User) SetCanSeeManagedUsers

func (u *User) SetCanSeeManagedUsers(canSeeManagedUsers bool) *User

func (*User) SetIsExemptFromDeviceLimits

func (u *User) SetIsExemptFromDeviceLimits(isExemptFromDeviceLimits bool) *User

func (*User) SetIsExemptFromLoginVerification

func (u *User) SetIsExemptFromLoginVerification(isExemptFromLoginVerification bool) *User

func (*User) SetIsExternalCollabRestricted

func (u *User) SetIsExternalCollabRestricted(isExternalCollabRestricted bool) *User

func (*User) SetIsPasswordResetRequired

func (u *User) SetIsPasswordResetRequired(b bool) *User

func (*User) SetIsSyncEnabled

func (u *User) SetIsSyncEnabled(isSyncEnabled bool) *User

func (*User) SetJobTitle

func (u *User) SetJobTitle(jobTitle string) *User

func (*User) SetLanguage

func (u *User) SetLanguage(language string) *User

func (*User) SetLogin

func (u *User) SetLogin(login string) *User

func (*User) SetName

func (u *User) SetName(name string) *User

func (*User) SetPhone

func (u *User) SetPhone(phone string) *User

func (*User) SetRole

func (u *User) SetRole(role UserRole) *User

func (*User) SetRollOutOfEnterprise

func (u *User) SetRollOutOfEnterprise(notify bool) *User

func (*User) SetSpaceAmount

func (u *User) SetSpaceAmount(spaceAmount int64) *User

func (*User) SetStatus

func (u *User) SetStatus(status UserStatus) *User

func (*User) SetTimezone

func (u *User) SetTimezone(timezone string) *User

func (*User) SetTrackingCodes

func (u *User) SetTrackingCodes(trackingCodes []map[string]string) *User

func (*User) UpdateUser

func (u *User) UpdateUser(userId string, fields []string) (*User, error)

Update User

Update the information for a user. https://developer.box.com/reference#update-a-users-information

func (*User) UpdateUserReq

func (u *User) UpdateUserReq(userId string, fields []string) *Request

Update User

Update the information for a user. https://developer.box.com/reference#update-a-users-information

type UserGroupMini

type UserGroupMini struct {
	Type  *UserGroupType `json:"type,omitempty"`
	ID    *string        `json:"id,omitempty"`
	Name  *string        `json:"name,omitempty"`
	Login *string        `json:"login,omitempty"`
}

func (*UserGroupMini) IsUser

func (u *UserGroupMini) IsUser() bool

func (*UserGroupMini) String

func (u *UserGroupMini) String() string

type UserGroupType

type UserGroupType string
const (
	TYPE_USER  UserGroupType = "user"
	TYPE_GROUP UserGroupType = "group"
)

func (*UserGroupType) MarshalJSON

func (u *UserGroupType) MarshalJSON() ([]byte, error)

func (*UserGroupType) String

func (u *UserGroupType) String() string

type UserRole

type UserRole string
const (
	UserRoleAdmin   UserRole = "admin"
	UserRoleCoAdmin UserRole = "coadmin"
	UserRoleUser    UserRole = "user"
)

func (*UserRole) MarshalJSON

func (ur *UserRole) MarshalJSON() ([]byte, error)

func (*UserRole) String

func (ur *UserRole) String() string

type UserStatus

type UserStatus string
const (
	UserStatusActive                 UserStatus = "active"
	UserStatusInactive               UserStatus = "inactive"
	UserStatusCannotDeleteEdit       UserStatus = "cannot_delete_edit"
	UserStatusCannotDeleteEditUpload UserStatus = "cannot_delete_edit_upload"
)

func (*UserStatus) MarshalJSON

func (us *UserStatus) MarshalJSON() ([]byte, error)

func (*UserStatus) String

func (us *UserStatus) String() string

type WatermarkInfo

type WatermarkInfo struct {
	IsWatermarked bool `json:"is_watermarked"`
}

func (*WatermarkInfo) String

func (wi *WatermarkInfo) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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