Gmail
Project Connectors/MailServices/Gmail/. GmailDataSource : WebAPIDataSource. Namespace TheTechIdea.Beep.Connectors.Gmail (…Gmail.Models). DataSourceType.Gmail, DatasourceCategory.Connector.
Entities
Static EntityEndpoints maps Gmail API resources (messages, labels, threads, etc.) to REST paths. Required parameters (e.g. user id, message id) mirror Google’s Gmail API.
Source & IDataSource
Implementation: Connectors/MailServices/Gmail/GmailDataSource.cs — GmailDataSource : WebAPIDataSource. Reads route through GetEntityAsync with logical entity keys (messages.list, messages.get, …). Send/create/update helpers call PostAsync / PutAsync on full gmail.googleapis.com URLs.
Command methods (CommandAttribute)
Name | Method | Returns | ObjectType |
|---|---|---|---|
| GetMessages | GetMessages(int maxResults = 10, string? q = null, string? labelIds = null) | Task<IEnumerable<GmailMessage>> | GmailMessage |
| GetMessage | GetMessage(string id) | Task<IEnumerable<GmailMessage>> | GmailMessage |
| GetThreads | GetThreads(int maxResults = 10, string? q = null) | Task<IEnumerable<GmailThread>> | GmailThread |
| GetLabels | GetLabels() | Task<IEnumerable<GmailLabel>> | GmailLabel |
| GetProfile | GetProfile() | Task<IEnumerable<GmailProfile>> | GmailProfile |
| SendMessage | SendMessageAsync(GmailMessage message) | Task<IEnumerable<GmailMessage>> | GmailMessage |
| CreateLabel | CreateLabelAsync(GmailLabel label) | Task<IEnumerable<GmailLabel>> | GmailLabel |
| UpdateLabel | UpdateLabelAsync(string id, GmailLabel label) | Task<IEnumerable<GmailLabel>> | GmailLabel |
| CreateDraft | CreateDraftAsync(GmailDraft draft) | Task<IEnumerable<GmailDraft>> | GmailDraft |
| UpdateDraft | UpdateDraftAsync(string id, GmailDraft draft) | Task<IEnumerable<GmailDraft>> | GmailDraft |
Model types
TheTechIdea.Beep.Connectors.Gmail.Models — GmailMessage, GmailThread, GmailLabel, GmailProfile, GmailDraft, GmailHistory, and related types in Models.cs; list responses use private parser DTOs inside GmailDataSource (e.g. messages/threads list envelopes).
Connection
OAuth 2.0 or service account access to Gmail requires scopes that match the entities you use. Supply tokens and API base URL through WebAPIConnectionProperties.