api

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient(apiKey string) *http.Client

NewHTTPClient creates an http.Client with the custom transport

Types

type AppendSheetRowsRequest added in v0.2.0

type AppendSheetRowsRequest struct {
	Range            string          `json:"range"`
	Values           [][]interface{} `json:"values"`
	ValueInputOption string          `json:"valueInputOption,omitempty"`
}

AppendSheetRowsRequest represents a request to append rows to a sheet

type Attachment

type Attachment struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	ContentType string `json:"contentType,omitempty"`
	Size        int64  `json:"size"`
	IsInline    bool   `json:"isInline"`
}

Attachment represents an email attachment

type Attendee

type Attendee struct {
	Email          string `json:"email"`
	Name           string `json:"name,omitempty"`
	DisplayName    string `json:"displayName,omitempty"` // Alias
	Response       string `json:"response,omitempty"`
	ResponseStatus string `json:"responseStatus,omitempty"` // Alias
}

Attendee represents an event attendee

type AuthStatusResponse

type AuthStatusResponse struct {
	Email        string    `json:"email"`
	OperatorName string    `json:"operatorName"`
	KeyID        int       `json:"keyId"`
	KeyTitle     string    `json:"keyTitle,omitempty"`
	CreatedAt    time.Time `json:"createdAt"`
}

AuthStatusResponse is the response for auth status endpoint

type BusyPeriod

type BusyPeriod struct {
	StartUtc        time.Time `json:"startUtc"`
	EndUtc          time.Time `json:"endUtc"`
	DurationMinutes int       `json:"durationMinutes"`
}

BusyPeriod represents a single busy time block

type Calendar

type Calendar struct {
	ID              int64     `json:"id"`
	ExternalID      string    `json:"externalId,omitempty"`
	Name            string    `json:"name"`
	Provider        string    `json:"provider"`
	Timezone        string    `json:"timezone,omitempty"`
	IsPrimary       bool      `json:"isPrimary"`
	IsOperatorOwner bool      `json:"isOperatorOwner,omitempty"`
	OwnerEmail      string    `json:"ownerEmail,omitempty"`
	LastSyncedAt    time.Time `json:"lastSyncedAt,omitempty"`
}

Calendar represents a calendar

type CalendarsResponse

type CalendarsResponse struct {
	Data       []Calendar `json:"data"`
	AccessInfo string     `json:"accessInfo,omitempty"`
}

CalendarsResponse is the response type for calendars

type Client

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

func NewClient

func NewClient(apiKey string) *Client

func (*Client) AppendSheetRows added in v0.2.0

func (c *Client) AppendSheetRows(fileID string, req AppendSheetRowsRequest) (*DriveOperationResult, error)

AppendSheetRows appends rows after the last row with data in the specified range

func (*Client) CreateDriveFolder added in v0.2.0

func (c *Client) CreateDriveFolder(req CreateFolderRequest) (*DriveOperationResult, error)

CreateDriveFolder creates a new folder in Google Drive

func (*Client) CreateEvent

func (c *Client) CreateEvent(req CreateEventRequest) (*Event, error)

CreateEvent creates a new event

func (*Client) Delete

func (c *Client) Delete(path string) ([]byte, error)

func (*Client) DeleteDriveFile added in v0.2.0

func (c *Client) DeleteDriveFile(fileID string) error

DeleteDriveFile moves a file to trash (204 No Content on success)

func (*Client) DeleteEmail

func (c *Client) DeleteEmail(emailID string) error

DeleteEmail deletes (trashes) an email

func (*Client) DeleteEvent

func (c *Client) DeleteEvent(eventID string, notifyAttendees bool) (*DeleteEventResponse, error)

DeleteEvent deletes a calendar event

func (*Client) EditDoc added in v0.2.0

func (c *Client) EditDoc(fileID string, req EditDocRequest) (*DriveOperationResult, error)

EditDoc applies text editing operations to a Google Doc

func (*Client) ForwardEmail

func (c *Client) ForwardEmail(emailID string, req ForwardEmailRequest) (*EmailActionResponse, error)

