drive

package
v0.0.0-...-de2eba5 Latest Latest
Warning

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

Go to latest
Published: May 19, 2015 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package drive provides access to the Drive API.

See https://developers.google.com/drive/

Usage example:

import "google.golang.org/api/drive/v1"
...
driveService, err := drive.New(oauthHttpClient)

Index

Constants

View Source
const (
	// View and manage Google Drive files that you have opened or created
	// with this app
	DriveFileScope = "https://www.googleapis.com/auth/drive.file"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	// CreatedDate: Create time for this file (formatted RFC 3339
	// timestamp).
	CreatedDate string `json:"createdDate,omitempty"`

	// Description: A short description of the file
	Description string `json:"description,omitempty"`

	// DownloadUrl: Short term download URL for the file. This will only be
	// populated on files with content stored in Drive.
	DownloadUrl string `json:"downloadUrl,omitempty"`

	// Etag: ETag of the file.
	Etag string `json:"etag,omitempty"`

	// FileExtension: The file extension used when downloading this file.
	// This field is read only. To set the extension, include it on title
	// when creating the file. This will only be populated on files with
	// content stored in Drive.
	FileExtension string `json:"fileExtension,omitempty"`

	// FileSize: The size of the file in bytes. This will only be populated
	// on files with content stored in Drive.
	FileSize int64 `json:"fileSize,omitempty,string"`

	// Id: The id of the file.
	Id string `json:"id,omitempty"`

	// IndexableText: Indexable text attributes for the file (can only be
	// written)
	IndexableText *FileIndexableText `json:"indexableText,omitempty"`

	// Kind: The type of file. This is always drive#file
	Kind string `json:"kind,omitempty"`

	// Labels: Labels for the file.
	Labels *FileLabels `json:"labels,omitempty"`

	// LastViewedDate: Last time this file was viewed by the user (formatted
	// RFC 3339 timestamp).
	LastViewedDate string `json:"lastViewedDate,omitempty"`

	// Md5Checksum: An MD5 checksum for the content of this file. This will
	// only be populated on files with content stored in Drive.
	Md5Checksum string `json:"md5Checksum,omitempty"`

	// MimeType: The mimetype of the file
	MimeType string `json:"mimeType,omitempty"`

	// ModifiedByMeDate: Last time this file was modified by the user
	// (formatted RFC 3339 timestamp).
	ModifiedByMeDate string `json:"modifiedByMeDate,omitempty"`

	// ModifiedDate: Last time this file was modified by anyone (formatted
	// RFC 3339 timestamp).
	ModifiedDate string `json:"modifiedDate,omitempty"`

	// ParentsCollection: Collection of parent folders which contain this
	// file.
	// On insert, setting this field will put the file in all of the
	// provided folders. If no folders are provided, the file will be placed
	// in the default root folder. On update, this field is ignored.
	ParentsCollection []*FileParentsCollection `json:"parentsCollection,omitempty"`

	// SelfLink: A link back to this file.
	SelfLink string `json:"selfLink,omitempty"`

	// Title: The title of this file.
	Title string `json:"title,omitempty"`

	// UserPermission: The permissions for the authenticated user on this
	// file.
	UserPermission *Permission `json:"userPermission,omitempty"`
}

type FileIndexableText

type FileIndexableText struct {
	// Text: The text to be indexed for this file
	Text string `json:"text,omitempty"`
}

type FileLabels

type FileLabels struct {
	// Hidden: Whether this file is hidden from the user
	Hidden *bool `json:"hidden,omitempty"`

	// Starred: Whether this file is starred by the user.
	Starred *bool `json:"starred,omitempty"`

	// Trashed: Whether this file has been trashed.
	Trashed *bool `json:"trashed,omitempty"`
}

type FileParentsCollection

type FileParentsCollection struct {
	// Id: The id of this parent
	Id string `json:"id,omitempty"`

	// ParentLink: A link to get the metadata for this parent
	ParentLink string `json:"parentLink,omitempty"`
}

type FilesGetCall

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

func (*FilesGetCall) Do

func (c *FilesGetCall) Do() (*File, error)

func (*FilesGetCall) Fields

func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*FilesGetCall) Projection

func (c *FilesGetCall) Projection(projection string) *FilesGetCall

Projection sets the optional parameter "projection": This parameter is deprecated and has no function.

Possible values:

"BASIC" - Deprecated
"FULL" - Deprecated

func (*FilesGetCall) UpdateViewedDate

func (c *FilesGetCall) UpdateViewedDate(updateViewedDate bool) *FilesGetCall

UpdateViewedDate sets the optional parameter "updateViewedDate": Whether to update the view date after successfully retrieving the file.

type FilesInsertCall

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

func (*FilesInsertCall) Do

func (c *FilesInsertCall) Do() (*File, error)

func (*FilesInsertCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*FilesInsertCall) Media

Media specifies the media to upload in a single chunk. At most one of Media and ResumableMedia may be set.

