pagerduty

package
v0.0.0-...-b079310 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoToken is returned by NewClient if a user
	// passed an empty/missing token.
	ErrNoToken = errors.New("an empty token was provided")

	// ErrAuthFailure is returned by NewClient if a user
	// passed an invalid token and failed validation against the PagerDuty API.
	ErrAuthFailure = errors.New("failed to authenticate using the provided token")
)

Functions

This section is empty.

Types

type AbilityService

type AbilityService service

AbilityService handles the communication with ability related methods of the PagerDuty API.

func (*AbilityService) List

List lists available abilities.

func (*AbilityService) Test

func (s *AbilityService) Test(id string) (*Response, error)

Test tests whether the account has a given ability.

type ActiveBetween

type ActiveBetween struct {
	StartTime int `json:"start_time,omitempty"`
	EndTime   int `json:"end_time,omitempty"`
}

ActiveBetween represents an active_between object for setting a timeline for rules

type Addon

type Addon struct {
	Addon   *Addon `json:"addon,omitempty"`
	HTMLURL string `json:"html_url,omitempty"`
	ID      string `json:"id,omitempty"`
	Name    string `json:"name,omitempty"`
	Self    string `json:"self,omitempty"`
	Src     string `json:"src,omitempty"`
	Summary string `json:"summary,omitempty"`
	Type    string `json:"type,omitempty"`
}

Addon represents a PagerDuty add-on.

type AddonReference

type AddonReference resourceReference

AddonReference represents a reference to an add-on.

type AddonService

type AddonService service

AddonService handles the communication with add-on related methods of the PagerDuty API.

func (*AddonService) Delete

func (s *AddonService) Delete(id string) (*Response, error)

Delete removes an existing add-on.

func (*AddonService) Get

func (s *AddonService) Get(id string) (*Addon, *Response, error)

Get retrieves information about an add-on.

func (*AddonService) Install

func (s *AddonService) Install(addon *Addon) (*Addon, *Response, error)

Install installs an add-on.

func (*AddonService) List

List lists installed add-ons.

func (*AddonService) Update

func (s *AddonService) Update(id string, addon *Addon) (*Addon, *Response, error)

Update updates an existing add-on.

type At

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

At represents when a scheduled action will occur.

type BusinessService

type BusinessService struct {
	ID             string `json:"id,omitempty"`
	Name           string `json:"name,omitempty"`
	Type           string `json:"type,omitempty"`
	Summary        string `json:"summary,omitempty"`
	Self           string `json:"self,omitempty"`
	PointOfContact string `json:"point_of_contact,omitempty"`
	HTMLUrl        string `json:"html_url,omitempty"`
	Description    string `json:"description,omitempty"`
}

BusinessService represents a business service.

type BusinessServicePayload

type BusinessServicePayload struct {
	BusinessService *BusinessService `json:"business_service,omitempty"`
}

BusinessServicePayload represents payload with a business service object

type BusinessServiceService

type BusinessServiceService service

BusinessServiceService handles the communication with business service related methods of the PagerDuty API.

func (*BusinessServiceService) Create

Create creates a new business service.

func (*BusinessServiceService) Delete

func (s *BusinessServiceService) Delete(ID string) (*Response, error)

Delete deletes a business service.

func (*BusinessServiceService) Get

Get gets a business service.

func (*BusinessServiceService) List

List lists existing business services.

func (*BusinessServiceService) Update

Update updates a business service.

type Client

type Client struct {
	Config              *Config
	Abilities           *AbilityService
	Addons              *AddonService
	EscalationPolicies  *EscalationPolicyService
	Extensions          *ExtensionService
	MaintenanceWindows  *MaintenanceWindowService
	Rulesets            *RulesetService
	Schedules           *ScheduleService
	Services            *ServicesService
	Teams               *TeamService
	ExtensionSchemas    *ExtensionSchemaService
	Users               *UserService
	Vendors             *VendorService
	EventRules          *EventRuleService
	BusinessServices    *BusinessServiceService
	ServiceDependencies *ServiceDependencyService
	Priorities          *PriorityService
	// contains filtered or unexported fields
}

Client manages the communication with the PagerDuty API

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient returns a new PagerDuty API client.

func (*Client) ValidateAuth

func (c *Client) ValidateAuth() error

ValidateAuth validates a token against the PagerDuty API

type ConditionParameter

type ConditionParameter struct {
	Path  string `json:"path,omitempty"`
	Value string `json:"value,omitempty"`
}

ConditionParameter represents parameters in a rule condition

type Config

type Config struct {
	BaseURL    string
	HTTPClient *http.Client
	Token      string
	UserAgent  string
	Debug      bool
}

Config represents the configuration for a PagerDuty client

type ContactMethod

type ContactMethod struct {
	ContactMethod *ContactMethod `json:"contact_method,omitempty"`
	ID            string         `json:"id,omitempty"`
	Summary       string         `json:"summary,omitempty"`
	Type          string         `json:"type,omitempty"`
	Self          string         `json:"self,omitempty"`
	HTMLURL       string         `json:"html_url,omitempty"`
	Label         string         `json:"label,omitempty"`
	Address       string         `json:"address,omitempty"`
	BlackListed   bool           `json:"blacklisted,omitempty"`

	// Email contact method options
	SendShortEmail bool `json:"send_short_email,omitempty"`

	// Phone contact method options
	CountryCode int  `json:"country_code,omitempty"`
	Enabled     bool `json:"enabled,omitempty"`

	// Push contact method options
	DeviceType string                    `json:"device_type,omitempty"`
	Sounds     []*PushContactMethodSound `json:"sounds,omitempty"`
	CreatedAt  string                    `json:"created_at,omitempty"`
}

ContactMethod represents a contact method for a user.

type ContactMethodReference

type ContactMethodReference resourceReference

ContactMethodReference represents a reference to a contact method.

type CreateScheduleOptions

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

CreateScheduleOptions represents options when creating a schedule.

type Error

type Error struct {
	ErrorResponse *Response
	Code          int         `json:"code,omitempty"`
	Errors        interface{} `json:"errors,omitempty"`
	Message       string      `json:"message,omitempty"`
}

Error represents an error response from the PagerDuty API.

func (*Error) Error

func (e *Error) Error() string

type EscalationPolicy

type EscalationPolicy struct {
	Description      string              `json:"description,omitempty"`
	EscalationPolicy *EscalationPolicy   `json:"escalation_policy,omitempty"`
	EscalationRules  []*EscalationRule   `json:"escalation_rules,omitempty"`
	HTMLURL          string              `json:"html_url,omitempty"`
	ID               string              `json:"id,omitempty"`
	Name             string              `json:"name,omitempty"`
	NumLoops         int                 `json:"num_loops,omitempty"`
	RepeatEnabled    bool                `json:"repeat_enabled,omitempty"`
	Self             string              `json:"self,omitempty"`
	Services         []*ServiceReference `json:"services,omitempty"`
	Summary          string              `json:"summary,omitempty"`
	Teams            []*TeamReference    `json:"teams"`
	Type             string              `json:"type,omitempty"`
}

