incident

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Id   IdentifierType = "id"
	Tiny IdentifierType = "tiny"

	User ResponderType = "user"
	Team ResponderType = "team"

	P1 Priority = "P1"
	P2 Priority = "P2"
	P3 Priority = "P3"
	P4 Priority = "P4"
	P5 Priority = "P5"

	Asc  Order = "asc"
	Desc Order = "desc"

	CreatedAt SortField = "createdAt"
	TinyId    SortField = "tinyId"
	Message   SortField = "message"
	Status    SortField = "status"
	IsSeen    SortField = "isSeen"
	Owner     SortField = "owner"
)

Variables

This section is empty.

Functions

func ValidatePriority

func ValidatePriority(priority Priority) error

Types

type AddDetailsRequest

type AddDetailsRequest struct {
	client.BaseRequest
	Identifier IdentifierType
	Id         string
	Note       string            `json:"note,omitempty"`
	Details    map[string]string `json:"details"`
}

func (*AddDetailsRequest) Method

func (r *AddDetailsRequest) Method() string

func (*AddDetailsRequest) RequestParams

func (r *AddDetailsRequest) RequestParams() map[string]string

func (*AddDetailsRequest) ResourcePath

func (r *AddDetailsRequest) ResourcePath() string

func (*AddDetailsRequest) Validate

func (r *AddDetailsRequest) Validate() error

type AddNoteRequest

type AddNoteRequest struct {
	client.BaseRequest
	Id         string
	Identifier IdentifierType
	Note       string `json:"note"`
}

func (*AddNoteRequest) Method

func (r *AddNoteRequest) Method() string

func (*AddNoteRequest) RequestParams

func (r *AddNoteRequest) RequestParams() map[string]string

func (*AddNoteRequest) ResourcePath

func (r *AddNoteRequest) ResourcePath() string

func (*AddNoteRequest) Validate

func (r *AddNoteRequest) Validate() error

type AddResponderRequest

type AddResponderRequest struct {
	client.BaseRequest
	Identifier IdentifierType
	Id         string      `json:"incidentId"`
	Note       string      `json:"note"`
	Responders []Responder `json:"responder"`
}

func (*AddResponderRequest) Method

func (r *AddResponderRequest) Method() string

func (*AddResponderRequest) RequestParams

func (r *AddResponderRequest) RequestParams() map[string]string

func (*AddResponderRequest) ResourcePath

func (r *AddResponderRequest) ResourcePath() string

func (*AddResponderRequest) Validate

func (r *AddResponderRequest) Validate() error

type AddTagsRequest

type AddTagsRequest struct {
	client.BaseRequest
	Identifier IdentifierType
	Id         string
	Note       string   `json:"note"`
	Tags       []string `json:"tags"`
}

func (*AddTagsRequest) Method

func (r *AddTagsRequest) Method() string

func (*AddTagsRequest) RequestParams

func (r *AddTagsRequest) RequestParams() map[string]string

func (*AddTagsRequest) ResourcePath

func (r *AddTagsRequest) ResourcePath() string

func (*AddTagsRequest) Validate

func (r *AddTagsRequest) Validate() error

type AsyncResult

type AsyncResult struct {
	client.ResultMetadata
	Result string `json:"result"`
}

type Client

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

func NewClient

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

func (*Client) AddDetails

func (c *Client) AddDetails(context context.Context, request *AddDetailsRequest) (*AsyncResult, error)

func (*Client) AddNote

func (c *Client) AddNote(context context.Context, request *AddNoteRequest) (*AsyncResult, error)

func (*Client) AddResponder

func (c *Client) AddResponder(context context.Context, request *AddResponderRequest) (*AsyncResult, error)

func (*Client) AddTags

func (c *Client) AddTags(context context.Context, request *AddTagsRequest) (*AsyncResult, error)

func (*Client) Close

func (c *Client) Close(context context.Context, request *CloseRequest) (*AsyncResult, error)

func (*Client) Create

