graphapi

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BodyDefault = MessageBodyDefault
	BodyText    = MessageBodyText
	BodyHTML    = MessageBodyHTML
)
View Source
const MaxCalendarAttachmentBytes = 3 << 20

MaxCalendarAttachmentBytes is Graph's exclusive upper bound for the simple event-attachment endpoint. Larger files require an upload session.

View Source
const (
	MaxInlineAttachmentBytes = 3 << 20
)

MaxInlineAttachmentBytes is Graph's exclusive upper bound for a simple attachment upload. Larger files require an upload session, which this focused inline-image path deliberately does not implement.

Variables

View Source
var (
	ErrNoWrite = errors.New("refused: writes are disabled (--no-write / OLK_NO_WRITE)")
	ErrNoSend  = errors.New("refused: sending is disabled (--no-send / OLK_NO_SEND)")
)

ErrNoWrite and ErrNoSend are returned by mutating methods when the corresponding guard is active.

Functions

func ErrorMetadata added in v1.11.0

func ErrorMetadata(err error) (code string, status int)

ErrorMetadata returns a stable, message-free code and status for JSON CLI consumers. Graph errors retain their provider code and HTTP status; local command failures use a fixed non-HTTP status.

func HTMLReferencesInlineContentID added in v1.13.0

func HTMLReferencesInlineContentID(body, contentID string) bool

HTMLReferencesInlineContentID reports whether HTML contains a cid: URL for exactly contentID. The boundary prevents a short ID such as "logo" from being accepted merely because the body references "logo-large".

func ValidateBirthday added in v0.7.0

func ValidateBirthday(s string) (time.Time, error)

ValidateBirthday parses an ISO date string (YYYY-MM-DD) and returns the parsed time.

func ValidateContactFieldLen added in v0.7.0

func ValidateContactFieldLen(value, label string, limit int) error

ValidateContactFieldLen checks that a contact string field is within length limits.

func ValidateEmail

func ValidateEmail(email string) error

ValidateEmail checks basic email format and length.

func ValidateInlineContentID added in v1.13.0

func ValidateInlineContentID(contentID string) error

ValidateInlineContentID rejects values that cannot be used safely and predictably in both a Content-ID header and a cid: URL.

func ValidatePhone

func ValidatePhone(phone string) error

ValidatePhone checks basic phone number format.

func ValidateTransactionID added in v1.13.0

func ValidateTransactionID(value string) error

ValidateTransactionID bounds the caller-supplied Graph idempotency key and rejects control characters that could corrupt logs or diagnostics.

Types

type Address added in v0.7.0

type Address struct {
	Street          string `json:"street,omitempty" untrusted:"true"`
	City            string `json:"city,omitempty" untrusted:"true"`
	State           string `json:"state,omitempty" untrusted:"true"`
	PostalCode      string `json:"postalCode,omitempty" untrusted:"true"`
	CountryOrRegion string `json:"countryOrRegion,omitempty" untrusted:"true"`
}

Address is a physical address.

type Attachment

type Attachment struct {
	ID          string `json:"id"`
	Name        string `json:"name" untrusted:"true"`
	ContentType string `json:"contentType"`
	Size        int32  `json:"size"`
	IsInline    bool   `json:"isInline"`
	ContentID   string `json:"contentId"`
	Content     []byte `json:"-"`
}

Attachment represents a mail attachment

type AttachmentInput added in v0.2.0

type AttachmentInput struct {
	Name        string
	ContentType string
	Content     []byte
}

AttachmentInput represents an attachment to be sent with a message

type AttendeeAvailabilityInfo added in v0.3.0

type AttendeeAvailabilityInfo struct {
	Email        string `json:"email"`
	Availability string `json:"availability"`
}

AttendeeAvailabilityInfo represents an attendee's availability for a time slot

type AttendeeDetails added in v1.13.0

type AttendeeDetails struct {
	Name         string `json:"name,omitempty" untrusted:"true"`
	Address      string `json:"address,omitempty" untrusted:"true"`
	Type         string `json:"type,omitempty"`
	Response     string `json:"response,omitempty"`
	ResponseTime string `json:"responseTime,omitempty"`
}

type AutoReplySettings added in v0.2.0

type AutoReplySettings struct {
	Status           string `json:"status"`
	InternalMessage  string `json:"internalMessage"`
	ExternalMessage  string `json:"externalMessage"`
	StartTime        string `json:"startTime,omitempty"`
	EndTime          string `json:"endTime,omitempty"`
	ExternalAudience string `json:"externalAudience"`
}

AutoReplySettings is a simplified auto-reply configuration for output

type BodyPreference added in v1.13.0

type BodyPreference = MessageBodyPreference

BodyPreference is shared by mail and calendar body requests.

func ParseBodyPreference added in v1.13.0

func ParseBodyPreference(value string) (BodyPreference, error)

type CalendarAttachment added in v1.14.0

type CalendarAttachment struct {
	ID          string `json:"id"`
	Name        string `json:"name" untrusted:"true"`
	ContentType string `json:"contentType"`
	Size        int32  `json:"size"`
}

CalendarAttachment is the stable output shape for an event attachment.

type CalendarDelta added in v1.9.6

type CalendarDelta struct {
	CalendarEvent
	Removed bool `json:"removed,omitempty"`
}

CalendarDelta is a changed event; Removed marks a deletion.

type CalendarEvent

type CalendarEvent struct {
	ID                string               `json:"id"`
	Subject           string               `json:"subject" untrusted:"true"`
	Start             string               `json:"start"`
	End               string               `json:"end"`
	Location          string               `json:"location" untrusted:"true"`
	Organizer         string               `json:"organizer" untrusted:"true"`
	Attendees         []string             `json:"attendees,omitempty" untrusted:"true" concise:"omit"`
	IsAllDay          bool                 `json:"isAllDay"`
	IsOnline          bool                 `json:"isOnlineMeeting"`
	OnlineURL         string               `json:"onlineMeetingUrl,omitempty" untrusted:"true"`
	Status            string               `json:"showAs"`
	Recurrence        string               `json:"recurrence,omitempty"`
	BodyPreview       string               `json:"bodyPreview,omitempty" untrusted:"true" concise:"omit"`
	Body              string               `json:"body,omitempty" untrusted:"true" concise:"omit"`
	BodyType          string               `json:"bodyType,omitempty"`
	ICalUID           string               `json:"iCalUId,omitempty"`
	ChangeKey         string               `json:"changeKey,omitempty"`
	CreatedAt         string               `json:"createdDateTime,omitempty"`
	ModifiedAt        string               `json:"lastModifiedDateTime,omitempty"`
	EventType         string               `json:"type,omitempty"`
	SeriesMasterID    string               `json:"seriesMasterId,omitempty"`
	OriginalStart     string               `json:"originalStart,omitempty"`
	IsCancelled       bool                 `json:"isCancelled"`
	IsReminderOn      *bool                `json:"isReminderOn,omitempty"`
	TransactionID     string               `json:"transactionId,omitempty"`
	AttendeeDetails   []AttendeeDetails    `json:"attendeeDetails,omitempty" concise:"omit"`
	ResponseStatus    *EventResponseStatus `json:"responseStatus,omitempty" concise:"omit"`
	RecurrenceDetails *RecurrenceDetails   `json:"recurrenceDetails,omitempty" concise:"omit"`
}

