Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add various all lists #6

Merged
merged 5 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions alertaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ var AlertActionTriggerModes = struct {
Manual: "MANUAL",
}

// AlertActionTriggerModesAll defines alertAction trigger modes list
var AlertActionTriggerModesAll = []string{
AlertActionTriggerModes.Automatic,
AlertActionTriggerModes.Manual,
}

// AlertActionTriggerTypes defines alertAction trigger types
var AlertActionTriggerTypes = struct {
AlertCreated string
Expand Down
44 changes: 40 additions & 4 deletions alertsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,57 @@ var AlertSourceStatuses = struct {
Disabled: "DISABLED",
}

// AlertSourceStatusesAll defines alert source statuses list
var AlertSourceStatusesAll = []string{
AlertSourceStatuses.Pending,
AlertSourceStatuses.AllAccepted,
AlertSourceStatuses.AllResolved,
AlertSourceStatuses.InMaintenance,
AlertSourceStatuses.Disabled,
}

// AlertSourceAlertCreations defines alert source alert creations
var AlertSourceAlertCreations = struct {
// @deprecated
OneIncidentPerEmail string
OneIncidentPerEmailSubject string
OnePendingIncidentAllowed string
OneOpenIncidentAllowed string

OneAlertPerEmail string
OneAlertPerEmailSubject string
OnePendingAlertAllowed string
OneOpenAlertAllowed string
OpenResolveOnExtraction string
}{
OneAlertPerEmail: "ONE_INCIDENT_PER_EMAIL",
OneAlertPerEmailSubject: "ONE_INCIDENT_PER_EMAIL_SUBJECT",
OnePendingAlertAllowed: "ONE_PENDING_INCIDENT_ALLOWED",
OneOpenAlertAllowed: "ONE_OPEN_INCIDENT_ALLOWED",
// @deprecated
OneIncidentPerEmail: "ONE_INCIDENT_PER_EMAIL",
OneIncidentPerEmailSubject: "ONE_INCIDENT_PER_EMAIL_SUBJECT",
OnePendingIncidentAllowed: "ONE_PENDING_INCIDENT_ALLOWED",
OneOpenIncidentAllowed: "ONE_OPEN_INCIDENT_ALLOWED",

OneAlertPerEmail: "ONE_ALERT_PER_EMAIL",
OneAlertPerEmailSubject: "ONE_ALERT_PER_EMAIL_SUBJECT",
OnePendingAlertAllowed: "ONE_PENDING_ALERT_ALLOWED",
OneOpenAlertAllowed: "ONE_OPEN_ALERT_ALLOWED",
OpenResolveOnExtraction: "OPEN_RESOLVE_ON_EXTRACTION",
}

// AlertSourceAlertCreationsAll defines alert source alert creations list
var AlertSourceAlertCreationsAll = []string{
// @deprecated
AlertSourceAlertCreations.OneIncidentPerEmail,
AlertSourceAlertCreations.OneIncidentPerEmailSubject,
AlertSourceAlertCreations.OnePendingIncidentAllowed,
AlertSourceAlertCreations.OneOpenIncidentAllowed,

AlertSourceAlertCreations.OneAlertPerEmail,
AlertSourceAlertCreations.OneAlertPerEmailSubject,
AlertSourceAlertCreations.OnePendingAlertAllowed,
AlertSourceAlertCreations.OneOpenAlertAllowed,
AlertSourceAlertCreations.OpenResolveOnExtraction,
}

// AlertSourceIntegrationTypes defines alert source integration types
var AlertSourceIntegrationTypes = struct {
AmazonCloudWatch string
Expand Down
7 changes: 7 additions & 0 deletions automationrule.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type AutomationRule struct {
SendNotification bool `json:"sendNotification"`
}

// AlertType defines the alert type in an automation rule
var AlertType = struct {
Created string
Accepted string
Expand All @@ -29,6 +30,12 @@ var AlertType = struct {
Accepted: "ACCEPTED",
}

// AlertType defines the alert type list
var AlertTypeAll = []string{
AlertType.Created,
AlertType.Accepted,
}

// CreateAutomationRuleInput represents the input of a CreateAutomationRule operation.
type CreateAutomationRuleInput struct {
_ struct{}
Expand Down
6 changes: 6 additions & 0 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ var ConnectionTriggerModes = struct {
Manual: "MANUAL",
}

// ConnectionTriggerModesAll defines all connection trigger modes
var ConnectionTriggerModesAll = []string{
ConnectionTriggerModes.Automatic,
ConnectionTriggerModes.Manual,
}

// ConnectionTriggerTypes defines connection trigger types
var ConnectionTriggerTypes = struct {
IncidentCreated string
Expand Down
29 changes: 29 additions & 0 deletions incident.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strconv"
)

// Incident definition https://api.ilert.com/api-docs/#tag/Incidents
type Incident struct {
ID int64 `json:"id"`
Summary string `json:"summary"`
Expand All @@ -22,22 +23,26 @@ type Incident struct {
AffectedTeams []TeamShort `json:"affectedTeams,omitempty"`
}

// AffectedServices defines affected services
type AffectedServices struct {
Impact string `json:"impact"`
Service Service `json:"service"`
}

// Subscriber defines a subscriber
type Subscriber struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
}

// UIMenuItem defines the ui menu item
type UIMenuItem struct {
ID int64 `json:"id"`
Label string `json:"label"`
}

// Affected defines affected entities on incident
type Affected struct {
StatusPagesInfo UIMenuItem `json:"statusPagesInfo"`
PrivateStatusPages int64 `json:"privateStatusPages"`
Expand All @@ -46,6 +51,7 @@ type Affected struct {
PublicSubscribers int64 `json:"publicSubscribers"`
}

// IncidentInclude defines incident includes
var IncidentInclude = struct {
Subscribed string
AffectedTeams string
Expand All @@ -56,6 +62,14 @@ var IncidentInclude = struct {
History: "history",
}

// IncidentIncludeAll defines incident includes list
var IncidentIncludeAll = []string{
IncidentInclude.Subscribed,
IncidentInclude.AffectedTeams,
IncidentInclude.History,
}

// IncidentType defines incident type
var IncidentType = struct {
User string
Team string
Expand All @@ -64,6 +78,13 @@ var IncidentType = struct {
Team: "TEAM",
}

// IncidentTypeAll defines incident type list
var IncidentTypeAll = []string{
IncidentType.User,
IncidentType.Team,
}

// IncidentStatus defines incident status
var IncidentStatus = struct {
Investigating string
Identified string
Expand All @@ -76,6 +97,14 @@ var IncidentStatus = struct {
Resolved: "RESOLVED",
}

// IncidentStatusAll defines incident status list
var IncidentStatusAll = []string{
IncidentStatus.Investigating,
IncidentStatus.Identified,
IncidentStatus.Monitoring,
IncidentStatus.Resolved,
}

// CreateIncidentInput represents the input of a CreateIncident operation.
type CreateIncidentInput struct {
_ struct{}
Expand Down
18 changes: 18 additions & 0 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ServiceOutage struct {
Until string `json:"until"` // Date time string in ISO format
}

// ServiceStatus defines services status
var ServiceStatus = struct {
Operational string
UnderMaintenance string
Expand All @@ -55,6 +56,16 @@ var ServiceStatus = struct {
MajorOutage: "MAJOR_OUTAGE",
}

// ServiceStatusAll defines services status list
var ServiceStatusAll = []string{
ServiceStatus.Operational,
ServiceStatus.UnderMaintenance,
ServiceStatus.Degraded,
ServiceStatus.PartialOutage,
ServiceStatus.MajorOutage,
}

// ServiceInclude defines included services
var ServiceInclude = struct {
Subscribed string
Uptime string
Expand All @@ -65,6 +76,13 @@ var ServiceInclude = struct {
Incidents: "incidents",
}

// ServiceIncludeAll defines included services list
var ServiceIncludeAll = []string{
ServiceInclude.Subscribed,
ServiceInclude.Uptime,
ServiceInclude.Incidents,
}

// CreateServiceInput represents the input of a CreateService operation.
type CreateServiceInput struct {
_ struct{}
Expand Down
8 changes: 7 additions & 1 deletion statuspage.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type StatusPage struct {
Subscribed bool `json:"subscribed,omitempty"`
}

// StatusPage defines status-page visibility
// StatusPageVisibility defines status page visibility
var StatusPageVisibility = struct {
Public string
Private string
Expand All @@ -41,6 +41,12 @@ var StatusPageVisibility = struct {
Private: "PRIVATE",
}

// StatusPageVisibilityAll defines status page visibility list
var StatusPageVisibilityAll = []string{
StatusPageVisibility.Public,
StatusPageVisibility.Private,
}

// CreateStatusPageInput represents the input of a CreateStatusPage operation.
type CreateStatusPageInput struct {
_ struct{}
Expand Down
28 changes: 27 additions & 1 deletion uptimemonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,21 @@ var UptimeMonitorStatuses = struct {
Unknown string
}{
Up: "up",
Down: "Down",
Down: "down",
Warning: "warn",
Paused: "paused",
Unknown: "unknown",
}

// UptimeMonitorStatusesAll defines uptime monitor statuses list
var UptimeMonitorStatusesAll = []string{
UptimeMonitorStatuses.Up,
UptimeMonitorStatuses.Down,
UptimeMonitorStatuses.Warning,
UptimeMonitorStatuses.Paused,
UptimeMonitorStatuses.Unknown,
}

// UptimeMonitorRegions defines uptime monitor regions
var UptimeMonitorRegions = struct {
EU string
Expand All @@ -59,17 +68,34 @@ var UptimeMonitorRegions = struct {
US: "US",
}

// UptimeMonitorRegionsAll defines uptime monitor regions list
var UptimeMonitorRegionsAll = []string{
UptimeMonitorRegions.EU,
UptimeMonitorRegions.US,
}

// UptimeMonitorCheckTypes defines uptime monitor check types
var UptimeMonitorCheckTypes = struct {
HTTP string
Ping string
TCP string
UDP string
SSL string
}{
HTTP: "http",
Ping: "ping",
TCP: "tcp",
UDP: "udp",
SSL: "ssl",
}

// UptimeMonitorCheckTypesAll defines uptime monitor check types list
var UptimeMonitorCheckTypesAll = []string{
UptimeMonitorCheckTypes.HTTP,
UptimeMonitorCheckTypes.Ping,
UptimeMonitorCheckTypes.TCP,
UptimeMonitorCheckTypes.UDP,
UptimeMonitorCheckTypes.SSL,
}

// CreateUptimeMonitorInput represents the input of a CreateUptimeMonitor operation.
Expand Down
33 changes: 33 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ var UserRole = struct {
Stakeholder: "STAKEHOLDER",
}

// UserRoleAll defines user roles list
var UserRoleAll = []string{
UserRole.User,
UserRole.Admin,
UserRole.Stakeholder,
}

// UserAlertUpdateStates defines user alert update states
var UserAlertUpdateStates = struct {
Accepted string
Expand All @@ -69,6 +76,13 @@ var UserAlertUpdateStates = struct {
Resolved: "RESOLVED",
}

// UserAlertUpdateStatesAll defines user alert update states list
var UserAlertUpdateStatesAll = []string{
UserAlertUpdateStates.Accepted,
UserAlertUpdateStates.Escalated,
UserAlertUpdateStates.Resolved,
}

// UserAlertUpdateNotificationTypes defines user alert update notification types
var UserAlertUpdateNotificationTypes = struct {
Email string
Expand All @@ -77,13 +91,26 @@ var UserAlertUpdateNotificationTypes = struct {
SMS string
VoiceMobile string
VoiceLandline string
WhatsApp string
}{
Email: "EMAIL",
PushAndroid: "ANDROID",
PushIPhone: "IPHONE",
SMS: "SMS",
VoiceMobile: "VOICE_MOBILE",
VoiceLandline: "VOICE_LANDLINE",
WhatsApp: "WHATSAPP",
}

// UserAlertUpdateNotificationTypesAll defines user alert update notification types list
var UserAlertUpdateNotificationTypesAll = []string{
UserAlertUpdateNotificationTypes.Email,
UserAlertUpdateNotificationTypes.PushAndroid,
UserAlertUpdateNotificationTypes.PushIPhone,
UserAlertUpdateNotificationTypes.SMS,
UserAlertUpdateNotificationTypes.VoiceMobile,
UserAlertUpdateNotificationTypes.VoiceLandline,
UserAlertUpdateNotificationTypes.WhatsApp,
}

// UserLanguage defines user language
Expand All @@ -95,6 +122,12 @@ var UserLanguage = struct {
German: "de",
}

// UserLanguageAll defines user language list
var UserLanguageAll = []string{
UserLanguage.English,
UserLanguage.German,
}

// CreateUserInput represents the input of a CreateUser operation.
type CreateUserInput struct {
_ struct{}
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ilert

// Version package version
const Version = "v2.0.0"
const Version = "v2.0.2"