googleworkspace

package
v0.1.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const FileScope = "https://www.googleapis.com/auth/drive.file"
View Source
const SelectedFiles = "selected_files"

Variables

This section is empty.

Functions

func ValidFileScopes

func ValidFileScopes(scopes []string) bool

ValidFileScopes rejects legacy broad grants rather than treating them as selected-file access.

func ValidateID

func ValidateID(id string) error

Types

type Config

type Config struct {
	AccessMode string `json:"access_mode,omitempty" validate:"omitempty,oneof=selected_files"`
}

func (Config) ConsentMode

func (c Config) ConsentMode() string

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(raw []byte) error

func (Config) Validate

func (c Config) Validate() error

type Discovery

type Discovery struct {
	Files         []File `json:"files"`
	NextPageToken string `json:"next_page_token,omitempty"`
}

type File

type File struct {
	FileID         string `json:"file_id"`
	Name           string `json:"name"`
	MIMEType       string `json:"mime_type"`
	DriveID        string `json:"drive_id,omitempty"`
	CanDownload    bool   `json:"can_download"`
	CanEdit        bool   `json:"can_edit"`
	CanAddChildren bool   `json:"can_add_children"`
}

type ListOptions

type ListOptions struct {
	FolderID  string `json:"folder_id,omitempty"`
	DriveID   string `json:"drive_id,omitempty"`
	MIMEType  string `json:"mime_type,omitempty"`
	PageToken string `json:"page_token,omitempty"`
}

func (ListOptions) Validate

func (o ListOptions) Validate() error

type Metadata

type Metadata struct {
	SpreadsheetID string      `json:"spreadsheet_id"`
	Title         string      `json:"title"`
	Worksheets    []Worksheet `json:"worksheets"`
}

type PendingInstallConfig

type PendingInstallConfig = Config

type Rectangle

type Rectangle struct{ StartRow, EndRow, StartColumn, EndColumn int }

Rectangle uses one-based inclusive coordinates, matching bounded A1 ranges.

func ParseRange

func ParseRange(value string) (Rectangle, error)

type Statement

type Statement struct {
	Type          string          `json:"type"`
	Resource      string          `json:"resource"`
	Operation     string          `json:"operation"`
	SpreadsheetID string          `json:"spreadsheet_id,omitempty"`
	WorksheetID   *int            `json:"worksheet_id,omitempty"`
	Range         string          `json:"range,omitempty"`
	Columns       []string        `json:"columns,omitempty"`
	Rows          json.RawMessage `json:"rows,omitempty"`
	FileID        string          `json:"file_id,omitempty"`
	FolderID      string          `json:"folder_id,omitempty"`
	DriveID       string          `json:"drive_id,omitempty"`
	MIMEType      string          `json:"mime_type,omitempty"`
	PageToken     string          `json:"page_token,omitempty"`
	Name          string          `json:"name,omitempty"`
	Format        string          `json:"format,omitempty"`
	Content       json.RawMessage `json:"content,omitempty"`
	MatchText     string          `json:"match_text,omitempty"`
	Delimiter     string          `json:"delimiter,omitempty"`
	HasHeader     *bool           `json:"has_header,omitempty"`
}

func DecodeStatement

func DecodeStatement(raw []byte) (Statement, error)

func (Statement) IsNative

func (s Statement) IsNative() bool

func (Statement) IsRead

func (s Statement) IsRead() bool

func (Statement) ListOptions

func (s Statement) ListOptions() ListOptions

func (Statement) NativeMIMEType

func (s Statement) NativeMIMEType() string

func (Statement) Validate

func (s Statement) Validate() error

type Worksheet

type Worksheet struct {
	WorksheetID int    `json:"worksheet_id"`
	Title       string `json:"title"`
	RowCount    int    `json:"row_count"`
	ColumnCount int    `json:"column_count"`
}

Jump to

Keyboard shortcuts

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