gmail

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const Domain = "gmail.googleapis.com"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(options ...gmail_config.Option) *Client

func (*Client) CreateFilter

func (c *Client) CreateFilter(ctx context.Context, userId string, f *filter.Filter, options ...fetch_config.Option) (*filter.Filter, error)

CreateFilter creates a filter for the given user.

func (*Client) CreateSendAs

func (c *Client) CreateSendAs(ctx context.Context, userId string, s *send_as.SendAs, options ...fetch_config.Option) (*send_as.SendAs, error)

CreateSendAs creates a custom "from" send-as alias for the given user.

func (*Client) DeleteFilter

func (c *Client) DeleteFilter(ctx context.Context, userId string, filterId string, options ...fetch_config.Option) error

DeleteFilter deletes a filter identified by filterId for the given user.

func (*Client) DeleteSendAs

func (c *Client) DeleteSendAs(ctx context.Context, userId string, sendAsEmail string, options ...fetch_config.Option) error

DeleteSendAs deletes a send-as alias identified by sendAsEmail for the given user.

func (*Client) GetFilter

func (c *Client) GetFilter(ctx context.Context, userId string, filterId string, options ...fetch_config.Option) (*filter.Filter, error)

GetFilter retrieves a filter identified by filterId for the given user.

func (*Client) GetMessage

func (c *Client) GetMessage(ctx context.Context, userId string, messageId string, options ...get_message_config.Option) (*message.Message, error)

GetMessage retrieves a message identified by messageId for the given user.

func (*Client) GetSendAs

func (c *Client) GetSendAs(ctx context.Context, userId string, sendAsEmail string, options ...fetch_config.Option) (*send_as.SendAs, error)

GetSendAs retrieves a send-as alias identified by sendAsEmail for the given user.

func (*Client) ListFilters

func (c *Client) ListFilters(ctx context.Context, userId string, options ...fetch_config.Option) ([]*filter.Filter, error)

ListFilters retrieves all filters for the given user.

func (*Client) ListHistory

func (c *Client) ListHistory(ctx context.Context, userId string, startHistoryId string, options ...list_history_config.Option) ([]*history.Record, error)

ListHistory retrieves all history records for the given user after the specified startHistoryId.

func (*Client) ListMessages

func (c *Client) ListMessages(ctx context.Context, userId string, q string, options ...fetch_config.Option) ([]*message.Message, error)

ListMessages retrieves all messages for the given user matching the optional query. The query string uses the same format as the Gmail search box (e.g. "in:inbox", "from:user@example.com"). Only message IDs and thread IDs are populated; use GetMessage to retrieve the full message.

func (*Client) Send

func (c *Client) Send(ctx context.Context, userId string, msg *message.Message, options ...fetch_config.Option) (*message.Message, error)

Send sends the specified message to the recipients in the To, Cc, and Bcc headers. The message should have its Raw field set to a base64url-encoded RFC 2822 email.

func (*Client) Trash

func (c *Client) Trash(ctx context.Context, userId string, messageId string, options ...fetch_config.Option) (*message.Message, error)

Trash moves the given message to the user's trash. Requires the gmail.modify scope (or wider).

func (*Client) UpdateSendAs

func (c *Client) UpdateSendAs(ctx context.Context, userId string, sendAsEmail string, s *send_as.SendAs, options ...fetch_config.Option) (*send_as.SendAs, error)

UpdateSendAs updates a send-as alias identified by sendAsEmail for the given user.

func (*Client) Watch

Watch sets up or renews a push notification watch on the given user's mailbox. Notifications are delivered to the Cloud Pub/Sub topic specified in the request's TopicName.

Jump to

Keyboard shortcuts

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