func New(key string, org string) (*Api, error) {
	a := Api{}
	a.key = key
	a.org = org
	a.timezone = "UTC"

	a.client = pagerduty.NewClient(key)

	_, err := a.client.ListSchedules(pagerduty.ListSchedulesOptions{})
	if err != nil {
		return &a, fmt.Errorf("Failed to list on-call schedules: %v", err)
	}

	log.Info("Authenticated with PagerDuty")

	return &a, nil
}
// Pagerduty API doesn't provide a sane way of checking for auth
// so we just get the schedules at setup time
Pagerduty API doesn't provide a sane way of checking for auth
so we just get the schedules at setup time
// Pagerduty API doesn ' t provide a sane way of checking for auth // so we just get the schedules at setup time
func New(key string, org string) (*Api, error) {
	a := Api{}
	a.key = key
	a.org = org
	a.timezone = "UTC"
	a.client = pagerduty.NewClient(key)
	_, err := a.client.ListSchedules(pagerduty.ListSchedulesOptions{})
	if err != nil {
		return &a, fmt.Errorf("Failed to list on-call schedules: %v", err)
	}
	log.Info("Authenticated with PagerDuty")
	return &a, nil
}
func New ( key string , org string ) ( * Api , error ) { a := Api { } a . key = key a . org = org a . timezone = " " a . client = pagerduty . NewClient ( key ) _ , err := a . client . ListSchedules ( pagerduty . ListSchedulesOptions { } ) if err != nil { return & a , fmt . Errorf ( " " , err ) } log . Info ( " " ) return & a , nil }
Pagerduty API doesn't provide a sane way of checking for auth
so we just get the schedules at setup time
Pagerduty API doesn ' t provide a sane way of checking for auth so we just get the schedules at setup time