api

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeAuthRequired   = "AUTH_REQUIRED"
	CodeCommandError   = "COMMAND_ERROR"
	CodeConfigNotFound = "CONFIG_KEY_NOT_FOUND"
	CodeNetworkError   = "NETWORK_ERROR"
	CodeUnexpectedResp = "UNEXPECTED_RESPONSE"
	CodeUnknownError   = "UNKNOWN_ERROR"
)

CLI-originated error codes.

View Source
const (
	// AUTH_* — authentication / authorization failures.
	CodeAuthUnauthorized = "AUTH_UNAUTHORIZED"
	CodeAuthForbidden    = "AUTH_FORBIDDEN"
	CodeAuthTokenExpired = "AUTH_TOKEN_EXPIRED"
	CodeAuthInvalidToken = "AUTH_INVALID_TOKEN"

	// VALIDATION_* — request validation failures.
	CodeValidationError        = "VALIDATION_ERROR"
	CodeValidationBadRequest   = "VALIDATION_BAD_REQUEST"
	CodeValidationInvalidInput = "VALIDATION_INVALID_INPUT"

	// NETWORK_* — network-level failures.
	CodeNetworkTimeout = "NETWORK_TIMEOUT"

	// SERVER_* — server-side failures.
	CodeServerInternal    = "SERVER_INTERNAL"
	CodeServerUnavailable = "SERVER_UNAVAILABLE"

	// RESOURCE_* — resource state errors.
	CodeResourceNotFound = "RESOURCE_NOT_FOUND"
	CodeResourceConflict = "RESOURCE_CONFLICT"

	// RATE_* — rate limiting.
	CodeRateLimitExceeded = "RATE_LIMIT_EXCEEDED"
)

Server-originated error codes — must match the server's envelope values exactly.

View Source
const (
	ExitSuccess  = 0
	ExitBusiness = 1
	ExitUsage    = 2
	ExitAuth     = 3
	ExitNetwork  = 4
	ExitServer   = 5
)

Exit codes for structured errors.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateFunc

type AggregateFunc struct {
	Fn     string `json:"fn"`
	Column string `json:"column,omitempty"`
	Alias  string `json:"alias"`
}

type AggregateResponse

type AggregateResponse struct {
	Results map[string]any `json:"results"`
}

type Attachment

type Attachment struct {
	ID                 string `json:"id"`
	Filename           string `json:"filename"`
	ContentType        string `json:"contentType"`
	ContentDisposition string `json:"contentDisposition"`
	ContentID          string `json:"contentId"`
	Size               int64  `json:"size"`
}

type BalanceResponse

type BalanceResponse struct {
	Balance int64 `json:"balance"`
}

type Client

type Client struct {
	BaseURL        string
	AccessToken    string
	HTTPClient     *resty.Client
	TokenRefresher TokenRefresher
}

func NewClient

func NewClient(baseURL, accessToken string) *Client

func (*Client) AddColumn

func (c *Client) AddColumn(ctx context.Context, tableID string, input *CreateColumnInput) (*Table, error)

func (*Client) AggregateRows

func (c *Client) AggregateRows(ctx context.Context, tableID string, req *QueryRequest) (*AggregateResponse, error)

func (*Client) ArchiveEmail added in v0.5.0

func (c *Client) ArchiveEmail(ctx context.Context, id string) (*EmailDetail, error)

func (*Client) CompleteUpload

func (c *Client) CompleteUpload(ctx context.Context, id, etag string, sizeBytes int64) (*DriveObject, error)

func (*Client) CreateMailbox

func (c *Client) CreateMailbox(ctx context.Context, req *CreateMailboxRequest) (*Mailbox, error)

func (*Client) CreateNote

func (c *Client) CreateNote(ctx context.Context, subject, content string, labels []string) (*Note, error)

func (*Client) CreateRow

func (c *Client) CreateRow(ctx context.Context, tableID string, data map[string]any) (*Row, error)

func (*Client) CreateTable

func (c *Client) CreateTable(ctx context.Context, req *CreateTableRequest) (*Table, error)

func (*Client) CreateTicket added in v0.5.1

func (c *Client) CreateTicket(ctx context.Context, ticketType, subject, message string) (*Ticket, error)