EscalationPolicy represents an escalation policy.

type EscalationPolicyReference

type EscalationPolicyReference resourceReference

EscalationPolicyReference represents a reference to an escalation policy.

type EscalationPolicyService

type EscalationPolicyService service

EscalationPolicyService handles the communication with escalation policy related methods of the PagerDuty API.

func (*EscalationPolicyService) Create

func (s *EscalationPolicyService) Create(escalationPolicy *EscalationPolicy) (*EscalationPolicy, *Response, error)

Create creates a new escalation policy.

func (*EscalationPolicyService) Delete

func (s *EscalationPolicyService) Delete(id string) (*Response, error)

Delete deletes an existing escalation policy.

func (*EscalationPolicyService) Get

Get retrieves information about an escalation policy.

func (*EscalationPolicyService) List

List lists existing escalation policies.

func (*EscalationPolicyService) Update

func (s *EscalationPolicyService) Update(id string, escalationPolicy *EscalationPolicy) (*EscalationPolicy, *Response, error)

Update updates an existing escalation policy.

type EscalationRule

type EscalationRule struct {
	EscalationDelayInMinutes int                          `json:"escalation_delay_in_minutes,omitempty"`
	ID                       string                       `json:"id,omitempty"`
	Targets                  []*EscalationTargetReference `json:"targets,omitempty"`
}

EscalationRule represents an escalation rule.

type EscalationTargetReference

type EscalationTargetReference resourceReference

EscalationTargetReference represents a reference to an escalation target

type EventRule

type EventRule struct {
	Actions           []interface{} `json:"actions,omitempty"`
	AdvancedCondition []interface{} `json:"advanced_condition,omitempty"`
	CatchAll          bool          `json:"catch_all,omitempty"`
	Condition         []interface{} `json:"condition,omitempty"`
	ID                string        `json:"id,omitempty"`
}

EventRule represents an event rule.

type EventRuleService

type EventRuleService service

EventRuleService handles the communication with event rules related methods of the PagerDuty API.

func (*EventRuleService) Create

func (s *EventRuleService) Create(eventRule *EventRule) (*EventRule, *Response, error)

Create creates a new event rule.

func (*EventRuleService) Delete

func (s *EventRuleService) Delete(id string) (*Response, error)

Delete deletes an existing event rule.

func (*EventRuleService) List

List lists existing event rules.

func (*EventRuleService) Update

func (s *EventRuleService) Update(id string, eventRule *EventRule) (*EventRule, *Response, error)

Update updates an existing event rule.

type Extension

type Extension struct {
	Extension        *Extension                `json:"extension,omitempty"`
	ID               string                    `json:"id,omitempty"`
	Summary          string                    `json:"summary,omitempty"`
	Type             string                    `json:"type,omitempty"`
	Self             string                    `json:"self,omitempty"`
	HTMLURL          string                    `json:"html_url,omitempty"`
	Name             string                    `json:"name"`
	EndpointURL      string                    `json:"endpoint_url,omitempty"`
	ExtensionObjects []*ServiceReference       `json:"extension_objects,omitempty"`
	ExtensionSchema  *ExtensionSchemaReference `json:"extension_schema"`
	Config           interface{}               `json:"config,omitempty"`
}

Extension represents an extension.

type ExtensionSchema

type ExtensionSchema struct {
	ExtensionSchema *ExtensionSchema `json:"extension_schema,omitempty"`
	Description     string           `json:"description,omitempty"`
	GuideURL        string           `json:"guide_url,omitempty"`
	HTMLURL         string           `json:"html_url,omitempty"`
	IconURL         string           `json:"icon_url,omitempty"`
	ID              string           `json:"id,omitempty"`
	Key             string           `json:"key,omitempty"`
	Label           string           `json:"label,omitempty"`
	LogoURL         string           `json:"logo_url,omitempty"`
	Self            string           `json:"self,omitempty"`
	SendTypes       []string         `json:"send_types,omitempty"`
	Summary         string           `json:"summary,omitempty"`
	Type            string           `json:"type,omitempty"`
	URL             string           `json:"url,omitempty"`
}

ExtensionSchema represents an extension schema.

type ExtensionSchemaReference

type ExtensionSchemaReference resourceReference

ExtensionSchemaReference represents a reference to an extension schema

type ExtensionSchemaService

type ExtensionSchemaService service

ExtensionSchemaService handles the communication with extension schemas related methods of the PagerDuty API.

func (*ExtensionSchemaService) Get

Get retrieves information about an extension schema.

func (*ExtensionSchemaService) List

List lists extension schemas.

type ExtensionService

type ExtensionService service

ExtensionService handles the communication with extension related methods of the PagerDuty API.

func (*ExtensionService) Create

func (s *ExtensionService) Create(extension *Extension) (*Extension, *Response, error)

Create creates a new extension.

func (*ExtensionService) Delete

func (s *ExtensionService) Delete(id string) (*Response, error)

Delete removes an existing extension.

func (*ExtensionService) Get

func (s *ExtensionService) Get(id string) (*Extension, *Response, error)

Get retrieves information about an extension.

func (*ExtensionService) List

List lists existing extensions.

func (*ExtensionService) Update

func (s *ExtensionService) Update(id string, extension *Extension) (*Extension, *Response, error)

Update updates an existing extension.

type GetEscalationPolicyOptions

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

GetEscalationPolicyOptions represents options when retrieving an escalation policy.

type GetEscalationRuleOptions

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

GetEscalationRuleOptions represents options when retrieving an escalation rule.

type GetIntegrationOptions

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

GetIntegrationOptions represents options when retrieving a service integration.

type GetMembersOptions

type GetMembersOptions struct {
	Limit    int      `url:"limit,omitempty"`
	More     bool     `url:"more,omitempty"`
	Offset   int      `url:"offset,omitempty"`
	Total    int      `url:"total,omitempty"`
	Includes []string `url:"include,omitempty,brackets"`
}

GetMembersOptions represents options when get member informations in team.

type GetMembersResponse

type GetMembersResponse struct {
	Limit   int       `json:"limit,omitempty"`
	More    bool      `json:"more,omitempty"`
	Offset  int       `json:"offset,omitempty"`
	Total   int       `json:"total,omitempty"`
	Members []*Member `json:"members,omitempty"`
}

GetMembersResponse represents member informations response of a team.

type GetScheduleOptions

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