func (c *Client) Create(context context.Context, request *CreateRequest) (*AsyncResult, error)

func (*Client) Delete

func (c *Client) Delete(context context.Context, request *DeleteRequest) (*AsyncResult, error)

func (*Client) Get

func (c *Client) Get(context context.Context, request *GetRequest) (*GetResult, error)

func (*Client) GetRequestStatus

func (c *Client) GetRequestStatus(context context.Context, request *RequestStatusRequest) (*RequestStatusResult, error)

func (*Client) List

func (c *Client) List(context context.Context, request *ListRequest) (*ListResult, error)

func (*Client) ListLogs

func (c *Client) ListLogs(context context.Context, request *ListLogsRequest) (*ListLogsResult, error)

func (*Client) ListNotes

func (c *Client) ListNotes(context context.Context, request *ListNotesRequest) (*ListNotesResult, error)

func (*Client) RemoveDetails

func (c *Client) RemoveDetails(context context.Context, request *RemoveDetailsRequest) (*AsyncResult, error)

func (*Client) RemoveTags

func (c *Client) RemoveTags(context context.Context, request *RemoveTagsRequest) (*AsyncResult, error)

func (*Client) UpdateDescription

func (c *Client) UpdateDescription(context context.Context, request *UpdateDescriptionRequest) (*AsyncResult, error)

func (*Client) UpdateMessage

func (c *Client) UpdateMessage(context context.Context, request *UpdateMessageRequest) (*AsyncResult, error)

func (*Client) UpdatePriority

func (c *Client) UpdatePriority(context context.Context, request *UpdatePriorityRequest) (*AsyncResult, error)

type CloseRequest

type CloseRequest struct {
	client.BaseRequest
	Id         string
	Identifier IdentifierType
	Note       string `json:"note,omitempty"`
}

func (*CloseRequest) Method

func (r *CloseRequest) Method() string

func (*CloseRequest) RequestParams

func (r *CloseRequest) RequestParams() map[string]string

func (*CloseRequest) ResourcePath

func (r *CloseRequest) ResourcePath() string

func (*CloseRequest) Validate

func (r *CloseRequest) Validate() error

type CreateRequest

type CreateRequest struct {
	client.BaseRequest
	Message            string            `json:"message"`
	Description        string            `json:"description,omitempty"`
	Responders         []Responder       `json:"responders,omitempty"`
	Tags               []string          `json:"description,omitempty"`
	Details            map[string]string `json:"details,omitempty"`
	Priority           Priority          `json:"priority,omitempty"`
	Note               string            `json:"note,omitempty"`
	ServiceId          string            `json:"serviceId"`
	StatusPageEntity   *StatusPageEntity `json:"statusPageEntry,omitempty"`
	NotifyStakeholders *bool             `json:"notifyStakeholders,omitempty"`
}

func (*CreateRequest) Method

func (r *CreateRequest) Method() string

func (*CreateRequest) ResourcePath

func (r *CreateRequest) ResourcePath() string

func (*CreateRequest) Validate

func (r *CreateRequest) Validate() error

type DeleteRequest

type DeleteRequest struct {
	client.BaseRequest
	Id         string
	Identifier IdentifierType
}

func (*DeleteRequest) Method

func (r *DeleteRequest) Method() string

func (*DeleteRequest) RequestParams

func (r *DeleteRequest) RequestParams() map[string]string

func (*DeleteRequest) ResourcePath

func (r *DeleteRequest) ResourcePath() string

func (*DeleteRequest) Validate

func (r *DeleteRequest) Validate() error

type GetRequest

type GetRequest struct {
	client.BaseRequest
	Id         string
	Identifier IdentifierType
}

func (*GetRequest) Method

func (r *GetRequest) Method() string

func (*GetRequest) RequestParams

func (r *GetRequest) RequestParams() map[string]string

func (*GetRequest) ResourcePath

func (r *GetRequest) ResourcePath() string

func (*GetRequest) Validate

