garoon

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: CC0-1.0 Imports: 9 Imported by: 2

README

Cybozu Garoon REST API client for Go CircleCI

Supported most of Garoon REST API excluding notification/items(POST)

import "github.com/otoyo/garoon"

Example

package main

import (
        "fmt"

        "github.com/otoyo/garoon"
)

func main() {
        c, err := garoon.NewClient("subdomain of .cybozu.com", "user", "password")
        if err != nil {
                fmt.Printf("%s\n", err)
                return
        }

        ev, err := c.FindEvent("123")
        if err != nil {
                fmt.Printf("%s\n", err)
                return
        }

        fmt.Printf("%#v\n", ev)
}

Documentation

See wiki

Contribution

Contributions are welcome ;)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalItem

type AdditionalItem struct {
	Value string `json:"value"`
}

type AdditionalItems

type AdditionalItems struct {
	Item AdditionalItem `json:"item"`
}

type Attachment

type Attachment struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	ContentType string `json:"contentType"`
	Size        string `json:"size"`
}

type AttendanceResponse

type AttendanceResponse struct {
	Status  string `json:"status"`
	Comment string `json:"comment,omitempty"`
}

type Attendee

type Attendee struct {
	User
	AttendanceResponse AttendanceResponse `json:"attendanceResponse,omitempty"`
}

type AvailableTime

type AvailableTime struct {
	Start    Time     `json:"start"`
	End      Time     `json:"end"`
	Facility Facility `json:"facility"`
}

type AvailableTimePager

type AvailableTimePager struct {
	AvailableTimes []AvailableTime `json:"availableTimes"`
}

type AvailableTimeParameter

type AvailableTimeParameter struct {
	TimeRanges              []DateTimePeriod `json:"timeRanges"`
	TimeInterval            string           `json:"timeInterval"`
	Attendees               []Attendee       `json:"attendees,omitempty"`
	Facilities              []Facility       `json:"facilities,omitempty"`
	FacilitySearchCondition string           `json:"facilitySearchCondition"`
}

type Client

type Client struct {
	HttpClient *http.Client
	Domain     string
	User       string
	Password   string
}

func NewClient

func NewClient(subdomain, user, password string) (*Client, error)

func (*Client) CreateEvent

func (c *Client) CreateEvent(event *Event) (*Event, error)

func (*Client) DeleteEvent

func (c *Client) DeleteEvent(id string) error

func (*Client) FindEvent

func (c *Client) FindEvent(id string) (*Event, error)

func (*Client) GetFacilities

func (c *Client) GetFacilities(values url.Values) (*FacilityPager, error)

func (*Client) GetFacilitiesByFacilityGroup

func (c *Client) GetFacilitiesByFacilityGroup(facilityGroupID string, values url.Values) (*FacilityPager, error)

func (*Client) GetFacilityGroups

func (c *Client) GetFacilityGroups(values url.Values) (*FacilityGroupPager, error)

func (*Client) GetNotificationItems

func (c *Client) GetNotificationItems(values url.Values) (*NotificationItemPager, error)

func (*Client) GetOrganizations

func (c *Client) GetOrganizations(values url.Values) (*OrganizationPager, error)

func (*Client) GetUsersByOrganization

func (c *Client) GetUsersByOrganization(organizationID string, values url.Values) (*UserPager, error)

func (*Client) SearchAvailableTimes

func (c *Client) SearchAvailableTimes(param *AvailableTimeParameter) (*AvailableTimePager, error)

func (*Client) SearchEvents

func (c *Client) SearchEvents(values url.Values) (*EventPager, error)

func (*Client) SearchUsers

func (c *Client) SearchUsers(values url.Values) (*UserPager, error)

func (*Client) UpdateEvent

func (c *Client) UpdateEvent(event *Event) (*Event, error)

type CompanyInfo

type CompanyInfo struct {
	Name      string `json:"name"`
	ZipCode   string `json:"zipCode"`
	Address   string `json:"address"`
	Route     string `json:"route"`
	RouteTime string `json:"routeTime"`
	RouteFare string `json:"routeFare"`
	Phone     string `json:"phone"`
}

type Creator

type Creator User

type DatePeriod

type DatePeriod struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type DateTimePeriod

type DateTimePeriod struct {
	Start time.Time `json:"start"`
	End   time.Time `json:"end"`
}

type ErrorResponse added in v0.1.2

type ErrorResponse struct {
	Error struct {
		ErrorCode string `json:"errorCode"`
		Message   string `json:"message"`
		Cause     string `json:"cause"`
	} `json:"error"`
}

type Event