GetScheduleOptions represents options when retrieving a schedule.

type GetServiceOptions

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

GetServiceOptions represents options when retrieving a service.

type GetUserOptions

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

GetUserOptions represents options when retrieving a user.

type IncidentUrgencyRule

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

IncidentUrgencyRule is the default urgency for new incidents.

type IncidentUrgencyType

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

IncidentUrgencyType are the incidents urgency during or outside support hours.

type Integration

type Integration struct {
	CreatedAt        string            `json:"created_at,omitempty"`
	HTMLURL          string            `json:"html_url,omitempty"`
	ID               string            `json:"id,omitempty"`
	Integration      *Integration      `json:"integration,omitempty"`
	IntegrationEmail string            `json:"integration_email,omitempty"`
	IntegrationKey   string            `json:"integration_key,omitempty"`
	Name             string            `json:"name,omitempty"`
	Self             string            `json:"self,omitempty"`
	Service          *ServiceReference `json:"service,omitempty"`
	Summary          string            `json:"summary,omitempty"`
	Type             string            `json:"type,omitempty"`
	Vendor           *VendorReference  `json:"vendor,omitempty"`
}

Integration represents a service integration.

type IntegrationReference

type IntegrationReference resourceReference

IntegrationReference represents a reference to an integration.

type ListAbilitiesResponse

type ListAbilitiesResponse struct {
	Abilities []string `json:"abilities,omitempty"`
}

ListAbilitiesResponse represents a list response of abilities.

type ListAddonsOptions

type ListAddonsOptions struct {
	Limit      int      `url:"limit,omitempty"`
	More       bool     `url:"more,omitempty"`
	Offset     int      `url:"offset,omitempty"`
	Total      int      `url:"total,omitempty"`
	Filter     string   `url:"filter,omitempty"`
	Include    []string `url:"include,omitempty,brackets"`
	ServiceIDs []string `url:"service_ids,omitempty,brackets"`
}

ListAddonsOptions represents options when listing add-ons.

type ListAddonsResponse

type ListAddonsResponse struct {
	Limit  int      `json:"limit,omitempty"`
	More   bool     `json:"more,omitempty"`
	Offset int      `json:"offset,omitempty"`
	Total  int      `json:"total,omitempty"`
	Addons []*Addon `json:"addons,omitempty"`
}

ListAddonsResponse represents a list response of add-ons.

type ListBusinessServicesResponse

type ListBusinessServicesResponse struct {
	Total            int                `json:"total,omitempty"`
	BusinessServices []*BusinessService `json:"business_services,omitempty"`
	Offset           int                `json:"offset,omitempty"`
	More             bool               `json:"more,omitempty"`
	Limit            int                `json:"limit,omitempty"`
}

ListBusinessServicesResponse represents a list response of business services.

type ListContactMethodsResponse

type ListContactMethodsResponse struct {
	Limit          int              `json:"limit,omitempty"`
	More           bool             `json:"more,omitempty"`
	Offset         int              `json:"offset,omitempty"`
	Total          int              `json:"total,omitempty"`
	ContactMethods []*ContactMethod `json:"contact_methods,omitempty"`
}

ListContactMethodsResponse represents

type ListEscalationPoliciesOptions

type ListEscalationPoliciesOptions struct {
	Limit    int      `url:"limit,omitempty"`
	More     bool     `url:"more,omitempty"`
	Offset   int      `url:"offset,omitempty"`
	Total    int      `url:"total,omitempty"`
	Includes []string `url:"include,omitempty,brackets"`
	Query    string   `url:"query,omitempty"`
	SortBy   string   `url:"sort_by,omitempty"`
	TeamIDs  []string `url:"team_ids,omitempty,brackets"`
	UserIDs  []string `url:"user_ids,omitempty,brackets"`
}

ListEscalationPoliciesOptions represents options when listing escalation policies.

type ListEscalationPoliciesResponse

type ListEscalationPoliciesResponse struct {
	Limit              int                 `json:"limit,omitempty"`
	More               bool                `json:"more,omitempty"`
	Offset             int                 `json:"offset,omitempty"`
	Total              int                 `json:"total,omitempty"`
	EscalationPolicies []*EscalationPolicy `json:"escalation_policies,omitempty"`
}

ListEscalationPoliciesResponse represents a list response of escalation policies.

type ListEscalationRulesResponse

type ListEscalationRulesResponse struct {
	Limit           int               `json:"limit,omitempty"`
	More            bool              `json:"more,omitempty"`
	Offset          int               `json:"offset,omitempty"`
	Total           int               `json:"total,omitempty"`
	EscalationRules []*EscalationRule `json:"escalation_rules,omitempty"`
}

ListEscalationRulesResponse represents a list response of escalation rules.

type ListEventRulesResponse

type ListEventRulesResponse struct {
	ExternalID    string       `json:"external_id,omitempty"`
	ObjectVersion string       `json:"object_version,omitempty"`
	FormatVersion int          `json:"format_version,string,omitempty"`
	EventRules    []*EventRule `json:"rules,omitempty"`
}

ListEventRulesResponse represents a list response of event rules.

type ListExtensionSchemasOptions

type ListExtensionSchemasOptions struct {
	Limit  int    `url:"limit,omitempty"`
	Offset int    `url:"offset,omitempty"`
	Total  int    `url:"total,omitempty"`
	Query  string `url:"query,omitempty"`
}

ListExtensionSchemasOptions represents options when listing extension schemas.

type ListExtensionSchemasResponse

type ListExtensionSchemasResponse struct {
	ExtensionSchemas []*ExtensionSchema `json:"extension_schemas,omitempty"`
	Limit            int                `json:"limit,omitempty"`
	More             bool               `json:"more,omitempty"`
	Offset           int                `json:"offset,omitempty"`
	Total            int                `json:"total,omitempty"`
}

ListExtensionSchemasResponse represents a list response of extension schemas.

type ListExtensionsOptions

type ListExtensionsOptions struct {
	ExtensionObjectID string   `url:"extension_object_id,omitempty"`
	Query             string   `url:"query,omitempty"`
	ExtensionSchemaID string   `url:"extension_schema_id,omitempty"`
	Include           []string `url:"include,omitempty,brackets"`
}

ListExtensionsOptions represents options when listing extensions.

type ListExtensionsResponse

type ListExtensionsResponse struct {
	Limit      int          `json:"limit,omitempty"`
	Extensions []*Extension `json:"extensions,omitempty"`
	More       bool         `json:"more,omitempty"`
	Offset     int          `json:"offset,omitempty"`
	Total      int          `json:"total,omitempty"`
}

ListExtensionsResponse represents a list response of extensions.

type ListMaintenanceWindowsOptions

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