func (r *GetRequest) Validate() error

type GetResult

type GetResult struct {
	client.ResultMetadata
	Incident
}

type IdentifierType

type IdentifierType string

type Incident

type Incident struct {
	Id              string            `json:"id"`
	ServiceId       string            `json:"serviceId"`
	TinyId          string            `json:"tinyId"`
	Message         string            `json:"message"`
	Status          string            `json:"status"`
	Tags            []string          `json:"tags"`
	CreatedAt       time.Time         `json:"createdAt"`
	UpdatedAt       time.Time         `json:"updatedAt"`
	Priority        Priority          `json:"priority"`
	OwnerTeam       string            `json:"ownerTeam"`
	Responders      []Responder       `json:"responders"`
	ExtraProperties map[string]string `json:"extraProperties"`
}

type ListLogsRequest

type ListLogsRequest struct {
	client.BaseRequest
	Identifier IdentifierType
	Id         string
	Limit      int
	Offset     int
	Order      Order
	Direction  string
}

func (*ListLogsRequest) Method

func (r *ListLogsRequest) Method() string

func (*ListLogsRequest) RequestParams

func (r *ListLogsRequest) RequestParams() map[string]string

func (*ListLogsRequest) ResourcePath

func (r *ListLogsRequest) ResourcePath() string

func (*ListLogsRequest) Validate

func (r *ListLogsRequest) Validate() error

type ListLogsResult

type ListLogsResult struct {
	client.ResultMetadata
	Logs   []LogResult `json:"data"`
	Paging Paging      `json:"paging"`
}

type ListNotesRequest

type ListNotesRequest struct {
	client.BaseRequest
	Identifier IdentifierType
	Id         string
	Limit      int
	Offset     int
	Order      Order
	Direction  string
}

func (*ListNotesRequest) Method

func (r *ListNotesRequest) Method() string

func (*ListNotesRequest) RequestParams

func (r *ListNotesRequest) RequestParams() map[string]string

func (*ListNotesRequest) ResourcePath

func (r *ListNotesRequest) ResourcePath() string

func (*ListNotesRequest) Validate

func (r *ListNotesRequest) Validate() error

type ListNotesResult

type ListNotesResult struct {
	client.ResultMetadata
	Notes  []NoteResult `json:"data"`
	Paging Paging       `json:"paging"`
}

type ListRequest

type ListRequest struct {
	client.BaseRequest
	Limit  int
	Sort   SortField
	Offset int
	Order  Order
	Query  string
}

func (*ListRequest) Method

func (r *ListRequest) Method() string

func (*ListRequest) RequestParams

func (r *ListRequest) RequestParams() map[string]string

func (*ListRequest) ResourcePath

func (r *ListRequest) ResourcePath() string

func (*ListRequest) Validate

func (r *ListRequest) Validate() error

type ListResult

type ListResult struct {
	client.ResultMetadata
	Incidents []Incident `json:"data"`
	Paging    Paging     `json:"paging"`
}

type LogResult

type LogResult struct {
	Log       string    `json:"log"`
	Type      string    `json:"type"`
	Owner     string    `json:"owner"`
	CreatedAt time.Time `json:"createdAt"`
	Offset    string    `json:"offset"`
}

type NoteResult

type NoteResult struct {
	Note      string    `json:"note"`
	Owner     string    `json:"owner"`
	CreatedAt time.Time `json:"createdAt"`
	Offset    string    `json:"offset"`
}

type Order

type Order string

type Paging

type Paging struct {
	Next  string `json:"next"`
	Prev  string `json:"prev"`
	First string `json:"first"`
	Last  string `json:"last"`
}

type Priority

type Priority string

type RemoveDetailsRequest

type RemoveDetailsRequest struct {
	client.BaseRequest
	Identifier IdentifierType
	Id         string
	Note       string
	Keys       []string
}

func (*RemoveDetailsRequest) Method

func (r *RemoveDetailsRequest) Method() string

func (*RemoveDetailsRequest) RequestParams