CalendarEvent is a simplified calendar event for output

type CalendarInfo

type CalendarInfo struct {
	ID    string `json:"id"`
	Name  string `json:"name" untrusted:"true"`
	Color string `json:"color"`
	Owner string `json:"owner" untrusted:"true"`
}

CalendarInfo is a simplified calendar representation

type Category added in v0.4.5

type Category struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName" untrusted:"true"`
	Color       string `json:"color"`
}

Category is a simplified outlook category for output

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 NewClientVerbose added in v0.9.0

func NewClientVerbose(cred azcore.TokenCredential) (*Client, error)

NewClientVerbose creates a new Graph API client with HTTP request/response logging to stderr

func (*Client) AttachToDraft added in v1.14.0

func (c *Client) AttachToDraft(ctx context.Context, target, draftID, name, contentType string, content []byte) (*Attachment, error)

AttachToDraft adds a file attachment to an existing draft in the target mailbox, or in the signed-in user's own mailbox when target is empty. The Files must be under 3 MB; larger uploads need an upload session.

func (*Client) CategorizeMessage added in v0.2.0

func (c *Client) CategorizeMessage(ctx context.Context, messageID string, categories []string) error

CategorizeMessage sets the categories on a message

func (*Client) CompleteTodoTask added in v0.2.0

func (c *Client) CompleteTodoTask(ctx context.Context, listID, taskID string) error

CompleteTodoTask marks a task as completed.

func (*Client) CopyDriveItem added in v0.8.0

func (c *Client) CopyDriveItem(ctx context.Context, driveID, itemID, destParentID, newName string) error

CopyDriveItem initiates an async copy of an item to a new parent.

func (*Client) CreateCategory added in v0.4.5

func (c *Client) CreateCategory(ctx context.Context, name, color string) (*Category, error)

func (*Client) CreateChecklistItem added in v0.6.0

func (c *Client) CreateChecklistItem(ctx context.Context, listID, taskID, displayName string) (*TodoChecklistItem, error)

CreateChecklistItem creates a new checklist item on a task.

func (*Client) CreateContact

func (c *Client) CreateContact(ctx context.Context, in *ContactCreateInput) (*Contact, error)

func (*Client) CreateDraft added in v0.2.0

func (c *Client) CreateDraft(ctx context.Context, target, subject, body string, to, cc, bcc []string, isHTML bool, inlineAttachments ...InlineAttachmentInput) (*DraftMessage, error)

CreateDraft leaves a draft in the target mailbox, or in the signed-in user's own mailbox when target is empty.

Drafting into a shared mailbox is the lower-privilege alternative to sending as one: it needs the Mail.ReadWrite.Shared scope and Full Access on the mailbox, but *not* Send As or Send on Behalf Of. The draft lands in that mailbox's Drafts folder for a person who does hold those rights to review and send, which keeps a human at the point where the message actually leaves.

func (*Client) CreateEvent

func (c *Client) CreateEvent(ctx context.Context, opts *CreateEventOptions) (*CalendarEvent, error)

func (*Client) CreateFolder added in v0.8.0

func (c *Client) CreateFolder(ctx context.Context, driveID, parentItemID, folderName string) (*DriveItem, error)

CreateFolder creates a new folder under the given parent item ID.

func (*Client) CreateLinkedResource added in v0.6.0

func (c *Client) CreateLinkedResource(ctx context.Context, listID, taskID, displayName, appName, externalID, webURL string) (*TodoLinkedResource, error)

CreateLinkedResource creates a new linked resource on a task.

func (*Client) CreateMailFolder added in v0.4.5

func (c *Client) CreateMailFolder(ctx context.Context, displayName string) (*MailFolder, error)

CreateMailFolder creates a new mail folder.

func (*Client) CreateMailRule added in v0.3.0

func (c *Client) CreateMailRule(ctx context.Context, name, from, subjectContains string, hasAttachment bool, moveFolder string, markRead, deleteMsg bool, forwardTo, importance string) (*MailRule, error)

func (*Client) CreateReplyDraft added in v1.13.0

func (c *Client) CreateReplyDraft(ctx context.Context, target, messageID string, opts *CreateReplyDraftOptions) (*DraftMessage, error)

CreateReplyDraft creates a real Outlook reply draft in the target mailbox, or in the signed-in user's own mailbox when target is empty. Plain drafts use Graph's comment form. HTML drafts first let Graph generate Outlook's quoted history, then insert the supplied fragment into that generated HTML body.

func (c *Client) CreateShareLink(ctx context.Context, driveID, itemID, linkType, scope string) (*ShareLink, error)

CreateShareLink creates a sharing link for an item.

func (*Client) CreateTodoList added in v0.4.5

func (c *Client) CreateTodoList(ctx context.Context, displayName string) (*TodoList, error)

CreateTodoList creates a new task list.

func (*Client) CreateTodoTask added in v0.2.0

func (c *Client) CreateTodoTask(ctx context.Context, listID, title, dueDate, importance, body, startDate, reminderDate, recurrence string, categories []string) (*TodoTask, error)

CreateTodoTask creates a new task in the given list.

func (*Client) CreateUploadSession added in v0.8.0

func (c *Client) CreateUploadSession(ctx context.Context, driveID, remotePath string, replace bool) (string, error)

CreateUploadSession creates a resumable upload session for large files (>= 4MB).

func (*Client) DeleteCalendarAttachment added in v1.14.0

func (c *Client) DeleteCalendarAttachment(ctx context.Context, eventID, attachmentID string) error

DeleteCalendarAttachment deletes an attachment from an event.

func (*Client) DeleteCategory added in v0.4.5

func (c *Client) DeleteCategory(ctx context.Context, categoryID string) error

func (*Client) DeleteChecklistItem added in v0.6.0

func (c *Client) DeleteChecklistItem(ctx context.Context, listID, taskID, itemID string) error

DeleteChecklistItem deletes a checklist item.

func (*Client) DeleteContact

