escalation

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

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

func (*Client) Create

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

func (*Client) Delete

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

func (*Client) Get

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

func (*Client) List

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

func (*Client) Update

func (c *Client) Update(context context.Context, request *UpdateRequest) (*UpdateResult, error)

type CreateRequest

type CreateRequest struct {
	client.BaseRequest
	Name        string         `json:"name,omitempty"`
	Description string         `json:"description,omitempty"`
	Rules       []RuleRequest  `json:"rules,omitempty"`
	OwnerTeam   *og.OwnerTeam  `json:"ownerTeam,omitempty"`
	Repeat      *RepeatRequest `json:"repeat,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 CreateResult

type CreateResult struct {
	client.ResultMetadata
	Result  string            `json:"result,omitempty"`
	Message string            `json:"message,omitempty"`
	Errors  map[string]string `json:"errors,omitempty"`
	Id      string            `json:"id,omitempty"`
	Name    string            `json:"name,omitempty"`
}

type DeleteRequest

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

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 DeleteResult

type DeleteResult struct {
	client.ResultMetadata
	Result  string `json:"result,omitempty"`
	Message string `json:"message,omitempty"`
}

type Escalation

type Escalation struct {
	Id          string        `json:"id"`
	Name        string        `json:"name"`
	Description string        `json:"description,omitempty"`
	Rules       []Rule        `json:"rules,omitempty"`
	OwnerTeam   *og.OwnerTeam `json:"ownerTeam,omitempty"`
	Repeat      *Repeat       `json:"repeat,omitempty"`
}

type EscalationDelay

type EscalationDelay struct {
	TimeUnit   og.TimeUnit `json:"timeUnit,omitempty"`
	TimeAmount uint32      `json:"timeAmount"`
}

type EscalationDelayRequest

type EscalationDelayRequest struct {
	TimeAmount uint32 `json:"timeAmount"`
}

type GetRequest

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

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
	Escalation
}

type Identifier

type Identifier string
const (
	Name Identifier = "name"
	Id   Identifier = "id"
)

type ListResult

type ListResult struct {
	client.ResultMetadata
	Escalations []Escalation `json:"data,omitempty"`
}

type Repeat

type Repeat struct {
	WaitInterval         uint32 `json:"waitInterval,omitempty"`
	Count                uint32 `json:"count,omitempty"`
	ResetRecipientStates bool   `json:"resetRecipientStates,omitempty"`
	CloseAlertAfterAll   bool   `json:"closeAlertAfterAll,omitempty"`
}

type RepeatRequest

type RepeatRequest struct {
	WaitInterval         uint32 `json:"waitInterval,omitempty"`
	Count                uint32 `json:"count,omitempty"`
	ResetRecipientStates *bool  `json:"resetRecipientStates,omitempty"`
	CloseAlertAfterAll   *bool  `json:"closeAlertAfterAll,omitempty"`
}

type Rule

type Rule struct {
	Condition  og.EscalationCondition `json:"condition,omitempty"`
	NotifyType og.NotifyType          `json:"notifyType,omitempty"`
	Recipient  og.Participant         `json:"recipient,omitempty"`
	Delay      EscalationDelay        `json:"delay,omitempty"`
}

type RuleRequest

type RuleRequest struct {
	Condition  og.EscalationCondition `json:"condition,omitempty"`
	NotifyType og.NotifyType          `json:"notifyType,omitempty"`
	Recipient  og.Participant         `json:"recipient,omitempty"`
	Delay      EscalationDelayRequest `json:"delay,omitempty"`
}

type UpdateRequest

type UpdateRequest struct {
	client.BaseRequest
	Name           string         `json:"name,omitempty"`
	Description    string         `json:"description,omitempty"`
	Rules          []RuleRequest  `json:"rules,omitempty"`
	OwnerTeam      *og.OwnerTeam  `json:"ownerTeam,omitempty"`
	Repeat         *RepeatRequest `json:"repeat,omitempty"`
	IdentifierType Identifier
	Identifier     string
}

func (*UpdateRequest) Method

func (r *UpdateRequest) Method() string

func (*UpdateRequest) RequestParams

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

func (*UpdateRequest) ResourcePath

func (r *UpdateRequest) ResourcePath() string

func (*UpdateRequest) Validate

func (r *UpdateRequest) Validate() error

type UpdateResult

type UpdateResult struct {
	client.ResultMetadata
	Result  string            `json:"result,omitempty"`
	Message string            `json:"message,omitempty"`
	Errors  map[string]string `json:"errors,omitempty"`
	Id      string            `json:"id,omitempty"`
	Name    string            `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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