func (r *RemoveDetailsRequest) RequestParams() map[string]string

func (*RemoveDetailsRequest) ResourcePath

func (r *RemoveDetailsRequest) ResourcePath() string

func (*RemoveDetailsRequest) Validate

func (r *RemoveDetailsRequest) Validate() error

type RemoveTagsRequest

type RemoveTagsRequest struct {
	client.BaseRequest
	Identifier IdentifierType
	Id         string
	Note       string
	Tags       []string
}

func (*RemoveTagsRequest) Method

func (r *RemoveTagsRequest) Method() string

func (*RemoveTagsRequest) RequestParams

func (r *RemoveTagsRequest) RequestParams() map[string]string

func (*RemoveTagsRequest) ResourcePath

func (r *RemoveTagsRequest) ResourcePath() string

func (*RemoveTagsRequest) Validate

func (r *RemoveTagsRequest) Validate() error

type RequestStatusRequest

type RequestStatusRequest struct {
	client.BaseRequest
	Id string
}

func (*RequestStatusRequest) Method

func (r *RequestStatusRequest) Method() string

func (*RequestStatusRequest) ResourcePath

func (r *RequestStatusRequest) ResourcePath() string

func (*RequestStatusRequest) Validate

func (r *RequestStatusRequest) Validate() error

type RequestStatusResult

type RequestStatusResult struct {
	client.ResultMetadata
	Success       bool   `json:"success"`
	Action        string `json:"action"`
	ProcessedAt   string `json:"processedAt"`
	IntegrationId string `json:"integrationId"`
	IsSuccess     bool   `json:"isSuccess"`
	Status        string `json:"status"`
	IncidentId    string `json:"incidentId"`
}

type Responder

type Responder struct {
	Type ResponderType `json:"type, omitempty"`
	Name string        `json:"name,omitempty"`
	Id   string        `json:"id,omitempty"`
}

type ResponderType

type ResponderType string

type SortField

type SortField string

type StatusPageEntity

type StatusPageEntity struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
}

type UpdateDescriptionRequest

type UpdateDescriptionRequest struct {
	client.BaseRequest
	Identifier  IdentifierType
	Id          string
	Description string `json:"description"`
}

func (*UpdateDescriptionRequest) Method

func (r *UpdateDescriptionRequest) Method() string

func (*UpdateDescriptionRequest) RequestParams

func (r *UpdateDescriptionRequest) RequestParams() map[string]string

func (*UpdateDescriptionRequest) ResourcePath

func (r *UpdateDescriptionRequest) ResourcePath() string

func (*UpdateDescriptionRequest) Validate

func (r *UpdateDescriptionRequest) Validate() error

type UpdateMessageRequest

type UpdateMessageRequest struct {
	client.BaseRequest
	Identifier IdentifierType
	Id         string
	Message    string `json:"message"`
}

func (*UpdateMessageRequest) Method

func (r *UpdateMessageRequest) Method() string

func (*UpdateMessageRequest) RequestParams

func (r *UpdateMessageRequest) RequestParams() map[string]string

func (*UpdateMessageRequest) ResourcePath

func (r *UpdateMessageRequest) ResourcePath() string

func (*UpdateMessageRequest) Validate

func (r *UpdateMessageRequest) Validate() error

type UpdatePriorityRequest

type UpdatePriorityRequest struct {
	client.BaseRequest
	Identifier IdentifierType
	Id         string
	Priority   Priority `json:"priority"`
}

func (*UpdatePriorityRequest) Method

func (r *UpdatePriorityRequest) Method() string

func (*UpdatePriorityRequest) RequestParams

func (r *UpdatePriorityRequest) RequestParams() map[string]string

func (*UpdatePriorityRequest) ResourcePath

func (r *UpdatePriorityRequest) ResourcePath() string

func (*UpdatePriorityRequest) Validate

func (r *UpdatePriorityRequest) Validate() error

Jump to

Keyboard shortcuts

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