Documentation
¶
Index ¶
- func ValidateEmail(email string) error
- func ValidatePhone(phone string) error
- type Attachment
- type CalendarEvent
- type CalendarInfo
- type Client
- func (c *Client) CreateContact(ctx context.Context, ...) (*Contact, error)
- func (c *Client) CreateEvent(ctx context.Context, subject string, start, end time.Time, location string, ...) (*CalendarEvent, error)
- func (c *Client) DeleteContact(ctx context.Context, contactID string) error
- func (c *Client) DeleteEvent(ctx context.Context, eventID string) error
- func (c *Client) DeleteMessage(ctx context.Context, messageID string) error
- func (c *Client) ForwardMessage(ctx context.Context, messageID string, comment string, toRecipients []string) error
- func (c *Client) GetAttachments(ctx context.Context, messageID string) ([]Attachment, error)
- func (c *Client) GetContact(ctx context.Context, contactID string) (*Contact, error)
- func (c *Client) GetEvent(ctx context.Context, eventID string) (*CalendarEvent, error)
- func (c *Client) GetMessage(ctx context.Context, messageID string) (*MailMessage, error)
- func (c *Client) Inner() *msgraphsdk.GraphServiceClient
- func (c *Client) ListCalendars(ctx context.Context) ([]CalendarInfo, error)
- func (c *Client) ListContacts(ctx context.Context, top int32) ([]Contact, error)
- func (c *Client) ListEvents(ctx context.Context, startTime, endTime time.Time, calendarID string, ...) ([]CalendarEvent, error)
- func (c *Client) ListMailFolders(ctx context.Context) ([]MailFolder, error)
- func (c *Client) ListMessages(ctx context.Context, opts ListMessagesOptions) ([]MailMessage, error)
- func (c *Client) MarkMessage(ctx context.Context, messageID string, isRead bool) error
- func (c *Client) MoveMessage(ctx context.Context, messageID string, folderID string) error
- func (c *Client) ReplyMessage(ctx context.Context, messageID string, comment string, replyAll bool) error
- func (c *Client) RespondToEvent(ctx context.Context, eventID string, response string) error
- func (c *Client) SearchContacts(ctx context.Context, query string, top int32) ([]Contact, error)
- func (c *Client) SearchMessages(ctx context.Context, query string, top int32) ([]MailMessage, error)
- func (c *Client) SendMessage(ctx context.Context, subject string, body string, toRecipients []string, ...) error
- func (c *Client) UpdateContact(ctx context.Context, contactID string, ...) (*Contact, error)
- func (c *Client) UpdateEvent(ctx context.Context, eventID string, subject *string, start, end *time.Time, ...) (*CalendarEvent, error)
- type Contact
- type ListMessagesOptions
- type MailFolder
- type MailMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateEmail ¶
ValidateEmail checks basic email format.
func ValidatePhone ¶
ValidatePhone checks basic phone number format.
Types ¶
type Attachment ¶
type Attachment struct {
ID string `json:"id"`
Name string `json:"name"`
ContentType string `json:"contentType"`
Size int32 `json:"size"`
Content []byte `json:"-"`
}
Attachment represents a mail attachment
type CalendarEvent ¶
type CalendarEvent struct {
ID string `json:"id"`
Subject string `json:"subject"`
Start string `json:"start"`
End string `json:"end"`
Location string `json:"location"`
Organizer string `json:"organizer"`
Attendees []string `json:"attendees,omitempty"`
IsAllDay bool `json:"isAllDay"`
IsOnline bool `json:"isOnlineMeeting"`
OnlineURL string `json:"onlineMeetingUrl,omitempty"`
Status string `json:"showAs"`
BodyPreview string `json:"bodyPreview"`
Body string `json:"body,omitempty"`
}
CalendarEvent is a simplified calendar event for output
type CalendarInfo ¶
type CalendarInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
Owner string `json:"owner"`
}
CalendarInfo is a simplified calendar representation
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Graph SDK client
func NewClient ¶
func NewClient(cred azcore.TokenCredential) (*Client, error)
NewClient creates a new Graph API client from a token credential
func (*Client) CreateContact ¶
func (*Client) CreateEvent ¶
func (*Client) DeleteContact ¶
func (*Client) DeleteEvent ¶
func (*Client) DeleteMessage ¶
func (*Client) ForwardMessage ¶
func (*Client) GetAttachments ¶
func (*Client) GetContact ¶
func (*Client) GetMessage ¶
func (*Client) Inner ¶
func (c *Client) Inner() *msgraphsdk.GraphServiceClient
Inner returns the underlying Graph SDK client
func (*Client) ListCalendars ¶
func (c *Client) ListCalendars(ctx context.Context) ([]CalendarInfo, error)
func (*Client) ListContacts ¶
func (*Client) ListEvents ¶
func (*Client) ListMailFolders ¶
func (c *Client) ListMailFolders(ctx context.Context) ([]MailFolder, error)
func (*Client) ListMessages ¶
func (c *Client) ListMessages(ctx context.Context, opts ListMessagesOptions) ([]MailMessage, error)
func (*Client) MarkMessage ¶
func (*Client) MoveMessage ¶
func (*Client) ReplyMessage ¶
func (*Client) RespondToEvent ¶
func (*Client) SearchContacts ¶
func (*Client) SearchMessages ¶
func (*Client) SendMessage ¶
func (*Client) UpdateContact ¶
type Contact ¶
type Contact struct {
ID string `json:"id"`
DisplayName string `json:"displayName"`
FirstName string `json:"givenName"`
LastName string `json:"surname"`
Emails []string `json:"emailAddresses"`
Phones []string `json:"phones,omitempty"`
Company string `json:"companyName"`
JobTitle string `json:"jobTitle"`
}
Contact is a simplified contact representation
type ListMessagesOptions ¶
type ListMessagesOptions struct {
FolderID string
Top int32
Filter string
OrderBy string
Search string
Select []string
}
ListMessagesOptions for filtering messages
type MailFolder ¶
type MailFolder struct {
ID string `json:"id"`
DisplayName string `json:"displayName"`
TotalCount int32 `json:"totalItemCount"`
UnreadCount int32 `json:"unreadItemCount"`
ParentFolderID string `json:"parentFolderId,omitempty"`
}
MailFolder is a simplified folder representation
type MailMessage ¶
type MailMessage struct {
ID string `json:"id"`
Subject string `json:"subject"`
From string `json:"from"`
To []string `json:"to"`
ReceivedAt string `json:"receivedDateTime"`
IsRead bool `json:"isRead"`
HasAttachments bool `json:"hasAttachments"`
BodyPreview string `json:"bodyPreview"`
Body string `json:"body,omitempty"`
BodyType string `json:"bodyType,omitempty"`
}
MailMessage is a simplified mail message for output
Click to show internal directories.
Click to hide internal directories.