func (c *Client) DeleteContact(ctx context.Context, contactID string) error

func (*Client) DeleteDraft added in v0.2.0

func (c *Client) DeleteDraft(ctx context.Context, target, draftID string) error

DeleteDraft deletes a draft from the target mailbox, or from the signed-in user's own mailbox when target is empty.

func (*Client) DeleteDriveItem added in v0.8.0

func (c *Client) DeleteDriveItem(ctx context.Context, driveID, itemID string) error

DeleteDriveItem deletes an item.

func (*Client) DeleteEvent

func (c *Client) DeleteEvent(ctx context.Context, eventID string) error

func (*Client) DeleteLinkedResource added in v0.6.0

func (c *Client) DeleteLinkedResource(ctx context.Context, listID, taskID, resourceID string) error

DeleteLinkedResource deletes a linked resource from a task.

func (*Client) DeleteMailFolder added in v0.4.5

func (c *Client) DeleteMailFolder(ctx context.Context, folderID string) error

DeleteMailFolder deletes a mail folder.

func (*Client) DeleteMailRule added in v0.3.0

func (c *Client) DeleteMailRule(ctx context.Context, ruleID string) error

func (*Client) DeleteMessage

func (c *Client) DeleteMessage(ctx context.Context, target, messageID string) error

DeleteMessage deletes a message from the target mailbox, or from the signed-in user's own mailbox when target is empty.

func (*Client) DeleteTodoAttachment added in v0.6.0

func (c *Client) DeleteTodoAttachment(ctx context.Context, listID, taskID, attachmentID string) error

DeleteTodoAttachment deletes a task attachment.

func (*Client) DeleteTodoList added in v0.4.5

func (c *Client) DeleteTodoList(ctx context.Context, listID string) error

DeleteTodoList deletes a task list.

func (*Client) DeleteTodoTask added in v0.2.0

func (c *Client) DeleteTodoTask(ctx context.Context, listID, taskID string) error

DeleteTodoTask deletes a task.

func (*Client) DeltaCalendarView added in v1.9.6

func (c *Client) DeltaCalendarView(ctx context.Context, target, token string, start, end time.Time, top int32) ([]CalendarDelta, DeltaPage, error)

DeltaCalendarView returns event changes in [start, end] since token. The window is required for the initial sync; on resume the token already encodes it, so start/end are ignored. Pass an empty token to start a fresh sync.

func (*Client) DeltaContacts added in v1.9.6

func (c *Client) DeltaContacts(ctx context.Context, target, token string, top int32) ([]ContactDelta, DeltaPage, error)

DeltaContacts returns contact changes since token. Pass an empty token to start a fresh sync.

func (*Client) DeltaMessages added in v1.9.6

func (c *Client) DeltaMessages(ctx context.Context, target, folderID, token string, top int32) ([]MailDelta, DeltaPage, error)

DeltaMessages returns message changes in a mail folder (default "inbox") since token. Pass an empty token to start a fresh sync.

func (*Client) DownloadAttachment added in v0.2.0

func (c *Client) DownloadAttachment(ctx context.Context, target, messageID, attachmentID string) (*Attachment, error)

DownloadAttachment fetches one file attachment from the target mailbox, or from the signed-in user's mailbox when target is empty.

func (*Client) DownloadCalendarAttachment added in v1.14.0

func (c *Client) DownloadCalendarAttachment(ctx context.Context, eventID, attachmentID string) (*CalendarAttachment, []byte, error)

DownloadCalendarAttachment downloads a file attachment from an event.

func (*Client) DownloadDriveItem added in v0.8.0

func (c *Client) DownloadDriveItem(ctx context.Context, driveID, itemID string) ([]byte, error)

DownloadDriveItem downloads file content by item ID. For large files, use GetDriveItem to get the DownloadURL and stream directly.

func (*Client) DownloadTodoAttachment added in v0.6.0

func (c *Client) DownloadTodoAttachment(ctx context.Context, listID, taskID, attachmentID string) (name, contentType string, content []byte, err error)

DownloadTodoAttachment downloads a task attachment's content.

func (*Client) FindMeetingTimes added in v0.3.0

func (c *Client) FindMeetingTimes(ctx context.Context, attendees []string, start, end time.Time, durationMinutes int32) ([]MeetingTimeSuggestion, error)

FindMeetingTimes finds available meeting times for the given attendees

func (*Client) FlagMessage added in v0.2.0

func (c *Client) FlagMessage(ctx context.Context, messageID, flagStatus string) error

FlagMessage sets the follow-up flag status on a message

func (*Client) ForwardMessage

func (c *Client) ForwardMessage(ctx context.Context, target, messageID, comment string, toRecipients []string, isHTML bool) error

ForwardMessage forwards a message from the target mailbox, or from the signed-in user's own mailbox when target is empty. As with ReplyMessage, the target selects both the mailbox the original is read from and the sending identity.

func (*Client) GetAttachments

func (c *Client) GetAttachments(ctx context.Context, target, messageID string) ([]Attachment, error)

GetAttachments lists attachments on a message in the target mailbox, or in the signed-in user's mailbox when target is empty.

func (*Client) GetAutoReply added in v0.2.0

func (c *Client) GetAutoReply(ctx context.Context) (*AutoReplySettings, error)

GetAutoReply retrieves the current auto-reply (out-of-office) settings

func (*Client) GetContact

func (c *Client) GetContact(ctx context.Context, target, contactID string) (*Contact, error)

GetContact returns a single contact from the target mailbox, or the signed-in user's mailbox when target is empty. See ListContacts for scope requirements.

func (*Client) GetDrive added in v0.8.0

func (c *Client) GetDrive(ctx context.Context, driveID string) (*DriveInfo, error)

GetDrive returns details for a specific drive, or the default drive if driveID is empty.

func (*Client) GetDriveItem added in v0.8.0

func (c *Client) GetDriveItem(ctx context.Context, driveID, itemID string) (*DriveItem, error)

GetDriveItem returns metadata for a specific item.

func (*Client) GetEvent

func (c *Client) GetEvent(ctx context.Context, target, eventID string, preference BodyPreference) (*CalendarEvent, error)

GetEvent returns a single event from the target mailbox, or the signed-in user's calendar when target is empty. See ListEvents for scope requirements.

func (*Client) GetMessage

func (c *Client) GetMessage(ctx context.Context, target, messageID string, preference MessageBodyPreference) (*MailMessage, error)

GetMessage returns a single message from the target mailbox, or the signed-in user's mailbox when target is empty. See ListMessages for scope requirements.

func (*Client) GetMessagesBatch added in v1.9.6

