generated from khulnasoft/khulnasoft-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
events.go
116 lines (89 loc) · 3.5 KB
/
events.go
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Package events provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT.
package events
import (
"time"
"github.com/gofrs/uuid"
)
// Defines values for EventSeverity.
const (
Alert EventSeverity = "alert"
Critical EventSeverity = "critical"
Debug EventSeverity = "debug"
Emergency EventSeverity = "emergency"
Error EventSeverity = "error"
Informational EventSeverity = "informational"
Warning EventSeverity = "warning"
Success EventSeverity = "success"
)
// Defines values for EventStatus.
const (
Read EventStatus = "read"
Unread EventStatus = "unread"
)
// CreatedAt Timestamp when the resource was created.
type CreatedAt = time.Time
// DeletedAt Timestamp when the resource was deleted.
type DeletedAt = time.Time
// Event Defines model for event_trackers
type Event struct {
// ActedUpon UUID of the entity on which the event was performed.
ActedUpon uuid.UUID `db:"acted_upon" json:"acted_upon"`
// Action Action taken on the resource.
Action string `db:"action" json:"action"`
// Category Resource name on which the operation is invoked.
Category string `db:"category" json:"category"`
// CreatedAt Timestamp when the resource was created.
CreatedAt CreatedAt `db:"created_at" json:"created_at"`
// DeletedAt Timestamp when the resource was deleted.
DeletedAt *DeletedAt `db:"deleted_at" json:"deleted_at,omitempty"`
// Description A summary/receipt of event that occurred.
Description string `db:"description" json:"description"`
ID ID `db:"id" json:"id"`
// Metadata Contains meaningful information, specific to the type of event.
// Structure of metadata can be different for different events.
Metadata map[string]interface{} `db:"metadata" json:"metadata" gorm:"type:bytes;serializer:json"`
OperationID OperationID `db:"operation_id" json:"operation_id"`
// Severity A set of seven standard event levels.
Severity EventSeverity `db:"severity" json:"severity"`
// Status Status for the event.
Status EventStatus `db:"status" json:"status"`
SystemID SystemID `db:"system_id" json:"system_id"`
// UpdatedAt Timestamp when the resource was updated.
UpdatedAt UpdatedAt `db:"updated_at" json:"updated_at"`
UserID *UserID `db:"user_id" json:"user_id,omitempty"`
}
// EventSeverity A set of seven standard event levels.
type EventSeverity string
// EventStatus Status for the event.
type EventStatus string
// EventsFilter defines model for events_filter.
type EventsFilter struct {
Action []string `json:"action"`
Category []string `json:"category"`
Limit int `json:"limit"`
Offset int `json:"offset"`
// Order order of sort asc/desc, default is asc
Order string `json:"order"`
Provider []string `json:"provider"`
Search string `json:"search"`
Status EventStatus `json:"status"`
Severity []string `json:"severity"`
// SortOn Field on which records are sorted
SortOn string `json:"sort_on"`
// ActedUpon UUID of the entity on which the event was performed.
ActedUpon []string `json:"acted_upon"`
}
// ID defines model for id.
type ID = uuid.UUID
// OperationID defines model for operation_id.
type OperationID = uuid.UUID
// SystemID defines model for system_id.
type SystemID = uuid.UUID
// Time defines model for time.
type Time = time.Time
// UpdatedAt Timestamp when the resource was updated.
type UpdatedAt = time.Time
// UserID defines model for user_uuid.
type UserID = uuid.UUID