func (*Client) DeleteColumn

func (c *Client) DeleteColumn(ctx context.Context, tableID, colID string) error

func (*Client) DeleteDriveObject

func (c *Client) DeleteDriveObject(ctx context.Context, id string) (*DriveObject, error)

func (*Client) DeleteDriveObjectByPath

func (c *Client) DeleteDriveObjectByPath(ctx context.Context, path string) (*DriveObject, error)

func (*Client) DeleteEmail

func (c *Client) DeleteEmail(ctx context.Context, id string) error

func (*Client) DeleteMailbox

func (c *Client) DeleteMailbox(ctx context.Context, id string) error

func (*Client) DeleteNote

func (c *Client) DeleteNote(ctx context.Context, id string) (*Note, error)

func (*Client) DeleteRow

func (c *Client) DeleteRow(ctx context.Context, tableID, rowID string) error

func (*Client) DeleteTable

func (c *Client) DeleteTable(ctx context.Context, id string) error

func (*Client) DownloadFromURL

func (c *Client) DownloadFromURL(ctx context.Context, downloadURL string) (io.ReadCloser, error)

DownloadFromURL downloads binary data from a presigned R2 URL. Caller must close the returned ReadCloser.

func (*Client) GenerateImage added in v0.2.1

func (c *Client) GenerateImage(ctx context.Context, req *ImageGenerateRequest) (*ImageGenerateResponse, error)

func (*Client) GenerateVideo added in v0.3.0

func (c *Client) GenerateVideo(ctx context.Context, req *VideoGenerateRequest) (*VideoGenerateResponse, error)

func (*Client) GetBalance

func (c *Client) GetBalance(ctx context.Context) (*BalanceResponse, error)

func (*Client) GetDownloadURL

func (c *Client) GetDownloadURL(ctx context.Context, id string) (*DownloadResponse, error)

func (*Client) GetDownloadURLByPath

func (c *Client) GetDownloadURLByPath(ctx context.Context, path string) (*DownloadResponse, error)

func (*Client) GetDriveObject

func (c *Client) GetDriveObject(ctx context.Context, id string) (*DriveObject, error)

func (*Client) GetDriveObjectByPath

func (c *Client) GetDriveObjectByPath(ctx context.Context, path string) (*DriveObject, error)

func (*Client) GetEmail

func (c *Client) GetEmail(ctx context.Context, id string) (*EmailDetail, error)

func (*Client) GetMe

func (c *Client) GetMe(ctx context.Context) (*UserProfile, error)

func (*Client) GetNote

func (c *Client) GetNote(ctx context.Context, id string) (*Note, error)

func (*Client) GetRow

func (c *Client) GetRow(ctx context.Context, tableID, rowID string) (*Row, error)

func (*Client) GetTable

func (c *Client) GetTable(ctx context.Context, id string) (*Table, error)

func (*Client) GetTrashedDownloadURL

func (c *Client) GetTrashedDownloadURL(ctx context.Context, id string) (*DownloadResponse, error)

func (*Client) GetTrashedDriveObject

func (c *Client) GetTrashedDriveObject(ctx context.Context, id string) (*DriveObject, error)

func (*Client) GetTrashedEmail

func (c *Client) GetTrashedEmail(ctx context.Context, id string) (*EmailDetail, error)

func (*Client) GetTrashedNote

func (c *Client) GetTrashedNote(ctx context.Context, id string) (*Note, error)

func (*Client) GetTrashedRow

func (c *Client) GetTrashedRow(ctx context.Context, tableID, rowID string) (*Row, error)

func (*Client) GetTrashedTable

func (c *Client) GetTrashedTable(ctx context.Context, id string) (*Table, error)

func (*Client) GetVideoStatus added in v0.3.0

func (c *Client) GetVideoStatus(ctx context.Context, requestID string) (*VideoStatusResponse, error)

func (*Client) GroupByRows

func (c *Client) GroupByRows(ctx context.Context, tableID string, req *QueryRequest) (*GroupByResponse, error)

func (*Client) ImageSearch

func (c *Client) ImageSearch(ctx context.Context, req *ImageSearchRequest) (*ImageSearchResponse, error)

func (*Client) InitUpload