func (c *Client) GetMessagesBatch(ctx context.Context, target string, ids []string, preference MessageBodyPreference) ([]MailMessage, error)

GetMessagesBatch fetches several messages in a single Graph $batch round-trip (up to maxBatchMessages), instead of one request each. It is best-effort: an id that fails (not found / no access) is omitted from the result rather than failing the whole call, so a missing id in the output means that fetch failed.

func (*Client) GetProfile added in v0.2.0

func (c *Client) GetProfile(ctx context.Context) (*UserProfile, error)

GetProfile retrieves the current user's profile information

func (*Client) GetSchedule added in v0.2.0

func (c *Client) GetSchedule(ctx context.Context, emails []string, start, end time.Time) ([]ScheduleInfo, error)

GetSchedule retrieves free/busy availability for the specified email addresses

func (*Client) GetTodoTask added in v0.2.0

func (c *Client) GetTodoTask(ctx context.Context, listID, taskID string) (*TodoTask, error)

GetTodoTask returns a single task by ID.

func (*Client) GetWellKnownMailFolder added in v1.11.0

func (c *Client) GetWellKnownMailFolder(ctx context.Context, target, name string) (*MailFolder, error)

GetWellKnownMailFolder resolves one guarded move destination by its canonical Graph identifier. It intentionally does not infer identity from localized or user-editable display names.

func (*Client) Inner

func (c *Client) Inner() *msgraphsdk.GraphServiceClient

Inner returns the underlying Graph SDK client

func (*Client) ListCalendarAttachments added in v1.14.0

func (c *Client) ListCalendarAttachments(ctx context.Context, eventID string) ([]CalendarAttachment, error)

ListCalendarAttachments lists attachments on the signed-in user's event.

func (*Client) ListCalendarView added in v0.3.0

func (c *Client) ListCalendarView(ctx context.Context, target string, startTime, endTime time.Time, calendarID string, top int32, preference BodyPreference) ([]CalendarEvent, error)

ListCalendarView returns expanded occurrences (including recurring) in a date range. ListCalendarView is an alias for ListEvents (which already calls the calendarView endpoint and expands recurrences). Kept for caller clarity.

func (*Client) ListCalendars

func (c *Client) ListCalendars(ctx context.Context, target string) ([]CalendarInfo, error)

ListCalendars returns calendars from the target mailbox, or the signed-in user's mailbox when target is empty. See ListEvents for scope requirements.

func (*Client) ListCategories added in v0.4.5

func (c *Client) ListCategories(ctx context.Context) ([]Category, error)

func (*Client) ListChecklistItems added in v0.6.0

func (c *Client) ListChecklistItems(ctx context.Context, listID, taskID string) ([]TodoChecklistItem, error)

ListChecklistItems returns all checklist items for a task.

func (*Client) ListCompleteThread added in v1.11.0

func (c *Client) ListCompleteThread(
	ctx context.Context,
	target string,
	conversationID string,
	preference MessageBodyPreference,
) ([]MailMessage, error)

ListCompleteThread consumes every Graph continuation page before returning one exact conversation, oldest first.

func (*Client) ListContacts

func (c *Client) ListContacts(ctx context.Context, target string, top, skip int32, orderBy string) ([]Contact, error)

ListContacts returns contacts from the target mailbox, or the signed-in user's mailbox when target is empty. Targeting another mailbox requires the calling token to carry Contacts.Read.Shared and the calling user to have Exchange Full Access delegation on the target.

func (*Client) ListDrafts added in v0.2.0

func (c *Client) ListDrafts(ctx context.Context, target string, top int32) ([]DraftMessage, error)

ListDrafts lists messages in the Drafts folder of the target mailbox, or of the signed-in user's own mailbox when target is empty.

func (*Client) ListDriveChildren added in v0.8.0

func (c *Client) ListDriveChildren(ctx context.Context, driveID, itemID string, top int32) ([]DriveItem, error)

ListDriveChildren returns items in a folder by item ID.

func (*Client) ListDriveChildrenByPath added in v0.8.0

func (c *Client) ListDriveChildrenByPath(ctx context.Context, driveID, path string, top int32) ([]DriveItem, error)

ListDriveChildrenByPath returns items in a folder by path.

func (*Client) ListDriveItemVersions added in v0.8.0

func (c *Client) ListDriveItemVersions(ctx context.Context, driveID, itemID string) ([]DriveItemVersion, error)

ListDriveItemVersions returns version history for an item.

func (*Client) ListDrives added in v0.8.0

func (c *Client) ListDrives(ctx context.Context) ([]DriveInfo, error)

ListDrives returns all drives for the current user.

func (*Client) ListEvents

func (c *Client) ListEvents(ctx context.Context, target string, startTime, endTime time.Time, calendarID string, top int32, preference BodyPreference) ([]CalendarEvent, error)

ListEvents returns calendar events in [startTime, endTime] from the target mailbox, or the signed-in user's calendar when target is empty. Targeting another mailbox requires the calling token to carry Calendars.Read.Shared and the calling user to have Exchange Full Access delegation on the target.

func (*Client) ListLinkedResources added in v0.6.0

func (c *Client) ListLinkedResources(ctx context.Context, listID, taskID string) ([]TodoLinkedResource, error)

ListLinkedResources returns all linked resources for a task.

func (*Client) ListMailFolders

func (c *Client) ListMailFolders(ctx context.Context, target string) ([]MailFolder, error)

ListMailFolders returns every visible folder in the target mailbox, or in the signed-in user's mailbox when target is empty. Graph's /mailFolders collection contains only the folders immediately below the mailbox root, so each folder that reports children is traversed through /childFolders.

func (*Client) ListMailRules added in v0.3.0

func (c *Client) ListMailRules(ctx context.Context) ([]MailRule, error)

func (*Client) ListMessages

func (c *Client) ListMessages(ctx context.Context, target string, opts *ListMessagesOptions) ([]MailMessage, error)

ListMessages returns messages from the target mailbox, or the signed-in user's mailbox when target is empty. Targeting another mailbox requires the calling token to carry the Mail.Read.Shared scope claim and the calling user to have Full Access delegation on the target mailbox in Exchange.

func (*Client) ListThread added in v1.9.6

func (c *Client) ListThread(ctx context.Context, target, conversationID string, top int32, preference MessageBodyPreference) ([]MailMessage, error)

ListThread returns every message in a conversation, oldest first. The conversation id comes from a message's conversationId field (now included in list/get output). Messages are matched across all folders (inbox, sent, …).

func (*Client) ListTodoAttachments added in v0.6.0

func (c *Client) ListTodoAttachments(ctx context.Context, listID, taskID string) ([]TodoAttachment, error)

