api

package
v1.52.3-0...-16af9ab Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package api has type definitions for sugarsync

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppAuthorization

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Jump to

Keyboard shortcuts

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