bamboohr

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBody

func ParseBody(resp *http.Response) ([]byte, error)

func Request

func Request(apiKey string, apiURL string) ([]byte, error)

Types

type Calendar

type Calendar struct {
	Items []Item `xml:"item"`
}

func (*Calendar) Holidays

func (calendar *Calendar) Holidays() []Item

func (*Calendar) ItemsByType

func (calendar *Calendar) ItemsByType(itemType string) []Item

func (*Calendar) TimeOffs

func (calendar *Calendar) TimeOffs() []Item

type Client

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

A Client represents the data required to connect to the BambooHR API

func NewClient

func NewClient(url string, apiKey string, subdomain string) *Client

NewClient creates and returns a new BambooHR client

func (*Client) Away

func (client *Client) Away(itemType, startDate, endDate string) []Item

Away returns a string representation of the people who are out of the office during the defined period

type Employee

type Employee struct {
	ID   int    `xml:"id,attr"`
	Name string `xml:",chardata"`
}

* Note: this currently implements the minimum number of fields to fulfill the Away functionality. * Undoubtedly there are more fields than this to an employee

type Item

type Item struct {
	Employee Employee `xml:"employee"`
	End      string   `xml:"end"`
	Holiday  string   `xml:"holiday"`
	Start    string   `xml:"start"`
	Type     string   `xml:"type,attr"`
}

func (*Item) IsOneDay

func (item *Item) IsOneDay() bool

func (*Item) Name

func (item *Item) Name() string

func (*Item) PrettyEnd

func (item *Item) PrettyEnd() string

func (*Item) PrettyStart

func (item *Item) PrettyStart() string

func (*Item) String

func (item *Item) String() string

type Settings

type Settings struct {
	*cfg.Common
	// contains filtered or unexported fields
}

func NewSettingsFromYAML

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings

type Widget

type Widget struct {
	view.TextWidget
	// contains filtered or unexported fields
}

func NewWidget

func NewWidget(tviewApp *tview.Application, redrawChan chan bool, settings *Settings) *Widget

func (*Widget) Refresh

func (widget *Widget) Refresh()

Jump to

Keyboard shortcuts

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