ListMaintenanceWindowsOptions represents options when listing maintenance windows.

type ListMaintenanceWindowsResponse

type ListMaintenanceWindowsResponse struct {
	Limit              int                  `json:"limit,omitempty"`
	MaintenanceWindows []*MaintenanceWindow `json:"maintenance_windows,omitempty"`
	More               bool                 `json:"more,omitempty"`
	Offset             int                  `json:"offset,omitempty"`
	Total              int                  `json:"total,omitempty"`
}

ListMaintenanceWindowsResponse represents a list response of maintenance windows.

type ListOnCallsOptions

type ListOnCallsOptions struct {
	ID    string `url:"id,omitempty"`
	Since string `url:"since,omitempty"`
	Until string `url:"until,omitempty"`
}

ListOnCallsOptions represents options when listing on calls.

type ListOnCallsResponse

type ListOnCallsResponse struct {
	Users []*User `json:"users,omitempty"`
}

ListOnCallsResponse represents a list response of on calls.

type ListOverridesOptions

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

ListOverridesOptions represents options when listing overrides.

type ListOverridesResponse

type ListOverridesResponse struct {
	Limit     int         `json:"limit,omitempty"`
	More      bool        `json:"more,omitempty"`
	Offset    int         `json:"offset,omitempty"`
	Overrides []*Override `json:"overrides,omitempty"`
	Total     int         `json:"total,omitempty"`
}

ListOverridesResponse represents a list response of schedules.

type ListPrioritiesResponse

type ListPrioritiesResponse struct {
	Total      int         `json:"total,omitempty"`
	Offset     int         `json:"offset,omitempty"`
	More       bool        `json:"more,omitempty"`
	Limit      int         `json:"limit,omitempty"`
	Priorities []*Priority `json:"priorities,omitempty"`
}

ListPrioritiesResponse represents a list response of abilities.

type ListRulesetRulesResponse

type ListRulesetRulesResponse struct {
	Total  int            `json:"total,omitempty"`
	Rules  []*RulesetRule `json:"rules,omitempty"`
	Offset int            `json:"offset,omitempty"`
	More   bool           `json:"more,omitempty"`
	Limit  int            `json:"limit,omitempty"`
}

ListRulesetRulesResponse represents a list of rules in a ruleset

type ListRulesetsResponse

type ListRulesetsResponse struct {
	Total    int        `json:"total,omitempty"`
	Rulesets []*Ruleset `json:"rulesets,omitempty"`
	Offset   int        `json:"offset,omitempty"`
	More     bool       `json:"more,omitempty"`
	Limit    int        `json:"limit,omitempty"`
}

ListRulesetsResponse represents a list response of rulesets.

type ListSchedulesOptions

type ListSchedulesOptions struct {
	Limit  int    `url:"limit,omitempty"`
	More   bool   `url:"more,omitempty"`
	Offset int    `url:"offset,omitempty"`
	Query  string `url:"query,omitempty"`
	Total  int    `url:"total,omitempty"`
}

ListSchedulesOptions represents options when listing schedules.

type ListSchedulesResponse

type ListSchedulesResponse struct {
	Limit     int         `json:"limit,omitempty"`
	More      bool        `json:"more,omitempty"`
	Offset    int         `json:"offset,omitempty"`
	Schedules []*Schedule `json:"schedules,omitempty"`
	Total     int         `json:"total,omitempty"`
}

ListSchedulesResponse represents a list response of schedules.

type ListServiceDependencies

type ListServiceDependencies struct {
	Relationships []*ServiceDependency `json:"relationships,omitempty"`
}

ListServiceDependencies represents a list of dependencies for a service

type ListServicesOptions

type ListServicesOptions struct {
	Limit    int      `url:"limit,omitempty"`
	More     bool     `url:"more,omitempty"`
	Offset   int      `url:"offset,omitempty"`
	Total    int      `url:"total,omitempty"`
	Includes []string `url:"include,omitempty,brackets"`
	Query    string   `url:"query,omitempty"`
	SortBy   string   `url:"sort_by,omitempty"`
	TeamIDs  []string `url:"team_ids,omitempty,brackets"`
	TimeZone string   `url:"time_zone,omitempty"`
}

ListServicesOptions represents options when listing services.

type ListServicesResponse

type ListServicesResponse struct {
	Limit    int  `json:"limit,omitempty"`
	More     bool `json:"more,omitempty"`
	Offset   int  `json:"offset,omitempty"`
	Total    int  `json:"total,omitempty"`
	Services []*Service
}

ListServicesResponse represents a list response of services.

type ListTeamsOptions

type ListTeamsOptions struct {
	Limit  int    `url:"limit,omitempty"`
	More   bool   `url:"more,omitempty"`
	Offset int    `url:"offset,omitempty"`
	Total  int    `url:"total,omitempty"`
	Query  string `url:"query,omitempty"`
}

ListTeamsOptions represents options when listing teams.

type ListTeamsResponse

type ListTeamsResponse struct {
	Limit  int     `json:"limit,omitempty"`
	More   bool    `json:"more,omitempty"`
	Offset int     `json:"offset,omitempty"`
	Total  int     `json:"total,omitempty"`
	Teams  []*Team `json:"teams,omitempty"`
}

ListTeamsResponse represents a list response of teams.

type ListUsersOptions

type ListUsersOptions struct {
	Limit   int      `url:"limit,omitempty"`
	More    bool     `url:"more,omitempty"`
	Offset  int      `url:"offset,omitempty"`
	Total   int      `url:"total,omitempty"`
	Include []string `url:"include,omitempty,brackets"`
	Query   string   `url:"query,omitempty"`
	TeamIDs []string `url:"team_ids,omitempty,brackets"`
}

ListUsersOptions represents options when listing users.

type ListUsersResponse

type ListUsersResponse struct {
	Limit  int     `json:"limit,omitempty"`
	More   bool    `json:"more,omitempty"`
	Offset int     `json:"offset,omitempty"`
	Total  int     `json:"total,omitempty"`
	Users  []*User `json:"users,omitempty"`
}

ListUsersResponse represents a list response of users.

type ListVendorsOptions

type ListVendorsOptions struct {
	Limit  int    `url:"limit,omitempty"`
	More   bool   `url:"more,omitempty"`
	Offset int    `url:"offset,omitempty"`
	Total  int    `url:"total,omitempty"`
	Query  string `url:"query,omitempty"`
}

ListVendorsOptions represents options when listing vendors.

type ListVendorsResponse

type ListVendorsResponse struct {
	Limit   int       `json:"limit,omitempty"`
	More    bool      `json:"more,omitempty"`
	Offset  int       `json:"offset,omitempty"`
	Total   int       `json:"total,omitempty"`
	Vendors []*Vendor `json:"vendors,omitempty"`
}

