api

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID         string `json:"id"`
	Attributes struct {
		Name         string `json:"name"`
		Type         string `json:"type"`
		IsFolder     bool   `json:"is_folder"`
		CreatedTime  Time   `json:"created_time_in_millisecond"`
		ModifiedTime Time   `json:"modified_time_in_millisecond"`
		UploadedTime Time   `json:"uploaded_time_in_millisecond"`
		StorageInfo  struct {
			Size        int64 `json:"size_in_bytes"`
			FileCount   int64 `json:"files_count"`
			FolderCount int64 `json:"folders_count"`
		} `json:"storage_info"`
	} `json:"attributes"`
}

Item is may represent a file or a folder in Zoho Workdrive

type ItemInfo

type ItemInfo struct {
	Item Item `json:"data"`
}

ItemInfo contains a single Zoho Item

type ItemList

type ItemList struct {
	Items []Item `json:"data"`
}

ItemList contains multiple Zoho Items

type TeamWorkspace

type TeamWorkspace struct {
	ID         string `json:"id"`
	Attributes struct {
		Name    string `json:"name"`
		Created Time   `json:"created_time_in_millisecond"`
		IsPart  bool   `json:"is_partof"`
	} `json:"attributes"`
}

TeamWorkspace represents a Zoho Team or workspace It's actually a VERY large json object that differs between Team and Workspace but we are only interested in some fields that both of them have so we can use the same struct for both

type TeamWorkspaceResponse

type TeamWorkspaceResponse struct {
	TeamWorkspace []TeamWorkspace `json:"data"`
}

TeamWorkspaceResponse is the response by the list teams api

type Time

type Time time.Time

Time represents represents date and time information for Zoho Zoho uses milliseconds since unix epoch (Java currentTimeMillis)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

UnmarshalJSON turns JSON into a Time

type UploadInfo

type UploadInfo struct {
	Attributes struct {
		ParentID    string `json:"parent_id"`
		FileName    string `json:"notes.txt"`
		RessourceID string `json:"resource_id"`
	} `json:"attributes"`
}

UploadInfo is a simplified and slightly different version of the Item struct only used in the response to uploads

type UploadResponse

type UploadResponse struct {
	Uploads []UploadInfo `json:"data"`
}

UploadResponse is the response to a file Upload

type User

type User struct {
	FirstName   string `json:"First_Name"`
	Email       string `json:"Email"`
	LastName    string `json:"Last_Name"`
	DisplayName string `json:"Display_Name"`
	ZUID        int64  `json:"ZUID"`
}

User is a Zoho user we are only interested in the ZUID here

type WriteAttributes

type WriteAttributes struct {
	Name        string `json:"name,omitempty"`
	ParentID    string `json:"parent_id,omitempty"`
	RessourceID string `json:"resource_id,omitempty"`
	Status      string `json:"status,omitempty"`
}

WriteAttributes is used to set various attributes for on items this is used for Move, Copy, Delete, Rename

type WriteMetadata

type WriteMetadata struct {
	Attributes WriteAttributes `json:"attributes,omitempty"`
	ID         string          `json:"id,omitempty"`
	Type       string          `json:"type"`
}

WriteMetadata is used to write item metadata

type WriteMetadataRequest

type WriteMetadataRequest struct {
	Data WriteMetadata `json:"data"`
}

WriteMetadataRequest is is used to write metadata for a single item

type WriteMultiMetadataRequest

type WriteMultiMetadataRequest struct {
	Meta []WriteMetadata `json:"data"`
}

WriteMultiMetadataRequest can be used to write metadata for multiple items at once but we don't use it that way

Jump to

Keyboard shortcuts

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