ForwardEmail forwards an email to specified recipients

func (*Client) Get

func (c *Client) Get(path string) ([]byte, error)

func (*Client) GetAllDriveFiles added in v0.2.0

func (c *Client) GetAllDriveFiles(params DriveListParams) (*DriveFilesResponse, error)

GetAllDriveFiles fetches all drive files by auto-paginating (safety cap: 50 pages)

func (*Client) GetAllEmails

func (c *Client) GetAllEmails(params EmailParams) (*EmailsResponse, error)

GetAllEmails fetches all emails by auto-paginating through results

func (*Client) GetAllEvents

func (c *Client) GetAllEvents(params EventParams) (*EventsResponse, error)

GetAllEvents fetches all events by auto-paginating through results

func (*Client) GetAuthStatus

func (c *Client) GetAuthStatus() (*AuthStatusResponse, error)

GetAuthStatus returns the current authentication status

func (*Client) GetCalendars

func (c *Client) GetCalendars() (*CalendarsResponse, error)

GetCalendars returns all calendars

func (*Client) GetDocContent added in v0.2.0

func (c *Client) GetDocContent(fileID, format string) (*DocContentResponse, error)

GetDocContent returns the content of a Google Doc

func (*Client) GetDriveFile added in v0.2.0

func (c *Client) GetDriveFile(fileID string) (*SingleDriveFileResponse, error)

GetDriveFile returns metadata for a single drive file

func (c *Client) GetDriveFileLinks(fileID string) (*DriveFileLinkResponse, error)

GetDriveFileLinks returns view/download/export links for a file

func (*Client) GetDriveFiles added in v0.2.0

func (c *Client) GetDriveFiles(params DriveListParams) (*DriveFilesResponse, error)

GetDriveFiles returns drive files matching the given parameters

func (*Client) GetDrivePermissions added in v0.2.0

func (c *Client) GetDrivePermissions(fileID string) (*DrivePermissionsResponse, error)

GetDrivePermissions returns the sharing permissions for a file

func (*Client) GetEmail

func (c *Client) GetEmail(emailID string, includeBody bool) (*SingleEmailResponse, error)

GetEmail returns a single email by ID

func (*Client) GetEmails

func (c *Client) GetEmails(params EmailParams) (*EmailsResponse, error)

GetEmails returns emails based on search parameters

func (*Client) GetEvent

func (c *Client) GetEvent(eventID string) (*SingleEventResponse, error)

GetEvent returns a single event by ID

func (*Client) GetEvents

func (c *Client) GetEvents(params EventParams) (*EventsResponse, error)

GetEvents returns events based on parameters

func (*Client) GetEventsByContact

func (c *Client) GetEventsByContact(params EventsByContactParams) (*EventsResponse, error)

GetEventsByContact returns events with a specific contact Requires at least one of: email or name email and name parameters support partial matching (case-insensitive)

func (*Client) GetFreeBusy

func (c *Client) GetFreeBusy(params FreeBusyParams) (*FreeBusyResponse, error)

GetFreeBusy returns free/busy information for calendars

func (*Client) GetSheetMetadata added in v0.2.0

func (c *Client) GetSheetMetadata(fileID string) (*SheetMetadataResponse, error)

GetSheetMetadata returns spreadsheet title and sheet tab info

func (*Client) GetThread

func (c *Client) GetThread(threadID string) (*ThreadResponse, error)

GetThread returns all messages in a thread by ID

func (*Client) Logout

func (c *Client) Logout() error

Logout revokes the current API key

func (*Client) ModifyEmail

func (c *Client) ModifyEmail(emailID string, req ModifyEmailRequest) error

ModifyEmail modifies email properties (read status, labels)

func (*Client) MoveDriveFile added in v0.2.0

func (c *Client) MoveDriveFile(fileID string, req MoveFileRequest) (*DriveOperationResult, error)

MoveDriveFile moves a file to a different folder

func (*Client) Patch

func (c *Client) Patch(path string, data interface{}) ([]byte, error)

func (*Client) Post