type Event struct {
	ID                       string                    `json:"id,omitempty"`
	Creator                  Creator                   `json:"creator,omitempty"`
	CreatedAt                time.Time                 `json:"createdAt,omitempty"`
	Updater                  Updater                   `json:"updater,omitempty"`
	UpdatedAt                time.Time                 `json:"updatedAt,omitempty"`
	EventType                string                    `json:"eventType"`
	EventMenu                string                    `json:"eventMenu,omitempty"`
	Subject                  string                    `json:"subject,omitempty"`
	Notes                    string                    `json:"notes,omitempty"`
	VisibilityType           string                    `json:"visibilityType,omitempty"`
	UseAttendanceCheck       bool                      `json:"useAttendanceCheck,omitempty"`
	CompanyInfo              CompanyInfo               `json:"companyInfo,omitempty"`
	Attachments              []Attachment              `json:"attachments,omitempty"`
	Start                    Time                      `json:"start"`
	End                      Time                      `json:"end,omitempty"`
	IsAllDay                 bool                      `json:"isAllDay,omitempty"`
	IsStartOnly              bool                      `json:"isStartOnly,omitempty"`
	OriginalStartTimeZone    string                    `json:"originalStartTimeZone,omitempty"`
	OriginalEndTimeZone      string                    `json:"originalEndTimeZone,omitempty"`
	Attendees                []Attendee                `json:"attendees,omitempty"`
	Watchers                 []Watcher                 `json:"watchers,omitempty"`
	Facilities               []Facility                `json:"facilities,omitempty"`
	FacilityUsingPurpose     string                    `json:"facilityUsingPurpose,omitempty"`
	FacilityReservationInfo  FacilityReservationInfo   `json:"facilityReservationInfo,omitempty"`
	FacilityUsageRequests    []FacilityUsageRequest    `json:"facilityUsageRequests,omitempty"`
	RepeatInfo               RepeatInfo                `json:"repeatInfo,omitempty"`
	TemporaryEventCandidates []TemporaryEventCandidate `json:"temporaryEventCandidates,omitempty"`
	AdditionalItems          AdditionalItems           `json:"additionalItems,omitempty"`
	RepeatID                 string                    `json:"repeatId,omitempty"`
}

type EventPager

type EventPager struct {
	Events  []Event `json:events`
	HasNext bool    `json:"hasNext"`
}

type Facility

type Facility struct {
	ID            string `json:"id,omitempty"`
	Name          string `json:"name,omitempty"`
	Code          string `json:"code,omitempty"`
	Notes         string `json:"notes,omitempty"`
	FacilityGroup string `json:"facilityGroup,omitempty"`
}

type FacilityGroup

type FacilityGroup struct {
	ID                  string `json:"id"`
	Name                string `json:"name"`
	Code                string `json:"code"`
	Notes               string `json:"notes"`
	ParentFacilityGroup string `json:"parentFacilityGroup"`
	ChildFacilityGroups []struct {
		ID string `json:"id"`
	} `json:"childFacilityGroups"`
}

type FacilityGroupPager

type FacilityGroupPager struct {
	FacilityGroups []FacilityGroup `json:"facilityGroups"`
	HasNext        bool            `json:"hasNext"`
}

type FacilityPager

type FacilityPager struct {
	Facilities []Facility `json:"facilities"`
	HasNext    bool       `json:"hasNext"`
}

type FacilityReservationInfo

type FacilityReservationInfo struct {
	AdditionalProp1 struct {
		Type  string `json:"type"`
		Value string `json:"value"`
	} `json:"additionalProp1"`
	AdditionalProp2 struct {
		Type  string `json:"type"`
		Value string `json:"value"`
	} `json:"additionalProp2"`
	AdditionalProp3 struct {
		Type  string `json:"type"`
		Value string `json:"value"`
	} `json:"additionalProp3"`
}

type FacilityUsageRequest

type FacilityUsageRequest struct {
	Status           string    `json:"status"`
	Facility         Facility  `json:"facility"`
	ApprovedBy       User      `json:"approvedBy"`
	ApprovedDateTime time.Time `json:"approvedDateTime"`
}

type NotificationItem

type NotificationItem struct {
	ModuleID  string    `json:"moduleId"`
	Creator   User      `json:"creator"`
	CreatedAt time.Time `json:"createdAt"`
	Operation string    `json:"operation"`
	URL       string    `json:"url"`
	Title     string    `json:"title"`
	Body      string    `json:"body"`
	Icon      string    `json:"icon"`
	IsRead    bool      `json:"isRead"`
}

type NotificationItemPager

type NotificationItemPager struct {
	NotificationItems []NotificationItem `json:"items"`
	HasNext           bool               `json:"hasNext"`
}

type Organization

type Organization struct {
	ID                 string `json:"id"`
	Name               string `json:"name"`
	Code               string `json:"code"`
	ParentOrganization string `json:"parentOrganization"`
	ChildOrganizations []struct {
		ID string `json:"id"`
	} `json:"childOrganizations"`
}

type OrganizationPager

type OrganizationPager struct {
	Organizations []Organization `json:organizations`
	HasNext       bool           `json:"hasNext"`
}

type RepeatInfo

type RepeatInfo struct {
	Type               string           `json:"type"`
	Period             DatePeriod       `json:"period"`
	Time               TimePeriod       `json:"time"`
	TimeZone           string           `json:"timeZone"`
	IsAllDay           bool             `json:"isAllDay,omitempty"`
	IsStartOnly        bool             `json:"isStartOnly,omitempty"`
	DayOfWeek          string           `json:"dayOfWeek,omitempty"`
	DayOfMonth         string           `json:"dayOfMonth,omitempty"`
	ExclusiveDateTimes []DateTimePeriod `json:"exclusiveDateTimes,omitempty"`
}

type TemporaryEventCandidate

type TemporaryEventCandidate struct {
	End      Time     `json:"end,omitempty"`
	Start    Time     `json:"start,omitempty"`
	Facility Facility `json:"facility,omitempty"`
}

type Time

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

type TimePeriod

type TimePeriod struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type Updater

type Updater User

type User

type User struct {
	ID   string `json:"id,omitempty"`
	Code string `json:"code,omitempty"`
	Name string `json:"name,omitempty"`
	Type string `json:"type"`
}

type UserPager

type UserPager struct {
	Users   []User `json:users`
	HasNext bool   `json:"hasNext"`
}

type Watcher

type Watcher User

Jump to

Keyboard shortcuts

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