Documentation
¶
Index ¶
- Variables
- func DownloadFile(ctx sdkcontext.BaseContext, driveService *drive.Service, fileID string, ...) (*string, error)
- func RegisterFoldersProp(form *smartform.FormBuilder, label string, hint string, required bool)
- func RegisterParentFoldersProp(form *smartform.FormBuilder) *smartform.FieldBuilder
- type File
- type ListFileResponse
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DownloadFile ¶
func DownloadFile(ctx sdkcontext.BaseContext, driveService *drive.Service, fileID string, fileName *string) (*string, error)
func RegisterFoldersProp ¶ added in v0.13.0
func RegisterParentFoldersProp ¶ added in v0.13.0
func RegisterParentFoldersProp(form *smartform.FormBuilder) *smartform.FieldBuilder
Types ¶
type File ¶
type File struct { // CreatedTime: The time at which the file was created (RFC 3339 // date-time). CreatedTime string `json:"createdTime,omitempty"` // Description: A short description of the file. Description string `json:"description,omitempty"` // DriveID: Output only. ID of the shared drive the file resides in. // Only populated for items in shared drives. DriveID string `json:"driveId,omitempty"` // ExplicitlyTrashed: Output only. Whether the file has been explicitly // trashed, as opposed to recursively trashed from a parent folder. ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"` // ExportLinks: Output only. Links for exporting Docs Editors files to // specific formats. ExportLinks map[string]string `json:"exportLinks,omitempty"` // FileExtension: Output only. The final component of // `fullFileExtension`. This is only available for files with binary // content in Google Drive. FileExtension string `json:"fileExtension,omitempty"` // FullFileExtension: Output only. The full file extension extracted // from the `name` field. May contain multiple concatenated extensions, // such as "tar.gz". This is only available for files with binary // content in Google Drive. This is automatically updated when the // `name` field changes, however it is not cleared if the new name does // not contain a valid extension. FullFileExtension string `json:"fullFileExtension,omitempty"` // HasAugmentedPermissions: Output only. Whether there are permissions // directly on this file. This field is only populated for items in // shared drives. HasAugmentedPermissions bool `json:"hasAugmentedPermissions,omitempty"` // HasThumbnail: Output only. Whether this file has a thumbnail. This // does not indicate whether the requesting app has access to the // thumbnail. To check access, look for the presence of the // thumbnailLink field. HasThumbnail bool `json:"hasThumbnail,omitempty"` // ID: The ID of the file. ID string `json:"id,omitempty"` // Kind: Output only. Identifies what kind of resource this is. Value: // the fixed string "drive#file". Kind string `json:"kind,omitempty"` // Md5Checksum: Output only. The MD5 checksum for the content of the // file. This is only applicable to files with binary content in Google // Drive. Md5Checksum string `json:"md5Checksum,omitempty"` // MimeType: The MIME type of the file. Google Drive attempts to // automatically detect an appropriate value from uploaded content, if // no value is provided. The value cannot be changed unless a new // revision is uploaded. If a file is created with a Google Doc MIME // type, the uploaded content is imported, if possible. The supported // import formats are published in the About resource. MimeType string `json:"mimeType,omitempty"` // ModifiedByMe: Output only. Whether the file has been modified by this // user. ModifiedByMe bool `json:"modifiedByMe,omitempty"` // ModifiedByMeTime: The last time the file was modified by the user // (RFC 3339 date-time). ModifiedByMeTime string `json:"modifiedByMeTime,omitempty"` // ModifiedTime: he last time the file was modified by anyone (RFC 3339 // date-time). Note that setting modifiedTime will also update // modifiedByMeTime for the user. ModifiedTime string `json:"modifiedTime,omitempty"` // Name: The name of the file. This is not necessarily unique within a // folder. Note that for immutable items such as the top level folders // of shared drives, My Drive root folder, and Application Data folder // the name is constant. Name string `json:"name,omitempty"` // OriginalFilename: The original filename of the uploaded content if // available, or else the original value of the `name` field. This is // only available for files with binary content in Google Drive. OriginalFilename string `json:"originalFilename,omitempty"` // Size: Output only. Size in bytes of blobs and first party editor // files. Won't be populated for files that have no size, like shortcuts // and folders. Size int64 `json:"size,omitempty,string"` // Spaces: Output only. The list of spaces which contain the file. The // currently supported values are 'drive', 'appDataFolder' and 'photos'. Spaces []string `json:"spaces,omitempty"` // Starred: Whether the user has starred the file. Starred bool `json:"starred,omitempty"` // TeamDriveID: Deprecated: Output only. Use `driveId` instead. TeamDriveID string `json:"teamDriveId,omitempty"` // Trashed: Whether the file has been trashed, either explicitly or from // a trashed parent folder. Only the owner may trash a file, and other // users cannot see files in the owner's trash. Trashed bool `json:"trashed,omitempty"` // TrashedTime: The time that the item was trashed (RFC 3339 date-time). // Only populated for items in shared drives. TrashedTime string `json:"trashedTime,omitempty"` // Version: Output only. A monotonically increasing version number for // the file. This reflects every change made to the file on the server, // even those not visible to the user. Version int64 `json:"version,omitempty,string"` // ViewedByMe: Output only. Whether the file has been viewed by this // user. ViewedByMe bool `json:"viewedByMe,omitempty"` // ViewedByMeTime: The last time the file was viewed by the user (RFC // 3339 date-time). ViewedByMeTime string `json:"viewedByMeTime,omitempty"` // ViewersCanCopyContent: Deprecated: Use `copyRequiresWriterPermission` // instead. ViewersCanCopyContent bool `json:"viewersCanCopyContent,omitempty"` // WebContentLink: Output only. A link for downloading the content of // the file in a browser. This is only available for files with binary // content in Google Drive. WebContentLink string `json:"webContentLink,omitempty"` // WebViewLink: Output only. A link for opening the file in a relevant // Google editor or viewer in a browser. WebViewLink string `json:"webViewLink,omitempty"` FileData *string `json:"fileData"` }
File The metadata for a file. Some resource methods (such as `files.update`) require a `fileId`. Use the `files.list` method to retrieve the ID for a file.
func HandleFileContent ¶
func HandleFileContent(ctx sdkcontext.BaseContext, files []*drive.File, driveService *drive.Service) ([]File, error)
type ListFileResponse ¶
Click to show internal directories.
Click to hide internal directories.