func (c *Client) Post(path string, data interface{}) ([]byte, error)

func (*Client) PostRaw added in v0.2.0

func (c *Client) PostRaw(path string, body []byte, contentType string) ([]byte, error)

PostRaw sends a POST request with a raw byte body and specified Content-Type

func (*Client) Put added in v0.2.0

func (c *Client) Put(path string, data interface{}) ([]byte, error)

Put sends a PUT request with JSON body

func (*Client) ReadSheetValues added in v0.2.0

func (c *Client) ReadSheetValues(fileID, rangeStr string) (*SheetValuesResponse, error)

ReadSheetValues reads cell values from a range in a spreadsheet

func (*Client) RenameDriveFile added in v0.2.0

func (c *Client) RenameDriveFile(fileID string, req RenameFileRequest) (*DriveOperationResult, error)

RenameDriveFile renames a file or folder

func (*Client) ReplyToEmail

func (c *Client) ReplyToEmail(emailID string, req ReplyEmailRequest) (*EmailActionResponse, error)

ReplyToEmail replies to an existing email

func (*Client) RespondToEvent

func (c *Client) RespondToEvent(eventID, status string) (*Event, error)

RespondToEvent responds to an event invitation

func (*Client) SendEmail

func (c *Client) SendEmail(req SendEmailRequest) (*EmailActionResponse, error)

SendEmail sends a new email

func (*Client) ShareDriveFile added in v0.2.0

func (c *Client) ShareDriveFile(fileID string, req ShareFileRequest) (*DriveOperationResult, error)

ShareDriveFile shares a file with a user, group, domain, or anyone

func (*Client) UpdateEvent

func (c *Client) UpdateEvent(eventID string, req UpdateEventRequest) (*Event, error)

UpdateEvent updates an existing event (partial update)

func (*Client) UploadDriveFile added in v0.2.0

func (c *Client) UploadDriveFile(fileName, mimeType, folderID, description string, body []byte) (*DriveOperationResult, error)

UploadDriveFile uploads a file to Google Drive. Pass an empty body to create a Google Workspace file.

func (*Client) WithBaseURL

func (c *Client) WithBaseURL(baseURL string) *Client

WithBaseURL sets a custom base URL (useful for testing)

func (*Client) WriteSheetValues added in v0.2.0

func (c *Client) WriteSheetValues(fileID string, req WriteSheetValuesRequest) (*DriveOperationResult, error)

WriteSheetValues writes cell values to a range in a spreadsheet (overwrites)

type CreateEventRequest

type CreateEventRequest struct {
	CalendarID  int64     `json:"calendarId"`
	Summary     string    `json:"summary"`
	Description string    `json:"description,omitempty"`
	Location    string    `json:"location,omitempty"`
	From        time.Time `json:"from"`
	To          time.Time `json:"to"`
	IsAllDay    bool      `json:"isAllDay,omitempty"`
	Attendees   []string  `json:"attendees,omitempty"`
	Recurrence  []string  `json:"recurrence,omitempty"`
}

CreateEventRequest represents a request to create an event

type CreateFolderRequest added in v0.2.0

type CreateFolderRequest struct {
	Name           string  `json:"name"`
	ParentFolderID *string `json:"parentFolderId,omitempty"`
	Description    *string `json:"description,omitempty"`
}

CreateFolderRequest represents a request to create a new folder

type DeleteEventResponse

type DeleteEventResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

DeleteEventResponse is the response from deleting an event

type DocContentResponse added in v0.2.0

type DocContentResponse struct {
	PlainText         *string     `json:"plainText,omitempty"`
	StructuredContent interface{} `json:"structuredContent,omitempty"`
	Title             *string     `json:"title,omitempty"`
	AccessInfo        *string     `json:"accessInfo,omitempty"`
}

DocContentResponse is the response for reading a Google Doc

type DocEditOperation added in v0.2.0

