github.com/elliott5/community@v0.14.1-0.20160709191136-823126fb026a/documize/api/endpoint/models/models.go (about) 1 // Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved. 2 // 3 // This software (Documize Community Edition) is licensed under 4 // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html 5 // 6 // You can operate outside the AGPL restrictions by purchasing 7 // Documize Enterprise Edition and obtaining a commercial license 8 // by contacting <sales@documize.com>. 9 // 10 // https://documize.com 11 12 // Package models describes the communication format between JS snd Go. 13 // Models are not persisted entities - they are object models that are marshalled between the 14 // backend and the consumer (UI). 15 package models 16 17 import ( 18 "github.com/documize/community/documize/api/entity" 19 ) 20 21 // PageSequenceRequestModel details a page ID and its sequence within the document. 22 type PageSequenceRequestModel struct { 23 PageID string `json:"pageId"` 24 Sequence float64 `json:"sequence"` 25 } 26 27 // PageLevelRequestModel details a page ID and level. 28 type PageLevelRequestModel struct { 29 PageID string `json:"pageId"` 30 Level int `json:"level"` 31 } 32 33 // AuthenticationModel details authentication token and user details. 34 type AuthenticationModel struct { 35 Token string `json:"token"` 36 User entity.User `json:"user"` 37 } 38 39 // DocumentUploadModel details the job ID of an uploaded document. 40 type DocumentUploadModel struct { 41 JobID string `json:"jobId"` 42 } 43 44 // FolderInvitationModel details which users have been invited to a folder. 45 type FolderInvitationModel struct { 46 Message string 47 Recipients []string 48 } 49 50 // FolderRolesModel details which users have what permissions on a given folder. 51 type FolderRolesModel struct { 52 Message string 53 Roles []entity.LabelRole 54 } 55 56 // AcceptSharedFolderModel is used to setup a user who has accepted a shared folder. 57 type AcceptSharedFolderModel struct { 58 Serial string `json:"serial"` 59 Firstname string `json:"firstname"` 60 Lastname string `json:"lastname"` 61 Password string `json:"password"` 62 } 63 64 // PageModel contains the page and associated meta. 65 type PageModel struct { 66 Page entity.Page `json:"page"` 67 Meta entity.PageMeta `json:"meta"` 68 }