ListTodoAttachments returns all attachments for a task.

func (*Client) ListTodoLists added in v0.2.0

func (c *Client) ListTodoLists(ctx context.Context) ([]TodoList, error)

ListTodoLists returns all task lists for the current user.

func (*Client) ListTodoTasks added in v0.2.0

func (c *Client) ListTodoTasks(ctx context.Context, listID string, top int32, status string) ([]TodoTask, error)

ListTodoTasks returns tasks in a given task list.

func (*Client) MarkMessage

func (c *Client) MarkMessage(ctx context.Context, messageID string, isRead bool) error

func (*Client) MoveDriveItem added in v0.8.0

func (c *Client) MoveDriveItem(ctx context.Context, driveID, itemID, destParentID, newName string) (*DriveItem, error)

MoveDriveItem moves or renames an item.

func (*Client) MoveMessage

func (c *Client) MoveMessage(
	ctx context.Context,
	target, messageID, folderID string,
) (*MoveMessageReceipt, error)

MoveMessage moves a message inside the target mailbox, or inside the signed-in user's own mailbox when target is empty. Message and folder IDs are mailbox-scoped, so both must have been resolved from the same target.

func (*Client) RecentDriveItems added in v0.8.0

func (c *Client) RecentDriveItems(ctx context.Context, driveID string) ([]DriveItem, error)

RecentDriveItems returns recently accessed items.

func (*Client) RenameMailFolder added in v0.4.5

func (c *Client) RenameMailFolder(ctx context.Context, folderID, displayName string) (*MailFolder, error)

RenameMailFolder renames a mail folder.

func (*Client) ReplyMessage

func (c *Client) ReplyMessage(ctx context.Context, target, messageID, comment string, replyAll, isHTML bool) error

ReplyMessage replies to a message in the target mailbox, or in the signed-in user's own mailbox when target is empty.

The target selects both the mailbox the original is read from and the identity the reply is sent as, because a message ID only resolves within the mailbox it was listed from. Without a target, an ID belonging to a shared mailbox fails to resolve at all, which is why replying from one was previously impossible rather than merely mis-attributed.

func (*Client) ResolveItemByPath added in v0.8.0

func (c *Client) ResolveItemByPath(ctx context.Context, driveID, path string) (*DriveItem, error)

ResolveItemByPath resolves a path to a DriveItem using the Graph API path syntax.

func (*Client) ResolveMailFolderPath added in v1.13.0

func (c *Client) ResolveMailFolderPath(ctx context.Context, target, reference string) (string, error)

ResolveMailFolderPath turns a display-name path such as Inbox/2026 into the ID Graph requires. A slash-bearing value whose first component does not name a top-level folder is left unchanged so existing Graph IDs containing slash characters remain valid inputs.

func (*Client) RespondToEvent

func (c *Client) RespondToEvent(ctx context.Context, eventID, response string) error

func (*Client) SearchContacts

func (c *Client) SearchContacts(ctx context.Context, target, query string, top int32) ([]Contact, error)

SearchContacts runs a prefix search against contacts in the target mailbox, or the signed-in user's mailbox when target is empty. See ListContacts for scope requirements.

func (*Client) SearchDirectory added in v0.4.4

func (c *Client) SearchDirectory(ctx context.Context, query string, top int32) ([]Person, error)

SearchDirectory searches the organization directory via /users with $search

func (*Client) SearchDrive added in v0.8.0

func (c *Client) SearchDrive(ctx context.Context, driveID, query string, top int32) ([]DriveItem, error)

SearchDrive searches for items matching a query.

func (*Client) SearchMessages

func (c *Client) SearchMessages(ctx context.Context, target, query string, top int32) ([]MailMessage, error)

SearchMessages runs a KQL search against the target mailbox, or the signed-in user's mailbox when target is empty. See ListMessages for scope requirements.

func (*Client) SearchPeople added in v0.3.0

func (c *Client) SearchPeople(ctx context.Context, query string, top int32) ([]Person, error)

func (*Client) SendDraft added in v0.2.0

func (c *Client) SendDraft(ctx context.Context, target, draftID string) error

SendDraft sends an existing draft from the target mailbox, or from the signed-in user's own mailbox when target is empty. Sending a draft that lives in someone else's mailbox still needs Send As or Send on Behalf Of — creating the draft does not confer the right to send it.

func (*Client) SendMessage

func (c *Client) SendMessage(ctx context.Context, target string, opts *SendMessageOptions) error

SendMessage sends from the target mailbox, or from the signed-in user's own mailbox when target is empty.

Sending as another mailbox needs three grants that are easy to confuse, and holding one tells you nothing about the others:

  • the token must carry the Mail.Send.Shared scope claim, requested at login with `--scope Mail.Send.Shared`;
  • the calling user must hold Send As or Send on Behalf Of on the target mailbox in Exchange; and
  • the calling user must hold Full Access on it as well.

The third comes with the endpoint. Microsoft requires Full Access for /users/{target}/sendMail specifically, over and above the sending delegation: https://learn.microsoft.com/en-us/graph/outlook-send-mail-from-other-user

That endpoint is chosen for where it files the sent copy. Posting to /users/{target}/sendMail saves it by default in the target's Sent Items, which is what a shared mailbox is for; the alternative, /me/sendMail with a from address, needs no Full Access but files the copy in the caller's own Sent Items where the team cannot see it. Either default can be overridden by mailbox configuration, so treat it as the documented default rather than a guarantee.

Before this took a target, a send with --mailbox set silently went out from the caller's own address and still reported success, which is the failure mode this signature exists to prevent.

func (*Client) SetAutoReply added in v0.2.0

func (c *Client) SetAutoReply(ctx context.Context, status, internalMsg, externalMsg, startTime, endTime, audience string) error

SetAutoReply updates the auto-reply (out-of-office) settings

func (*Client) SetGuards added in v0.9.0

func (c *Client) SetGuards(noWrite, noSend bool)

SetGuards configures the no-write / no-send capability guards on the client.

func (*Client) SetImmutableIDs added in v1.11.0

func (c *Client) SetImmutableIDs(enabled bool)

SetImmutableIDs opts Outlook item requests into IDs that remain stable across moves within the same mailbox.

func (*Client) SetImportance added in v0.2.0

func (c *Client) SetImportance(ctx context.Context, messageID, importance string) error

SetImportance sets the importance level on a message

func (*Client) SharedWithMeItems added in v0.8.0

func (c *Client) SharedWithMeItems(ctx context.Context, driveID string) ([]DriveItem, error)

SharedWithMeItems returns items shared with the current user.

func (*Client) ToggleChecklistItem added in v0.6.0