ListVendorsResponse represents a list response of vendors.

type MaintenanceWindow

type MaintenanceWindow struct {
	CreatedBy         *UserReference      `json:"created_by,omitempty"`
	Description       string              `json:"description,omitempty"`
	EndTime           string              `json:"end_time,omitempty"`
	HTMLURL           string              `json:"html_url,omitempty"`
	ID                string              `json:"id,omitempty"`
	MaintenanceWindow *MaintenanceWindow  `json:"maintenance_window,omitempty"`
	Self              string              `json:"self,omitempty"`
	SequenceNumber    int                 `json:"sequence_number,omitempty"`
	Services          []*ServiceReference `json:"services,omitempty"`
	Src               string              `json:"src,omitempty"`
	StartTime         string              `json:"start_time,omitempty"`
	Summary           string              `json:"summary,omitempty"`
	Teams             []*TeamReference    `json:"teams,omitempty"`
	Type              string              `json:"type,omitempty"`
}

MaintenanceWindow represents a PagerDuty maintenance window.

type MaintenanceWindowService

type MaintenanceWindowService service

MaintenanceWindowService handles the communication with add-on related methods of the PagerDuty API.

func (*MaintenanceWindowService) Create

func (s *MaintenanceWindowService) Create(maintenanceWindow *MaintenanceWindow) (*MaintenanceWindow, *Response, error)

Create creates a new maintenancce window.

func (*MaintenanceWindowService) Delete

func (s *MaintenanceWindowService) Delete(id string) (*Response, error)

Delete removes an existing maintenance window.

func (*MaintenanceWindowService) Get

Get retrieves information about a maintenance window.

func (*MaintenanceWindowService) List

List lists existing maintenance windows.

func (*MaintenanceWindowService) Update

func (s *MaintenanceWindowService) Update(id string, maintenanceWindow *MaintenanceWindow) (*MaintenanceWindow, *Response, error)

Update updates an existing maintenance window.

type Member

type Member struct {
	User *UserReference `json:"user,omitempty"`
	Role string         `json:"role,omitempty"`
}

Member represents a team member.

type NotificationRule

type NotificationRule struct {
	NotificationRule    *NotificationRule       `json:"notification_rule,omitempty"`
	ContactMethod       *ContactMethodReference `json:"contact_method,omitempty"`
	HTMLURL             string                  `json:"html_url,omitempty"`
	ID                  string                  `json:"id,omitempty"`
	Self                string                  `json:"self,omitempty"`
	StartDelayInMinutes int                     `json:"start_delay_in_minutes,omitempty"`
	Summary             string                  `json:"summary,omitempty"`
	Type                string                  `json:"type,omitempty"`
	Urgency             string                  `json:"urgency,omitempty"`
}

NotificationRule represents a user notification rule.

type Override

type Override struct {
	Override *Override      `json:"override,omitempty"`
	ID       string         `json:"id,omitempty"`
	Start    string         `json:"start,omitempty"`
	End      string         `json:"end,omitempty"`
	User     *UserReference `json:"user,omitempty"`
}

Override represents an override

type Priority

type Priority struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

Priority represents a priority

type PriorityService

type PriorityService service

PriorityService handles the communication with priority related methods of the PagerDuty API.

func (*PriorityService) List

List lists available priorities.

type PushContactMethodSound

type PushContactMethodSound struct {
	Type string `json:"type,omitempty"`
	File string `json:"file,omitempty"`
}

PushContactMethodSound represents a sound for a push contact method.

type Response

type Response struct {
	*http.Response
}

Response is a wrapper around http.Response

type Restriction

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

Restriction represents a schedule layer restriction.

type RuleActionExtraction

type RuleActionExtraction struct {
	Target string `json:"target,omitempty"`
	Source string `json:"source,omitempty"`
	Regex  string `json:"regex,omitempty"`
}

RuleActionExtraction represents a rule extraction action object

type RuleActionParameter

type RuleActionParameter struct {
	Value string `json:"value,omitempty"`
}

RuleActionParameter represents a generic parameter object on a rule action

type RuleActionSuppress

type RuleActionSuppress struct {
	Value               bool   `json:"value,omitempty"`
	ThresholdValue      int    `json:"threshold_value,omitempty"`
	ThresholdTimeUnit   string `json:"threshold_time_unit,omitempty"`
	ThresholdTimeAmount int    `json:"threshold_time_amount,omitempty"`
}

RuleActionSuppress represents a rule suppress action object

type RuleActions

type RuleActions struct {
	Suppress    *RuleActionSuppress     `json:"suppress,omitempty"`
	Annotate    *RuleActionParameter    `json:"annotate,omitempty"`
	Severity    *RuleActionParameter    `json:"severity,omitempty"`
	Priority    *RuleActionParameter    `json:"priority,omitempty"`
	Route       *RuleActionParameter    `json:"route,omitempty"`
	EventAction *RuleActionParameter    `json:"event_action,omitempty"`
	Extractions []*RuleActionExtraction `json:"extractions,omitempty"`
}

RuleActions represents a rule action

type RuleConditions

type RuleConditions struct {
	Operator          string              `json:"operator,omitempty"`
	RuleSubconditions []*RuleSubcondition `json:"subconditions,omitempty"`
}

RuleConditions represents the conditions field for a Ruleset

type RuleSubcondition

type RuleSubcondition struct {
	Operator   string              `json:"operator,omitempty"`
	Parameters *ConditionParameter `json:"parameters,omitempty"`
}

RuleSubcondition represents a subcondition of a ruleset condition

type RuleTimeFrame

type RuleTimeFrame struct {
	ScheduledWeekly *ScheduledWeekly `json:"scheduled_weekly,omitempty"`
	ActiveBetween   *ActiveBetween   `json:"active_between,omitempty"`
}

RuleTimeFrame represents a time_frame object on the rule object

type Ruleset

type Ruleset struct {
	ID          string         `json:"id,omitempty"`
	Name        string         `json:"name,omitempty"`
	Type        string         `json:"type,omitempty"`
	RoutingKeys []string       `json:"routing_keys,omitempty"`
	Team        *RulesetObject `json:"team,omitempty"`
	Updater     *RulesetObject `json:"updater,omitempty"`
	Creator     *RulesetObject `json:"creator,omitempty"`
}

Ruleset represents a ruleset.

type RulesetObject

type RulesetObject struct {
	Type string `json:"type,omitempty"`
	ID   string `json:"id,omitempty"`
}

RulesetObject represents a generic object that is common within a ruleset object

type RulesetPayload

type RulesetPayload struct {
	Ruleset *Ruleset `json:"ruleset,omitempty"`
}

RulesetPayload represents payload with a ruleset object

type RulesetReference