type DocEditOperation struct {
	Type      string  `json:"type"`
	Text      *string `json:"text,omitempty"`
	Index     *int    `json:"index,omitempty"`
	Find      *string `json:"find,omitempty"`
	Replace   *string `json:"replace,omitempty"`
	MatchCase *bool   `json:"matchCase,omitempty"`
}

DocEditOperation represents a single text editing operation on a Google Doc

type DriveFile added in v0.2.0

type DriveFile struct {
	ID               string            `json:"id"`
	Name             *string           `json:"name,omitempty"`
	MimeType         *string           `json:"mimeType,omitempty"`
	Size             *int64            `json:"size,omitempty"`
	CreatedTime      *string           `json:"createdTime,omitempty"`
	ModifiedTime     *string           `json:"modifiedTime,omitempty"`
	Owners           []DriveUser       `json:"owners,omitempty"`
	SharedWith       []DriveUser       `json:"sharedWith,omitempty"`
	Description      *string           `json:"description,omitempty"`
	WebViewLink      *string           `json:"webViewLink,omitempty"`
	DownloadLink     *string           `json:"downloadLink,omitempty"`
	ParentFolderID   *string           `json:"parentFolderId,omitempty"`
	ParentFolderName *string           `json:"parentFolderName,omitempty"`
	Labels           map[string]string `json:"labels,omitempty"`
	IsFolder         bool              `json:"isFolder"`
	Provider         string            `json:"provider"`
}

DriveFile represents a file or folder in Google Drive

type DriveFileLinkResponse added in v0.2.0

type DriveFileLinkResponse struct {
	Success               bool              `json:"success"`
	WebViewLink           *string           `json:"webViewLink,omitempty"`
	DownloadUrl           *string           `json:"downloadUrl,omitempty"`
	ExportLinks           map[string]string `json:"exportLinks,omitempty"`
	FileName              *string           `json:"fileName,omitempty"`
	MimeType              *string           `json:"mimeType,omitempty"`
	Size                  *int64            `json:"size,omitempty"`
	IsGoogleWorkspaceFile bool              `json:"isGoogleWorkspaceFile"`
	ErrorMessage          *string           `json:"errorMessage,omitempty"`
	ErrorCode             *string           `json:"errorCode,omitempty"`
}

DriveFileLinkResponse is the response for file download/export links

type DriveFilesResponse added in v0.2.0

type DriveFilesResponse struct {
	Files         []DriveFile `json:"files"`
	NextPageToken *string     `json:"nextPageToken,omitempty"`
	HasMore       bool        `json:"hasMore,omitempty"`
	AccessInfo    *string     `json:"accessInfo,omitempty"`
	AuthWarnings  []string    `json:"authWarnings,omitempty"`
}

DriveFilesResponse is the response for drive file list/search

type DriveListParams added in v0.2.0

type DriveListParams struct {
	Q              string
	FolderID       string
	MimeType       string
	Name           string
	TrashedOnly    bool
	SharedWithMe   bool
	ModifiedAfter  string
	ModifiedBefore string
	Limit          int
	PageToken      string
	OrderBy        string
}

DriveListParams holds parameters for drive file list/search queries

type DriveOperationResult added in v0.2.0

type DriveOperationResult struct {
	Success      bool    `json:"success"`
	FileID       *string `json:"fileId,omitempty"`
	ErrorMessage *string `json:"errorMessage,omitempty"`
	ErrorCode    *string `json:"errorCode,omitempty"`
}

DriveOperationResult is the response for mutating drive operations

type DrivePermission added in v0.2.0

type DrivePermission struct {
	ID           string  `json:"id"`
	Type         string  `json:"type"`
	Role         string  `json:"role"`
	EmailAddress *string `json:"emailAddress,omitempty"`
	Domain       *string `json:"domain,omitempty"`
	DisplayName  *string `json:"displayName,omitempty"`
}

DrivePermission represents a single sharing permission (ACL entry)

type DrivePermissionsResponse added in v0.2.0

type DrivePermissionsResponse struct {
	Permissions []DrivePermission `json:"permissions"`
	AccessInfo  *string           `json:"accessInfo,omitempty"`
}

DrivePermissionsResponse is the response for file permissions