func (c *Client) ToggleChecklistItem(ctx context.Context, listID, taskID, itemID string) (*TodoChecklistItem, error)

ToggleChecklistItem toggles the IsChecked state of a checklist item.

func (*Client) UpdateChecklistItem added in v0.6.0

func (c *Client) UpdateChecklistItem(ctx context.Context, listID, taskID, itemID string, displayName *string, isChecked *bool) (*TodoChecklistItem, error)

UpdateChecklistItem updates a checklist item's properties.

func (*Client) UpdateContact

func (c *Client) UpdateContact(ctx context.Context, contactID string, in *ContactUpdateInput) (*Contact, error)

func (*Client) UpdateDraftRecipients added in v1.14.0

func (c *Client) UpdateDraftRecipients(ctx context.Context, target, draftID string, recipients DraftRecipients) error

UpdateDraftRecipients replaces the To, CC and BCC lists of an existing draft in the target mailbox, or in the signed-in user's own mailbox when target is empty. The body and subject are left alone: a reply draft's body includes the quoted original, and rewriting it here would silently drop that.

func (*Client) UpdateEvent

func (c *Client) UpdateEvent(ctx context.Context, opts *UpdateEventOptions) (*CalendarEvent, error)

func (*Client) UpdateTodoTask added in v0.4.5

func (c *Client) UpdateTodoTask(ctx context.Context, listID, taskID string, title, dueDate, importance, body, startDate, reminderDate, recurrence *string, categories *[]string) (*TodoTask, error)

UpdateTodoTask updates a task's properties.

func (*Client) UploadCalendarAttachment added in v1.14.0

func (c *Client) UploadCalendarAttachment(ctx context.Context, eventID, name, contentType string, content []byte) (*CalendarAttachment, error)

UploadCalendarAttachment adds a small file attachment to an event. Graph's simple endpoint accepts files strictly smaller than 3 MB; upload sessions are intentionally left for a separate large-file implementation.

func (*Client) UploadSmallFile added in v0.8.0

func (c *Client) UploadSmallFile(ctx context.Context, driveID, remotePath string, content []byte, replace bool) (*DriveItem, error)

UploadSmallFile uploads a file under 4MB via simple PUT.

func (*Client) UploadTodoAttachment added in v0.6.0

func (c *Client) UploadTodoAttachment(ctx context.Context, listID, taskID, name, contentType string, content []byte) (*TodoAttachment, error)

UploadTodoAttachment uploads a file attachment to a task.

type Contact

type Contact struct {
	ID               string   `json:"id"`
	DisplayName      string   `json:"displayName" untrusted:"true"`
	FirstName        string   `json:"givenName" untrusted:"true"`
	LastName         string   `json:"surname" untrusted:"true"`
	MiddleName       string   `json:"middleName,omitempty" untrusted:"true"`
	NickName         string   `json:"nickName,omitempty" untrusted:"true"`
	Emails           []string `json:"emailAddresses"`
	BusinessPhones   []string `json:"businessPhones,omitempty"`
	HomePhones       []string `json:"homePhones,omitempty"`
	MobilePhone      string   `json:"mobilePhone,omitempty"`
	ImAddresses      []string `json:"imAddresses,omitempty"`
	Company          string   `json:"companyName" untrusted:"true"`
	JobTitle         string   `json:"jobTitle" untrusted:"true"`
	Department       string   `json:"department,omitempty" untrusted:"true"`
	OfficeLocation   string   `json:"officeLocation,omitempty" untrusted:"true"`
	Profession       string   `json:"profession,omitempty" untrusted:"true"`
	Manager          string   `json:"manager,omitempty" untrusted:"true"`
	AssistantName    string   `json:"assistantName,omitempty" untrusted:"true"`
	Birthday         string   `json:"birthday,omitempty"`
	PersonalNotes    string   `json:"personalNotes,omitempty" untrusted:"true" concise:"omit"`
	SpouseName       string   `json:"spouseName,omitempty" untrusted:"true"`
	Children         []string `json:"children,omitempty" untrusted:"true"`
	Categories       []string `json:"categories,omitempty"`
	BusinessHomePage string   `json:"businessHomePage,omitempty" untrusted:"true"`
	BusinessAddress  *Address `json:"businessAddress,omitempty" concise:"omit"`
	HomeAddress      *Address `json:"homeAddress,omitempty" concise:"omit"`
	OtherAddress     *Address `json:"otherAddress,omitempty" concise:"omit"`
	CreatedAt        string   `json:"createdDateTime,omitempty"`
	ModifiedAt       string   `json:"lastModifiedDateTime,omitempty"`
	ChangeKey        string   `json:"changeKey,omitempty"`
}

Contact is a simplified contact representation

type ContactCreateInput added in v0.7.0

type ContactCreateInput struct {
	FirstName     string
	LastName      string
	Emails        []string
	BusinessPhone string
	HomePhone     string
	MobilePhone   string
	Company       string
	JobTitle      string
	Department    string
	Birthday      string
	PersonalNotes string
	Manager       string
	MiddleName    string
	NickName      string
	Categories    []string
	Address       *Address
	AddressType   string // "business", "home", "other"
}

ContactCreateInput contains the fields for creating a contact.

type ContactDelta added in v1.9.6

type ContactDelta struct {
	Contact
	Removed bool `json:"removed,omitempty"`
}

ContactDelta is a changed contact; Removed marks a deletion.

type ContactUpdateInput added in v0.7.0

type ContactUpdateInput struct {
	FirstName     *string
	LastName      *string
	Emails        *[]string
	BusinessPhone *string
	HomePhone     *string
	MobilePhone   *string
	Company       *string
	JobTitle      *string
	Department    *string
	Birthday      *string
	PersonalNotes *string
	Manager       *string
	MiddleName    *string
	NickName      *string
	Categories    *[]string
	Address       *Address
	AddressType   string
}

ContactUpdateInput contains the fields for updating a contact. Nil pointers mean "don't change".

type CreateEventOptions added in v1.14.0

type CreateEventOptions struct {
	CalendarID      string
	Subject         string
	Start           time.Time
	End             time.Time
	Location        string
	Attendees       []string
	IsAllDay        bool
	IsOnlineMeeting bool
	Recurrence      string
	TransactionID   string
	ReminderOn      *bool
	Body            *EventBodyInput
}

CreateEventOptions contains the fields supported when creating an event.

type CreateReplyDraftOptions added in v1.13.0

type CreateReplyDraftOptions struct {
	Body              string
	ReplyAll          bool
	IsHTML            bool
	InlineAttachments []InlineAttachmentInput
}

CreateReplyDraftOptions carries the content and reply mode for a threaded reply draft. InlineAttachments are supported only for HTML drafts.