type RulesetReference resourceReference

RulesetReference represents a reference to a ruleset schema

type RulesetRule

type RulesetRule struct {
	ID         string            `json:"id,omitempty"`
	Position   int               `json:"position,omitempty"`
	Disabled   bool              `json:"disabled,omitempty"`
	Conditions *RuleConditions   `json:"conditions,omitempty"`
	Actions    *RuleActions      `json:"actions,omitempty"`
	Ruleset    *RulesetReference `json:"ruleset,omitempty"`
	Self       string            `json:"self,omitempty"`
	CatchAll   bool              `json:"catch_all,omitempty"`
	TimeFrame  *RuleTimeFrame    `json:"time_frame,omitempty"`
}

RulesetRule represents a Ruleset rule

type RulesetRulePayload

type RulesetRulePayload struct {
	Rule *RulesetRule `json:"rule,omitempty"`
}

RulesetRulePayload represents a payload for ruleset rules

type RulesetService

type RulesetService service

RulesetService handles the communication with rulesets related methods of the PagerDuty API.

func (*RulesetService) Create

func (s *RulesetService) Create(ruleset *Ruleset) (*Ruleset, *Response, error)

Create creates a new ruleset.

func (*RulesetService) CreateRule

func (s *RulesetService) CreateRule(rulesetID string, rule *RulesetRule) (*RulesetRule, *Response, error)

CreateRule for Ruleset

func (*RulesetService) Delete

func (s *RulesetService) Delete(ID string) (*Response, error)

Delete deletes an existing ruleset.

func (*RulesetService) DeleteRule

func (s *RulesetService) DeleteRule(rulesetID, ruleID string) (*Response, error)

DeleteRule deletes an existing rule from the ruleset.

func (*RulesetService) Get

func (s *RulesetService) Get(ID string) (*Ruleset, *Response, error)

Get gets a new ruleset.

func (*RulesetService) GetRule

func (s *RulesetService) GetRule(rulesetID, ruleID string) (*RulesetRule, *Response, error)

GetRule for Ruleset

func (*RulesetService) List

List lists existing rulesets.

func (*RulesetService) ListRules

func (s *RulesetService) ListRules(rulesetID string) (*ListRulesetRulesResponse, *Response, error)

ListRules Lists Event Rules for Ruleset

func (*RulesetService) Update

func (s *RulesetService) Update(ID string, ruleset *Ruleset) (*Ruleset, *Response, error)

Update updates an existing ruleset.

func (*RulesetService) UpdateRule

func (s *RulesetService) UpdateRule(rulesetID, ruleID string, rule *RulesetRule) (*RulesetRule, *Response, error)

UpdateRule for Ruleset

type Schedule

type Schedule struct {
	Description          string                       `json:"description,omitempty"`
	EscalationPolicies   []*EscalationPolicyReference `json:"escalation_policies,omitempty"`
	FinalSchedule        *SubSchedule                 `json:"final_schedule,omitempty"`
	HTMLURL              string                       `json:"html_url,omitempty"`
	ID                   string                       `json:"id,omitempty"`
	Name                 string                       `json:"name,omitempty"`
	OverridesSubSchedule *SubSchedule                 `json:"overrides_subschedule,omitempty"`
	Schedule             *Schedule                    `json:"schedule,omitempty"`
	ScheduleLayers       []*ScheduleLayer             `json:"schedule_layers,omitempty"`
	Self                 string                       `json:"self,omitempty"`
	Summary              string                       `json:"summary,omitempty"`
	TimeZone             string                       `json:"time_zone,omitempty"`
	Type                 string                       `json:"type,omitempty"`
	Users                []*UserReference             `json:"users,omitempty"`
}

Schedule represents a schedule.

type ScheduleLayer

type ScheduleLayer struct {
	End                        string                  `json:"end,omitempty"`
	ID                         string                  `json:"id,omitempty"`
	Name                       string                  `json:"name,omitempty"`
	RenderedCoveragePercentage float64                 `json:"rendered_coverage_percentage,omitempty"`
	RenderedScheduleEntries    []*ScheduleLayerEntry   `json:"rendered_schedule_entries,omitempty"`
	Restrictions               []*Restriction          `json:"restrictions,omitempty"`
	RotationTurnLengthSeconds  int                     `json:"rotation_turn_length_seconds,omitempty"`
	RotationVirtualStart       string                  `json:"rotation_virtual_start,omitempty"`
	Start                      string                  `json:"start,omitempty"`
	Users                      []*UserReferenceWrapper `json:"users,omitempty"`
}

ScheduleLayer represents a schedule layer in a schedule

type ScheduleLayerEntry

type ScheduleLayerEntry struct {
	End   string         `json:"end,omitempty"`
	Start string         `json:"start,omitempty"`
	User  *UserReference `json:"user,omitempty"`
}

ScheduleLayerEntry represents a rendered schedule layer entry.

type ScheduleReference

type ScheduleReference resourceReference

ScheduleReference represents a reference to a schedule.

type ScheduleService

type ScheduleService service

ScheduleService handles the communication with schedule related methods of the PagerDuty API.

func (*ScheduleService) Create

func (s *ScheduleService) Create(schedule *Schedule, o *CreateScheduleOptions) (*Schedule, *Response, error)

Create creates a new schedule.

func (*ScheduleService) CreateOverride

func (s *ScheduleService) CreateOverride(id string, override *Override) (*Override, *Response, error)

CreateOverride creates an override for a specific user covering the specified time range.

func (*ScheduleService) Delete

func (s *ScheduleService) Delete(id string) (*Response, error)

Delete removes an existing schedule.

func (*ScheduleService) DeleteOverride

func (s *ScheduleService) DeleteOverride(id string, overrideID string) (*Response, error)

DeleteOverride deletes an override.

func (*ScheduleService) Get

Get retrieves information about a schedule.

func (*ScheduleService) List

List lists existing schedules.

func (*ScheduleService) ListOnCalls

func (s *ScheduleService) ListOnCalls(scheduleID string, o *ListOnCallsOptions) (*ListOnCallsResponse, *Response, error)

ListOnCalls lists all of the users on call in a given schedule for a given time range.

func (*ScheduleService) ListOverrides

func (s *ScheduleService) ListOverrides(scheduleID string, o *ListOverridesOptions) (*ListOverridesResponse, *Response, error)

ListOverrides lists existing overrides.

func (*ScheduleService) Update

func (s *ScheduleService) Update(id string, schedule *Schedule, o *UpdateScheduleOptions) (*Schedule, *Response, error)

Update updates an existing schedule.

type ScheduledAction

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

ScheduledAction contains scheduled actions for the service.

type ScheduledWeekly