type DriveUser added in v0.2.0

type DriveUser struct {
	Email       string  `json:"email"`
	DisplayName *string `json:"displayName,omitempty"`
	Role        *string `json:"role,omitempty"`
}

DriveUser represents a file owner or collaborator

type EditDocRequest added in v0.2.0

type EditDocRequest struct {
	Operations []DocEditOperation `json:"operations"`
}

EditDocRequest represents a request to edit a Google Doc

type Email

type Email struct {
	ID             string        `json:"id"`
	ThreadID       string        `json:"threadId,omitempty"`
	Subject        string        `json:"subject,omitempty"`
	From           *Participant  `json:"from,omitempty"`
	To             []Participant `json:"to,omitempty"`
	CC             []Participant `json:"cc,omitempty"`
	BCC            []Participant `json:"bcc,omitempty"`
	BodyPreview    string        `json:"bodyPreview,omitempty"`
	Body           string        `json:"body,omitempty"`
	BodyType       string        `json:"bodyType,omitempty"`
	SentAt         time.Time     `json:"sentAt,omitempty"`
	ReceivedAt     time.Time     `json:"receivedAt,omitempty"`
	IsRead         bool          `json:"isRead"`
	HasAttachments bool          `json:"hasAttachments"`
	Attachments    []Attachment  `json:"attachments,omitempty"`
	Labels         []string      `json:"labels,omitempty"`
	Importance     string        `json:"importance,omitempty"`
	Provider       string        `json:"provider"`
}

Email represents an email message

type EmailActionResponse

type EmailActionResponse struct {
	Success      bool   `json:"success"`
	EmailID      string `json:"emailId,omitempty"`
	ThreadID     string `json:"threadId,omitempty"`
	ErrorMessage string `json:"errorMessage,omitempty"`
}

EmailActionResponse is the response for send/reply/forward operations

type EmailParams

type EmailParams struct {
	Query         string
	From          string
	To            string
	Subject       string
	Label         string
	Unread        *bool
	After         time.Time
	Before        time.Time
	HasAttachment *bool
	Limit         int
	IncludeBody   bool
	PageToken     string
}

EmailParams holds parameters for email list/search queries

type EmailsResponse

type EmailsResponse struct {
	Emails        []Email `json:"emails"`
	TotalCount    int     `json:"totalCount,omitempty"`
	HasMore       bool    `json:"hasMore,omitempty"`
	NextPageToken string  `json:"nextPageToken,omitempty"`
	AccessInfo    string  `json:"accessInfo,omitempty"`
}

EmailsResponse is the response type for email list/search operations

type Event

type Event struct {
	ID               string     `json:"id"`
	CalendarID       int64      `json:"calendarId,omitempty"`
	Title            string     `json:"title"`
	Summary          string     `json:"summary,omitempty"` // Alias for backwards compat
	Description      string     `json:"description,omitempty"`
	Location         string     `json:"location,omitempty"`
	StartUtc         time.Time  `json:"startUtc"`
	EndUtc           time.Time  `json:"endUtc"`
	StartLocal       string     `json:"startLocal,omitempty"`
	EndLocal         string     `json:"endLocal,omitempty"`
	DurationMinutes  int        `json:"durationMinutes,omitempty"`
	Status           string     `json:"status"`
	AllDay           bool       `json:"allDay"`
	IsAllDay         bool       `json:"isAllDay,omitempty"` // Alias for backwards compat
	Attendees        []Attendee `json:"attendees,omitempty"`
	Organizer        string     `json:"organizer,omitempty"`
	JoinUrl          string     `json:"joinUrl,omitempty"`
	Labels           []string   `json:"labels,omitempty"`
	IsRecurringEvent bool       `json:"isRecurringEvent,omitempty"`
}

Event represents a calendar event

type EventParams

type EventParams struct {
	From             time.Time
	To               time.Time
	CalendarID       int64
	Limit            int
	Offset           int
	Query            string // keyword search (q parameter)
	Attendees        string // comma-separated attendee emails
	IncludeCancelled bool
}

