Documentation ¶
Overview ¶
Package gsmgmail implements the Gmail APIs
Index ¶
- func AccessWindowIsValid(accessWindow string) bool
- func BatchDeleteMessages(userID string, ids []string) (bool, error)
- func BatchModifyMessages(userID string, ids, addLabelIds, removeLabelIds []string) (bool, error)
- func ColorIsValid(color string) bool
- func CreateDelegate(userID, fields string, delegate *gmail.Delegate) (*gmail.Delegate, error)
- func CreateDraft(userID, fields string, draft *gmail.Draft, media ...io.Reader) (*gmail.Draft, error)
- func CreateFilter(userID, fields string, settingsfilter *gmail.Filter) (*gmail.Filter, error)
- func CreateForwardingAddress(userID, fields string, forwardingAddress *gmail.ForwardingAddress) (*gmail.ForwardingAddress, error)
- func CreateLabel(userID, fields string, label *gmail.Label) (*gmail.Label, error)
- func CreateSendAs(userID, fields string, sendAs *gmail.SendAs) (*gmail.SendAs, error)
- func DeleteDelegate(userID, delegateEmail string) (bool, error)
- func DeleteDraft(userID, id string) (bool, error)
- func DeleteFilter(userID, id string) (bool, error)
- func DeleteForwardingAddress(userID, forwardingEmail string) (bool, error)
- func DeleteLabel(userID, id string) (bool, error)
- func DeleteMessage(userID, id string) (bool, error)
- func DeleteSendAs(userID, sendAsEmail string) (bool, error)
- func DeleteSmimeInfo(userID, sendAsEmail, id string) (bool, error)
- func DeleteThread(userID, id string) (bool, error)
- func DispositionIsValid(disposition string) bool
- func ExpungeBehaviourIsValid(expungebehaviour string) bool
- func FormatIsValid(format string) bool
- func GetAttachment(userID, messageID, id, fields string) (*gmail.MessagePartBody, error)
- func GetAutoForwardingSettings(userID, fields string) (*gmail.AutoForwarding, error)
- func GetDelegate(userID, delegateEmail, fields string) (*gmail.Delegate, error)
- func GetDraft(userID, id, format, fields string) (*gmail.Draft, error)
- func GetFilter(userID, id, fields string) (*gmail.Filter, error)
- func GetForwardingAddress(userID, forwardingEmail, fields string) (*gmail.ForwardingAddress, error)
- func GetIMAPSettings(userID, fields string) (*gmail.ImapSettings, error)
- func GetLabel(userID, id, fields string) (*gmail.Label, error)
- func GetLanguageSettings(userID, fields string) (*gmail.LanguageSettings, error)
- func GetMessage(userID, id, format, metadataHeaders, fields string) (*gmail.Message, error)
- func GetPOPSettings(userID, fields string) (*gmail.PopSettings, error)
- func GetSendAs(userID, sendAsEmail, fields string) (*gmail.SendAs, error)
- func GetSmimeInfo(userID, sendAsEmail, id, fields string) (*gmail.SmimeInfo, error)
- func GetThread(userID, id, format, metadataHeaders, fields string) (*gmail.Thread, error)
- func GetUserProfile(userID, fields string) (*gmail.Profile, error)
- func GetVacationResponderSettings(userID, fields string) (*gmail.VacationSettings, error)
- func HistoryTypeIsValid(historyType string) bool
- func ImportMessage(userID, internalDateSource, fields string, message *gmail.Message, ...) (*gmail.Message, error)
- func InsertMessage(userID, internalDateSource, fields string, message *gmail.Message, ...) (*gmail.Message, error)
- func InsertSmimeInfo(userID, sendAsEmail, fields string, smimeInfo *gmail.SmimeInfo) (*gmail.SmimeInfo, error)
- func InternalDateSourceIsValid(internalDateSource string) bool
- func LabelListVisibilityIsValid(labelListVisibility string) bool
- func ListDelegates(userID, fields string) ([]*gmail.Delegate, error)
- func ListDrafts(userID, q, fields string, includeSpamTrash bool, cap int) (<-chan *gmail.Draft, <-chan error)
- func ListFilters(userID, fields string) ([]*gmail.Filter, error)
- func ListForwardingAddresses(userID, fields string) ([]*gmail.ForwardingAddress, error)
- func ListHistory(userID, labelID, fields string, startHistoryID uint64, historyTypes []string, ...) (<-chan *gmail.History, <-chan error)
- func ListLabels(userID, fields string) ([]*gmail.Label, error)
- func ListMessages(userID, q, fields string, labelIds []string, includeSpamTrash bool, cap int) (<-chan *gmail.Message, <-chan error)
- func ListSendAs(userID, fields string) ([]*gmail.SendAs, error)
- func ListSmimeInfo(userID, sendAsEmail, fields string) ([]*gmail.SmimeInfo, error)
- func ListThreads(userID, q, fields string, labelIDs []string, includeSpamTrash bool, cap int) (<-chan *gmail.Thread, <-chan error)
- func MessageVisibilityIsValid(messageVisibility string) bool
- func ModifyMessage(userID, id, fields string, addLabelIds, removeLabelIds []string) (*gmail.Message, error)
- func ModifyThread(userID, id, fields string, addLabelIds, removeLabelIds []string) (*gmail.Thread, error)
- func PatchLabel(userID, id, fields string, label *gmail.Label) (*gmail.Label, error)
- func PatchSendAs(userID, sendAsEmail, fields string, sendAs *gmail.SendAs) (*gmail.SendAs, error)
- func SecurityModeIsValid(SecurityMode string) bool
- func SendDraft(userID string, draft *gmail.Draft, media ...io.Reader) (*gmail.Message, error)
- func SendMessage(userID, fields string, message *gmail.Message) (*gmail.Message, error)
- func SetClient(c *http.Client)
- func SetDefaultSmimeInfo(userID, sendAsEmail, id string) (bool, error)
- func SizeComparisonIsValid(sizeComparison string) bool
- func TrashMessage(userID, id, fields string) (*gmail.Message, error)
- func TrashThread(userID, id, fields string) (*gmail.Thread, error)
- func UntrashMessage(userID, id, fields string) (*gmail.Message, error)
- func UntrashThread(userID, id, fields string) (*gmail.Thread, error)
- func UpdateAutoForwardingSettings(userID, fields string, autoForwarding *gmail.AutoForwarding) (*gmail.AutoForwarding, error)
- func UpdateDraft(userID, id, fields string, draft *gmail.Draft, media ...io.Reader) (*gmail.Draft, error)
- func UpdateIMAPSettings(userID, fields string, imapSettings *gmail.ImapSettings) (*gmail.ImapSettings, error)
- func UpdateLanguageSettings(userID, fields string, languageSetting *gmail.LanguageSettings) (*gmail.LanguageSettings, error)
- func UpdatePOPSettings(userID, fields string, popSettings *gmail.PopSettings) (*gmail.PopSettings, error)
- func UpdateVacationResponderSettings(userID, fields string, vacationSettings *gmail.VacationSettings) (*gmail.VacationSettings, error)
- func VerifySendAs(userID, sendAsEmail string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessWindowIsValid ¶
AccessWindowIsValid checks if the given AccessWindow is valid see: https://developers.google.com/gmail/api/reference/rest/v1/PopSettings#accesswindow
func BatchDeleteMessages ¶
BatchDeleteMessages deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.
func BatchModifyMessages ¶
BatchModifyMessages modifies the labels on the specified messages.
func ColorIsValid ¶
ColorIsValid checks if the given Color is valid see: https://developers.google.com/gmail/api/reference/rest/v1/users.labels#MessageListVisibility
func CreateDelegate ¶
CreateDelegate adds a delegate with its verification status set directly to accepted, without sending any verification email. The delegate user must be a member of the same Workspace organization as the delegator user. Gmail imposes limitations on the number of delegates and delegators each user in a Workspace organization can have. These limits depend on your organization, but in general each user can have up to 25 delegates and up to 10 delegators. Note that a delegate user must be referred to by their primary email address, and not an email alias. Also note that when a new delegate is created, there may be up to a one minute delay before the new delegate is available for use. This method is only available to service account clients that have been delegated domain-wide authority.
func CreateDraft ¶
func CreateDraft(userID, fields string, draft *gmail.Draft, media ...io.Reader) (*gmail.Draft, error)
CreateDraft creates a new draft with the DRAFT label.
func CreateFilter ¶
CreateFilter creates a filter.
func CreateForwardingAddress ¶
func CreateForwardingAddress(userID, fields string, forwardingAddress *gmail.ForwardingAddress) (*gmail.ForwardingAddress, error)
CreateForwardingAddress creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted.
func CreateLabel ¶
CreateLabel creates a new label.
func CreateSendAs ¶
CreateSendAs creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias.
func DeleteDelegate ¶
DeleteDelegate removes the specified delegate (which can be of any verification status), and revokes any verification that may have been required for using it. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority.
func DeleteDraft ¶
DeleteDraft immediately and permanently deletes the specified draft. Does not simply trash it.
func DeleteFilter ¶
DeleteFilter deletes a filter.
func DeleteForwardingAddress ¶
DeleteForwardingAddress deletes the specified forwarding address and revokes any verification that may have been required.
func DeleteLabel ¶
DeleteLabel immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.
func DeleteMessage ¶
DeleteMessage immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.
func DeleteSendAs ¶
DeleteSendAs deletes the specified send-as alias. Revokes any verification that may have been required for using it.
func DeleteSmimeInfo ¶
DeleteSmimeInfo deletes the specified S/MIME config for the specified send-as alias.
func DeleteThread ¶
DeleteThread Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer TrashThread instead.
func DispositionIsValid ¶
DispositionIsValid checks if the given Disposition is valid see: https://developers.google.com/gmail/api/reference/rest/v1/AutoForwarding#disposition
func ExpungeBehaviourIsValid ¶
ExpungeBehaviourIsValid checks if the given ExpungeBehaviour is valid see: https://developers.google.com/gmail/api/reference/rest/v1/ImapSettings#expungebehavior
func FormatIsValid ¶
FormatIsValid checks if the given Format is valid see: https://developers.google.com/gmail/api/reference/rest/v1/Format
func GetAttachment ¶
GetAttachment gets the specified message attachment.
func GetAutoForwardingSettings ¶
GetAutoForwardingSettings gets the auto-forwarding setting for the specified account.
func GetDelegate ¶
GetDelegate gets the specified delegate. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority.
func GetForwardingAddress ¶
GetForwardingAddress gets the specified forwarding address.
func GetIMAPSettings ¶
GetIMAPSettings gets IMAP settings.
func GetLanguageSettings ¶
GetLanguageSettings gets language settings.
func GetMessage ¶
GetMessage gets the specified message.
func GetPOPSettings ¶
GetPOPSettings gets POP settings.
func GetSendAs ¶
GetSendAs gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection.
func GetSmimeInfo ¶
GetSmimeInfo gets the specified S/MIME config for the specified send-as alias.
func GetUserProfile ¶
GetUserProfile Ggts the specified user's Gmail profile.
func GetVacationResponderSettings ¶
GetVacationResponderSettings gets vacation responder settings.
func HistoryTypeIsValid ¶
HistoryTypeIsValid checks if the given HistoryType is valid see: https://developers.google.com/gmail/api/reference/rest/v1/users.history/list#historytype
func ImportMessage ¶
func ImportMessage(userID, internalDateSource, fields string, message *gmail.Message, deleted, neverMarkSpam, processForCalendar bool) (*gmail.Message, error)
ImportMessage imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.
func InsertMessage ¶
func InsertMessage(userID, internalDateSource, fields string, message *gmail.Message, deleted bool) (*gmail.Message, error)
InsertMessage directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.
func InsertSmimeInfo ¶
func InsertSmimeInfo(userID, sendAsEmail, fields string, smimeInfo *gmail.SmimeInfo) (*gmail.SmimeInfo, error)
InsertSmimeInfo uploads the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key.
func InternalDateSourceIsValid ¶
InternalDateSourceIsValid checks if the given internalDateSource is valid see: https://developers.google.com/gmail/api/reference/rest/v1/InternalDateSource
func LabelListVisibilityIsValid ¶
LabelListVisibilityIsValid checks if the given LabelListVisibility is valid see: https://developers.google.com/gmail/api/reference/rest/v1/users.labels#MessageListVisibility
func ListDelegates ¶
ListDelegates lists the delegates for the specified account. This method is only available to service account clients that have been delegated domain-wide authority.
func ListDrafts ¶
func ListDrafts(userID, q, fields string, includeSpamTrash bool, cap int) (<-chan *gmail.Draft, <-chan error)
ListDrafts lists the drafts in the user's mailbox.
func ListFilters ¶
ListFilters lists the message filters of a Gmail user.
func ListForwardingAddresses ¶
ListForwardingAddresses lists the forwarding addresses for the specified account.
func ListHistory ¶
func ListHistory(userID, labelID, fields string, startHistoryID uint64, historyTypes []string, cap int) (<-chan *gmail.History, <-chan error)
ListHistory lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId).
func ListLabels ¶
ListLabels lists all labels in the user's mailbox.
func ListMessages ¶
func ListMessages(userID, q, fields string, labelIds []string, includeSpamTrash bool, cap int) (<-chan *gmail.Message, <-chan error)
ListMessages lists the messages in the user's mailbox.
func ListSendAs ¶
ListSendAs lists the send-as aliases for the specified account. The result includes the primary send-as address associated with the account as well as any custom "from" aliases.
func ListSmimeInfo ¶
ListSmimeInfo lists S/MIME configs for the specified send-as alias.
func ListThreads ¶
func ListThreads(userID, q, fields string, labelIDs []string, includeSpamTrash bool, cap int) (<-chan *gmail.Thread, <-chan error)
ListThreads lists the threads in the user's mailbox.
func MessageVisibilityIsValid ¶
MessageVisibilityIsValid checks if the given MessageVisibility is valid see: https://developers.google.com/gmail/api/reference/rest/v1/users.labels#MessageListVisibility
func ModifyMessage ¶
func ModifyMessage(userID, id, fields string, addLabelIds, removeLabelIds []string) (*gmail.Message, error)
ModifyMessage modifies the labels on the specified message.
func ModifyThread ¶
func ModifyThread(userID, id, fields string, addLabelIds, removeLabelIds []string) (*gmail.Thread, error)
ModifyThread modifies the labels applied to the thread. This applies to all messages in the thread.
func PatchLabel ¶
PatchLabel PATCHes the specified label.
func PatchSendAs ¶
PatchSendAs PATCHes the specified send-as alias.
func SecurityModeIsValid ¶
SecurityModeIsValid checks if the given SecurityMode is valid see: https://developers.google.com/gmail/api/reference/rest/v1/PopSettings#securitymode
func SendDraft ¶
SendDraft sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
func SendMessage ¶
SendMessage sends the specified message to the recipients in the To, Cc, and Bcc headers.
func SetDefaultSmimeInfo ¶
SetDefaultSmimeInfo sets the default S/MIME config for the specified send-as alias.
func SizeComparisonIsValid ¶
SizeComparisonIsValid checks if the given SizeComparison is valid see: https://developers.google.com/gmail/api/reference/rest/v1/PopSettings#sizecomparison
func TrashMessage ¶
TrashMessage moves the specified message to the trash.
func TrashThread ¶
TrashThread moves the specified thread to the trash.
func UntrashMessage ¶
UntrashMessage removes the specified message from the trash.
func UntrashThread ¶
UntrashThread removes the specified thread from the trash.
func UpdateAutoForwardingSettings ¶
func UpdateAutoForwardingSettings(userID, fields string, autoForwarding *gmail.AutoForwarding) (*gmail.AutoForwarding, error)
UpdateAutoForwardingSettings updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled.
func UpdateDraft ¶
func UpdateDraft(userID, id, fields string, draft *gmail.Draft, media ...io.Reader) (*gmail.Draft, error)
UpdateDraft replaces a draft's content.
func UpdateIMAPSettings ¶
func UpdateIMAPSettings(userID, fields string, imapSettings *gmail.ImapSettings) (*gmail.ImapSettings, error)
UpdateIMAPSettings updates IMAP settings.
func UpdateLanguageSettings ¶
func UpdateLanguageSettings(userID, fields string, languageSetting *gmail.LanguageSettings) (*gmail.LanguageSettings, error)
UpdateLanguageSettings updates language settings. If successful, the return object contains the displayLanguage that was saved for the user,which may differ from the value passed into the request. This is because the requested displayLanguage may not be directly supported by Gmail but have a close variant that is, and so the variant may be chosen and saved instead.
func UpdatePOPSettings ¶
func UpdatePOPSettings(userID, fields string, popSettings *gmail.PopSettings) (*gmail.PopSettings, error)
UpdatePOPSettings updates POP settings.
func UpdateVacationResponderSettings ¶
func UpdateVacationResponderSettings(userID, fields string, vacationSettings *gmail.VacationSettings) (*gmail.VacationSettings, error)
UpdateVacationResponderSettings updates vacation responder settings.
func VerifySendAs ¶
VerifySendAs sends a verification email to the specified send-as alias address. The verification status must be pending.
Types ¶
This section is empty.