api

package
v0.0.0-...-b4aeae5 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package api provides types used by the Yandex API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncInfo

type AsyncInfo struct {
	HRef      string `json:"href"`
	Method    string `json:"method"`
	Templated bool   `json:"templated"`
}

AsyncInfo struct is returned by the API for various async operations.

type AsyncStatus

type AsyncStatus struct {
	Status string `json:"status"`
}

AsyncStatus is returned when requesting the status of an async operations. Possible values in-progress, success, failure

type CustomPropertyResponse

type CustomPropertyResponse struct {
	CustomProperties map[string]interface{} `json:"custom_properties"`
}

CustomPropertyResponse struct we send and is returned by the API for CustomProperty request.

type DiskInfo

type DiskInfo struct {
	TotalSpace int64 `json:"total_space"`
	UsedSpace  int64 `json:"used_space"`
	TrashSize  int64 `json:"trash_size"`
}

DiskInfo contains disk metadata

type ErrorResponse

type ErrorResponse struct {
	ErrorName   string `json:"error"`
	Description string `json:"description"`
	Message     string `json:"message"`

	StatusCode int `json:""`
}

ErrorResponse represents erroneous API response. Implements go's built in `error`.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type ResourceInfoRequestOptions

type ResourceInfoRequestOptions struct {
	SortMode *SortMode
	Limit    uint64
	Offset   uint64
	Fields   []string
}

ResourceInfoRequestOptions struct

type ResourceInfoResponse

type ResourceInfoResponse struct {
	PublicKey        string                 `json:"public_key"`
	Name             string                 `json:"name"`
	Created          string                 `json:"created"`
	CustomProperties map[string]interface{} `json:"custom_properties"`
	Preview          string                 `json:"preview"`
	PublicURL        string                 `json:"public_url"`
	OriginPath       string                 `json:"origin_path"`
	Modified         string                 `json:"modified"`
	Path             string                 `json:"path"`
	Md5              string                 `json:"md5"`
	ResourceType     string                 `json:"type"`
	MimeType         string                 `json:"mime_type"`
	Size             int64                  `json:"size"`
	Embedded         *ResourceListResponse  `json:"_embedded"`
}

ResourceInfoResponse struct is returned by the API for metadata requests.

type ResourceListResponse

type ResourceListResponse struct {
	Sort      *SortMode              `json:"sort"`
	PublicKey string                 `json:"public_key"`
	Items     []ResourceInfoResponse `json:"items"`
	Path      string                 `json:"path"`
	Limit     *uint64                `json:"limit"`
	Offset    *uint64                `json:"offset"`
	Total     *uint64                `json:"total"`
}

ResourceListResponse struct

type SortMode

type SortMode struct {
	// contains filtered or unexported fields
}

SortMode struct - sort mode

func (*SortMode) ByCreated

func (m *SortMode) ByCreated() *SortMode

ByCreated - sort mode

func (*SortMode) ByModified

func (m *SortMode) ByModified() *SortMode

ByModified - sort mode

func (*SortMode) ByName

func (m *SortMode) ByName() *SortMode

ByName - sort mode

func (*SortMode) ByPath

func (m *SortMode) ByPath() *SortMode

ByPath - sort mode

func (*SortMode) BySize

func (m *SortMode) BySize() *SortMode

BySize - sort mode

func (*SortMode) Default

func (m *SortMode) Default() *SortMode

Default - sort mode

func (*SortMode) Reverse

func (m *SortMode) Reverse() *SortMode

Reverse - sort mode

func (*SortMode) String

func (m *SortMode) String() string

func (*SortMode) UnmarshalJSON

func (m *SortMode) UnmarshalJSON(value []byte) error

UnmarshalJSON sort mode

Jump to

Keyboard shortcuts

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