EventParams holds parameters for event queries

type EventsByContactParams

type EventsByContactParams struct {
	Email  string // Partial email matching (case-insensitive)
	Name   string // Partial name/display name matching (case-insensitive)
	Limit  int
	Offset int
}

EventsByContactParams holds parameters for events by-contact queries

type EventsResponse

type EventsResponse struct {
	RequestID                string  `json:"request_id,omitempty"`
	Events                   []Event `json:"events"`
	Meta                     *Meta   `json:"meta,omitempty"`
	AccessInfo               string  `json:"accessInfo,omitempty"`
	CurrentUserCalendarEmail string  `json:"currentUserCalendarEmail,omitempty"`
}

EventsResponse is the response type for calendar events

type ForwardEmailRequest

type ForwardEmailRequest struct {
	To       []Participant `json:"to"`
	CC       []Participant `json:"cc,omitempty"`
	Body     string        `json:"body,omitempty"`
	BodyType string        `json:"bodyType,omitempty"`
}

ForwardEmailRequest represents a request to forward an email

type FreeBusyCalendar

type FreeBusyCalendar struct {
	CalendarID   int64        `json:"calendarId"`
	CalendarName string       `json:"calendarName"`
	Busy         []BusyPeriod `json:"busy"`
}

FreeBusyCalendar represents free/busy info for a single calendar

type FreeBusyParams

type FreeBusyParams struct {
	From      time.Time
	To        time.Time
	Calendars string // comma-separated calendar IDs
}

FreeBusyParams holds parameters for free/busy queries

type FreeBusyResponse

type FreeBusyResponse struct {
	Calendars  []FreeBusyCalendar `json:"calendars"`
	AccessInfo string             `json:"accessInfo,omitempty"`
}

FreeBusyResponse is the response type for free/busy queries

type Meta

type Meta struct {
	Count       int       `json:"count,omitempty"`
	Offset      int       `json:"offset,omitempty"`
	HasMore     bool      `json:"hasMore,omitempty"`
	TotalCount  int       `json:"totalCount,omitempty"`
	Truncated   bool      `json:"truncated,omitempty"`
	ExecutionMs int       `json:"execution_ms,omitempty"`
	From        time.Time `json:"from,omitempty"`
	To          time.Time `json:"to,omitempty"`
	Timestamp   time.Time `json:"timestamp,omitempty"`
}

Meta contains response metadata

type ModifyEmailRequest

type ModifyEmailRequest struct {
	MarkAsRead   *bool    `json:"markAsRead,omitempty"`
	AddLabels    []string `json:"addLabels,omitempty"`
	RemoveLabels []string `json:"removeLabels,omitempty"`
}

ModifyEmailRequest represents a request to modify email properties

type MoveFileRequest added in v0.2.0

type MoveFileRequest struct {
	DestinationFolderID string `json:"destinationFolderId"`
}

MoveFileRequest represents a request to move a file to another folder

type Participant

type Participant struct {
	Email string `json:"email"`
	Name  string `json:"name,omitempty"`
}

Participant represents an email participant (sender/recipient)

type RenameFileRequest added in v0.2.0

type RenameFileRequest struct {
	NewName string `json:"newName"`
}

RenameFileRequest represents a request to rename a file or folder

type ReplyEmailRequest

type ReplyEmailRequest struct {
	Body     string `json:"body"`
	BodyType string `json:"bodyType,omitempty"`
	ReplyAll bool   `json:"replyAll,omitempty"`
}

ReplyEmailRequest represents a request to reply to an email

type SendEmailRequest

type SendEmailRequest struct {
	To           []Participant `json:"to"`
	CC           []Participant `json:"cc,omitempty"`
	BCC          []Participant `json:"bcc,omitempty"`
	Subject      string        `json:"subject"`
	Body         string        `json:"body"`
	BodyType     string        `json:"bodyType,omitempty"`
	Importance   string        `json:"importance,omitempty"`
	ConnectionID *int64        `json:"connectionId,omitempty"`
}

SendEmailRequest represents a request to send a new email