func (c *Client) InitUpload(ctx context.Context, req *InitUploadRequest) (*InitUploadResponse, error)

func (*Client) ListDriveObjects

func (c *Client) ListDriveObjects(ctx context.Context, page, pageSize int, prefix string) (*DriveListResponse, error)

func (*Client) ListEmails

func (c *Client) ListEmails(ctx context.Context, page, pageSize int, direction string, isRead *bool, archived *bool) (*EmailListResponse, error)

func (*Client) ListMailboxes

func (c *Client) ListMailboxes(ctx context.Context) ([]*Mailbox, error)

func (*Client) ListNotes

func (c *Client) ListNotes(ctx context.Context, page, pageSize int, labels []string, status, query string) (*NoteListResponse, error)

func (*Client) ListRows

func (c *Client) ListRows(ctx context.Context, tableID string, page, pageSize int) (*RowListResponse, error)

func (*Client) ListTables

func (c *Client) ListTables(ctx context.Context, page, pageSize int) (*TableListResponse, error)

func (*Client) ListTrashedDriveObjects

func (c *Client) ListTrashedDriveObjects(ctx context.Context, page, pageSize int) (*DriveListResponse, error)

func (*Client) ListTrashedEmails

func (c *Client) ListTrashedEmails(ctx context.Context, page, pageSize int, direction string) (*EmailListResponse, error)

func (*Client) ListTrashedRows

func (c *Client) ListTrashedRows(ctx context.Context, tableID string, page, pageSize int) (*RowListResponse, error)

func (*Client) ListTrashedTables

func (c *Client) ListTrashedTables(ctx context.Context, page, pageSize int) (*TableListResponse, error)

func (*Client) MarkEmailAsRead added in v0.4.1

func (c *Client) MarkEmailAsRead(ctx context.Context, id string) (*EmailDetail, error)

func (*Client) MarkEmailAsUnread added in v0.4.1

func (c *Client) MarkEmailAsUnread(ctx context.Context, id string) (*EmailDetail, error)

func (*Client) NewsSearch

func (c *Client) NewsSearch(ctx context.Context, req *NewsSearchRequest) (*NewsSearchResponse, error)

func (*Client) PatchColumn

func (c *Client) PatchColumn(ctx context.Context, tableID, colID string, patch *ColumnPatch) (*Table, error)

func (*Client) PatchMailbox

func (c *Client) PatchMailbox(ctx context.Context, id string, patch *MailboxPatch) (*Mailbox, error)

func (*Client) PatchNote

func (c *Client) PatchNote(ctx context.Context, id string, patch *NotePatch) (*Note, error)

func (*Client) PatchRow

func (c *Client) PatchRow(ctx context.Context, tableID, rowID string, data map[string]any) (*Row, error)

func (*Client) PatchTable

func (c *Client) PatchTable(ctx context.Context, id string, patch *TablePatch) (*Table, error)

func (*Client) PermanentlyDeleteDriveObject

func (c *Client) PermanentlyDeleteDriveObject(ctx context.Context, id string) error

func (*Client) PermanentlyDeleteEmail

func (c *Client) PermanentlyDeleteEmail(ctx context.Context, id string) error

func (*Client) PermanentlyDeleteNote

func (c *Client) PermanentlyDeleteNote(ctx context.Context, id string) error

func (*Client) PermanentlyDeleteRow

func (c *Client) PermanentlyDeleteRow(ctx context.Context, tableID, rowID string) error

func (*Client) PermanentlyDeleteTable

func (c *Client) PermanentlyDeleteTable(ctx context.Context, id string) error

func (*Client) QueryRows

func (c *Client) QueryRows(ctx context.Context, tableID string, req *QueryRequest) (*RowListResponse, error)

func (*Client) RestoreDriveObject

func (c *Client) RestoreDriveObject(ctx context.Context, id string) (*DriveObject, error)

func (*Client) RestoreEmail

func (c *Client) RestoreEmail(ctx context.Context, id string) (*EmailDetail, error)

func (*Client) RestoreNote

func (c *Client) RestoreNote(ctx context.Context, id string) (*Note, error)

func (*Client) RestoreRow

func (c *Client) RestoreRow(ctx context.Context, tableID, rowID string) (*Row, error)