type ScheduledWeekly struct {
	Weekdays  []int  `json:"weekdays,omitempty"`
	Timezone  string `json:"timezone,omitempty"`
	StartTime int    `json:"start_time,omitempty"`
	Duration  int    `json:"duration,omitempty"`
}

ScheduledWeekly represents a time_frame object for scheduling rules weekly

type Service

type Service struct {
	AcknowledgementTimeout *int                       `json:"acknowledgement_timeout"`
	Addons                 []*AddonReference          `json:"addons,omitempty"`
	AlertCreation          string                     `json:"alert_creation,omitempty"`
	AlertGrouping          string                     `json:"alert_grouping,omitempty"`
	AlertGroupingTimeout   *int                       `json:"alert_grouping_timeout,omitempty"`
	AutoResolveTimeout     *int                       `json:"auto_resolve_timeout"`
	CreatedAt              string                     `json:"created_at,omitempty"`
	Description            string                     `json:"description,omitempty"`
	EscalationPolicy       *EscalationPolicyReference `json:"escalation_policy,omitempty"`
	HTMLURL                string                     `json:"html_url,omitempty"`
	ID                     string                     `json:"id,omitempty"`
	IncidentUrgencyRule    *IncidentUrgencyRule       `json:"incident_urgency_rule,omitempty"`
	Integrations           []*IntegrationReference    `json:"integrations,omitempty"`
	LastIncidentTimestamp  string                     `json:"last_incident_timestamp,omitempty"`
	Name                   string                     `json:"name,omitempty"`
	ScheduledActions       []*ScheduledAction         `json:"scheduled_actions,omitempty"`
	Self                   string                     `json:"self,omitempty"`
	Service                *Service                   `json:"service,omitempty"`
	Status                 string                     `json:"status,omitempty"`
	Summary                string                     `json:"summary,omitempty"`
	SupportHours           *SupportHours              `json:"support_hours,omitempty"`
	Teams                  []*TeamReference           `json:"teams,omitempty"`
	Type                   string                     `json:"type,omitempty"`
}

Service represents a service.

type ServiceDependency

type ServiceDependency struct {
	ID                string      `json:"id,omitempty"`
	Type              string      `json:"type,omitempty"`
	SupportingService *ServiceObj `json:"supporting_service,omitempty"`
	DependentService  *ServiceObj `json:"dependent_service,omitempty"`
}

ServiceDependency represents a relationship between a business and technical service

type ServiceDependencyService

type ServiceDependencyService service

ServiceDependencyService handles the communication with service dependency related methods of the PagerDuty API.

func (*ServiceDependencyService) AssociateServiceDependencies

func (s *ServiceDependencyService) AssociateServiceDependencies(dependencies *ListServiceDependencies) (*ListServiceDependencies, *Response, error)

AssociateServiceDependencies Create new dependencies between two services

func (*ServiceDependencyService) DisassociateServiceDependencies

func (s *ServiceDependencyService) DisassociateServiceDependencies(dependencies *ListServiceDependencies) (*ListServiceDependencies, *Response, error)

DisassociateServiceDependencies Disassociate dependencies between two services.

func (*ServiceDependencyService) GetBusinessServiceDependencies

func (s *ServiceDependencyService) GetBusinessServiceDependencies(businessServiceID string) (*ListServiceDependencies, *Response, error)

GetBusinessServiceDependencies gets all immediate dependencies of a business service.

func (*ServiceDependencyService) GetTechnicalServiceDependencies

func (s *ServiceDependencyService) GetTechnicalServiceDependencies(technicalServiceID string) (*ListServiceDependencies, *Response, error)

GetTechnicalServiceDependencies gets all immediate dependencies of a technical service.

type ServiceObj

type ServiceObj struct {
	ID   string `json:"id,omitempty"`
	Type string `json:"type,omitempty"`
}

ServiceObj represents a service object in service relationship

type ServiceReference

type ServiceReference resourceReference

ServiceReference represents a reference to a service.

type ServicesService

type ServicesService service

ServicesService handles the communication with service related methods of the PagerDuty API.

func (*ServicesService) Create

func (s *ServicesService) Create(service *Service) (*Service, *Response, error)

Create creates a new service.

func (*ServicesService) CreateIntegration

func (s *ServicesService) CreateIntegration(serviceID string, integration *Integration) (*Integration, *Response, error)

CreateIntegration creates a new service integration.

func (*ServicesService) Delete

func (s *ServicesService) Delete(id string) (*Response, error)

Delete removes an existing service.

func (*ServicesService) DeleteIntegration

func (s *ServicesService) DeleteIntegration(serviceID, integrationID string) (*Response, error)

DeleteIntegration removes an existing service integration.

func (*ServicesService) Get

Get retrieves information about a service.

func (*ServicesService) GetIntegration

func (s *ServicesService) GetIntegration(serviceID, integrationID string, o *GetIntegrationOptions) (*Integration, *Response, error)

GetIntegration retrieves information about a service integration.

func (*ServicesService) List

List lists existing services.

func (*ServicesService) Update

func (s *ServicesService) Update(id string, service *Service) (*Service, *Response, error)

Update updates an existing service.

func (*ServicesService) UpdateIntegration

func (s *ServicesService) UpdateIntegration(serviceID, integrationID string, integration *Integration) (*Integration, *Response, error)

UpdateIntegration updates an existing service integration.

type SubSchedule

type SubSchedule struct {
	Name                       string                `json:"name,omitempty"`
	RenderedCoveragePercentage float64               `json:"rendered_coverage_percentage,omitempty"`
	RenderedScheduleEntries    []*ScheduleLayerEntry `json:"rendered_schedule_entries,omitempty"`
}

SubSchedule represents a sub-schedule of a schedule.

type SupportHours

type SupportHours struct {
	DaysOfWeek []int  `json:"days_of_week,omitempty"`
	EndTime    string `json:"end_time,omitempty"`
	StartTime  string `json:"start_time,omitempty"`
	TimeZone   string `json:"time_zone,omitempty"`
	Type       string `json:"type,omitempty"`
}

SupportHours are the support hours for the service.

type Team

type Team struct {
	Description string `json:"description,omitempty"`
	HTMLURL     string `json:"html_url,omitempty"`
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Self        string `json:"self,omitempty"`
	Summary     string `json:"summary,omitempty"`
	Team        *Team  `json:"team,omitempty"`
	Type        string `json:"type,omitempty"`
}

Team represents a team.

type TeamReference

type TeamReference resourceReference

TeamReference represents a reference to a team.

type TeamService

type TeamService service

TeamService handles the communication with team related methods of the PagerDuty API.

func (*TeamService) AddEscalationPolicy

func (s *TeamService) AddEscalationPolicy(teamID, escID string) (*Response, error)

AddEscalationPolicy adds an escalation policy to a team.

