summaryrefslogtreecommitdiffstats
path: root/pkg/icingadb/v1/notification.go
blob: 31bdbbf6ac238d1eca82b3ed394152ce3aadcdf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package v1

import (
	"github.com/icinga/icingadb/pkg/contracts"
	"github.com/icinga/icingadb/pkg/types"
)

type Notification struct {
	EntityWithChecksum    `json:",inline"`
	EnvironmentMeta       `json:",inline"`
	NameCiMeta            `json:",inline"`
	HostId                types.Binary             `json:"host_id"`
	ServiceId             types.Binary             `json:"service_id"`
	NotificationcommandId types.Binary             `json:"notificationcommand_id"`
	TimesBegin            types.Int                `json:"times_begin"`
	TimesEnd              types.Int                `json:"times_end"`
	NotificationInterval  uint32                   `json:"notification_interval"`
	TimeperiodId          types.Binary             `json:"timeperiod_id"`
	States                types.NotificationStates `json:"states"`
	Types                 types.NotificationTypes  `json:"types"`
	ZoneId                types.Binary             `json:"zone_id"`
}

type NotificationUser struct {
	EntityWithoutChecksum `json:",inline"`
	EnvironmentMeta       `json:",inline"`
	NotificationId        types.Binary `json:"notification_id"`
	UserId                types.Binary `json:"user_id"`
}

type NotificationUsergroup struct {
	EntityWithoutChecksum `json:",inline"`
	EnvironmentMeta       `json:",inline"`
	NotificationId        types.Binary `json:"notification_id"`
	UsergroupId           types.Binary `json:"usergroup_id"`
}

type NotificationRecipient struct {
	EntityWithoutChecksum `json:",inline"`
	EnvironmentMeta       `json:",inline"`
	NotificationId        types.Binary `json:"notification_id"`
	UserId                types.Binary `json:"user_id"`
	UsergroupId           types.Binary `json:"usergroup_id"`
}

type NotificationCustomvar struct {
	CustomvarMeta  `json:",inline"`
	NotificationId types.Binary `json:"notification_id"`
}

func NewNotification() contracts.Entity {
	return &Notification{}
}

func NewNotificationUser() contracts.Entity {
	return &NotificationUser{}
}

func NewNotificationUsergroup() contracts.Entity {
	return &NotificationUsergroup{}
}

func NewNotificationRecipient() contracts.Entity {
	return &NotificationRecipient{}
}

func NewNotificationCustomvar() contracts.Entity {
	return &NotificationCustomvar{}
}

// Assert interface compliance.
var (
	_ contracts.Initer = (*Notification)(nil)
)