func (*FilesInsertCall) ProgressUpdater

func (c *FilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesInsertCall

ProgressUpdater provides a callback function that will be called after every chunk. It should be a low-latency function in order to not slow down the upload operation. This should only be called when using ResumableMedia (as opposed to Media).

func (*FilesInsertCall) ResumableMedia

func (c *FilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesInsertCall

ResumableMedia specifies the media to upload in chunks and can be cancelled with ctx. At most one of Media and ResumableMedia may be set. mediaType identifies the MIME media type of the upload, such as "image/png". If mediaType is "", it will be auto-detected.

type FilesPatchCall

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

func (*FilesPatchCall) Do

func (c *FilesPatchCall) Do() (*File, error)

func (*FilesPatchCall) Fields

func (c *FilesPatchCall) Fields(s ...googleapi.Field) *FilesPatchCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*FilesPatchCall) NewRevision

func (c *FilesPatchCall) NewRevision(newRevision bool) *FilesPatchCall

NewRevision sets the optional parameter "newRevision": Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).

func (*FilesPatchCall) UpdateModifiedDate

func (c *FilesPatchCall) UpdateModifiedDate(updateModifiedDate bool) *FilesPatchCall

UpdateModifiedDate sets the optional parameter "updateModifiedDate": Controls updating the modified date of the file. If true, the modified date will be updated to the current time, regardless of whether other changes are being made. If false, the modified date will only be updated to the current time if other changes are also being made (changing the title, for example).

func (*FilesPatchCall) UpdateViewedDate

func (c *FilesPatchCall) UpdateViewedDate(updateViewedDate bool) *FilesPatchCall

UpdateViewedDate sets the optional parameter "updateViewedDate": Whether to update the view date after successfully updating the file.

type FilesService

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

func NewFilesService

func NewFilesService(s *Service) *FilesService

func (*FilesService) Get

func (r *FilesService) Get(id string) *FilesGetCall

Get: Gets a file's metadata by id.

func (*FilesService) Insert

func (r *FilesService) Insert(file *File) *FilesInsertCall

Insert: Inserts a file, and any settable metadata or blob content sent with the request.

func (*FilesService) Patch

func (r *FilesService) Patch(id string, file *File) *FilesPatchCall

Patch: Updates file metadata and/or content. This method supports patch semantics.

func (*FilesService) Update

func (r *FilesService) Update(id string, file *File) *FilesUpdateCall

Update: Updates file metadata and/or content

type FilesUpdateCall

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

func (*FilesUpdateCall) Do

func (c *FilesUpdateCall) Do() (*File, error)

func (*FilesUpdateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*FilesUpdateCall) Media

Media specifies the media to upload in a single chunk. At most one of Media and ResumableMedia may be set.

func (*FilesUpdateCall) NewRevision

func (c *FilesUpdateCall) NewRevision(newRevision bool) *FilesUpdateCall

NewRevision sets the optional parameter "newRevision": Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).

func (*FilesUpdateCall) ProgressUpdater

func (c *FilesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesUpdateCall

ProgressUpdater provides a callback function that will be called after every chunk. It should be a low-latency function in order to not slow down the upload operation. This should only be called when using ResumableMedia (as opposed to Media).

func (*FilesUpdateCall) ResumableMedia

func (c *FilesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesUpdateCall

ResumableMedia specifies the media to upload in chunks and can be cancelled with ctx. At most one of Media and ResumableMedia may be set. mediaType identifies the MIME media type of the upload, such as "image/png". If mediaType is "", it will be auto-detected.

func (*FilesUpdateCall) UpdateModifiedDate

func (c *FilesUpdateCall) UpdateModifiedDate(updateModifiedDate bool) *FilesUpdateCall

UpdateModifiedDate sets the optional parameter "updateModifiedDate": Controls updating the modified date of the file. If true, the modified date will be updated to the current time, regardless of whether other changes are being made. If false, the modified date will only be updated to the current time if other changes are also being made (changing the title, for example).

func (*FilesUpdateCall) UpdateViewedDate

func (c *FilesUpdateCall) UpdateViewedDate(updateViewedDate bool) *FilesUpdateCall

UpdateViewedDate sets the optional parameter "updateViewedDate": Whether to update the view date after successfully updating the file.

type Permission

type Permission struct {
	// AdditionalRoles: Any additional roles that this permission describes.
	AdditionalRoles []string `json:"additionalRoles,omitempty"`

	// Etag: An etag for this permission.
	Etag string `json:"etag,omitempty"`

	// Kind: The kind of this permission. This is always drive#permission
	Kind string `json:"kind,omitempty"`

	// Role: The role that this permission describes. (For example: reader,
	// writer, owner)
	Role string `json:"role,omitempty"`

	// Type: The type of permission (For example: user, group etc).
	Type string `json:"type,omitempty"`
}

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Files *FilesService
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) (*Service, error)

Jump to

Keyboard shortcuts

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