func (*Client) RestoreTable

func (c *Client) RestoreTable(ctx context.Context, id string) (*Table, error)

func (*Client) Scrape

func (c *Client) Scrape(ctx context.Context, req *ScrapeRequest) (*ScrapeResponse, error)

func (*Client) SendEmail

func (c *Client) SendEmail(ctx context.Context, req *SendEmailRequest) (*EmailDetail, error)

func (*Client) UnarchiveEmail added in v0.5.0

func (c *Client) UnarchiveEmail(ctx context.Context, id string) (*EmailDetail, error)

func (*Client) UploadToPresignedURL

func (c *Client) UploadToPresignedURL(ctx context.Context, uploadURL, contentType string, body io.Reader, size int64) (string, error)

UploadToPresignedURL uploads binary data to a presigned R2 URL. Returns the ETag from the response header.

func (*Client) WebSearch

func (c *Client) WebSearch(ctx context.Context, req *WebSearchRequest) (*WebSearchResponse, error)

type Column

type Column struct {
	ID         string          `json:"id"`
	Name       string          `json:"name"`
	Type       string          `json:"type"`
	Position   int             `json:"position"`
	IsRequired bool            `json:"isRequired"`
	Options    json.RawMessage `json:"options,omitempty"`
}

type ColumnPatch

type ColumnPatch struct {
	Name       *string         `json:"name,omitempty"`
	Type       *string         `json:"type,omitempty"`
	IsRequired *bool           `json:"isRequired,omitempty"`
	Position   *int            `json:"position,omitempty"`
	Options    json.RawMessage `json:"options,omitempty"`
}

type CompleteUploadRequest

type CompleteUploadRequest struct {
	ETag      string `json:"etag"`
	SizeBytes int64  `json:"sizeBytes"`
}

type CreateColumnInput

type CreateColumnInput struct {
	Name       string          `json:"name"`
	Type       string          `json:"type"`
	IsRequired bool            `json:"isRequired,omitempty"`
	Position   *int            `json:"position,omitempty"`
	Options    json.RawMessage `json:"options,omitempty"`
}

type CreateMailboxRequest

type CreateMailboxRequest struct {
	Address     string `json:"address"`
	DisplayName string `json:"displayName,omitempty"`
}

type CreateNoteRequest

type CreateNoteRequest struct {
	Subject string   `json:"subject"`
	Content string   `json:"content"`
	Labels  []string `json:"labels,omitempty"`
}

type CreateTableRequest

type CreateTableRequest struct {
	Name        string               `json:"name"`
	Description string               `json:"description,omitempty"`
	Columns     []*CreateColumnInput `json:"columns,omitempty"`
}

type CreateTicketRequest added in v0.5.1

type CreateTicketRequest struct {
	Type    string `json:"type"`
	Subject string `json:"subject"`
	Message string `json:"message"`
}

type DownloadResponse

type DownloadResponse struct {
	DownloadURL string `json:"downloadUrl"`
	ExpiresIn   int    `json:"expiresIn"`
}

type DriveListResponse

type DriveListResponse struct {
	Items    []DriveObject `json:"items"`
	Total    int64         `json:"total"`
	Page     int           `json:"page"`
	PageSize int           `json:"pageSize"`
}

type DriveObject

type DriveObject struct {
	ID         string         `json:"id"`
	Path       string         `json:"path"`
	SizeBytes  int64          `json:"sizeBytes"`
	MimeType   string         `json:"mimeType,omitempty"`
	ETag       string         `json:"etag,omitempty"`
	Visibility string         `json:"visibility"`
	Properties map[string]any `json:"properties"`
	CreatedAt  time.Time      `json:"createdAt"`
	UpdatedAt  time.Time      `json:"updatedAt"`
	DeletedAt  *time.Time     `json:"deletedAt,omitempty"`
}

type Email

