1// Copyright (c) Dropbox, Inc. 2// 3// Permission is hereby granted, free of charge, to any person obtaining a copy 4// of this software and associated documentation files (the "Software"), to deal 5// in the Software without restriction, including without limitation the rights 6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7// copies of the Software, and to permit persons to whom the Software is 8// furnished to do so, subject to the following conditions: 9// 10// The above copyright notice and this permission notice shall be included in 11// all copies or substantial portions of the Software. 12// 13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19// THE SOFTWARE. 20 21// Package paper : This namespace contains endpoints and data types for managing 22// docs and folders in Dropbox Paper. New Paper users will see docs they create 23// in their filesystem as '.paper' files alongside their other Dropbox content. 24// The /paper endpoints are being deprecated and you'll need to use /files and 25// /sharing endpoints to interact with their Paper content. Read more in the 26// `Paper Migration Guide` 27// <https://www.dropbox.com/lp/developers/reference/paper-migration-guide>. 28package paper 29 30import ( 31 "encoding/json" 32 "time" 33 34 "github.com/dropbox/dropbox-sdk-go-unofficial/v6/dropbox" 35 "github.com/dropbox/dropbox-sdk-go-unofficial/v6/dropbox/sharing" 36) 37 38// AddMember : has no documentation (yet) 39type AddMember struct { 40 // PermissionLevel : Permission for the user. 41 PermissionLevel *PaperDocPermissionLevel `json:"permission_level"` 42 // Member : User which should be added to the Paper doc. Specify only email 43 // address or Dropbox account ID. 44 Member *sharing.MemberSelector `json:"member"` 45} 46 47// NewAddMember returns a new AddMember instance 48func NewAddMember(Member *sharing.MemberSelector) *AddMember { 49 s := new(AddMember) 50 s.Member = Member 51 s.PermissionLevel = &PaperDocPermissionLevel{Tagged: dropbox.Tagged{Tag: "edit"}} 52 return s 53} 54 55// RefPaperDoc : has no documentation (yet) 56type RefPaperDoc struct { 57 // DocId : The Paper doc ID. 58 DocId string `json:"doc_id"` 59} 60 61// NewRefPaperDoc returns a new RefPaperDoc instance 62func NewRefPaperDoc(DocId string) *RefPaperDoc { 63 s := new(RefPaperDoc) 64 s.DocId = DocId 65 return s 66} 67 68// AddPaperDocUser : has no documentation (yet) 69type AddPaperDocUser struct { 70 RefPaperDoc 71 // Members : User which should be added to the Paper doc. Specify only email 72 // address or Dropbox account ID. 73 Members []*AddMember `json:"members"` 74 // CustomMessage : A personal message that will be emailed to each 75 // successfully added member. 76 CustomMessage string `json:"custom_message,omitempty"` 77 // Quiet : Clients should set this to true if no email message shall be sent 78 // to added users. 79 Quiet bool `json:"quiet"` 80} 81 82// NewAddPaperDocUser returns a new AddPaperDocUser instance 83func NewAddPaperDocUser(DocId string, Members []*AddMember) *AddPaperDocUser { 84 s := new(AddPaperDocUser) 85 s.DocId = DocId 86 s.Members = Members 87 s.Quiet = false 88 return s 89} 90 91// AddPaperDocUserMemberResult : Per-member result for `docsUsersAdd`. 92type AddPaperDocUserMemberResult struct { 93 // Member : One of specified input members. 94 Member *sharing.MemberSelector `json:"member"` 95 // Result : The outcome of the action on this member. 96 Result *AddPaperDocUserResult `json:"result"` 97} 98 99// NewAddPaperDocUserMemberResult returns a new AddPaperDocUserMemberResult instance 100func NewAddPaperDocUserMemberResult(Member *sharing.MemberSelector, Result *AddPaperDocUserResult) *AddPaperDocUserMemberResult { 101 s := new(AddPaperDocUserMemberResult) 102 s.Member = Member 103 s.Result = Result 104 return s 105} 106 107// AddPaperDocUserResult : has no documentation (yet) 108type AddPaperDocUserResult struct { 109 dropbox.Tagged 110} 111 112// Valid tag values for AddPaperDocUserResult 113const ( 114 AddPaperDocUserResultSuccess = "success" 115 AddPaperDocUserResultUnknownError = "unknown_error" 116 AddPaperDocUserResultSharingOutsideTeamDisabled = "sharing_outside_team_disabled" 117 AddPaperDocUserResultDailyLimitReached = "daily_limit_reached" 118 AddPaperDocUserResultUserIsOwner = "user_is_owner" 119 AddPaperDocUserResultFailedUserDataRetrieval = "failed_user_data_retrieval" 120 AddPaperDocUserResultPermissionAlreadyGranted = "permission_already_granted" 121 AddPaperDocUserResultOther = "other" 122) 123 124// Cursor : has no documentation (yet) 125type Cursor struct { 126 // Value : The actual cursor value. 127 Value string `json:"value"` 128 // Expiration : Expiration time of `value`. Some cursors might have 129 // expiration time assigned. This is a UTC value after which the cursor is 130 // no longer valid and the API starts returning an error. If cursor expires 131 // a new one needs to be obtained and pagination needs to be restarted. Some 132 // cursors might be short-lived some cursors might be long-lived. This 133 // really depends on the sorting type and order, e.g.: 1. on one hand, 134 // listing docs created by the user, sorted by the created time ascending 135 // will have undefinite expiration because the results cannot change while 136 // the iteration is happening. This cursor would be suitable for long term 137 // polling. 2. on the other hand, listing docs sorted by the last modified 138 // time will have a very short expiration as docs do get modified very often 139 // and the modified time can be changed while the iteration is happening 140 // thus altering the results. 141 Expiration *time.Time `json:"expiration,omitempty"` 142} 143 144// NewCursor returns a new Cursor instance 145func NewCursor(Value string) *Cursor { 146 s := new(Cursor) 147 s.Value = Value 148 return s 149} 150 151// PaperApiBaseError : has no documentation (yet) 152type PaperApiBaseError struct { 153 dropbox.Tagged 154} 155 156// Valid tag values for PaperApiBaseError 157const ( 158 PaperApiBaseErrorInsufficientPermissions = "insufficient_permissions" 159 PaperApiBaseErrorOther = "other" 160) 161 162// DocLookupError : has no documentation (yet) 163type DocLookupError struct { 164 dropbox.Tagged 165} 166 167// Valid tag values for DocLookupError 168const ( 169 DocLookupErrorInsufficientPermissions = "insufficient_permissions" 170 DocLookupErrorOther = "other" 171 DocLookupErrorDocNotFound = "doc_not_found" 172) 173 174// DocSubscriptionLevel : The subscription level of a Paper doc. 175type DocSubscriptionLevel struct { 176 dropbox.Tagged 177} 178 179// Valid tag values for DocSubscriptionLevel 180const ( 181 DocSubscriptionLevelDefault = "default" 182 DocSubscriptionLevelIgnore = "ignore" 183 DocSubscriptionLevelEvery = "every" 184 DocSubscriptionLevelNoEmail = "no_email" 185) 186 187// ExportFormat : The desired export format of the Paper doc. 188type ExportFormat struct { 189 dropbox.Tagged 190} 191 192// Valid tag values for ExportFormat 193const ( 194 ExportFormatHtml = "html" 195 ExportFormatMarkdown = "markdown" 196 ExportFormatOther = "other" 197) 198 199// Folder : Data structure representing a Paper folder. 200type Folder struct { 201 // Id : Paper folder ID. This ID uniquely identifies the folder. 202 Id string `json:"id"` 203 // Name : Paper folder name. 204 Name string `json:"name"` 205} 206 207// NewFolder returns a new Folder instance 208func NewFolder(Id string, Name string) *Folder { 209 s := new(Folder) 210 s.Id = Id 211 s.Name = Name 212 return s 213} 214 215// FolderSharingPolicyType : The sharing policy of a Paper folder. The sharing 216// policy of subfolders is inherited from the root folder. 217type FolderSharingPolicyType struct { 218 dropbox.Tagged 219} 220 221// Valid tag values for FolderSharingPolicyType 222const ( 223 FolderSharingPolicyTypeTeam = "team" 224 FolderSharingPolicyTypeInviteOnly = "invite_only" 225) 226 227// FolderSubscriptionLevel : The subscription level of a Paper folder. 228type FolderSubscriptionLevel struct { 229 dropbox.Tagged 230} 231 232// Valid tag values for FolderSubscriptionLevel 233const ( 234 FolderSubscriptionLevelNone = "none" 235 FolderSubscriptionLevelActivityOnly = "activity_only" 236 FolderSubscriptionLevelDailyEmails = "daily_emails" 237 FolderSubscriptionLevelWeeklyEmails = "weekly_emails" 238) 239 240// FoldersContainingPaperDoc : Metadata about Paper folders containing the 241// specififed Paper doc. 242type FoldersContainingPaperDoc struct { 243 // FolderSharingPolicyType : The sharing policy of the folder containing the 244 // Paper doc. 245 FolderSharingPolicyType *FolderSharingPolicyType `json:"folder_sharing_policy_type,omitempty"` 246 // Folders : The folder path. If present the first folder is the root 247 // folder. 248 Folders []*Folder `json:"folders,omitempty"` 249} 250 251// NewFoldersContainingPaperDoc returns a new FoldersContainingPaperDoc instance 252func NewFoldersContainingPaperDoc() *FoldersContainingPaperDoc { 253 s := new(FoldersContainingPaperDoc) 254 return s 255} 256 257// ImportFormat : The import format of the incoming data. 258type ImportFormat struct { 259 dropbox.Tagged 260} 261 262// Valid tag values for ImportFormat 263const ( 264 ImportFormatHtml = "html" 265 ImportFormatMarkdown = "markdown" 266 ImportFormatPlainText = "plain_text" 267 ImportFormatOther = "other" 268) 269 270// InviteeInfoWithPermissionLevel : has no documentation (yet) 271type InviteeInfoWithPermissionLevel struct { 272 // Invitee : Email address invited to the Paper doc. 273 Invitee *sharing.InviteeInfo `json:"invitee"` 274 // PermissionLevel : Permission level for the invitee. 275 PermissionLevel *PaperDocPermissionLevel `json:"permission_level"` 276} 277 278// NewInviteeInfoWithPermissionLevel returns a new InviteeInfoWithPermissionLevel instance 279func NewInviteeInfoWithPermissionLevel(Invitee *sharing.InviteeInfo, PermissionLevel *PaperDocPermissionLevel) *InviteeInfoWithPermissionLevel { 280 s := new(InviteeInfoWithPermissionLevel) 281 s.Invitee = Invitee 282 s.PermissionLevel = PermissionLevel 283 return s 284} 285 286// ListDocsCursorError : has no documentation (yet) 287type ListDocsCursorError struct { 288 dropbox.Tagged 289 // CursorError : has no documentation (yet) 290 CursorError *PaperApiCursorError `json:"cursor_error,omitempty"` 291} 292 293// Valid tag values for ListDocsCursorError 294const ( 295 ListDocsCursorErrorCursorError = "cursor_error" 296 ListDocsCursorErrorOther = "other" 297) 298 299// UnmarshalJSON deserializes into a ListDocsCursorError instance 300func (u *ListDocsCursorError) UnmarshalJSON(body []byte) error { 301 type wrap struct { 302 dropbox.Tagged 303 // CursorError : has no documentation (yet) 304 CursorError *PaperApiCursorError `json:"cursor_error,omitempty"` 305 } 306 var w wrap 307 var err error 308 if err = json.Unmarshal(body, &w); err != nil { 309 return err 310 } 311 u.Tag = w.Tag 312 switch u.Tag { 313 case "cursor_error": 314 u.CursorError = w.CursorError 315 316 if err != nil { 317 return err 318 } 319 } 320 return nil 321} 322 323// ListPaperDocsArgs : has no documentation (yet) 324type ListPaperDocsArgs struct { 325 // FilterBy : Allows user to specify how the Paper docs should be filtered. 326 FilterBy *ListPaperDocsFilterBy `json:"filter_by"` 327 // SortBy : Allows user to specify how the Paper docs should be sorted. 328 SortBy *ListPaperDocsSortBy `json:"sort_by"` 329 // SortOrder : Allows user to specify the sort order of the result. 330 SortOrder *ListPaperDocsSortOrder `json:"sort_order"` 331 // Limit : Size limit per batch. The maximum number of docs that can be 332 // retrieved per batch is 1000. Higher value results in invalid arguments 333 // error. 334 Limit int32 `json:"limit"` 335} 336 337// NewListPaperDocsArgs returns a new ListPaperDocsArgs instance 338func NewListPaperDocsArgs() *ListPaperDocsArgs { 339 s := new(ListPaperDocsArgs) 340 s.FilterBy = &ListPaperDocsFilterBy{Tagged: dropbox.Tagged{Tag: "docs_accessed"}} 341 s.SortBy = &ListPaperDocsSortBy{Tagged: dropbox.Tagged{Tag: "accessed"}} 342 s.SortOrder = &ListPaperDocsSortOrder{Tagged: dropbox.Tagged{Tag: "ascending"}} 343 s.Limit = 1000 344 return s 345} 346 347// ListPaperDocsContinueArgs : has no documentation (yet) 348type ListPaperDocsContinueArgs struct { 349 // Cursor : The cursor obtained from `docsList` or `docsListContinue`. 350 // Allows for pagination. 351 Cursor string `json:"cursor"` 352} 353 354// NewListPaperDocsContinueArgs returns a new ListPaperDocsContinueArgs instance 355func NewListPaperDocsContinueArgs(Cursor string) *ListPaperDocsContinueArgs { 356 s := new(ListPaperDocsContinueArgs) 357 s.Cursor = Cursor 358 return s 359} 360 361// ListPaperDocsFilterBy : has no documentation (yet) 362type ListPaperDocsFilterBy struct { 363 dropbox.Tagged 364} 365 366// Valid tag values for ListPaperDocsFilterBy 367const ( 368 ListPaperDocsFilterByDocsAccessed = "docs_accessed" 369 ListPaperDocsFilterByDocsCreated = "docs_created" 370 ListPaperDocsFilterByOther = "other" 371) 372 373// ListPaperDocsResponse : has no documentation (yet) 374type ListPaperDocsResponse struct { 375 // DocIds : The list of Paper doc IDs that can be used to access the given 376 // Paper docs or supplied to other API methods. The list is sorted in the 377 // order specified by the initial call to `docsList`. 378 DocIds []string `json:"doc_ids"` 379 // Cursor : Pass the cursor into `docsListContinue` to paginate through all 380 // files. The cursor preserves all properties as specified in the original 381 // call to `docsList`. 382 Cursor *Cursor `json:"cursor"` 383 // HasMore : Will be set to True if a subsequent call with the provided 384 // cursor to `docsListContinue` returns immediately with some results. If 385 // set to False please allow some delay before making another call to 386 // `docsListContinue`. 387 HasMore bool `json:"has_more"` 388} 389 390// NewListPaperDocsResponse returns a new ListPaperDocsResponse instance 391func NewListPaperDocsResponse(DocIds []string, Cursor *Cursor, HasMore bool) *ListPaperDocsResponse { 392 s := new(ListPaperDocsResponse) 393 s.DocIds = DocIds 394 s.Cursor = Cursor 395 s.HasMore = HasMore 396 return s 397} 398 399// ListPaperDocsSortBy : has no documentation (yet) 400type ListPaperDocsSortBy struct { 401 dropbox.Tagged 402} 403 404// Valid tag values for ListPaperDocsSortBy 405const ( 406 ListPaperDocsSortByAccessed = "accessed" 407 ListPaperDocsSortByModified = "modified" 408 ListPaperDocsSortByCreated = "created" 409 ListPaperDocsSortByOther = "other" 410) 411 412// ListPaperDocsSortOrder : has no documentation (yet) 413type ListPaperDocsSortOrder struct { 414 dropbox.Tagged 415} 416 417// Valid tag values for ListPaperDocsSortOrder 418const ( 419 ListPaperDocsSortOrderAscending = "ascending" 420 ListPaperDocsSortOrderDescending = "descending" 421 ListPaperDocsSortOrderOther = "other" 422) 423 424// ListUsersCursorError : has no documentation (yet) 425type ListUsersCursorError struct { 426 dropbox.Tagged 427 // CursorError : has no documentation (yet) 428 CursorError *PaperApiCursorError `json:"cursor_error,omitempty"` 429} 430 431// Valid tag values for ListUsersCursorError 432const ( 433 ListUsersCursorErrorInsufficientPermissions = "insufficient_permissions" 434 ListUsersCursorErrorOther = "other" 435 ListUsersCursorErrorDocNotFound = "doc_not_found" 436 ListUsersCursorErrorCursorError = "cursor_error" 437) 438 439// UnmarshalJSON deserializes into a ListUsersCursorError instance 440func (u *ListUsersCursorError) UnmarshalJSON(body []byte) error { 441 type wrap struct { 442 dropbox.Tagged 443 // CursorError : has no documentation (yet) 444 CursorError *PaperApiCursorError `json:"cursor_error,omitempty"` 445 } 446 var w wrap 447 var err error 448 if err = json.Unmarshal(body, &w); err != nil { 449 return err 450 } 451 u.Tag = w.Tag 452 switch u.Tag { 453 case "cursor_error": 454 u.CursorError = w.CursorError 455 456 if err != nil { 457 return err 458 } 459 } 460 return nil 461} 462 463// ListUsersOnFolderArgs : has no documentation (yet) 464type ListUsersOnFolderArgs struct { 465 RefPaperDoc 466 // Limit : Size limit per batch. The maximum number of users that can be 467 // retrieved per batch is 1000. Higher value results in invalid arguments 468 // error. 469 Limit int32 `json:"limit"` 470} 471 472// NewListUsersOnFolderArgs returns a new ListUsersOnFolderArgs instance 473func NewListUsersOnFolderArgs(DocId string) *ListUsersOnFolderArgs { 474 s := new(ListUsersOnFolderArgs) 475 s.DocId = DocId 476 s.Limit = 1000 477 return s 478} 479 480// ListUsersOnFolderContinueArgs : has no documentation (yet) 481type ListUsersOnFolderContinueArgs struct { 482 RefPaperDoc 483 // Cursor : The cursor obtained from `docsFolderUsersList` or 484 // `docsFolderUsersListContinue`. Allows for pagination. 485 Cursor string `json:"cursor"` 486} 487 488// NewListUsersOnFolderContinueArgs returns a new ListUsersOnFolderContinueArgs instance 489func NewListUsersOnFolderContinueArgs(DocId string, Cursor string) *ListUsersOnFolderContinueArgs { 490 s := new(ListUsersOnFolderContinueArgs) 491 s.DocId = DocId 492 s.Cursor = Cursor 493 return s 494} 495 496// ListUsersOnFolderResponse : has no documentation (yet) 497type ListUsersOnFolderResponse struct { 498 // Invitees : List of email addresses that are invited on the Paper folder. 499 Invitees []*sharing.InviteeInfo `json:"invitees"` 500 // Users : List of users that are invited on the Paper folder. 501 Users []*sharing.UserInfo `json:"users"` 502 // Cursor : Pass the cursor into `docsFolderUsersListContinue` to paginate 503 // through all users. The cursor preserves all properties as specified in 504 // the original call to `docsFolderUsersList`. 505 Cursor *Cursor `json:"cursor"` 506 // HasMore : Will be set to True if a subsequent call with the provided 507 // cursor to `docsFolderUsersListContinue` returns immediately with some 508 // results. If set to False please allow some delay before making another 509 // call to `docsFolderUsersListContinue`. 510 HasMore bool `json:"has_more"` 511} 512 513// NewListUsersOnFolderResponse returns a new ListUsersOnFolderResponse instance 514func NewListUsersOnFolderResponse(Invitees []*sharing.InviteeInfo, Users []*sharing.UserInfo, Cursor *Cursor, HasMore bool) *ListUsersOnFolderResponse { 515 s := new(ListUsersOnFolderResponse) 516 s.Invitees = Invitees 517 s.Users = Users 518 s.Cursor = Cursor 519 s.HasMore = HasMore 520 return s 521} 522 523// ListUsersOnPaperDocArgs : has no documentation (yet) 524type ListUsersOnPaperDocArgs struct { 525 RefPaperDoc 526 // Limit : Size limit per batch. The maximum number of users that can be 527 // retrieved per batch is 1000. Higher value results in invalid arguments 528 // error. 529 Limit int32 `json:"limit"` 530 // FilterBy : Specify this attribute if you want to obtain users that have 531 // already accessed the Paper doc. 532 FilterBy *UserOnPaperDocFilter `json:"filter_by"` 533} 534 535// NewListUsersOnPaperDocArgs returns a new ListUsersOnPaperDocArgs instance 536func NewListUsersOnPaperDocArgs(DocId string) *ListUsersOnPaperDocArgs { 537 s := new(ListUsersOnPaperDocArgs) 538 s.DocId = DocId 539 s.Limit = 1000 540 s.FilterBy = &UserOnPaperDocFilter{Tagged: dropbox.Tagged{Tag: "shared"}} 541 return s 542} 543 544// ListUsersOnPaperDocContinueArgs : has no documentation (yet) 545type ListUsersOnPaperDocContinueArgs struct { 546 RefPaperDoc 547 // Cursor : The cursor obtained from `docsUsersList` or 548 // `docsUsersListContinue`. Allows for pagination. 549 Cursor string `json:"cursor"` 550} 551 552// NewListUsersOnPaperDocContinueArgs returns a new ListUsersOnPaperDocContinueArgs instance 553func NewListUsersOnPaperDocContinueArgs(DocId string, Cursor string) *ListUsersOnPaperDocContinueArgs { 554 s := new(ListUsersOnPaperDocContinueArgs) 555 s.DocId = DocId 556 s.Cursor = Cursor 557 return s 558} 559 560// ListUsersOnPaperDocResponse : has no documentation (yet) 561type ListUsersOnPaperDocResponse struct { 562 // Invitees : List of email addresses with their respective permission 563 // levels that are invited on the Paper doc. 564 Invitees []*InviteeInfoWithPermissionLevel `json:"invitees"` 565 // Users : List of users with their respective permission levels that are 566 // invited on the Paper folder. 567 Users []*UserInfoWithPermissionLevel `json:"users"` 568 // DocOwner : The Paper doc owner. This field is populated on every single 569 // response. 570 DocOwner *sharing.UserInfo `json:"doc_owner"` 571 // Cursor : Pass the cursor into `docsUsersListContinue` to paginate through 572 // all users. The cursor preserves all properties as specified in the 573 // original call to `docsUsersList`. 574 Cursor *Cursor `json:"cursor"` 575 // HasMore : Will be set to True if a subsequent call with the provided 576 // cursor to `docsUsersListContinue` returns immediately with some results. 577 // If set to False please allow some delay before making another call to 578 // `docsUsersListContinue`. 579 HasMore bool `json:"has_more"` 580} 581 582// NewListUsersOnPaperDocResponse returns a new ListUsersOnPaperDocResponse instance 583func NewListUsersOnPaperDocResponse(Invitees []*InviteeInfoWithPermissionLevel, Users []*UserInfoWithPermissionLevel, DocOwner *sharing.UserInfo, Cursor *Cursor, HasMore bool) *ListUsersOnPaperDocResponse { 584 s := new(ListUsersOnPaperDocResponse) 585 s.Invitees = Invitees 586 s.Users = Users 587 s.DocOwner = DocOwner 588 s.Cursor = Cursor 589 s.HasMore = HasMore 590 return s 591} 592 593// PaperApiCursorError : has no documentation (yet) 594type PaperApiCursorError struct { 595 dropbox.Tagged 596} 597 598// Valid tag values for PaperApiCursorError 599const ( 600 PaperApiCursorErrorExpiredCursor = "expired_cursor" 601 PaperApiCursorErrorInvalidCursor = "invalid_cursor" 602 PaperApiCursorErrorWrongUserInCursor = "wrong_user_in_cursor" 603 PaperApiCursorErrorReset = "reset" 604 PaperApiCursorErrorOther = "other" 605) 606 607// PaperDocCreateArgs : has no documentation (yet) 608type PaperDocCreateArgs struct { 609 // ParentFolderId : The Paper folder ID where the Paper document should be 610 // created. The API user has to have write access to this folder or error is 611 // thrown. 612 ParentFolderId string `json:"parent_folder_id,omitempty"` 613 // ImportFormat : The format of provided data. 614 ImportFormat *ImportFormat `json:"import_format"` 615} 616 617// NewPaperDocCreateArgs returns a new PaperDocCreateArgs instance 618func NewPaperDocCreateArgs(ImportFormat *ImportFormat) *PaperDocCreateArgs { 619 s := new(PaperDocCreateArgs) 620 s.ImportFormat = ImportFormat 621 return s 622} 623 624// PaperDocCreateError : has no documentation (yet) 625type PaperDocCreateError struct { 626 dropbox.Tagged 627} 628 629// Valid tag values for PaperDocCreateError 630const ( 631 PaperDocCreateErrorInsufficientPermissions = "insufficient_permissions" 632 PaperDocCreateErrorOther = "other" 633 PaperDocCreateErrorContentMalformed = "content_malformed" 634 PaperDocCreateErrorFolderNotFound = "folder_not_found" 635 PaperDocCreateErrorDocLengthExceeded = "doc_length_exceeded" 636 PaperDocCreateErrorImageSizeExceeded = "image_size_exceeded" 637) 638 639// PaperDocCreateUpdateResult : has no documentation (yet) 640type PaperDocCreateUpdateResult struct { 641 // DocId : Doc ID of the newly created doc. 642 DocId string `json:"doc_id"` 643 // Revision : The Paper doc revision. Simply an ever increasing number. 644 Revision int64 `json:"revision"` 645 // Title : The Paper doc title. 646 Title string `json:"title"` 647} 648 649// NewPaperDocCreateUpdateResult returns a new PaperDocCreateUpdateResult instance 650func NewPaperDocCreateUpdateResult(DocId string, Revision int64, Title string) *PaperDocCreateUpdateResult { 651 s := new(PaperDocCreateUpdateResult) 652 s.DocId = DocId 653 s.Revision = Revision 654 s.Title = Title 655 return s 656} 657 658// PaperDocExport : has no documentation (yet) 659type PaperDocExport struct { 660 RefPaperDoc 661 // ExportFormat : has no documentation (yet) 662 ExportFormat *ExportFormat `json:"export_format"` 663} 664 665// NewPaperDocExport returns a new PaperDocExport instance 666func NewPaperDocExport(DocId string, ExportFormat *ExportFormat) *PaperDocExport { 667 s := new(PaperDocExport) 668 s.DocId = DocId 669 s.ExportFormat = ExportFormat 670 return s 671} 672 673// PaperDocExportResult : has no documentation (yet) 674type PaperDocExportResult struct { 675 // Owner : The Paper doc owner's email address. 676 Owner string `json:"owner"` 677 // Title : The Paper doc title. 678 Title string `json:"title"` 679 // Revision : The Paper doc revision. Simply an ever increasing number. 680 Revision int64 `json:"revision"` 681 // MimeType : MIME type of the export. This corresponds to `ExportFormat` 682 // specified in the request. 683 MimeType string `json:"mime_type"` 684} 685 686// NewPaperDocExportResult returns a new PaperDocExportResult instance 687func NewPaperDocExportResult(Owner string, Title string, Revision int64, MimeType string) *PaperDocExportResult { 688 s := new(PaperDocExportResult) 689 s.Owner = Owner 690 s.Title = Title 691 s.Revision = Revision 692 s.MimeType = MimeType 693 return s 694} 695 696// PaperDocPermissionLevel : has no documentation (yet) 697type PaperDocPermissionLevel struct { 698 dropbox.Tagged 699} 700 701// Valid tag values for PaperDocPermissionLevel 702const ( 703 PaperDocPermissionLevelEdit = "edit" 704 PaperDocPermissionLevelViewAndComment = "view_and_comment" 705 PaperDocPermissionLevelOther = "other" 706) 707 708// PaperDocSharingPolicy : has no documentation (yet) 709type PaperDocSharingPolicy struct { 710 RefPaperDoc 711 // SharingPolicy : The default sharing policy to be set for the Paper doc. 712 SharingPolicy *SharingPolicy `json:"sharing_policy"` 713} 714 715// NewPaperDocSharingPolicy returns a new PaperDocSharingPolicy instance 716func NewPaperDocSharingPolicy(DocId string, SharingPolicy *SharingPolicy) *PaperDocSharingPolicy { 717 s := new(PaperDocSharingPolicy) 718 s.DocId = DocId 719 s.SharingPolicy = SharingPolicy 720 return s 721} 722 723// PaperDocUpdateArgs : has no documentation (yet) 724type PaperDocUpdateArgs struct { 725 RefPaperDoc 726 // DocUpdatePolicy : The policy used for the current update call. 727 DocUpdatePolicy *PaperDocUpdatePolicy `json:"doc_update_policy"` 728 // Revision : The latest doc revision. This value must match the head 729 // revision or an error code will be returned. This is to prevent colliding 730 // writes. 731 Revision int64 `json:"revision"` 732 // ImportFormat : The format of provided data. 733 ImportFormat *ImportFormat `json:"import_format"` 734} 735 736// NewPaperDocUpdateArgs returns a new PaperDocUpdateArgs instance 737func NewPaperDocUpdateArgs(DocId string, DocUpdatePolicy *PaperDocUpdatePolicy, Revision int64, ImportFormat *ImportFormat) *PaperDocUpdateArgs { 738 s := new(PaperDocUpdateArgs) 739 s.DocId = DocId 740 s.DocUpdatePolicy = DocUpdatePolicy 741 s.Revision = Revision 742 s.ImportFormat = ImportFormat 743 return s 744} 745 746// PaperDocUpdateError : has no documentation (yet) 747type PaperDocUpdateError struct { 748 dropbox.Tagged 749} 750 751// Valid tag values for PaperDocUpdateError 752const ( 753 PaperDocUpdateErrorInsufficientPermissions = "insufficient_permissions" 754 PaperDocUpdateErrorOther = "other" 755 PaperDocUpdateErrorDocNotFound = "doc_not_found" 756 PaperDocUpdateErrorContentMalformed = "content_malformed" 757 PaperDocUpdateErrorRevisionMismatch = "revision_mismatch" 758 PaperDocUpdateErrorDocLengthExceeded = "doc_length_exceeded" 759 PaperDocUpdateErrorImageSizeExceeded = "image_size_exceeded" 760 PaperDocUpdateErrorDocArchived = "doc_archived" 761 PaperDocUpdateErrorDocDeleted = "doc_deleted" 762) 763 764// PaperDocUpdatePolicy : has no documentation (yet) 765type PaperDocUpdatePolicy struct { 766 dropbox.Tagged 767} 768 769// Valid tag values for PaperDocUpdatePolicy 770const ( 771 PaperDocUpdatePolicyAppend = "append" 772 PaperDocUpdatePolicyPrepend = "prepend" 773 PaperDocUpdatePolicyOverwriteAll = "overwrite_all" 774 PaperDocUpdatePolicyOther = "other" 775) 776 777// PaperFolderCreateArg : has no documentation (yet) 778type PaperFolderCreateArg struct { 779 // Name : The name of the new Paper folder. 780 Name string `json:"name"` 781 // ParentFolderId : The encrypted Paper folder Id where the new Paper folder 782 // should be created. The API user has to have write access to this folder 783 // or error is thrown. If not supplied, the new folder will be created at 784 // top level. 785 ParentFolderId string `json:"parent_folder_id,omitempty"` 786 // IsTeamFolder : Whether the folder to be created should be a team folder. 787 // This value will be ignored if parent_folder_id is supplied, as the new 788 // folder will inherit the type (private or team folder) from its parent. We 789 // will by default create a top-level private folder if both 790 // parent_folder_id and is_team_folder are not supplied. 791 IsTeamFolder bool `json:"is_team_folder,omitempty"` 792} 793 794// NewPaperFolderCreateArg returns a new PaperFolderCreateArg instance 795func NewPaperFolderCreateArg(Name string) *PaperFolderCreateArg { 796 s := new(PaperFolderCreateArg) 797 s.Name = Name 798 return s 799} 800 801// PaperFolderCreateError : has no documentation (yet) 802type PaperFolderCreateError struct { 803 dropbox.Tagged 804} 805 806// Valid tag values for PaperFolderCreateError 807const ( 808 PaperFolderCreateErrorInsufficientPermissions = "insufficient_permissions" 809 PaperFolderCreateErrorOther = "other" 810 PaperFolderCreateErrorFolderNotFound = "folder_not_found" 811 PaperFolderCreateErrorInvalidFolderId = "invalid_folder_id" 812) 813 814// PaperFolderCreateResult : has no documentation (yet) 815type PaperFolderCreateResult struct { 816 // FolderId : Folder ID of the newly created folder. 817 FolderId string `json:"folder_id"` 818} 819 820// NewPaperFolderCreateResult returns a new PaperFolderCreateResult instance 821func NewPaperFolderCreateResult(FolderId string) *PaperFolderCreateResult { 822 s := new(PaperFolderCreateResult) 823 s.FolderId = FolderId 824 return s 825} 826 827// RemovePaperDocUser : has no documentation (yet) 828type RemovePaperDocUser struct { 829 RefPaperDoc 830 // Member : User which should be removed from the Paper doc. Specify only 831 // email address or Dropbox account ID. 832 Member *sharing.MemberSelector `json:"member"` 833} 834 835// NewRemovePaperDocUser returns a new RemovePaperDocUser instance 836func NewRemovePaperDocUser(DocId string, Member *sharing.MemberSelector) *RemovePaperDocUser { 837 s := new(RemovePaperDocUser) 838 s.DocId = DocId 839 s.Member = Member 840 return s 841} 842 843// SharingPolicy : Sharing policy of Paper doc. 844type SharingPolicy struct { 845 // PublicSharingPolicy : This value applies to the non-team members. 846 PublicSharingPolicy *SharingPublicPolicyType `json:"public_sharing_policy,omitempty"` 847 // TeamSharingPolicy : This value applies to the team members only. The 848 // value is null for all personal accounts. 849 TeamSharingPolicy *SharingTeamPolicyType `json:"team_sharing_policy,omitempty"` 850} 851 852// NewSharingPolicy returns a new SharingPolicy instance 853func NewSharingPolicy() *SharingPolicy { 854 s := new(SharingPolicy) 855 return s 856} 857 858// SharingTeamPolicyType : The sharing policy type of the Paper doc. 859type SharingTeamPolicyType struct { 860 dropbox.Tagged 861} 862 863// Valid tag values for SharingTeamPolicyType 864const ( 865 SharingTeamPolicyTypePeopleWithLinkCanEdit = "people_with_link_can_edit" 866 SharingTeamPolicyTypePeopleWithLinkCanViewAndComment = "people_with_link_can_view_and_comment" 867 SharingTeamPolicyTypeInviteOnly = "invite_only" 868) 869 870// SharingPublicPolicyType : has no documentation (yet) 871type SharingPublicPolicyType struct { 872 dropbox.Tagged 873} 874 875// Valid tag values for SharingPublicPolicyType 876const ( 877 SharingPublicPolicyTypePeopleWithLinkCanEdit = "people_with_link_can_edit" 878 SharingPublicPolicyTypePeopleWithLinkCanViewAndComment = "people_with_link_can_view_and_comment" 879 SharingPublicPolicyTypeInviteOnly = "invite_only" 880 SharingPublicPolicyTypeDisabled = "disabled" 881) 882 883// UserInfoWithPermissionLevel : has no documentation (yet) 884type UserInfoWithPermissionLevel struct { 885 // User : User shared on the Paper doc. 886 User *sharing.UserInfo `json:"user"` 887 // PermissionLevel : Permission level for the user. 888 PermissionLevel *PaperDocPermissionLevel `json:"permission_level"` 889} 890 891// NewUserInfoWithPermissionLevel returns a new UserInfoWithPermissionLevel instance 892func NewUserInfoWithPermissionLevel(User *sharing.UserInfo, PermissionLevel *PaperDocPermissionLevel) *UserInfoWithPermissionLevel { 893 s := new(UserInfoWithPermissionLevel) 894 s.User = User 895 s.PermissionLevel = PermissionLevel 896 return s 897} 898 899// UserOnPaperDocFilter : has no documentation (yet) 900type UserOnPaperDocFilter struct { 901 dropbox.Tagged 902} 903 904// Valid tag values for UserOnPaperDocFilter 905const ( 906 UserOnPaperDocFilterVisited = "visited" 907 UserOnPaperDocFilterShared = "shared" 908 UserOnPaperDocFilterOther = "other" 909) 910