rclone: github.com/ncw/rclone/backend/sugarsync/api Index | Files

package api

import "github.com/ncw/rclone/backend/sugarsync/api"

Package api has type definitions for sugarsync

Converted from the API docs with help from https://www.onlinetool.io/xmltogo/

Index

Package Files

types.go

type AppAuthorization Uses

type AppAuthorization struct {
    XMLName          xml.Name `xml:"appAuthorization"`
    Username         string   `xml:"username"`
    Password         string   `xml:"password"`
    Application      string   `xml:"application"`
    AccessKeyID      string   `xml:"accessKeyId"`
    PrivateAccessKey string   `xml:"privateAccessKey"`
}

AppAuthorization is used to request a refresh token

The token is returned in the Location: field

type Authorization Uses

type Authorization struct {
    XMLName    xml.Name  `xml:"authorization"`
    Expiration time.Time `xml:"expiration"`
    User       string    `xml:"user"`
}

Authorization is returned from the TokenAuthRequest

type Collection Uses

type Collection struct {
    Type        string    `xml:"type,attr"`
    Name        string    `xml:"displayName"`
    Ref         string    `xml:"ref"` // only for Folder
    DsID        string    `xml:"dsid"`
    TimeCreated time.Time `xml:"timeCreated"`
    Parent      string    `xml:"parent"`
    Collections string    `xml:"collections"`
    Files       string    `xml:"files"`
    Contents    string    `xml:"contents"`
}

Collection represents - Workspace Collection - Sync Folders collection - Folder

type CollectionContents Uses

type CollectionContents struct {
    //XMLName     xml.Name     `xml:"collectionContents"`
    Start       int          `xml:"start,attr"`
    HasMore     bool         `xml:"hasMore,attr"`
    End         int          `xml:"end,attr"`
    Collections []Collection `xml:"collection"`
    Files       []File       `xml:"file"`
}

CollectionContents is the result of a list call

type CopyFile Uses

type CopyFile struct {
    XMLName xml.Name `xml:"fileCopy"`
    Source  string   `xml:"source,attr"`
    Name    string   `xml:"displayName"`
}

CopyFile copies a file from source

type CreateFile Uses

type CreateFile struct {
    XMLName   xml.Name `xml:"file"`
    Name      string   `xml:"displayName"`
    MediaType string   `xml:"mediaType"`
}

CreateFile is posted to a folder URL to create a file

type CreateFolder Uses

type CreateFolder struct {
    XMLName xml.Name `xml:"folder"`
    Name    string   `xml:"displayName"`
}

CreateFolder is posted to a folder URL to create a folder

type CreateSyncFolder Uses

type CreateSyncFolder struct {
    XMLName xml.Name `xml:"syncFolder"`
    Name    string   `xml:"displayName"`
}

CreateSyncFolder is posted to the root folder URL to create a sync folder

type File Uses

type File struct {
    Name            string    `xml:"displayName"`
    Ref             string    `xml:"ref"`
    DsID            string    `xml:"dsid"`
    TimeCreated     time.Time `xml:"timeCreated"`
    Parent          string    `xml:"parent"`
    Size            int64     `xml:"size"`
    LastModified    time.Time `xml:"lastModified"`
    MediaType       string    `xml:"mediaType"`
    PresentOnServer bool      `xml:"presentOnServer"`
    FileData        string    `xml:"fileData"`
    Versions        string    `xml:"versions"`
    PublicLink      PublicLink
}

File represents a single file

type MoveFile Uses

type MoveFile struct {
    XMLName xml.Name `xml:"file"`
    Name    string   `xml:"displayName"`
    Parent  string   `xml:"parent"`
}

MoveFile is posted to a file URL to create a file

type MoveFolder Uses

type MoveFolder struct {
    XMLName xml.Name `xml:"folder"`
    Name    string   `xml:"displayName"`
    Parent  string   `xml:"parent"`
}

MoveFolder is posted to a folder URL to move a folder

type PublicLink struct {
    XMLName xml.Name `xml:"publicLink"`
    URL     string   `xml:",chardata"`
    Enabled bool     `xml:"enabled,attr"`
}

PublicLink is the URL and enabled flag for a public link

type SetLastModified Uses

type SetLastModified struct {
    XMLName      xml.Name  `xml:"file"`
    LastModified time.Time `xml:"lastModified"`
}

SetLastModified sets the modified time for a file

type SetPublicLink struct {
    XMLName    xml.Name `xml:"file"`
    PublicLink PublicLink
}

SetPublicLink can be used to enable the file for sharing

type TokenAuthRequest Uses

type TokenAuthRequest struct {
    XMLName          xml.Name `xml:"tokenAuthRequest"`
    AccessKeyID      string   `xml:"accessKeyId"`
    PrivateAccessKey string   `xml:"privateAccessKey"`
    RefreshToken     string   `xml:"refreshToken"`
}

TokenAuthRequest is the request to get Authorization

type User Uses

type User struct {
    XMLName  xml.Name `xml:"user"`
    Username string   `xml:"username"`
    Nickname string   `xml:"nickname"`
    Quota    struct {
        Limit int64 `xml:"limit"`
        Usage int64 `xml:"usage"`
    }   `xml:"quota"`
    Workspaces            string `xml:"workspaces"`
    SyncFolders           string `xml:"syncfolders"`
    Deleted               string `xml:"deleted"`
    MagicBriefcase        string `xml:"magicBriefcase"`
    WebArchive            string `xml:"webArchive"`
    MobilePhotos          string `xml:"mobilePhotos"`
    Albums                string `xml:"albums"`
    RecentActivities      string `xml:"recentActivities"`
    ReceivedShares        string `xml:"receivedShares"`
    PublicLinks           string `xml:"publicLinks"`
    MaximumPublicLinkSize int    `xml:"maximumPublicLinkSize"`
}

User is returned from the /user call

Package api imports 2 packages (graph). Updated 2020-02-17. Refresh now. Tools for package owners.