type ShareFileRequest added in v0.2.0

type ShareFileRequest struct {
	Type             string  `json:"type"`
	Role             string  `json:"role"`
	EmailAddress     *string `json:"emailAddress,omitempty"`
	Domain           *string `json:"domain,omitempty"`
	SendNotification *bool   `json:"sendNotification,omitempty"`
	Message          *string `json:"message,omitempty"`
}

ShareFileRequest represents a request to share a file

type SheetMetadataResponse added in v0.2.0

type SheetMetadataResponse struct {
	SpreadsheetID string         `json:"spreadsheetId"`
	Title         *string        `json:"title,omitempty"`
	Sheets        []SheetTabInfo `json:"sheets"`
	AccessInfo    *string        `json:"accessInfo,omitempty"`
}

SheetMetadataResponse is the response for spreadsheet metadata

type SheetTabInfo added in v0.2.0

type SheetTabInfo struct {
	SheetID     int    `json:"sheetId"`
	Title       string `json:"title"`
	RowCount    int    `json:"rowCount"`
	ColumnCount int    `json:"columnCount"`
}

SheetTabInfo represents metadata for a single sheet tab

type SheetValuesResponse added in v0.2.0

type SheetValuesResponse struct {
	Range      string          `json:"range"`
	Values     [][]interface{} `json:"values"`
	AccessInfo *string         `json:"accessInfo,omitempty"`
}

SheetValuesResponse is the response for reading sheet cell values

type SingleDriveFileResponse added in v0.2.0

type SingleDriveFileResponse struct {
	File       *DriveFile `json:"file"`
	AccessInfo *string    `json:"accessInfo,omitempty"`
}

SingleDriveFileResponse wraps a single file with access info

type SingleEmailResponse

type SingleEmailResponse struct {
	Email      Email  `json:"email"`
	AccessInfo string `json:"accessInfo,omitempty"`
}

SingleEmailResponse wraps a single email with access info

type SingleEventResponse

type SingleEventResponse struct {
	Event                    Event  `json:"event"`
	AccessInfo               string `json:"accessInfo,omitempty"`
	CurrentUserCalendarEmail string `json:"currentUserCalendarEmail,omitempty"`
}

SingleEventResponse is the response type for a single event GET

type ThreadResponse

type ThreadResponse struct {
	ID            string        `json:"id"`
	Subject       string        `json:"subject,omitempty"`
	Messages      []Email       `json:"messages"`
	MessageCount  int           `json:"messageCount"`
	Participants  []Participant `json:"participants,omitempty"`
	LastMessageAt time.Time     `json:"lastMessageAt,omitempty"`
	Provider      string        `json:"provider"`
	AccessInfo    string        `json:"accessInfo,omitempty"`
}

ThreadResponse is the response type for GET /threads/{id}

type Transport

type Transport struct {
	Base   http.RoundTripper
	APIKey string
}

Transport implements http.RoundTripper with automatic auth and logging

func NewTransport

func NewTransport(apiKey string) *Transport

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

type UpdateEventRequest

type UpdateEventRequest struct {
	Summary           string     `json:"summary,omitempty"`
	Description       string     `json:"description,omitempty"`
	Location          string     `json:"location,omitempty"`
	From              *time.Time `json:"from,omitempty"`
	To                *time.Time `json:"to,omitempty"`
	IsAllDay          *bool      `json:"isAllDay,omitempty"`
	AddAttendees      []string   `json:"addAttendees,omitempty"`
	RemoveAttendees   []string   `json:"removeAttendees,omitempty"`
	SendNotifications *bool      `json:"sendNotifications,omitempty"`
}

UpdateEventRequest represents a request to update an event (PATCH)

type WriteSheetValuesRequest added in v0.2.0

type WriteSheetValuesRequest struct {
	Range            string          `json:"range"`
	Values           [][]interface{} `json:"values"`
	ValueInputOption string          `json:"valueInputOption,omitempty"`
}

WriteSheetValuesRequest represents a request to write cell values

Jump to

Keyboard shortcuts

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