type DeltaPage added in v1.9.6

type DeltaPage struct {
	Token    string `json:"deltaToken,omitempty"` // opaque cursor; pass back to fetch the next page/changes
	Complete bool   `json:"complete"`             // true when caught up (token is a deltaLink); false = more pages now
}

DeltaPage is the continuation cursor returned by a delta call.

type DraftMessage added in v0.2.0

type DraftMessage struct {
	ID      string   `json:"id"`
	Subject string   `json:"subject" untrusted:"true"`
	To      []string `json:"to" untrusted:"true"`
	Body    string   `json:"body,omitempty" untrusted:"true"`
	Created string   `json:"createdDateTime"`
}

DraftMessage is a simplified draft message for output

type DraftRecipients added in v1.14.0

type DraftRecipients struct {
	To  []string `json:"to" untrusted:"true"`
	CC  []string `json:"cc" untrusted:"true"`
	BCC []string `json:"bcc" untrusted:"true"`
}

DraftRecipients carries the recipient lists an UpdateDraftRecipients call replaces. A nil slice leaves that list untouched; an empty slice clears it.

type DriveInfo added in v0.8.0

type DriveInfo struct {
	ID             string `json:"id"`
	Name           string `json:"name" untrusted:"true"`
	DriveType      string `json:"driveType"`
	QuotaTotal     int64  `json:"quotaTotal"`
	QuotaUsed      int64  `json:"quotaUsed"`
	QuotaRemaining int64  `json:"quotaRemaining"`
	QuotaState     string `json:"quotaState"`
	OwnerName      string `json:"ownerName,omitempty"`
	OwnerEmail     string `json:"ownerEmail,omitempty"`
	WebURL         string `json:"webUrl"`
}

DriveInfo is a simplified drive for output.

type DriveItem added in v0.8.0

type DriveItem struct {
	ID          string `json:"id"`
	Name        string `json:"name" untrusted:"true"`
	Size        int64  `json:"size"`
	ItemType    string `json:"itemType"`
	MimeType    string `json:"mimeType,omitempty"`
	CreatedAt   string `json:"createdDateTime"`
	ModifiedAt  string `json:"lastModifiedDateTime"`
	WebURL      string `json:"webUrl"`
	DownloadURL string `json:"-"` // pre-authenticated URL with embedded token; excluded from JSON for security
	ParentPath  string `json:"parentPath,omitempty" untrusted:"true"`
	ChildCount  int32  `json:"childCount,omitempty"`
	CreatedBy   string `json:"createdBy,omitempty" untrusted:"true"`
	ModifiedBy  string `json:"modifiedBy,omitempty" untrusted:"true"`
}

DriveItem is a simplified drive item for output.

type DriveItemVersion added in v0.8.0

type DriveItemVersion struct {
	ID         string `json:"id"`
	ModifiedAt string `json:"lastModifiedDateTime"`
	Size       int64  `json:"size"`
	ModifiedBy string `json:"lastModifiedBy,omitempty"`
}

DriveItemVersion is a simplified version entry for output.

type EventBodyInput added in v1.14.0

type EventBodyInput struct {
	Content string
	HTML    bool
}

EventBodyInput describes the caller-authored body of an event. A nil input means that the body should be omitted from an update.

type EventResponseStatus added in v1.13.0

type EventResponseStatus struct {
	Response string `json:"response,omitempty"`
	Time     string `json:"time,omitempty"`
}

type InlineAttachmentInput added in v1.13.0

type InlineAttachmentInput struct {
	ContentID   string
	Name        string
	ContentType string
	Content     []byte
}

InlineAttachmentInput is an image embedded in an HTML draft and referenced from the draft body with a matching cid: URL.

type ListMessagesOptions

type ListMessagesOptions struct {
	FolderID string
	Top      int32
	Filter   string
	OrderBy  string
	Search   string
	Select   []string
}

ListMessagesOptions for filtering messages

type MailDelta added in v1.9.6

type MailDelta struct {
	MailMessage
	Removed bool `json:"removed,omitempty"`
}

MailDelta is a changed message; Removed marks a deletion.

type MailFolder

type MailFolder struct {
	ID               string `json:"id"`
	WellKnownName    string `json:"wellKnownName,omitempty"`
	DisplayName      string `json:"displayName" untrusted:"true"`
	TotalCount       int32  `json:"totalItemCount"`
	UnreadCount      int32  `json:"unreadItemCount"`
	ChildFolderCount int32  `json:"childFolderCount"`
	ParentFolderID   string `json:"parentFolderId,omitempty"`
}

MailFolder is a simplified folder representation

type MailFollowupFlag added in v1.11.0

type MailFollowupFlag struct {
	Status string `json:"status"`
}

MailFollowupFlag is the stable output shape for a provider follow-up flag.

type MailMessage

type MailMessage struct {
	ID                string            `json:"id"`
	ParentFolderID    string            `json:"parentFolderId,omitempty"`
	ChangeKey         string            `json:"changeKey,omitempty"`
	Subject           string            `json:"subject" untrusted:"true"`
	From              string            `json:"from" untrusted:"true"`
	To                []string          `json:"to" untrusted:"true"`
	Cc                []string          `json:"cc" untrusted:"true"`
	Bcc               []string          `json:"bcc" untrusted:"true"`
	ReplyTo           []string          `json:"replyTo" untrusted:"true"`
	ReceivedAt        string            `json:"receivedDateTime"`
	IsRead            bool              `json:"isRead"`
	HasAttachments    bool              `json:"hasAttachments"`
	BodyPreview       string            `json:"bodyPreview,omitempty" untrusted:"true" concise:"omit"`
	Body              string            `json:"body,omitempty" untrusted:"true" concise:"omit"`
	BodyType          string            `json:"bodyType,omitempty"`
	Categories        []string          `json:"categories,omitempty"`
	ConversationID    string            `json:"conversationId,omitempty"`
	Flag              *MailFollowupFlag `json:"flag,omitempty"`
	InternetMessageID string            `json:"internetMessageId,omitempty"`
	CreatedAt         string            `json:"createdDateTime,omitempty"`
	ModifiedAt        string            `json:"lastModifiedDateTime,omitempty"`
}

MailMessage is a simplified mail message for output

type MailRule added in v0.3.0

type MailRule struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName" untrusted:"true"`
	Sequence    int32  `json:"sequence"`
	IsEnabled   bool   `json:"isEnabled"`
	Conditions  string `json:"conditions"`
	Actions     string `json:"actions"`
}

MailRule is a simplified message rule for output

type MeetingTimeSuggestion added in v0.3.0

