og

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Daily  RotationType = "daily"
	Weekly RotationType = "weekly"
	Hourly RotationType = "hourly"

	User       ParticipantType = "user"
	Team       ParticipantType = "team"
	Escalation ParticipantType = "escalation"
	Schedule   ParticipantType = "schedule"
	None       ParticipantType = "none"

	Monday    Day = "monday"
	Tuesday   Day = "tuesday"
	Wednesday Day = "wednesday"
	Thursday  Day = "thursday"
	Friday    Day = "friday"
	Saturday  Day = "saturday"
	Sunday    Day = "sunday"

	TimeOfDay           RestrictionType = "time-of-day"
	WeekdayAndTimeOfDay RestrictionType = "weekday-and-time-of-day"

	MatchAll           ConditionMatchType = "match-all"
	MatchAnyCondition  ConditionMatchType = "match-any-condition"
	MatchAllConditions ConditionMatchType = "match-all-conditions"

	Months  TimeUnit = "months"
	Weeks   TimeUnit = "weeks"
	Days    TimeUnit = "days"
	Minutes TimeUnit = "minutes"
	Hours   TimeUnit = "hours"

	Message         ConditionFieldType = "message"
	Alias           ConditionFieldType = "alias"
	Description     ConditionFieldType = "description"
	Source          ConditionFieldType = "source"
	Entity          ConditionFieldType = "entity"
	EventType       ConditionFieldType = "eventType"
	Tags            ConditionFieldType = "tags"
	Actions         ConditionFieldType = "actions"
	Details         ConditionFieldType = "details"
	ExtraProperties ConditionFieldType = "extra-properties"
	Recipients      ConditionFieldType = "recipients"
	Teams           ConditionFieldType = "teams"
	Priority        ConditionFieldType = "priority"
	ConversationSub ConditionFieldType = "conversationSubject"
	FromAddress     ConditionFieldType = "from_address"
	FromName        ConditionFieldType = "from_name"
	Subject         ConditionFieldType = "subject"

	Matches                ConditionOperation = "matches"
	Contains               ConditionOperation = "contains"
	StartsWith             ConditionOperation = "starts-with"
	EndsWith               ConditionOperation = "ends-with"
	Equals                 ConditionOperation = "equals"
	ContainsKey            ConditionOperation = "contains-key"
	ContainsValue          ConditionOperation = "contains-value"
	GreaterThan            ConditionOperation = "greater-than"
	LessThan               ConditionOperation = "less-than"
	IsEmpty                ConditionOperation = "is-empty"
	EqualsIgnoreWhitespcae ConditionOperation = "equals-ignore-whitespace"
)

Variables

This section is empty.

Functions

func Hour

func Hour(hour uint32) *uint32

func Minute

func Minute(minute uint32) *uint32

func ValidateConditions

func ValidateConditions(conditions []Condition) error

func ValidateCriteria

func ValidateCriteria(criteria Criteria) error

func ValidateFilter

func ValidateFilter(filter Filter) error

func ValidateRestrictions

func ValidateRestrictions(timeRestriction *TimeRestriction) error

func ValidateRotations

func ValidateRotations(rotations []Rotation) error

Types

type Condition

type Condition struct {
	Field         ConditionFieldType `json:"field,omitempty"`
	IsNot         *bool              `json:"not,omitempty"`
	Operation     ConditionOperation `json:"operation,omitempty"`
	ExpectedValue string             `json:"expectedValue,omitempty"`
	Key           string             `json:"key,omitempty"`
	Order         *int               `json:"order,omitempty"`
}

type ConditionFieldType

type ConditionFieldType string

type ConditionMatchType

type ConditionMatchType string

type ConditionOperation

type ConditionOperation string

type Contact

type Contact struct {
	To              string     `json:"to,omitempty"`
	MethodOfContact MethodType `json:"method,omitempty"`
}

type Criteria

type Criteria struct {
	CriteriaType ConditionMatchType `json:"type"`
	Conditions   []Condition        `json:"conditions,omitempty"`
}

type Day

type Day string

type EscalationCondition

type EscalationCondition string
const (
	IfNotAcked  EscalationCondition = "if-not-acked"
	IfNotClosed EscalationCondition = "if-not-closed"
)

type Filter

type Filter struct {
	ConditionMatchType ConditionMatchType `json:"type,omitempty"`
	Conditions         []Condition        `json:"conditions,omitempty"`
}

type Identifier

type Identifier interface {
	// contains filtered or unexported methods
}

type MethodType

type MethodType string
const (
	Sms    MethodType = "sms"
	Email  MethodType = "email"
	Voice  MethodType = "voice"
	Mobile MethodType = "mobile"
)

type NotifyType

type NotifyType string
const (
	Next     NotifyType = "next"
	Previous NotifyType = "previous"
	Default  NotifyType = "default"
	Users    NotifyType = "users"
	Admins   NotifyType = "admins"
	Random   NotifyType = "random"
	All      NotifyType = "all"
)

type OwnerTeam

type OwnerTeam struct {
	Id   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type Participant

type Participant struct {
	Type     ParticipantType `json:"type, omitempty"`
	Name     string          `json:"name,omitempty"`
	Id       string          `json:"id,omitempty"`
	Username string          `json:"username, omitempty"`
}

type ParticipantType

type ParticipantType string

type Restriction

type Restriction struct {
	StartDay  Day     `json:"startDay,omitempty"`
	StartHour *uint32 `json:"startHour,omitempty"`
	StartMin  *uint32 `json:"startMin,omitempty"`
	EndHour   *uint32 `json:"endHour,omitempty"`
	EndDay    Day     `json:"endDay,omitempty"`
	EndMin    *uint32 `json:"endMin,omitempty"`
}

type RestrictionType

type RestrictionType string

type Rotation

type Rotation struct {
	client.BaseRequest
	Id              string           `json:"id,omitempty"`
	Name            string           `json:"name,omitempty"`
	StartDate       *time.Time       `json:"startDate,omitempty"`
	EndDate         *time.Time       `json:"endDate,omitempty"`
	Type            RotationType     `json:"type,omitempty"`
	Length          uint32           `json:"length,omitempty"`
	Participants    []Participant    `json:"participants,omitempty"`
	TimeRestriction *TimeRestriction `json:"timeRestriction,omitempty"`
}

func (*Rotation) Validate

func (r *Rotation) Validate() error

func (*Rotation) WithParticipant

func (r *Rotation) WithParticipant(participant Participant) *Rotation

func (*Rotation) WithParticipants

func (r *Rotation) WithParticipants(participant ...Participant) *Rotation

func (*Rotation) WithTimeRestriction

func (r *Rotation) WithTimeRestriction(timeRestriction TimeRestriction) *Rotation

type RotationType

type RotationType string

type SendAfter

type SendAfter struct {
	TimeAmount uint32 `json:"timeAmount,omitempty"`
	TimeUnit   string `json:"timeUnit,omitempty"`
}

type Step

type Step struct {
	Contact   Contact    `json:"contact,omitempty"`
	SendAfter *SendAfter `json:"sendAfter,omitempty"`
	Enabled   *bool      `json:"enabled,omitempty"`
}

type TimeRestriction

type TimeRestriction struct {
	Type            RestrictionType `json:"type,omitempty"`
	RestrictionList []Restriction   `json:"restrictions,omitempty"`
	Restriction     Restriction     `json:"restriction,omitempty"`
}

func (*TimeRestriction) WithRestrictions

func (tr *TimeRestriction) WithRestrictions(restrictions ...Restriction) *TimeRestriction

type TimeUnit

type TimeUnit string

Jump to

Keyboard shortcuts

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