Documentation ¶
Overview ¶
Package dropbox implements a simple v2 client.
Example ¶
Example using the Client, which provides both User and File clients.
d := dropbox.New(dropbox.NewConfig("<token>")) file, _ := os.Open("Readme.md") d.Files.Upload(&dropbox.UploadInput{ Path: "Readme.md", Reader: file, Mute: true, })
Output:
Example (Files) ¶
Example using the Files client directly.
files := dropbox.NewFiles(dropbox.NewConfig("<token>")) out, _ := files.Download(&dropbox.DownloadInput{ Path: "Readme.md", }) io.Copy(os.Stdout, out.Body)
Output:
Example (Users) ¶
Example using the Users client directly.
users := dropbox.NewUsers(dropbox.NewConfig("<token>")) out, _ := users.GetCurrentAccount() fmt.Printf("%v\n", out)
Output:
Index ¶
- Constants
- Variables
- type ACLUpdatePolicy
- type APIPathRoot
- type AccessType
- type Client
- type Config
- type CopyInput
- type CopyOutput
- type CreateFolderInput
- type CreateFolderOutput
- type CreateSharedLinkInput
- type CreateSharedLinkOutput
- type DeleteInput
- type DeleteOutput
- type Dimensions
- type DownloadInput
- type DownloadOutput
- type Error
- type FileSharingInfo
- type Files
- func (c *Files) Copy(ctx context.Context, in *CopyInput) (out *CopyOutput, err error)
- func (c *Files) CreateFolder(ctx context.Context, in *CreateFolderInput) (out *CreateFolderOutput, err error)
- func (c *Files) Delete(ctx context.Context, in *DeleteInput) (out *DeleteOutput, err error)
- func (c *Files) Download(ctx context.Context, in *DownloadInput) (out *DownloadOutput, err error)
- func (c *Files) GetMetadata(ctx context.Context, in *GetMetadataInput) (out *GetMetadataOutput, err error)
- func (c *Files) GetPreview(ctx context.Context, in *GetPreviewInput) (out *GetPreviewOutput, err error)
- func (c *Files) GetThumbnail(ctx context.Context, in *GetThumbnailInput) (out *GetThumbnailOutput, err error)
- func (c *Files) ListFolder(ctx context.Context, in *ListFolderInput) (out *ListFolderOutput, err error)
- func (c *Files) ListFolderContinue(ctx context.Context, in *ListFolderContinueInput) (out *ListFolderOutput, err error)
- func (c *Files) ListRevisions(ctx context.Context, in *ListRevisionsInput) (out *ListRevisionsOutput, err error)
- func (c *Files) Move(ctx context.Context, in *MoveInput) (out *MoveOutput, err error)
- func (c *Files) PermanentlyDelete(ctx context.Context, in *PermanentlyDeleteInput) (err error)
- func (c *Files) Restore(ctx context.Context, in *RestoreInput) (out *RestoreOutput, err error)
- func (c *Files) Search(ctx context.Context, in *SearchInput) (out *SearchOutput, err error)
- func (c *Files) Upload(ctx context.Context, in *UploadInput) (out *UploadOutput, err error)
- type FolderAction
- type FolderPolicy
- type FullTeam
- type GPSCoordinates
- type GetAccountBatchInput
- type GetAccountBatchOutput
- type GetAccountInput
- type GetAccountOutput
- type GetCurrentAccountOutput
- type GetMetadataInput
- type GetMetadataOutput
- type GetPreviewInput
- type GetPreviewOutput
- type GetSpaceUsageOutput
- type GetThumbnailInput
- type GetThumbnailOutput
- type GroupInfo
- type GroupMembershipInfo
- type GroupType
- type InviteeInfo
- type InviteeMembershipInfo
- type ListFolderContinueInput
- type ListFolderInput
- type ListFolderOutput
- type ListRevisionsInput
- type ListRevisionsOutput
- type ListSharedFileMembersInput
- type ListSharedFolderContinueInput
- type ListSharedFolderInput
- type ListSharedFolderMembersInput
- type ListSharedFolderOutput
- type ListSharedMembersContinueInput
- type ListSharedMembersOutput
- type MediaInfo
- type MediaMetadata
- type MemberAction
- type MemberPermission
- type MemberPolicy
- type Metadata
- type MoveInput
- type MoveOutput
- type Paper
- func (c *Paper) AlphaGetMetadata(ctx context.Context, in *PaperGetMetadataInput) (out *PaperGetMetadataOutput, err error)
- func (c *Paper) Create(ctx context.Context, in *PaperCreateInput) (out *PaperCreateOutput, err error)
- func (c *Paper) Download(ctx context.Context, in *PaperDownloadInput) (out *DownloadOutput, err error)
- func (c *Paper) GetFolderInfo(ctx context.Context, in *PaperGetFolderInfoInput) (out *PaperGetFolderInfoOutput, err error)
- func (c *Paper) ListDocs(ctx context.Context, in *PaperDocsListInput) (out *PaperDocsListOutput, err error)
- func (c *Paper) ListDocsContinue(ctx context.Context, in *PaperDocsListContinueInput) (out *PaperDocsListOutput, err error)
- func (c *Paper) PermanentlyDelete(ctx context.Context, in *PaperPermanentlyDeleteInput) (err error)
- type PaperCreateInput
- type PaperCreateOutput
- type PaperDocStatus
- type PaperDocsListContinueInput
- type PaperDocsListCursor
- type PaperDocsListInput
- type PaperDocsListOutput
- type PaperDownloadInput
- type PaperFolder
- type PaperFolderSharingPolicyType
- type PaperGetFolderInfoInput
- type PaperGetFolderInfoOutput
- type PaperGetMetadataInput
- type PaperGetMetadataOutput
- type PaperPermanentlyDeleteInput
- type PermanentlyDeleteInput
- type PermissionDeniedReason
- type PhotoMetadata
- type RestoreInput
- type RestoreOutput
- type SearchInput
- type SearchMatch
- type SearchMatchType
- type SearchMode
- type SearchOutput
- type SharedFolderMetadata
- type SharedLinkPolicy
- type Sharing
- func (c *Sharing) CreateSharedLink(ctx context.Context, in *CreateSharedLinkInput) (out *CreateSharedLinkOutput, err error)
- func (c *Sharing) ListSharedFileMembers(ctx context.Context, in *ListSharedFileMembersInput) (out *ListSharedMembersOutput, err error)
- func (c *Sharing) ListSharedFileMembersContinue(ctx context.Context, in *ListSharedMembersContinueInput) (out *ListSharedMembersOutput, err error)
- func (c *Sharing) ListSharedFolderMembers(ctx context.Context, in *ListSharedFolderMembersInput) (out *ListSharedMembersOutput, err error)
- func (c *Sharing) ListSharedFolderMembersContinue(ctx context.Context, in *ListSharedMembersContinueInput) (out *ListSharedMembersOutput, err error)
- func (c *Sharing) ListSharedFolders(ctx context.Context, in *ListSharedFolderInput) (out *ListSharedFolderOutput, err error)
- func (c *Sharing) ListSharedFoldersContinue(ctx context.Context, in *ListSharedFolderContinueInput) (out *ListSharedFolderOutput, err error)
- type TeamSharingPolicies
- type ThumbnailFormat
- type ThumbnailSize
- type UploadInput
- type UploadOutput
- type UserInfo
- type UserMembershipInfo
- type Users
- func (c *Users) GetAccount(ctx context.Context, in *GetAccountInput) (out *GetAccountOutput, err error)
- func (c *Users) GetAccountBatch(ctx context.Context, in *GetAccountBatchInput) (out GetAccountBatchOutput, err error)
- func (c *Users) GetCurrentAccount(ctx context.Context) (out *GetCurrentAccountOutput, err error)
- func (c *Users) GetSpaceUsage(ctx context.Context) (out *GetSpaceUsageOutput, err error)
- type VideoMetadata
- type VisibilityType
- type WriteMode
Examples ¶
Constants ¶
const ( SearchModeFilename SearchMode = "filename" SearchModeFilenameAndContent = "filename_and_content" SearchModeDeletedFilename = "deleted_filename" )
Supported search modes.
const ( SearchMatchFilename SearchMatchType = "filename" SearchMatchContent = "content" SearchMatchBoth = "both" )
Supported search match types.
const ( // GetThumbnailSizeW32H32 specifies a size of 32 by 32 px GetThumbnailSizeW32H32 ThumbnailSize = "w32h32" // GetThumbnailSizeW64H64 specifies a size of 64 by 64 px GetThumbnailSizeW64H64 = "w64h64" // GetThumbnailSizeW128H128 specifies a size of 128 by 128 px GetThumbnailSizeW128H128 = "w128h128" // GetThumbnailSizeW640H480 specifies a size of 640 by 480 px GetThumbnailSizeW640H480 = "w640h480" // GetThumbnailSizeW1024H768 specifies a size of 1024 by 768 px GetThumbnailSizeW1024H768 = "w1024h768" )
const ( // PaperDocsFilterAccessed indicates that for this paper/docs/list call we // only want to get documents that the user accessed. PaperDocsFilterAccessed = "docs_accessed" // PaperDocsFilterCreated indicates that for this paper/docs/list call we // only want to get documents that the user created. PaperDocsFilterCreated = "docs_created" // PaperDocsSortByAccessed indicates that for this paper/docs/list call we // want to sort the returned doc IDs in the order in which the documents // were accessed by the user PaperDocsSortByAccessed = "accessed" // PaperDocsSortByModified indicates that for this paper/docs/list call we // want to sort the returned doc IDs in the order in which the documents // were modified by any user PaperDocsSortByModified = "modified" // PaperDocsSortByCreated indicates that for this paper/docs/list call we // want to sort the returned doc IDs in the order in which the documents // were created PaperDocsSortByCreated = "created" // PaperDocsSortAscending indicates that for this paper/docs/list call we // want to return the doc IDs in ascending order for how they are sorted PaperDocsSortAscending = "ascending" // PaperDocsSortDescending indicates that for this paper/docs/list call we // want to return the doc IDs in decending order for how they are sorted PaperDocsSortDescending = "decending" )
const ( // ExportFormatHTML indicates that we want to download a Dropbox Paper file // as HTML. ExportFormatHTML = "html" // ExportFormatMarkdown indicates that we want to download a Dropbox Paper // file as Markdown. ExportFormatMarkdown = "markdown" )
const ( Public VisibilityType = "public" TeamOnly = "team_only" Password = "password" TeamAndPassword = "team_and_password" )
Visibility types supported.
const ( MemberActionMakeEditor MemberAction = "make_editor" MemberActionMakeOwner = "make_owner" MemberActionMakeViewer = "make_viewer" MemberActionRemove = "remove" )
MemberAction possible values.
const ( UserNotOnSameTeamAsOwner PermissionDeniedReason = "user_not_same_team_as_owner" UserNotAllowedByOwner = "user_not_allowed_by_owner" TargetIsIndirectmember = "target_is_indirect_member" TargetIsOwner = "target_is_owner" TargetIsSelf = "target_is_self" TargetNotActive = "target_not_active" )
PermissionDeniedReason possible values
const ( Owner AccessType = "owner" Editor = "editor" Viewer = "viewer" ViewerNoComment = "viewer_no_comment" )
Access types supported.
const (
TooManyRequests = "too_many_requests"
)
error tag constant values
Variables ¶
var HomeNamespace = &APIPathRoot{Tag: "home"}
HomeNamespace is a Dropbox-API-Path-Root header value used for specifying that Dropbox API requests should be sent relative to a user's home namespace.
Functions ¶
This section is empty.
Types ¶
type ACLUpdatePolicy ¶
type ACLUpdatePolicy string
ACLUpdatePolicy determines who can add and remove members from this shared folder.
const ( ACLUpdatePolicyOwner ACLUpdatePolicy = "owner" ACLUpdatePolicyEditors = "editors" )
ACLUpdatePolicy types supported.
type APIPathRoot ¶
type APIPathRoot struct { Tag string `json:".tag"` NamespaceID string `json:"namespace_id,omitempty"` Root string `json:"root,omitempty"` }
APIPathRoot is marshalled onto the Dropbox-API-Path-Root header to indicate which namespace to send Dropbox API requests relative to. doc: https://www.dropbox.com/developers/reference/namespace-guide
func NamespaceIDNamespace ¶
func NamespaceIDNamespace(namespaceID string) *APIPathRoot
NamespaceIDNamespace is a Dropbox-API-Path-Root header value used for specifying that Dropbox API requests should be sent relative to the Dropbox namespace passed in.
func RootNamespace ¶
func RootNamespace(rootNamespaceID string) *APIPathRoot
RootNamespace is a Dropbox-API-Path-Root header value used for specifying that Dropbox API requests should be sent relative to the user's root Dropbox namespace. If a request is sent relative to a namespace that isn't a user's root namespace, then an error occurs.
type AccessType ¶
type AccessType string
AccessType determines the level of access to a shared folder.
type Client ¶
Client implements a Dropbox client. You may use the Files and Users clients directly if preferred, however Client exposes them both.
type Config ¶
type Config struct { HTTPClient *http.Client AccessToken string Namespace *APIPathRoot }
Config for the Dropbox clients.
type CreateFolderInput ¶
type CreateFolderInput struct {
Path string `json:"path"`
}
CreateFolderInput request input.
type CreateFolderOutput ¶
type CreateFolderOutput struct { Name string `json:"name"` PathLower string `json:"path_lower"` ID string `json:"id"` }
CreateFolderOutput request output.
type CreateSharedLinkInput ¶
type CreateSharedLinkInput struct {}
CreateSharedLinkInput request input.
type CreateSharedLinkOutput ¶
type CreateSharedLinkOutput struct { VisibilityType `json:".tag"` } `json:"visibility"` }Tag
CreateSharedLinkOutput request output.
type Dimensions ¶
Dimensions specifies the dimensions of a photo or video.
type DownloadInput ¶
type DownloadInput struct {
Path string `json:"path"`
}
DownloadInput request input.
type DownloadOutput ¶
type DownloadOutput struct { Body io.ReadCloser Length int64 }
DownloadOutput request output.
type Error ¶
type Error struct { Status string StatusCode int Header http.Header Summary string `json:"error_summary"` Message string `json:"user_message"` // optionally present Err interface{} `json:"error"` }
Error response.
type FileSharingInfo ¶
type FileSharingInfo struct { ReadOnly bool `json:"read_only"` ModifiedBy string `json:"modified_by,omitempty"` }
FileSharingInfo for a file which is contained in a shared folder.
type Files ¶
type Files struct {
*Client
}
Files client for files and folders.
func (*Files) CreateFolder ¶
func (c *Files) CreateFolder(ctx context.Context, in *CreateFolderInput) (out *CreateFolderOutput, err error)
CreateFolder creates a folder.
func (*Files) Delete ¶
func (c *Files) Delete(ctx context.Context, in *DeleteInput) (out *DeleteOutput, err error)
Delete a file or folder and its contents.
func (*Files) Download ¶
func (c *Files) Download(ctx context.Context, in *DownloadInput) (out *DownloadOutput, err error)
Download a file.
func (*Files) GetMetadata ¶
func (c *Files) GetMetadata(ctx context.Context, in *GetMetadataInput) (out *GetMetadataOutput, err error)
GetMetadata returns the metadata for a file or folder.
func (*Files) GetPreview ¶
func (c *Files) GetPreview(ctx context.Context, in *GetPreviewInput) (out *GetPreviewOutput, err error)
GetPreview a preview for a file. Currently previews are only generated for the files with the following extensions: .doc, .docx, .docm, .ppt, .pps, .ppsx, .ppsm, .pptx, .pptm, .xls, .xlsx, .xlsm, .rtf
func (*Files) GetThumbnail ¶
func (c *Files) GetThumbnail(ctx context.Context, in *GetThumbnailInput) (out *GetThumbnailOutput, err error)
GetThumbnail a thumbnail for a file. Currently thumbnails are only generated for the files with the following extensions: png, jpeg, png, tiff, tif, gif and bmp.
func (*Files) ListFolder ¶
func (c *Files) ListFolder(ctx context.Context, in *ListFolderInput) (out *ListFolderOutput, err error)
ListFolder returns the metadata for a file or folder.
func (*Files) ListFolderContinue ¶
func (c *Files) ListFolderContinue(ctx context.Context, in *ListFolderContinueInput) (out *ListFolderOutput, err error)
ListFolderContinue pagenates using the cursor from ListFolder.
func (*Files) ListRevisions ¶
func (c *Files) ListRevisions(ctx context.Context, in *ListRevisionsInput) (out *ListRevisionsOutput, err error)
ListRevisions gets the revisions of the specified file.
func (*Files) PermanentlyDelete ¶
func (c *Files) PermanentlyDelete(ctx context.Context, in *PermanentlyDeleteInput) (err error)
PermanentlyDelete a file or folder and its contents.
func (*Files) Restore ¶
func (c *Files) Restore(ctx context.Context, in *RestoreInput) (out *RestoreOutput, err error)
Restore a file to a specific revision.
func (*Files) Search ¶
func (c *Files) Search(ctx context.Context, in *SearchInput) (out *SearchOutput, err error)
Search for files and folders.
func (*Files) Upload ¶
func (c *Files) Upload(ctx context.Context, in *UploadInput) (out *UploadOutput, err error)
Upload a file smaller than 150MB.
type FolderAction ¶
type FolderAction struct {
ChangeOptions string
}
FolderAction defines actions that may be taken on shared folders.
type FolderPolicy ¶
type FolderPolicy struct { ACLUpdatePolicy struct { Tag ACLUpdatePolicy `json:".tag"` } `json:"acl_update_policy"` Tag SharedLinkPolicy `json:".tag"` } `json:"shared_link_policy"` MemberPolicy struct { Tag MemberPolicy `json:".tag"` } `json:"member_policy"` ResolvedMemberPolicy struct { Tag MemberPolicy `json:".tag"` } `json:"resolved_member_policy"` }
FolderPolicy enumerates the policies governing this shared folder.
type FullTeam ¶
type FullTeam struct { ID string `json:"id"` Name string `json:"name"` SharingPolicies TeamSharingPolicies `json:"sharing_policies"` OfficeAddinPolicy struct { Tag string `json:"tag"` } `json:"office_addin_policy"` }
FullTeam represents a Dropbox team.
type GPSCoordinates ¶
type GPSCoordinates struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` }
GPSCoordinates specifies the GPS coordinate of a photo or video.
type GetAccountBatchInput ¶
type GetAccountBatchInput struct {
AccountIDs []string `json:"account_ids"`
}
GetAccountBatchInput request input. At most 300 ids may be listed.
type GetAccountBatchOutput ¶
type GetAccountBatchOutput []*GetAccountOutput
GetAccountBatchOutput request output.
type GetAccountInput ¶
type GetAccountInput struct {
AccountID string `json:"account_id"`
}
GetAccountInput request input.
type GetAccountOutput ¶
type GetAccountOutput struct { AccountID string `json:"account_id"` Name struct { GivenName string `json:"given_name"` Surname string `json:"surname"` FamiliarName string `json:"familiar_name"` DisplayName string `json:"display_name"` } `json:"name"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` Disabled bool `json:"disabled"` IsTeammate bool `json:"is_teammate"` }
GetAccountOutput request output.
type GetCurrentAccountOutput ¶
type GetCurrentAccountOutput struct { AccountID string `json:"account_id"` Name struct { GivenName string `json:"given_name"` Surname string `json:"surname"` FamiliarName string `json:"familiar_name"` DisplayName string `json:"display_name"` } `json:"name"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` Disabled bool `json:"disabled"` Country string `json:"country"` Locale string `json:"locale"` ReferralLink string `json:"referral_link"` TeamMemberID string `json:"team_member_id"` IsPaired bool `json:"is_paired"` AccountType struct { Tag string `json:".tag"` } `json:"account_type"` RootInfo struct { Tag string `json:".tag"` RootNamespaceID string `json:"root_namespace_id"` HomeNamespaceID string `json:"home_namespace_id"` HomePath string `json:"home_path"` } `json:"root_info"` }
GetCurrentAccountOutput request output.
type GetMetadataInput ¶
type GetMetadataInput struct { Path string `json:"path"` IncludeMediaInfo bool `json:"include_media_info"` }
GetMetadataInput request input.
type GetMetadataOutput ¶
type GetMetadataOutput struct {
Metadata
}
GetMetadataOutput request output.
type GetPreviewInput ¶
type GetPreviewInput struct {
Path string `json:"path"`
}
GetPreviewInput request input.
type GetPreviewOutput ¶
type GetPreviewOutput struct { Body io.ReadCloser Length int64 }
GetPreviewOutput request output.
type GetSpaceUsageOutput ¶
type GetSpaceUsageOutput struct { Used uint64 `json:"used"` Allocation struct { Used uint64 `json:"used"` Allocated uint64 `json:"allocated"` } `json:"allocation"` }
GetSpaceUsageOutput request output.
type GetThumbnailInput ¶
type GetThumbnailInput struct { Path string `json:"path"` Format ThumbnailFormat `json:"format"` Size ThumbnailSize `json:"size"` }
GetThumbnailInput request input.
type GetThumbnailOutput ¶
type GetThumbnailOutput struct { Body io.ReadCloser Length int64 }
GetThumbnailOutput request output.
type GroupInfo ¶
type GroupInfo struct { GroupName string `json:"group_name"` GroupID string `json:"group_id"` GroupType struct { Tag GroupType `json:".tag"` } `json:"group_type"` IsOwner bool `json:"is_owner"` SameTeam bool `json:"same_team"` GroupExternalID string `json:"group_external_id,omitempty"` MemberCount *uint32 `json:"member_count,omitempty"` }
GroupInfo defines information about the membership group.
type GroupMembershipInfo ¶
type GroupMembershipInfo struct { AccessType struct { Tag AccessType `json:".tag"` } `json:"access_type"` Group GroupInfo `json:"group"` Permissions []MemberPermission `json:"permissions,omitempty"` Initials *string `json:"initials,omitempty"` IsInherited bool `json:"is_inherited"` }
GroupMembershipInfo is information about a group member of the shared folder.
type GroupType ¶
type GroupType string
GroupType determines how a group is created and managed.
const ( GroupTypeTeam GroupType = "team" GroupTypeUserManaged = "user_managed" )
GroupType possible values.
type InviteeInfo ¶
type InviteeInfo struct {
Email string `json:"email"`
}
InviteeInfo contains information about the recipient of a shared folder invitation.
type InviteeMembershipInfo ¶
type InviteeMembershipInfo struct { AccessType struct { Tag AccessType `json:".tag"` } `json:"access_type"` Invitee InviteeInfo `json:"invitee"` Permissions []MemberPermission `json:"permissions,omitempty"` Initials *string `json:"initials,omitempty"` IsInherited bool `json:"is_inherited"` }
InviteeMembershipInfo is information about an invited member of a shared folder.
type ListFolderContinueInput ¶
type ListFolderContinueInput struct {
Cursor string `json:"cursor"`
}
ListFolderContinueInput request input.
type ListFolderInput ¶
type ListFolderInput struct { Path string `json:"path"` Recursive bool `json:"recursive"` IncludeMediaInfo bool `json:"include_media_info"` IncludeDeleted bool `json:"include_deleted"` }
ListFolderInput request input.
type ListFolderOutput ¶
type ListFolderOutput struct { Cursor string `json:"cursor"` HasMore bool `json:"has_more"` Entries []*Metadata }
ListFolderOutput request output.
type ListRevisionsInput ¶
ListRevisionsInput request input.
type ListRevisionsOutput ¶
ListRevisionsOutput request output.
type ListSharedFileMembersInput ¶
type ListSharedFileMembersInput struct {}
ListSharedFileMembersInput request input.
type ListSharedFolderContinueInput ¶
type ListSharedFolderContinueInput struct {
}ListSharedFolderContinueInput request input.
type ListSharedFolderInput ¶
type ListSharedFolderInput struct {}
ListSharedFolderInput request input.
type ListSharedFolderMembersInput ¶
type ListSharedFolderMembersInput struct {}
ListSharedFolderMembersInput request input.
type ListSharedFolderOutput ¶
type ListSharedFolderOutput struct {}
ListSharedFolderOutput lists metadata about shared folders with a cursor to retrieve the next page.
type ListSharedMembersContinueInput ¶
type ListSharedMembersContinueInput struct {
}ListSharedMembersContinueInput is the input for continuing listing file/folder members.
type ListSharedMembersOutput ¶
type ListSharedMembersOutput struct {}
ListSharedMembersOutput enumerates shared file/folder user and group membership.
type MediaInfo ¶
type MediaInfo struct { Pending bool `json:"pending"` Metadata *MediaMetadata `json:"metadata,omitempty"` }
MediaInfo provides additional information for a photo or video file.
type MediaMetadata ¶
type MediaMetadata struct { Tag string `json:".tag"` Dimensions *Dimensions `json:"dimensions,omitempty"` Location *GPSCoordinates `json:"location,omitempty"` TimeTaken time.Time `json:"time_taken,omitempty"` PhotoMetadata VideoMetadata }
MediaMetadata provides metadata for a photo or video.
type MemberAction ¶
type MemberAction string
MemberAction indicates the action that the user may wish to take on the member.
type MemberPermission ¶
type MemberPermission struct { Action MemberAction `json:"action"` Allow bool `json:"allow"` Reason PermissionDeniedReason `json:"reason,omitempty"` }
MemberPermission indicates whether the user is allowed to take the action on the associated member.
type MemberPolicy ¶
type MemberPolicy string
MemberPolicy determines who can be a member of this shared folder, as set on the folder itself.
const ( MemberPolicyTeam MemberPolicy = "team" MemberPolicyAnyone = "anyone" )
MemberPolicy types supported.
type Metadata ¶
type Metadata struct { Tag string `json:".tag"` Name string `json:"name"` PathLower string `json:"path_lower"` PathDisplay string `json:"path_display"` ClientModified time.Time `json:"client_modified"` ServerModified time.Time `json:"server_modified"` Rev string `json:"rev"` Size uint64 `json:"size"` ID string `json:"id"` MediaInfo *MediaInfo `json:"media_info,omitempty"` SharingInfo *FileSharingInfo `json:"sharing_info,omitempty"` }
Metadata for a file or folder.
type Paper ¶
type Paper struct {
*Client
}
Paper client for Dropbox Paper.
func (*Paper) AlphaGetMetadata ¶
func (c *Paper) AlphaGetMetadata(ctx context.Context, in *PaperGetMetadataInput) (out *PaperGetMetadataOutput, err error)
AlphaGetMetadata returns metadata for the requested file. Note that this is an currently an alpha endpoint, and may disappear.
func (*Paper) Create ¶
func (c *Paper) Create(ctx context.Context, in *PaperCreateInput) (out *PaperCreateOutput, err error)
Create creates a Dropbox Paper file on a user's Dropbox Paper.
func (*Paper) Download ¶
func (c *Paper) Download(ctx context.Context, in *PaperDownloadInput) (out *DownloadOutput, err error)
Download a Dropbox Paper.
func (*Paper) GetFolderInfo ¶
func (c *Paper) GetFolderInfo(ctx context.Context, in *PaperGetFolderInfoInput) (out *PaperGetFolderInfoOutput, err error)
GetFolderInfo returns information on which folders the requested Dropbox Paper is part of.
func (*Paper) ListDocs ¶
func (c *Paper) ListDocs(ctx context.Context, in *PaperDocsListInput) (out *PaperDocsListOutput, err error)
ListDocs returns the documents in a user's Dropbox Paper.
func (*Paper) ListDocsContinue ¶
func (c *Paper) ListDocsContinue(ctx context.Context, in *PaperDocsListContinueInput) (out *PaperDocsListOutput, err error)
ListDocsContinue paginates using the cursor from ListDocs.
func (*Paper) PermanentlyDelete ¶
func (c *Paper) PermanentlyDelete(ctx context.Context, in *PaperPermanentlyDeleteInput) (err error)
PermanentlyDelete a file or folder and its contents.
type PaperCreateInput ¶
type PaperCreateInput struct { ImportFormat string `json:"import_format"` ParentFolderID string `json:"parent_folder_id,omitempty"` Reader io.Reader `json:"-"` }
PaperCreateInput is the Dropbox-API-Arg JSON format for providing options on the format, and the parent folder ID if passed in, of the Dropbox Paper being created.
type PaperCreateOutput ¶
type PaperCreateOutput struct { DocID string `json:"doc_id"` Revision int64 `json:"revision"` Title string `json:"title"` }
PaperCreateOutput is the returned response format for a successful request to the /paper/create endpoint.
type PaperDocStatus ¶
type PaperDocStatus struct {
Tag string `json:".tag"`
}
PaperDocStatus contains information about whether a Dropbox Paper is active or deleted.
type PaperDocsListContinueInput ¶
type PaperDocsListContinueInput struct {
Cursor string `json:"cursor"`
}
PaperDocsListContinueInput is the payload for /paper/docs/list/continue requests.
type PaperDocsListCursor ¶
type PaperDocsListCursor struct { Value string `json:"value"` Expiration time.Time `json:"expiration"` }
PaperDocsListCursor is a cursor to use in /paper/docs/list/continue calls to continue listing papers where the previous list call left off.
type PaperDocsListInput ¶
type PaperDocsListInput struct { FilterBy string `json:"filter_by,omitempty"` SortBy string `json:"sort_by,omitempty"` SortOrder string `json:"sort_order,omitempty"` Limit int `json:"limit,omitempty"` }
PaperDocsListInput is the payload for /paper/docs/list requests.
type PaperDocsListOutput ¶
type PaperDocsListOutput struct { DocIDs []string `json:"doc_ids"` Cursor PaperDocsListCursor `json:"cursor"` HasMore bool `json:"has_more"` }
PaperDocsListOutput is the response format for /paper/docs/list and /paper/docs/list/continue.
type PaperDownloadInput ¶
type PaperDownloadInput struct { DocID string `json:"doc_id"` ExportFormat string `json:"export_format"` }
PaperDownloadInput is the request format for downloading a Dropbox paper, including the paper's ID and the format we want to download it in.
type PaperFolder ¶
PaperFolder contains the ID and display name of a folder containing a Dropbox Paper.
type PaperFolderSharingPolicyType ¶
type PaperFolderSharingPolicyType struct {
Tag string `json:".tag"`
}
PaperFolderSharingPolicyType is the folder sharing policy for the folder that contains the requested Drobox Paper; can be either "team or "invite_only".
type PaperGetFolderInfoInput ¶
type PaperGetFolderInfoInput struct {
DocID string `json:"doc_id"`
}
PaperGetFolderInfoInput is the request payload format for /paper/docs/get_folder_info requests, indicating the ID of the Dropbox Paper document that the caller wants to get folder information for.
type PaperGetFolderInfoOutput ¶
type PaperGetFolderInfoOutput struct { FolderSharingPolicyType PaperFolderSharingPolicyType `json:"folder_sharing_policy_type,omitempty"` Folders []PaperFolder `json:"folders,omitempty"` }
PaperGetFolderInfoOutput is the response format for /paper/docs/get_folder_info requests, containing information on which folders the requested Dropbox Paper is a part of.
type PaperGetMetadataInput ¶
type PaperGetMetadataInput struct {
DocID string `json:"doc_id"`
}
PaperGetMetadataInput is the request payload format for the alpha /paper/docs/get_metadata requests, indicating the ID of the Dropbox Paper document that the caller wants to get metadata for.
type PaperGetMetadataOutput ¶
type PaperGetMetadataOutput struct { DocID string `json:"doc_id"` Owner string `json:"owner"` Title string `json:"title"` CreatedDate time.Time `json:"created_date"` Status PaperDocStatus `json:"status"` Revision int64 `json:"revision"` LastUpdatedDate time.Time `json:"last_updated_date"` LastEditor string `json:"last_editor"` }
PaperGetMetadataOutput is the response format for the alpha /paper/docs/get_metadata endpoint, containing metadata on a Dropbox Paper.
type PaperPermanentlyDeleteInput ¶
type PaperPermanentlyDeleteInput struct {
DocID string `json:"doc_id"`
}
PaperPermanentlyDeleteInput request input.
type PermanentlyDeleteInput ¶
type PermanentlyDeleteInput struct {
Path string `json:"path"`
}
PermanentlyDeleteInput request input.
type PermissionDeniedReason ¶
type PermissionDeniedReason string
PermissionDeniedReason is the reason the user is denied a permission.
type RestoreInput ¶
RestoreInput request input.
type SearchInput ¶
type SearchInput struct { Path string `json:"path"` Query string `json:"query"` Start uint64 `json:"start,omitempty"` MaxResults uint64 `json:"max_results,omitempty"` Mode SearchMode `json:"mode"` }
SearchInput request input.
type SearchMatch ¶
type SearchMatch struct { MatchType struct { Tag SearchMatchType `json:".tag"` } `json:"match_type"` Metadata *Metadata `json:"metadata"` }
SearchMatch represents a matched file or folder.
type SearchMatchType ¶
type SearchMatchType string
SearchMatchType represents the type of match made.
type SearchOutput ¶
type SearchOutput struct { Matches []*SearchMatch `json:"matches"` More bool `json:"more"` Start uint64 `json:"start"` }
SearchOutput request output.
type SharedFolderMetadata ¶
type SharedFolderMetadata struct { AccessType `json:".tag"` } `json:"access_type"` ID string `json:"id"` Name string `json:"name"` } `json:"owner_team"` }Tag
SharedFolderMetadata includes basic information about the shared folder.
type SharedLinkPolicy ¶
type SharedLinkPolicy string
SharedLinkPolicy governs who can view shared links.
const ()
SharedLinkPolicy types supported.
type Sharing ¶
type Sharing struct {
*Client
}
Sharing client.
func (*Sharing) CreateSharedLink ¶
func (c *Sharing) CreateSharedLink(ctx context.Context, in *CreateSharedLinkInput) (out *CreateSharedLinkOutput, err error)
CreateSharedLink returns a shared link.
func (*Sharing) ListSharedFileMembers ¶
func (c *Sharing) ListSharedFileMembers(ctx context.Context, in *ListSharedFileMembersInput) (out *ListSharedMembersOutput, err error)
ListSharedFileMembers returns shared file membership by its file ID.
func (*Sharing) ListSharedFileMembersContinue ¶
func (c *Sharing) ListSharedFileMembersContinue(ctx context.Context, in *ListSharedMembersContinueInput) (out *ListSharedMembersOutput, err error)
ListSharedFileMembersContinue returns shared file membership by its file ID.
func (*Sharing) ListSharedFolderMembers ¶
func (c *Sharing) ListSharedFolderMembers(ctx context.Context, in *ListSharedFolderMembersInput) (out *ListSharedMembersOutput, err error)
ListSharedFolderMembers returns shared folder membership by its folder ID.
func (*Sharing) ListSharedFolderMembersContinue ¶
func (c *Sharing) ListSharedFolderMembersContinue(ctx context.Context, in *ListSharedMembersContinueInput) (out *ListSharedMembersOutput, err error)
ListSharedFolderMembersContinue returns shared folder membership by its folder ID.
func (*Sharing) ListSharedFolders ¶
func (c *Sharing) ListSharedFolders(ctx context.Context, in *ListSharedFolderInput) (out *ListSharedFolderOutput, err error)
ListSharedFolders returns the list of all shared folders the current user has access to.
func (*Sharing) ListSharedFoldersContinue ¶
func (c *Sharing) ListSharedFoldersContinue(ctx context.Context, in *ListSharedFolderContinueInput) (out *ListSharedFolderOutput, err error)
ListSharedFoldersContinue returns the list of all shared folders the current user has access to.
type TeamSharingPolicies ¶
type TeamSharingPolicies struct { string `json:"tag"` } `json:"shared_folder_member_policy"` Tag string `json:"tag"` } `json:"shared_folder_join_policy"` Tag string `json:"tag"` } `json:"shared_link_create_policy"` }Tag
TeamSharingPolicies represents the sharing policies for a Dropbox team.
type ThumbnailFormat ¶
type ThumbnailFormat string
ThumbnailFormat determines the format of the thumbnail.
const ( // GetThumbnailFormatJPEG specifies a JPG thumbnail GetThumbnailFormatJPEG ThumbnailFormat = "jpeg" // GetThumbnailFormatPNG specifies a PNG thumbnail GetThumbnailFormatPNG = "png" )
type UploadInput ¶
type UploadInput struct { Path string `json:"path"` Mode WriteMode `json:"mode"` AutoRename bool `json:"autorename"` Mute bool `json:"mute"` ClientModified time.Time `json:"client_modified,omitempty"` Reader io.Reader `json:"-"` }
UploadInput request input.
type UserInfo ¶
type UserInfo struct { AccountID string `json:"account_id"` SameTeam bool `json:"same_team"` TeamMemberID string `json:"team_member_id"` }
UserInfo is the account information for the membership user.
type UserMembershipInfo ¶
type UserMembershipInfo struct { AccessType struct { Tag AccessType `json:".tag"` } `json:"access_type"` User UserInfo `json:"user"` Permissions []MemberPermission `json:"permissions,omitempty"` Initials string `json:"initials,omitempty"` IsInherited bool `json:"is_inherited"` }
UserMembershipInfo is information about a user member of the shared folder.
type Users ¶
type Users struct {
*Client
}
Users client for user accounts.
func (*Users) GetAccount ¶
func (c *Users) GetAccount(ctx context.Context, in *GetAccountInput) (out *GetAccountOutput, err error)
GetAccount returns information about a user's account.
func (*Users) GetAccountBatch ¶
func (c *Users) GetAccountBatch(ctx context.Context, in *GetAccountBatchInput) (out GetAccountBatchOutput, err error)
GetAccountBatch returns a list of information about users' accounts.
func (*Users) GetCurrentAccount ¶
func (c *Users) GetCurrentAccount(ctx context.Context) (out *GetCurrentAccountOutput, err error)
GetCurrentAccount returns information about the current user's account.
func (*Users) GetSpaceUsage ¶
func (c *Users) GetSpaceUsage(ctx context.Context) (out *GetSpaceUsageOutput, err error)
GetSpaceUsage returns space usage information for the current user's account.
type VideoMetadata ¶
type VideoMetadata struct {
Duration uint64 `json:"duration,omitempty"`
}
VideoMetadata specifies metadata for a video.