type Email struct {
	ID          string        `json:"id"`
	MailboxID   string        `json:"mailboxId"`
	Direction   string        `json:"direction"`
	From        string        `json:"from"`
	To          []string      `json:"to"`
	CC          []string      `json:"cc"`
	BCC         []string      `json:"bcc"`
	ReplyTo     []string      `json:"replyTo"`
	Subject     string        `json:"subject"`
	Snippet     string        `json:"snippet,omitempty"`
	Status      string        `json:"status"`
	Attachments []*Attachment `json:"attachments"`
	ReadAt      *time.Time    `json:"readAt,omitempty"`
	ArchivedAt  *time.Time    `json:"archivedAt,omitempty"`
	SentAt      *time.Time    `json:"sentAt,omitempty"`
	CreatedAt   time.Time     `json:"createdAt"`
	DeletedAt   *time.Time    `json:"deletedAt,omitempty"`
}

type EmailDetail

type EmailDetail struct {
	Email
	TextBody string `json:"textBody"`
	HTMLBody string `json:"htmlBody"`
}

type EmailListResponse

type EmailListResponse struct {
	Items    []*Email `json:"items"`
	Total    int64    `json:"total"`
	Page     int      `json:"page"`
	PageSize int      `json:"pageSize"`
}

type Error

type Error struct {
	Code       string         `json:"code"`
	Message    string         `json:"message"`
	RequestID  string         `json:"requestId,omitempty"`
	StatusCode int            `json:"-"`
	Hint       string         `json:"hint,omitempty"`
	Details    map[string]any `json:"details,omitempty"`
	Cause      error          `json:"-"`
}

Error is a structured API error that preserves the server's error envelope fields (code, message, requestId, hint, details) through Go's error chain.

func NewError

func NewError(code, message string) *Error

NewError creates a new structured Error with the given code and message.

func NewErrorFrom

func NewErrorFrom(code, message string, cause error) *Error

NewErrorFrom creates a new structured Error wrapping a cause.

func (*Error) Error

func (e *Error) Error() string

func (*Error) ExitCode

func (e *Error) ExitCode() int

ExitCode maps the error code prefix to a CLI exit code. The CATEGORY_DETAIL convention means prefix matching is sufficient — adding new server codes under an existing prefix works automatically.

func (*Error) Unwrap

func (e *Error) Unwrap() error

func (*Error) WithDetails

func (e *Error) WithDetails(details map[string]any) *Error

WithDetails returns the error with added details.

func (*Error) WithHint

func (e *Error) WithHint(hint string) *Error

WithHint returns the error with an added hint.

type ErrorBody

type ErrorBody struct {
	Code    string         `json:"code"`
	Message string         `json:"message"`
	Hint    string         `json:"hint,omitempty"`
	Details map[string]any `json:"details,omitempty"`
}

type GroupByResponse

type GroupByResponse struct {
	Groups   []map[string]any `json:"groups"`
	Total    int64            `json:"total"`
	Page     int              `json:"page"`
	PageSize int              `json:"pageSize"`
}

type ImageGenerateRequest added in v0.2.1

type ImageGenerateRequest struct {
	Model       string            `json:"model,omitempty"`
	Prompt      string            `json:"prompt"`
	Images      []*ReferenceImage `json:"images,omitempty"`
	AspectRatio string            `json:"aspectRatio,omitempty"`
	ImageSize   string            `json:"imageSize,omitempty"`
}

type ImageGenerateResponse added in v0.2.1

type ImageGenerateResponse struct {
	Image    string `json:"image"`
	MimeType string `json:"mimeType"`
	Text     string `json:"text,omitempty"`
}

type ImageResult

type ImageResult struct {
	Title        string `json:"title"`
	ImageURL     string `json:"imageUrl"`
	ImageWidth   int    `json:"imageWidth"`
	ImageHeight  int    `json:"imageHeight"`
	ThumbnailURL string `json:"thumbnailUrl"`
	Source       string `json:"source"`
	Domain       string `json:"domain"`
	Link         string `json:"link"`
	Position     int    `json:"position"`
}

type ImageSearchRequest

type ImageSearchRequest struct {
	Q    string `json:"q"`
	GL   string `json:"gl,omitempty"`
	HL   string `json:"hl,omitempty"`
	Num  int    `json:"num,omitempty"`
	Page int    `json:"page,omitempty"`
	TBS  string `json:"tbs,omitempty"`
}

type ImageSearchResponse

