outlook_http

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtensionOdataType = "microsoft.graph.openTypeExtension"
	ExtensionName      = "inovex.calendarsync.meta"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attendee

type Attendee struct {
	EmailAdress EmailAddress `json:"emailAddress,omitempty"`
}

type Body

type Body struct {
	ContentType string `json:"contentType,omitempty"`
	Content     string `json:"content,omitempty"`
}

type CalendarAPI

type CalendarAPI struct {
	// contains filtered or unexported fields
}

func (*CalendarAPI) CreateEvent

func (c *CalendarAPI) CreateEvent(ctx context.Context, e models.Event) error

func (*CalendarAPI) DeleteEvent

func (c *CalendarAPI) DeleteEvent(ctx context.Context, e models.Event) error

func (*CalendarAPI) EventsInTimeframe

func (c *CalendarAPI) EventsInTimeframe(ctx context.Context, start time.Time, end time.Time) ([]models.Event, error)

func (*CalendarAPI) GetCalendarID added in v0.8.0

func (c *CalendarAPI) GetCalendarID() string

func (*CalendarAPI) Initialize

func (c *CalendarAPI) Initialize(ctx context.Context, config map[string]interface{}) error

func (*CalendarAPI) Name

func (c *CalendarAPI) Name() string

func (*CalendarAPI) SetLogger

func (c *CalendarAPI) SetLogger(logger *log.Logger)

func (*CalendarAPI) SetupOauth2

func (c *CalendarAPI) SetupOauth2(ctx context.Context, credentials auth.Credentials, storage auth.Storage, bindPort uint) error

func (*CalendarAPI) UpdateEvent

func (c *CalendarAPI) UpdateEvent(ctx context.Context, e models.Event) error

type EmailAddress

type EmailAddress struct {
	Name    string `json:"name"`
	Address string `json:"address"`
}

type Event

type Event struct {
	ID                         string         `json:"id"`
	UID                        string         `json:"iCalUId"`
	ChangeKey                  string         `json:"changeKey"`
	HtmlLink                   string         `json:"webLink"`
	Subject                    string         `json:"subject"`
	Start                      Time           `json:"start"`
	End                        Time           `json:"end"`
	Body                       Body           `json:"body,omitempty"`
	Attendees                  []Attendee     `json:"attendees,omitempty"`
	Location                   Location       `json:"location"`
	IsReminderOn               bool           `json:"isReminderOn"`
	ReminderMinutesBeforeStart int            `json:"reminderMinutesBeforeStart"`
	Extensions                 []Extensions   `json:"extensions"`
	IsAllDay                   bool           `json:"isAllDay"`
	OnlineMeetingUrl           string         `json:"onlineMeetingUrl"`
	ResponseStatus             ResponseStatus `json:"responseStatus,omitempty"`
}

type EventList

type EventList struct {
	NextLink string  `json:"@odata.nextLink"`
	Events   []Event `json:"value"`
}

type Extensions

type Extensions struct {
	OdataType     string `json:"@odata.type"`
	ExtensionName string `json:"extensionName"`
	// needs to be embedded, Microsoft returns a 500 on an non-embedded object
	models.Metadata
}

type Location

type Location struct {
	Name string `json:"displayName"`
}

type OutlookCalendarClient

type OutlookCalendarClient interface {
	ListEvents(ctx context.Context, starttime time.Time, endtime time.Time) ([]models.Event, error)
	CreateEvent(ctx context.Context, event models.Event) error
	UpdateEvent(ctx context.Context, event models.Event) error
	DeleteEvent(ctx context.Context, event models.Event) error
	GetCalendarID() string
}

type OutlookClient

type OutlookClient struct {
	Client     *http.Client
	CalendarID string
}

OutlookClient implements the OutlookCalendarClient interface

func (*OutlookClient) CreateEvent

func (o *OutlookClient) CreateEvent(ctx context.Context, event models.Event) error

CreateEvent creates an event in the outlook sink When an event is sent, the server sends invitations to all the attendees. https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http

func (*OutlookClient) DeleteEvent

func (o *OutlookClient) DeleteEvent(ctx context.Context, event models.Event) error

func (OutlookClient) GetCalendarID added in v0.8.0

func (o OutlookClient) GetCalendarID() string

func (*OutlookClient) ListEvents

func (o *OutlookClient) ListEvents(ctx context.Context, start time.Time, end time.Time) ([]models.Event, error)

func (*OutlookClient) UpdateEvent

func (o *OutlookClient) UpdateEvent(ctx context.Context, event models.Event) error

UpdateEvent updates the event when used as a sink

type ResponseStatus added in v0.8.0

type ResponseStatus struct {
	Response string `json:"response,omitempty"`
}

type Time

type Time struct {
	DateTime string `json:"dateTime"`
	TimeZone string `json:"timeZone"`
}

Jump to

Keyboard shortcuts

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