pagerduty

package module
v0.0.0-...-5ec50f5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-pgerduty

go-pagerduty is a CLI and go client library for PagerDuty v2 API. godoc

Installation

go get github.com/PagerDuty/go-pagerduty

Usage

CLI
From golang libraries
package main

import (
	"fmt"
	"github.com/PagerDuty/go-pagerduty"
)

var	authtoken = "" // Set your auth token here

func main() {
	var opts pagerduty.ListEscalationPoliciesOptions
	client := pagerduty.NewClient(authtoken)
	if eps, err := client.ListEscalationPolicies(opts); err != nil {
		panic(err)
	} else {
		for _, p := range eps.EscalationPolicies {
			fmt.Println(p.Name)
		}
	}
}

License

Apache 2

Contributing

  1. Fork it ( https://github.com/PagerDuty/go-pagerduty/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Documentation

Index

Constants

View Source
const (
	APIEndpoint = "https://api.pagerduty.com"
)
View Source
const EventEndPoint = "https://events.pagerduty.com/generic/2010-04-15/create_event.json"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIListObject

type APIListObject struct {
	Limit  uint `url:"limit,omitempty"`
	Offset uint `url:"offset,omitempty"`
	More   bool `url:"more,omitempty"`
	Total  uint `url:"total,omitempty"`
}

type APIObject

type APIObject struct {
	ID      string `json:"id,omitempty"`
	Type    string `json:"type,omitempty"`
	Summary string `json:"summary,omitempty"`
	Self    string `json:"self,omitempty"`
	HtmlUrl string `json:"html_url,omitempty"`
}

APIObject represents generic api json response that is shared by most domain object (like escalation

type Acknowledgement

type Acknowledgement struct {
	At           string
	Acknowledger APIObject
}

type Addon

type Addon struct {
	APIObject
	Name     string      `json:"name,omitempty"`
	Src      string      `json:"src,omitempty"`
	Services []APIObject `json:"services,omitempty"`
}

type Agent

type Agent APIObject

type Assignment

type Assignment struct {
	At       string
	Assignee APIObject
}

type Channel

type Channel struct {
	Type string
}

type Client

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

Client wraps http client

func NewClient

func NewClient(authToken string) *Client

NewClient creates an API client

func (*Client) AddEscalationPolicyToTeam

func (c *Client) AddEscalationPolicyToTeam(teamID, epID string) error

func (*Client) AddUserToTeam

func (c *Client) AddUserToTeam(teamID, userID string) error

func (*Client) CreateEscalationPolicy

func (c *Client) CreateEscalationPolicy(ep EscalationPolicy) error

func (*Client) CreateIncidentNote

func (c *Client) CreateIncidentNote(id string, note IncidentNote) error

func (*Client) CreateIntegration

func (c *Client) CreateIntegration(id string, i Integration) error

func (*Client) CreateMaintaienanceWindows

func (c *Client) CreateMaintaienanceWindows(m MaintenanceWindow) error

func (*Client) CreateOverride

func (c *Client) CreateOverride(id string, o Overrides) error

func (*Client) CreateSchedule

func (c *Client) CreateSchedule(s Schedule) error

func (*Client) CreateService

func (c *Client) CreateService(s Service) error

func (*Client) CreateTeam

func (c *Client) CreateTeam(t *Team) error

func (*Client) CreateUser

func (c *Client) CreateUser(u User) error

func (*Client) Delete

func (c *Client) Delete(path string) (*http.Response, error)

func (*Client) DeleteAddon

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

func (*Client) DeleteEscalationPolicy

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

func (*Client) DeleteMaintenanceWindow

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

func (*Client) DeleteOverride

func (c *Client) DeleteOverride(scheduleID, overrideID string) error

func (*Client) DeleteSchedule

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

func (*Client) DeleteService

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

func (*Client) DeleteTeam

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

func (*Client) DeleteUser

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

func (*Client) Do

func (c *Client) Do(method, path string, body io.Reader) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(path string) (*http.Response, error)

func (*Client) GetAddon

func (c *Client) GetAddon(id string) (*Addon, error)

func (*Client) GetEscalationPolicy

func (c *Client) GetEscalationPolicy(id string, o *GetEscalationPolicyOptions) (*EscalationPolicy, error)

func (*Client) GetIncident

func (c *Client) GetIncident(id string) (*Incident, error)

func (*Client) GetIntegration

func (c *Client) GetIntegration(serviceID, integrationID string, o GetIntegrationOptions) (*Integration, error)

func (*Client) GetLogEntry

func (c *Client) GetLogEntry(id string, o GetLogEntryOptions) (*LogEntry, error)

func (*Client) GetMaintenanceWindow

func (c *Client) GetMaintenanceWindow(id string, o GetMaintenanceWindowOptions) (*MaintenanceWindow, error)

func (*Client) GetSchedule

func (c *Client) GetSchedule(id string, o GetScheduleOptions) (*Schedule, error)

func (*Client) GetService

func (c *Client) GetService(id string, o GetServiceOptions) (*Service, error)

func (*Client) GetTeam

func (c *Client) GetTeam(id string) (*Team, error)

func (*Client) GetUser

func (c *Client) GetUser(id string, o GetUserOptions) (*User, error)

func (*Client) InstallAddon

func (c *Client) InstallAddon(a Addon) error

func (*Client) ListAddons

func (c *Client) ListAddons(o ListAddonOptions) (*ListAddonResponse, error)

func (*Client) ListEscalationPolicies

func (*Client) ListIncidentNotes

func (c *Client) ListIncidentNotes(id string) ([]IncidentNote, error)

func (*Client) ListIncidents

func (c *Client) ListIncidents(o ListIncidentsOptions) (*ListIncidentsResponse, error)

func (*Client) ListLogEntries

func (c *Client) ListLogEntries(o ListLogEntriesOptions) (*ListLogEntryResponse, error)

func (*Client) ListNotifications

func (c *Client) ListNotifications(o ListNotificationOptions) (*ListNotificationsResponse, error)

func (*Client) ListOnCallUsers

func (c *Client) ListOnCallUsers(id string, o ListOnCallUsersOptions) ([]User, error)

func (*Client) ListOnCalls

func (c *Client) ListOnCalls(o ListOnCallOptions) (*ListOnCallsResponse, error)

func (*Client) ListOverrides

func (c *Client) ListOverrides(id string, o ListOverridesOptions) ([]Overrides, error)

func (*Client) ListSchedules

func (c *Client) ListSchedules(o ListSchedulesOptions) (*ListSchedulesResponse, error)

func (*Client) ListServices

func (c *Client) ListServices(o ListServiceOptions) (*ListServiceResponse, error)

func (*Client) ListTeams

func (c *Client) ListTeams(o ListTeamOptions) (*ListTeamResponse, error)

func (*Client) ListUsers

func (c *Client) ListUsers(o ListUserOptions) (*ListUsersResponse, error)

func (*Client) ManageIncidents

func (c *Client) ManageIncidents(incidents []Incident, o ManageIncidentsOptions) error

func (*Client) Post

func (c *Client) Post(path string, payload interface{}) (*http.Response, error)

func (*Client) PreviewSchedule

func (c *Client) PreviewSchedule(s Schedule, o PreviewScheduleOptions) error

func (*Client) Put

func (c *Client) Put(path string, payload interface{}) (*http.Response, error)

func (*Client) RemoveEscalationPolicyFromTeam

func (c *Client) RemoveEscalationPolicyFromTeam(teamID, epID string) error

func (*Client) RemoveUserFromTeam

func (c *Client) RemoveUserFromTeam(teamID, userID string) error

func (*Client) SnoozeIncident

func (c *Client) SnoozeIncident(id string, duration uint) error

func (*Client) UpdateAddon

func (c *Client) UpdateAddon(id string, a Addon) error

func (*Client) UpdateEscalationPolicy

func (c *Client) UpdateEscalationPolicy(e *EscalationPolicy) error

func (*Client) UpdateIntegration

func (c *Client) UpdateIntegration(serviceID string, i Integration) error

func (*Client) UpdateMaintenanceWindow

func (c *Client) UpdateMaintenanceWindow(m MaintenanceWindow) error

func (*Client) UpdateSchedule

func (c *Client) UpdateSchedule(id string, s Schedule) error

func (*Client) UpdateService

func (c *Client) UpdateService(s Service) error

func (*Client) UpdateTeam

func (c *Client) UpdateTeam(id string, t *Team) error

func (*Client) UpdateUser

func (c *Client) UpdateUser(u User) error

type ContactMethod

type ContactMethod struct {
	ID             string
	Label          string
	Address        string
	Type           string
	SendShortEmail bool `json:"send_short_email"`
}

type EmailFilter

type EmailFilter struct {
	SubjectMode    string `json:"subject_mode,omitempty"`
	SubjectRegex   string `json:"subject_regex,omitempty"`
	BodyMode       string `json:"body_mode,omitempty"`
	BodyRegex      string `json:"body_regex,omitempty"`
	FromEmailMode  string `json:"from_email_mode,omitempty"`
	FromEmailRegex string `json:"from_email_regex,omitempty"`
}

type EscalationPolicy

type EscalationPolicy struct {
	APIObject
	Name            string      `json:"name,omitempty"`
	EscalationRules []APIObject `json:"escalation_rules,omitempty"`
	Services        []APIObject `json:"services,omitempty"`
	NumLoops        uint        `json:"num_loops,omitempty"`
	Teams           []APIObject `json:"teams,omitempty"`
	Description     string      `json:"description,omitempty"`
}

type EscalationRule

type EscalationRule struct {
	Id      string `json:"id"`
	Delay   uint   `json:"escalation_delay_in_minutes"`
	Targets []APIObject
}

type Event

type Event struct {
	ServiceKey  string        `json:"service_key"`
	Type        string        `json:"event_type"`
	IncidentKey string        `json:"incident_key,omitempty"`
	Description string        `json:"description"`
	Client      string        `json:"client,omitempty"`
	ClientURL   string        `json:"client_url,omitempty"`
	Details     interface{}   `json:"details,omitempty"`
	Contexts    []interface{} `json:"contexts,omitempty"`
}

type EventResponse

type EventResponse struct {
	Status      string `json:"status"`
	Message     string `json:"message"`
	IncidentKey string `json:"incident_key"`
}

func CreateEvent

func CreateEvent(e Event) (*EventResponse, error)

type GetEscalationPolicyOptions

type GetEscalationPolicyOptions struct {
	Includes []string `url:"include,omitempty,brackets"`
}

type GetIntegrationOptions

type GetIntegrationOptions struct {
	Includes []string `url:"include,omitempty,brackets"`
}

type GetLogEntryOptions

type GetLogEntryOptions struct {
	TimeZone string   `url:"timezone,omitempty"`
	Includes []string `url:"include,omitempty,brackets"`
}

type GetMaintenanceWindowOptions

type GetMaintenanceWindowOptions struct {
	Includes []string `url:"include,omitempty,brackets"`
}

type GetScheduleOptions

type GetScheduleOptions struct {
	APIListObject
	TimeZone string `url:"time_zone,omitempty"`
	Since    string `url:"since,omitempty"`
	Until    string `url:"until,omitempty"`
}

type GetServiceOptions

type GetServiceOptions struct {
	Includes []string `url:"include,brackets,omitempty"`
}

type GetUserOptions

type GetUserOptions struct {
	Includes []string `url:"include,omitempty,brackets"`
}

type Incident

type Incident struct {
	APIObject
	IncidentNumber       uint              `json:"incident_number,omitempty"`
	CreatedAt            string            `json:"created_at,omitempty"`
	PendingActions       []PendingAction   `json:"pending_actions,omitempty"`
	IncidentKey          string            `json:"incident_key,omitempty"`
	Service              APIObject         `json:"service,omitempty"`
	Assignments          []Assignment      `json:"assignments,omitempty"`
	Acknowledgements     []Acknowledgement `json:"acknowledgements,omitempty"`
	LastStatusChangeAt   string            `json:"last_status_change_at,omitempty"`
	LastStatusChangeBy   APIObject         `json:"last_status_change_by,omitempty"`
	FirstTriggerLogEntry APIObject         `json:"last_trigger_log_entry,omitempty"`
	EscalationPolicy     APIObject         `json:"escalation_policy,omitempty"`
	Teams                []APIObject       `json:"teams,omitempty"`
	Urgency              string            `json:"urgency,omitempty"`
}

type IncidentDetail

type IncidentDetail struct {
	ID                    string           `json:"id"`
	IncidentNumber        uint             `json:"incident_number"`
	CreatedOn             string           `json:"created_on"`
	Status                string           `json:"status"`
	HTMLUrl               string           `json:"html_url"`
	Service               string           `json:"service"`
	AssignedToUser        *json.RawMessage `json:"assigned_to_user"`
	AssignedTo            []string         `json:"assigned_to"`
	TriggerSummaryData    *json.RawMessage `json:"trigger_summary_daya"`
	TriggerDeatilsHTMLUrl string           `json:"trigger_details_html_url"`
}

type IncidentNote

type IncidentNote struct {
	ID        string    `json:"id,omitempty"`
	User      APIObject `json:"user,omitempty"`
	Content   string    `json:"content,omitempty"`
	CreatedAt string    `json:"created_at,omitempty"`
}

type IncidentUrgencyRule

type IncidentUrgencyRule struct {
	Type                string       `json:"type,omitempty"`
	Urgency             string       `json:"urgency,omitempty"`
	DuringSupportHours  SupportHours `json:"during_support_hours,omitempty"`
	OutsideSupportHours SupportHours `json:"outside_support_hours,omitempty"`
}

type Integration

type Integration struct {
	APIObject
	Name                  string        `json:"name,omitempty"`
	Service               APIObject     `json:"service,omitempty"`
	CreatedAt             string        `json:"created_at,omitempty"`
	Vendor                APIObject     `json:"vendor,omitempty"`
	IntegrationEmail      string        `json:"integration_email"`
	EmailIncidentCreation string        `json:"email_incident_creation,omitempty"`
	EmailFilterMode       string        `json:"email_filter_mode"`
	EmailFilters          []EmailFilter `json:"email_filters,omitempty"`
}

type ListAddonOptions

type ListAddonOptions struct {
	APIListObject
	Includes   []string `url:"include,omitempty,brackets"`
	ServiceIDs []string `url:"service_ids,omitempty,brackets"`
	Filter     string   `url:"filter,omitempty"`
}

type ListAddonResponse

type ListAddonResponse struct {
	APIListObject
	Addons []Addon `json:"addons"`
}

type ListEscalationPoliciesOptions

type ListEscalationPoliciesOptions struct {
	APIListObject
	Query    string   `url:"query,omitempty"`
	UserIDs  []string `url:"user_ids,omitempty,brackets"`
	TeamIDs  []string `url:"team_ids,omitempty,brackets"`
	Includes []string `url:"include,omitempty,brackets"`
	SortBy   string   `url:"sort_by,omitempty"`
}

type ListEscalationPolicyResponse

type ListEscalationPolicyResponse struct {
	APIListObject
	EscalationPolicies []EscalationPolicy `json:"escalation_policies"`
}

type ListIncidentsOptions

type ListIncidentsOptions struct {
	APIListObject
	Since       string   `url:"since,omitempty"`
	Until       string   `url:"until,omitempty"`
	DateRange   string   `url:"date_range,omitempty"`
	Statuses    []string `url:"statuses,omitempty,brackets"`
	IncidentKey string   `url:"incident_key,omitempty"`
	ServiceIDs  []string `url:"service_ids,omitempty,brackets"`
	TeamIDs     []string `url:"team_ids,omitempty,brackets"`
	UserIDs     []string `url:"user_ids,omitempty,brackets"`
	Urgencies   []string `url:"urgencies,omitempty,brackets"`
	TimeZone    string   `url:"time_zone,omitempty"`
	SortBy      string   `url:"sort_by,omitempty"`
	Includes    []string `url:"include,omitempty,brackets"`
}

type ListIncidentsResponse

type ListIncidentsResponse struct {
	APIListObject
	Incidents []Incident `json:"incidents,omitempty"`
}

type ListLogEntriesOptions

type ListLogEntriesOptions struct {
	APIListObject
	TimeZone   string   `url:"time_zone"`
	Since      string   `url:"omitempty"`
	Until      string   `url:"omitempty"`
	IsOverview bool     `url:"is_overview,omitempty"`
	Includes   []string `url:"include,omitempty,brackets"`
}

type ListLogEntryResponse

type ListLogEntryResponse struct {
	APIListObject
	LogEntries []LogEntry `json:"log_entries"`
}

type ListMaintenanceWindowsOptions

type ListMaintenanceWindowsOptions struct {
	APIListObject
	Query      string   `url:"query,omitempty"`
	Includes   []string `url:"include,omitempty,brackets"`
	TeamIDs    []string `url:"team_ids,omitempty,brackets"`
	ServiceIDs []string `url:"service_ids,omitempty,brackets"`
	Filter     string   `url:"filter,omitempty,brackets"`
}

type ListMaintenanceWindowsResponse

type ListMaintenanceWindowsResponse struct {
	APIListObject
	MaintenanceWindows []MaintenanceWindow `json:"maintenance_windows"`
}

type ListNotificationOptions

type ListNotificationOptions struct {
	APIListObject
	TimeZone string   `url:"time_zone,omitempty"`
	Since    string   `url:"since,omitempty"`
	Until    string   `url:"until,omitempty"`
	Filter   string   `url:"filter,omitempty"`
	Includes []string `url:"include,omitempty"`
}

type ListNotificationsResponse

type ListNotificationsResponse struct {
	APIListObject
	Notifications []Notification
}

type ListOnCallOptions

type ListOnCallOptions struct {
	APIListObject
	TimeZone            string   `url:"time_zone,omitempty"`
	Includes            []string `url:"include,omitempty,brackets"`
	UserIDs             []string `url:"user_ids,omitempty,brackets"`
	EscalationPolicyIDs []string `url:"escalation_policy_ids,omitempty,brackets"`
	ScheduleIDs         []string `url:"schedule_ids,omitempty,brackets"`
	Since               string   `json:"since,omitempty"`
	Until               string   `json:"until,omitempty"`
	Earliest            bool     `json:"earliest,omitempty"`
}

type ListOnCallUsersOptions

type ListOnCallUsersOptions struct {
	APIListObject
	Since string `url:"since,omitempty"`
	Until string `url:"until,omitempty"`
}

type ListOnCallsResponse

type ListOnCallsResponse struct {
	OnCalls []OnCall `json:"oncalls"`
}

type ListOverridesOptions

type ListOverridesOptions struct {
	APIListObject
	Since    string `url:"since,omitempty"`
	Until    string `url:"until,omitempty"`
	Editable bool   `url:"editable,omitempty"`
	Overflow bool   `url:"overflow,omitempty"`
}

type ListSchedulesOptions

type ListSchedulesOptions struct {
	APIListObject
	Query string `url:"query,omitempty"`
}

type ListSchedulesResponse

type ListSchedulesResponse struct {
	APIListObject
	Schedules []Schedule
}

type ListServiceOptions

type ListServiceOptions struct {
	APIListObject
	TeamIDs  []string `url:"team_ids,omitempty,brackets"`
	TimeZone string   `url:"time_zone,omitempty"`
	SortBy   string   `url:"sort_by,omitempty"`
	Query    string   `url:"query,omitempty"`
	Includes []string `url:"include,omitempty,brackets"`
}

type ListServiceResponse

type ListServiceResponse struct {
	APIListObject
	Services []Service
}

type ListTeamOptions

type ListTeamOptions struct {
	APIListObject
	Query string `url:"query,omitempty"`
}

type ListTeamResponse

type ListTeamResponse struct {
	APIListObject
	Teams []Team
}

type ListUserOptions

type ListUserOptions struct {
	APIListObject
	Query    string   `url:"query,omitempty"`
	TeamIDs  []string `url:"team_ids,omitempty,brackets"`
	Includes []string `url:"include,omitempty,brackets"`
}

type ListUsersResponse

type ListUsersResponse struct {
	APIListObject
	Users []User
}

type LogEntry

type LogEntry struct {
	APIObject
	CreatedAt    string `json:"created_at"`
	Agent        Agent
	Channel      Channel
	Incident     Incident
	Teams        []Team
	Contexts     []string
	EventDetails map[string]string
}

type MaintenanceWindow

type MaintenanceWindow struct {
	APIObject
	SequenceNumber uint   `json:"sequence_number,omitempty"`
	StartTime      string `json:"start_time"`
	EndTime        string `json:"end_time"`
	Description    string
	Services       []APIObject
	Teams          []APIListObject
	CreatedBy      APIListObject `json:"created_by"`
}

type ManageIncidentsOptions

type ManageIncidentsOptions struct {
	From string `url:"from,omitempty"`
}

type NamedTime

type NamedTime struct {
	Type string `json:"type,omitempty"`
	Name string `json:"name,omitempty"`
}

type Notification

type Notification struct {
	ID        string `json:"id"`
	Type      string
	StartedAt string `json:"started_at"`
	Address   string
	User      APIObject
}

type NotificationRule

type NotificationRule struct {
	ID                  string
	StartDelayInMinutes uint          `json:"start_delay_in_minutes"`
	CreatedAt           string        `json:"created_at"`
	ContactMethod       ContactMethod `json:"contact_method"`
	Urgency             string
	Type                string
}

type OnCall

type OnCall struct {
	User             APIObject
	Schedule         APIObject
	EscalationPolicy APIObject
	EscalationLevel  uint
	Start            string
	End              string
}

type Overrides

type Overrides struct {
	ID    string    `json:"id,omitempty"`
	Start string    `json:"start,omitempty"`
	End   string    `json:"end,omitempty"`
	User  APIObject `json:"user,omitempty"`
}

type PendingAction

type PendingAction struct {
	Type string
	At   string
}

type PreviewScheduleOptions

type PreviewScheduleOptions struct {
	APIListObject
	Since    string `url:"since,omitempty"`
	Until    string `url:"until,omitempty"`
	Overflow bool   `url:"overflow,omitempty"`
}

type RenderedScheduleEntry

type RenderedScheduleEntry struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
	User  APIObject
}

type Restriction

type Restriction struct {
	Type            string
	StartTimeOfDay  string `json:"start_time_of_day,omitempty"`
	DurationSeconds uint   `json:"duration_seconds,omitempty"`
}

type Schedule

type Schedule struct {
	APIObject
	Name                 string          `json:"name,omitempty"`
	TimeZone             string          `json:"time_zone,omitempty"`
	Desciption           string          `json:"description,omitempty"`
	EscalationPolicies   []APIObject     `json:"escalation_policies,omitempty"`
	Users                []APIObject     `json:"users,omitempty"`
	ScheduleLayers       []ScheduleLayer `json:"schedule_layers,omitempty"`
	OverridesSubschedule ScheduleLayer   `json:"override_subschedule,omitempty"`
	FinalSchedule        ScheduleLayer   `json:"final_schedule,omitempty"`
}

type ScheduleLayer

type ScheduleLayer struct {
	APIObject
	Name                       string                  `json:"name,omitempty"`
	Start                      string                  `json:"start,omitempty"`
	End                        string                  `json:"end,omitempty"`
	RotationVirtualStart       string                  `json:"rotation_virtual_start,omitempty"`
	RotationTurnLengthSeconds  uint                    `json:"rotation_virtual_start,omitempty"`
	Users                      []APIObject             `json:"users,omitempty"`
	Restrictions               []Restriction           `json:"restrictions,omitempty"`
	RenderedScheduleEntries    []RenderedScheduleEntry `json:"rendered_schedule_entries,omitempty"`
	RenderedCoveragePercentage float64                 `json:"rendered_coverage_percentage,omitempty"`
}

type ScheduledAction

type ScheduledAction struct {
	Type      string    `json:"type,omitempty"`
	At        NamedTime `json:"at,omitempty"`
	ToUrgency string    `json:"to_urgency"`
}

type Service

type Service struct {
	APIObject
	Name                   string              `json:"name,omitempty"`
	Description            string              `json:"description,omitempty"`
	AutoResolveTimeout     uint                `json:"auto_resolve_timeout,omitempty"`
	AcknowledgementTimeout uint                `json:"acknowledgement_timeout,omitempty"`
	CreateAt               string              `json:"created_at,omitempty"`
	Status                 string              `json:"status,omitempty"`
	LastIncidentTimestamp  string              `json:"last_incident_timestamp,omitempty"`
	Integrations           []Integration       `json:"integrations,omitempty"`
	EscalationPolicy       EscalationPolicy    `json:"escalation_policy,omitempty"`
	Teams                  []Team              `json:"teams,omitempty"`
	IncidentUrgencyRule    IncidentUrgencyRule `json:"incident_urgency_rule,omitempty"`
	SupportHours           SupportHoursDetails `json:"support_hours,omitempty"`
	ScheduledActions       []ScheduledAction   `json:"scheduled_actions,omitempty"`
}

type SupportHours

type SupportHours struct {
	Type    string `json:"type,omitempty"`
	Urgency string `json:"urgency,omitempty"`
}

type SupportHoursDetails

type SupportHoursDetails struct {
	Type       string `json:"type,omitempty"`
	Timezone   string `json:"time_zone"`
	StartTime  string `json:"start_time"`
	EndTime    string `json:"end_time"`
	DaysOfWeek []uint `json:"days_of_week"`
}

type Team

type Team struct {
	APIObject
	Name        string
	Description string
}

type UpdateScheduleOptions

type UpdateScheduleOptions struct {
	Overflow bool `url:"overflow,omitempty"`
}

type User

type User struct {
	APIObject
	Name              string
	Email             string
	Timezone          string
	Color             string
	Role              string
	AvatarURL         string `json:"avatar_url"`
	Description       string
	InvitationSent    bool
	ContactMethods    []ContactMethod    `json:"contact_methods"`
	NotificationRules []NotificationRule `json:"notification_rules"`
	JobTitle          string             `json:"jon_title"`
	Teams             []Team
}

type WebhookPayload

type WebhookPayload struct {
	ID        string           `json:"id"`
	Type      string           `json:"type"`
	CreatedOn string           `json:"created_on"`
	Data      *json.RawMessage `json:"data"`
}

func DecodeWebhook

func DecodeWebhook(r io.Reader) (*WebhookPayload, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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