func (*TeamService) AddUser

func (s *TeamService) AddUser(teamID, userID string) (*Response, error)

AddUser adds a user to a team.

func (*TeamService) AddUserWithRole

func (s *TeamService) AddUserWithRole(teamID, userID string, role string) (*Response, error)

AddUserWithRole adds a user with the specified role (one of observer, manager, or responder[default])

func (*TeamService) Create

func (s *TeamService) Create(team *Team) (*Team, *Response, error)

Create creates a new team.

func (*TeamService) Delete

func (s *TeamService) Delete(id string) (*Response, error)

Delete removes an existing team.

func (*TeamService) Get

func (s *TeamService) Get(id string) (*Team, *Response, error)

Get retrieves information about a team.

func (*TeamService) GetMembers

func (s *TeamService) GetMembers(teamID string, o *GetMembersOptions) (*GetMembersResponse, *Response, error)

GetMembers retrieves information about members on a team.

func (*TeamService) List

List lists existing teams.

func (*TeamService) RemoveEscalationPolicy

func (s *TeamService) RemoveEscalationPolicy(teamID, escID string) (*Response, error)

RemoveEscalationPolicy removes an escalation policy from a team.

func (*TeamService) RemoveUser

func (s *TeamService) RemoveUser(teamID, userID string) (*Response, error)

RemoveUser removes a user from a team.

func (*TeamService) Update

func (s *TeamService) Update(id string, team *Team) (*Team, *Response, error)

Update updates an existing team.

type UpdateScheduleOptions

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

UpdateScheduleOptions represents options when updating a schedule.

type User

type User struct {
	AvatarURL         string                    `json:"avatar_url,omitempty"`
	Color             string                    `json:"color,omitempty"`
	ContactMethods    []*ContactMethodReference `json:"contact_methods,omitempty"`
	Description       string                    `json:"description,omitempty"`
	Email             string                    `json:"email,omitempty"`
	HTMLURL           string                    `json:"html_url,omitempty"`
	ID                string                    `json:"id,omitempty"`
	InvitationSent    bool                      `json:"invitation_sent,omitempty"`
	JobTitle          string                    `json:"job_title,omitempty"`
	Name              string                    `json:"name,omitempty"`
	NotificationRules []*NotificationRule       `json:"notification_rules,omitempty"`
	Role              string                    `json:"role,omitempty"`
	Self              string                    `json:"self,omitempty"`
	Summary           string                    `json:"summary,omitempty"`
	Teams             []*TeamReference          `json:"teams,omitempty"`
	TimeZone          string                    `json:"time_zone,omitempty"`
	Type              string                    `json:"type,omitempty"`
	User              *User                     `json:"user,omitempty"`
}

User represents a user.

type UserReference

type UserReference resourceReference

UserReference represents a reference to a user.

type UserReferenceWrapper

type UserReferenceWrapper struct {
	User *UserReference `json:"user,omitempty"`
}

UserReferenceWrapper is a wrapper around UserReference

type UserService

type UserService service

UserService handles the communication with user related methods of the PagerDuty API.

func (*UserService) Create

func (s *UserService) Create(user *User) (*User, *Response, error)

Create creates a new user.

func (*UserService) CreateContactMethod

func (s *UserService) CreateContactMethod(userID string, contactMethod *ContactMethod) (*ContactMethod, *Response, error)

CreateContactMethod creates a new contact method for a user.

func (*UserService) CreateNotificationRule

func (s *UserService) CreateNotificationRule(userID string, rule *NotificationRule) (*NotificationRule, *Response, error)

CreateNotificationRule creates a new notification rule for a user.

func (*UserService) Delete

func (s *UserService) Delete(id string) (*Response, error)

Delete removes an existing user.

func (*UserService) DeleteContactMethod

func (s *UserService) DeleteContactMethod(userID, contactMethodID string) (*Response, error)

DeleteContactMethod deletes a contact method for a user.

func (*UserService) DeleteNotificationRule

func (s *UserService) DeleteNotificationRule(userID, ruleID string) (*Response, error)

DeleteNotificationRule deletes a notification rule for a user.

func (*UserService) Get

func (s *UserService) Get(id string, o *GetUserOptions) (*User, *Response, error)

Get retrieves information about a user.

func (*UserService) GetContactMethod

func (s *UserService) GetContactMethod(userID string, contactMethodID string) (*ContactMethod, *Response, error)

GetContactMethod retrieves a contact method for a user.

func (*UserService) GetNotificationRule

func (s *UserService) GetNotificationRule(userID string, ruleID string) (*NotificationRule, *Response, error)

GetNotificationRule retrieves a notification rule for a user.

func (*UserService) List

List lists existing users.

func (*UserService) ListContactMethods

func (s *UserService) ListContactMethods(userID string) (*ListContactMethodsResponse, *Response, error)

ListContactMethods lists contact methods for a user.

func (*UserService) Update

func (s *UserService) Update(id string, user *User) (*User, *Response, error)

Update updates an existing user.

func (*UserService) UpdateContactMethod

func (s *UserService) UpdateContactMethod(userID, contactMethodID string, contactMethod *ContactMethod) (*ContactMethod, *Response, error)

UpdateContactMethod updates a contact method for a user.

func (*UserService) UpdateNotificationRule

func (s *UserService) UpdateNotificationRule(userID, ruleID string, rule *NotificationRule) (*NotificationRule, *Response, error)

UpdateNotificationRule updates a notification rulefor a user.

type Vendor

type Vendor struct {
	Description         string  `json:"description,omitempty"`
	GenericServiceType  string  `json:"generic_service_type,omitempty"`
	HTMLURL             string  `json:"html_url,omitempty"`
	ID                  string  `json:"id,omitempty"`
	IntegrationGuideURL string  `json:"integration_guide_url,omitempty"`
	LogoURL             string  `json:"logo_url,omitempty"`
	Name                string  `json:"name,omitempty"`
	Self                string  `json:"self,omitempty"`
	Summary             string  `json:"summary,omitempty"`
	ThumbnailURL        string  `json:"thumbnail_url,omitempty"`
	Type                string  `json:"type,omitempty"`
	Vendor              *Vendor `json:"vendor,omitempty"`
	WebsiteURL          string  `json:"website_url,omitempty"`
}

Vendor represents a vendor.

type VendorReference

type VendorReference resourceReference

VendorReference represents a reference to a vendor

type VendorService

type VendorService service

VendorService handles the communication with vendor related methods of the PagerDuty API.

func (*VendorService) Get

func (s *VendorService) Get(id string) (*Vendor, *Response, error)

Get retrieves information about a vendor.

func (*VendorService) List

List lists existing vendors.

Jump to

Keyboard shortcuts

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