type MeetingTimeSuggestion struct {
	Start                  string                     `json:"start"`
	End                    string                     `json:"end"`
	Confidence             float64                    `json:"confidence"`
	OrganizerAvailability  string                     `json:"organizerAvailability"`
	AttendeeAvailabilities []AttendeeAvailabilityInfo `json:"attendeeAvailabilities,omitempty"`
}

MeetingTimeSuggestion represents a suggested meeting time

type MessageBodyPreference added in v1.11.0

type MessageBodyPreference string

MessageBodyPreference is a typed request for the representation Graph must return for a message body. The zero value preserves Graph's default.

const (
	MessageBodyDefault MessageBodyPreference = ""
	MessageBodyText    MessageBodyPreference = "text"
	MessageBodyHTML    MessageBodyPreference = "html"
)

func ParseMessageBodyPreference added in v1.11.0

func ParseMessageBodyPreference(value string) (MessageBodyPreference, error)

ParseMessageBodyPreference converts a CLI-facing value into the closed set accepted by the Graph request layer.

type MoveMessageReceipt added in v1.11.0

type MoveMessageReceipt struct {
	SourceID string `json:"sourceId"`
	ID       string `json:"id"`
	Status   string `json:"status"`
	Code     string `json:"code"`
}

MoveMessageReceipt is the stable provider-success result returned after Graph has created the destination message.

type Person added in v0.3.0

type Person struct {
	DisplayName string `json:"displayName" untrusted:"true"`
	Email       string `json:"email" untrusted:"true"`
	JobTitle    string `json:"jobTitle,omitempty" untrusted:"true"`
	Department  string `json:"department,omitempty" untrusted:"true"`
	Company     string `json:"companyName,omitempty" untrusted:"true"`
}

Person is a simplified person for output

type RecurrenceDetails added in v1.13.0

type RecurrenceDetails struct {
	PatternType         string   `json:"patternType,omitempty"`
	Interval            int32    `json:"interval,omitempty"`
	DaysOfWeek          []string `json:"daysOfWeek,omitempty"`
	DayOfMonth          int32    `json:"dayOfMonth,omitempty"`
	Month               int32    `json:"month,omitempty"`
	Index               string   `json:"index,omitempty"`
	RangeType           string   `json:"rangeType,omitempty"`
	StartDate           string   `json:"startDate,omitempty"`
	EndDate             string   `json:"endDate,omitempty"`
	NumberOfOccurrences int32    `json:"numberOfOccurrences,omitempty"`
}

type ScheduleInfo added in v0.2.0

type ScheduleInfo struct {
	Email        string         `json:"email"`
	Availability string         `json:"availability"`
	Items        []ScheduleItem `json:"scheduleItems"`
}

ScheduleInfo represents the free/busy schedule for a user

type ScheduleItem added in v0.2.0

type ScheduleItem struct {
	Status  string `json:"status"`
	Start   string `json:"start"`
	End     string `json:"end"`
	Subject string `json:"subject,omitempty" untrusted:"true"`
}

ScheduleItem represents a single busy block in a user's schedule

type SendMessageOptions added in v1.13.0

type SendMessageOptions struct {
	Subject     string
	Body        string
	To          []string
	CC          []string
	BCC         []string
	IsHTML      bool
	Attachments []AttachmentInput
	Importance  string
	ReadReceipt bool
}

SendMessageOptions carries the content of an outgoing message. It exists so that SendMessage can take a mailbox target without growing an eleventh positional parameter.

type ShareLink struct {
	ID       string `json:"id"`
	LinkType string `json:"type"`
	URL      string `json:"webUrl"`
	Scope    string `json:"scope"`
}

ShareLink is a simplified sharing link for output.

type TodoAttachment added in v0.6.0

type TodoAttachment struct {
	ID          string `json:"id"`
	Name        string `json:"name" untrusted:"true"`
	ContentType string `json:"contentType"`
	Size        int32  `json:"size"`
}

TodoAttachment is a simplified attachment for output

type TodoChecklistItem added in v0.6.0

type TodoChecklistItem struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName" untrusted:"true"`
	IsChecked   bool   `json:"isChecked"`
	CreatedAt   string `json:"createdDateTime,omitempty"`
}

TodoChecklistItem is a simplified checklist item for output

type TodoLinkedResource added in v0.6.0

type TodoLinkedResource struct {
	ID              string `json:"id"`
	DisplayName     string `json:"displayName" untrusted:"true"`
	ApplicationName string `json:"applicationName"`
	ExternalID      string `json:"externalId"`
	WebURL          string `json:"webUrl"`
}

TodoLinkedResource is a simplified linked resource for output

type TodoList added in v0.2.0

type TodoList struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName" untrusted:"true"`
	IsOwner     bool   `json:"isOwner"`
}

TodoList is a simplified task list for output

type TodoTask added in v0.2.0

type TodoTask struct {
	ID             string   `json:"id"`
	Title          string   `json:"title" untrusted:"true"`
	Status         string   `json:"status"`
	Importance     string   `json:"importance"`
	DueDate        string   `json:"dueDateTime,omitempty"`
	CreatedAt      string   `json:"createdDateTime"`
	CompletedAt    string   `json:"completedDateTime,omitempty"`
	Body           string   `json:"body,omitempty" untrusted:"true" concise:"omit"`
	StartDate      string   `json:"startDateTime,omitempty"`
	IsReminderOn   bool     `json:"isReminderOn"`
	ReminderDate   string   `json:"reminderDateTime,omitempty"`
	Recurrence     string   `json:"recurrence,omitempty"`
	Categories     []string `json:"categories,omitempty"`
	HasAttachments bool     `json:"hasAttachments"`
}

TodoTask is a simplified task for output

type UpdateEventOptions added in v1.14.0

type UpdateEventOptions struct {
	EventID    string
	Subject    *string
	Start      *time.Time
	End        *time.Time
	Location   *string
	AllDay     *bool
	ReminderOn *bool
	Body       *EventBodyInput
}

UpdateEventOptions contains only the fields that should be patched. Nil pointers preserve the existing event values.

type UserProfile added in v0.2.0

type UserProfile struct {
	DisplayName string `json:"displayName" untrusted:"true"`
	Email       string `json:"mail"`
	UPN         string `json:"userPrincipalName"`
	JobTitle    string `json:"jobTitle,omitempty" untrusted:"true"`
	Department  string `json:"department,omitempty" untrusted:"true"`
	Office      string `json:"officeLocation,omitempty" untrusted:"true"`
	Phone       string `json:"businessPhones,omitempty"`
}

UserProfile is a simplified user profile for output

Jump to

Keyboard shortcuts

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