Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CreateFilter(ctx context.Context, userId string, f *filter.Filter, ...) (*filter.Filter, error)
- func (c *Client) CreateSendAs(ctx context.Context, userId string, s *send_as.SendAs, ...) (*send_as.SendAs, error)
- func (c *Client) DeleteFilter(ctx context.Context, userId string, filterId string, ...) error
- func (c *Client) DeleteSendAs(ctx context.Context, userId string, sendAsEmail string, ...) error
- func (c *Client) GetFilter(ctx context.Context, userId string, filterId string, ...) (*filter.Filter, error)
- func (c *Client) GetMessage(ctx context.Context, userId string, messageId string, ...) (*message.Message, error)
- func (c *Client) GetSendAs(ctx context.Context, userId string, sendAsEmail string, ...) (*send_as.SendAs, error)
- func (c *Client) ListFilters(ctx context.Context, userId string, options ...fetch_config.Option) ([]*filter.Filter, error)
- func (c *Client) ListHistory(ctx context.Context, userId string, startHistoryId string, ...) ([]*history.Record, error)
- func (c *Client) ListMessages(ctx context.Context, userId string, q string, options ...fetch_config.Option) ([]*message.Message, error)
- func (c *Client) Send(ctx context.Context, userId string, msg *message.Message, ...) (*message.Message, error)
- func (c *Client) Trash(ctx context.Context, userId string, messageId string, ...) (*message.Message, error)
- func (c *Client) UpdateSendAs(ctx context.Context, userId string, sendAsEmail string, s *send_as.SendAs, ...) (*send_as.SendAs, error)
- func (c *Client) Watch(ctx context.Context, userId string, request *watch_request.WatchRequest, ...) (*watch_response.WatchResponse, error)
Constants ¶
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 ¶
func (c *Client) Watch(ctx context.Context, userId string, request *watch_request.WatchRequest, options ...fetch_config.Option) (*watch_response.WatchResponse, error)
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.