type ImageSearchResponse struct {
	SearchParameters *SearchParameters `json:"searchParameters"`
	Images           []*ImageResult    `json:"images"`
	Credits          int               `json:"credits"`
}

type InitUploadRequest

type InitUploadRequest struct {
	Path      string `json:"path"`
	SizeBytes int64  `json:"sizeBytes"`
	MimeType  string `json:"mimeType,omitempty"`
}

type InitUploadResponse

type InitUploadResponse struct {
	ID        string `json:"id"`
	UploadURL string `json:"uploadUrl"`
	ExpiresIn int    `json:"expiresIn"`
}

type Mailbox

type Mailbox struct {
	ID          string    `json:"id"`
	Address     string    `json:"address"`
	DisplayName string    `json:"displayName"`
	IsActive    bool      `json:"isActive"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type MailboxPatch

type MailboxPatch struct {
	DisplayName *string `json:"displayName,omitempty"`
	IsActive    *bool   `json:"isActive,omitempty"`
}

type NewsResult

type NewsResult struct {
	Title    string `json:"title"`
	Link     string `json:"link"`
	Snippet  string `json:"snippet"`
	Date     string `json:"date"`
	Source   string `json:"source"`
	ImageURL string `json:"imageUrl,omitempty"`
	Position int    `json:"position"`
}

type NewsSearchRequest

type NewsSearchRequest struct {
	Q    string `json:"q"`
	GL   string `json:"gl,omitempty"`
	HL   string `json:"hl,omitempty"`
	Num  int    `json:"num,omitempty"`
	Page int    `json:"page,omitempty"`
	TBS  string `json:"tbs,omitempty"`
}

type NewsSearchResponse

type NewsSearchResponse struct {
	SearchParameters *SearchParameters `json:"searchParameters"`
	News             []*NewsResult     `json:"news"`
	Credits          int               `json:"credits"`
}

type Note

type Note struct {
	ID        string     `json:"id"`
	UserID    string     `json:"userId"`
	Subject   string     `json:"subject"`
	Content   string     `json:"content"`
	Labels    []string   `json:"labels"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt time.Time  `json:"updatedAt"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
}

type NoteListResponse

type NoteListResponse struct {
	Items    []Note `json:"items"`
	Total    int64  `json:"total"`
	Page     int    `json:"page"`
	PageSize int    `json:"pageSize"`
}

type NotePatch

type NotePatch struct {
	Subject *string   `json:"subject,omitempty"`
	Content *string   `json:"content,omitempty"`
	Labels  *[]string `json:"labels,omitempty"`
}

type OrganicResult

type OrganicResult struct {
	Title    string `json:"title"`
	Link     string `json:"link"`
	Snippet  string `json:"snippet"`
	Position int    `json:"position"`
}

type QueryCondition

type QueryCondition struct {
	Column string `json:"column"`
	Op     string `json:"op"`
	Value  any    `json:"value,omitempty"`
}

type QueryFilter

type QueryFilter struct {
	And []*QueryCondition `json:"and,omitempty"`
	Or  []*QueryCondition `json:"or,omitempty"`
}

type QueryRequest

type QueryRequest struct {
	Filter    *QueryFilter     `json:"filter,omitempty"`
	Sort      []*QuerySort     `json:"sort,omitempty"`
	Aggregate []*AggregateFunc `json:"aggregate,omitempty"`
	GroupBy   []string         `json:"groupBy,omitempty"`
	Page      int              `json:"page,omitempty"`
	PageSize  int              `json:"pageSize,omitempty"`
}

type QuerySort

type QuerySort struct {
	Column    string `json:"column"`
	Direction string `json:"direction,omitempty"`
}

type ReferenceImage added in v0.2.1

type ReferenceImage struct {
	Data     string `json:"data"`
	MimeType string `json:"mimeType"`
}

type Response

type Response struct {
	Success   bool            `json:"success"`
	Data      json.RawMessage `json:"data"`
	Error     *ErrorBody      `json:"error"`
	RequestID string          `json:"requestId"`
}

type Row

type Row struct {
	ID        string         `json:"id"`
	TableID   string         `json:"tableId"`
	Data      map[string]any `json:"data"`
	CreatedAt time.Time      `json:"createdAt"`
	UpdatedAt time.Time      `json:"updatedAt"`
	DeletedAt *time.Time     `json:"deletedAt,omitempty"`
}

type RowListResponse

type RowListResponse struct {
	Items    []*Row `json:"items"`
	Total    int64  `json:"total"`
	Page     int    `json:"page"`
	PageSize int    `json:"pageSize"`
}

type ScrapeRequest

type ScrapeRequest struct {
	URL             string `json:"url"`
	IncludeMarkdown bool   `json:"includeMarkdown,omitempty"`
}

type ScrapeResponse

type ScrapeResponse struct {
	Markdown string            `json:"markdown"`
	Metadata map[string]string `json:"metadata"`
	Credits  int               `json:"credits"`
}

type SearchParameters

type SearchParameters struct {
	Q      string `json:"q"`
	GL     string `json:"gl,omitempty"`
	HL     string `json:"hl,omitempty"`
	Num    int    `json:"num,omitempty"`
	Type   string `json:"type"`
	Engine string `json:"engine"`
}

type SendEmailRequest

type SendEmailRequest struct {
	MailboxID string   `json:"mailboxId"`
	To        []string `json:"to"`
	CC        []string `json:"cc,omitempty"`
	BCC       []string `json:"bcc,omitempty"`
	ReplyTo   string   `json:"replyTo,omitempty"`
	Subject   string   `json:"subject"`
	HTML      string   `json:"html,omitempty"`
	Text      string   `json:"text,omitempty"`
}

type Table

type Table struct {
	ID          string     `json:"id"`
	UserID      string     `json:"userId"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Columns     []*Column  `json:"columns"`
	CreatedAt   time.Time  `json:"createdAt"`
	UpdatedAt   time.Time  `json:"updatedAt"`
	DeletedAt   *time.Time `json:"deletedAt,omitempty"`
}

