teamup

package module
v0.0.0-...-080e136 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

README

Teamup Client

An unofficial golang client for Teamup.

Installation

go get git.sr.ht/~jessdwitch/go-teamup-client

Integration testing

To run the integration testing suite against Teamup's mock server, add a .testkey file with your API key in it.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Error struct {
		ID      string `json:"id"`
		Title   string `json:"title"`
		Message string `json:"message"`
	} `json:"error"`
}

type CalendarEvent

type CalendarEvent struct {
	ID                   string                 `json:"id"`
	SubcalendarIds       []interface{}          `json:"subcalendar_ids"`        // TODO: Type unclear. "[null]" is a possible response
	SubcalendarRemoteIds []interface{}          `json:"subcalendar_remote_ids"` // TODO: Type unclear. "[null]" is a possible response
	StartDt              time.Time              `json:"start_dt"`
	EndDt                time.Time              `json:"end_dt"`
	AllDay               bool                   `json:"all_day,omitempty"`
	Rrule                string                 `json:"rrule,omitempty"`
	Notes                string                 `json:"notes,omitempty"`
	CreationDt           time.Time              `json:"creation_dt,omitempty"`
	UpdateDt             time.Time              `json:"update_dt,omitempty"`
	DeleteDt             time.Time              `json:"delete_dt,omitempty"`
	Tz                   string                 `json:"tz,omitempty"`
	Version              string                 `json:"version,omitempty"`
	RemoteID             string                 `json:"remote_id,omitempty"`
	SeriesID             int                    `json:"series_id,omitempty"`
	RistartDt            time.Time              `json:"ristart_dt,omitempty"`
	RsstartDt            time.Time              `json:"rsstart_dt,omitempty"`
	Attachments          []EventAttachment      `json:"attachments,omitempty"`
	Title                string                 `json:"title,omitempty"`
	Location             string                 `json:"location,omitempty"`
	Who                  string                 `json:"who,omitempty"`
	Readonly             bool                   `json:"readonly,omitempty"`
	SignupEnabled        bool                   `json:"signup_enabled,omitempty"`
	SignupDeadline       time.Time              `json:"signup_deadline,omitempty"`
	SignupVisibility     string                 `json:"signup_visibility,omitempty"`
	SignupLimit          string                 `json:"signup_limit,omitempty"`
	CommentsEnabled      bool                   `json:"comments_enabled,omitempty"`
	CommentsVisibility   string                 `json:"comments_visibility,omitempty"`
	Custom               map[string]interface{} `json:"custom,omitempty"` // TODO: JSON is like {"fieldName": "someString", "field2": ["a", "b"]}
	Comments             []EventComment         `json:"comments,omitempty"`
	Signups              []EventSignup          `json:"signups,omitempty"`
}

type CalendarEventResponse

type CalendarEventResponse struct {
	Events    []CalendarEvent `json:"events"`
	Timestamp int             `json:"timestamp"`
}

type Client

type Client struct {
	APIKey      string
	CalendarKey string
	HTTPClient  http.Client
	BaseURL     string
	UserAgent   string
	Logger      Logger
}

type EventAttachment

type EventAttachment struct {
	ID         string    `json:"id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Size       int       `json:"size,omitempty"`
	Mimetype   string    `json:"mimetype,omitempty"`
	Link       string    `json:"link,omitempty"`
	Thumbnail  string    `json:"thumbnail,omitempty"`
	UploadDate time.Time `json:"upload_date,omitempty"`
	Preview    string    `json:"preview,omitempty"`
}

type EventComment

type EventComment struct {
	ID         string    `json:"id,omitempty"`
	EventID    string    `json:"event_id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Email      string    `json:"email,omitempty"`
	Message    string    `json:"message,omitempty"`
	RemoteID   string    `json:"remote_id,omitempty"`
	CreationDt time.Time `json:"creation_dt,omitempty"`
	UpdateDt   time.Time `json:"update_dt,omitempty"`
	Updater    string    `json:"updater,omitempty"`
}

type EventService

type EventService service

func (*EventService) GetEvents

func (s *EventService) GetEvents(ctx context.Context, modifiedSince *time.Time) (*CalendarEventResponse, *http.Response, error)

Get Events Collection, Get Events Changed, Search Events

type EventSignup

type EventSignup struct {
	ID         string    `json:"id,omitempty"`
	EventID    string    `json:"event_id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Email      string    `json:"email,omitempty"`
	RemoteID   string    `json:"remote_id,omitempty"`
	CreationDt time.Time `json:"creation_dt,omitempty"`
	UpdateDt   time.Time `json:"update_dt,omitempty"`
	EmailHash  string    `json:"email_hash,omitempty"`
}

type Logger

type Logger interface {
	Log(map[string]any)
}

Logger: Client will pass a map of logged fields

Jump to

Keyboard shortcuts

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