type TableListResponse

type TableListResponse struct {
	Items    []*Table `json:"items"`
	Total    int64    `json:"total"`
	Page     int      `json:"page"`
	PageSize int      `json:"pageSize"`
}

type TablePatch

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

type Ticket added in v0.5.1

type Ticket struct {
	ID        string `json:"id"`
	Type      string `json:"type"`
	Subject   string `json:"subject"`
	Message   string `json:"message"`
	Status    string `json:"status"`
	CreatedAt string `json:"createdAt"`
}

type TokenRefresher

type TokenRefresher func(ctx context.Context) (newAccessToken string, err error)

TokenRefresher is a callback that refreshes the access token. It receives the request context so cancellation propagates correctly. It returns the new access token or an error.

type UserProfile

type UserProfile struct {
	ID        string    `json:"id"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"createdAt"`
}

type VideoGenerateRequest added in v0.3.0

type VideoGenerateRequest struct {
	Model       string    `json:"model,omitempty"`
	Prompt      string    `json:"prompt"`
	Duration    int       `json:"duration"`
	AspectRatio string    `json:"aspectRatio,omitempty"`
	Resolution  string    `json:"resolution,omitempty"`
	Image       *VideoRef `json:"image,omitempty"`
	Video       *VideoRef `json:"video,omitempty"`
}

type VideoGenerateResponse added in v0.3.0

type VideoGenerateResponse struct {
	RequestID string `json:"requestId"`
}

type VideoReady added in v0.3.0

type VideoReady struct {
	URL      string `json:"url"`
	Duration int    `json:"duration"`
}

type VideoRef added in v0.3.0

type VideoRef struct {
	URL string `json:"url"`
}

type VideoStatusResponse added in v0.3.0

type VideoStatusResponse struct {
	Status string      `json:"status"`
	Video  *VideoReady `json:"video,omitempty"`
}

type WebSearchRequest

type WebSearchRequest struct {
	Q    string `json:"q"`
	GL   string `json:"gl,omitempty"`
	HL   string `json:"hl,omitempty"`
	Num  int    `json:"num,omitempty"`
	Page int    `json:"page,omitempty"`
}

type WebSearchResponse

type WebSearchResponse struct {
	SearchParameters *SearchParameters `json:"searchParameters"`
	Organic          []*OrganicResult  `json:"organic"`
	Credits          int               `json:"credits"`
}

Jump to

Keyboard shortcuts

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