|
| 1 | +package signals |
| 2 | + |
| 3 | +import "time" |
| 4 | + |
| 5 | +// Signal is the api response to signals and signals operations. |
| 6 | +type Signal struct { |
| 7 | + // CreatedAt is the created date and time the event was created in ISO 8601 format. |
| 8 | + CreatedAt time.Time `json:"created_at"` |
| 9 | + // Description is the user created description of the signal |
| 10 | + Description string `json:"description"` |
| 11 | + // Name is the user created name of the signal. |
| 12 | + Name string `json:"name"` |
| 13 | + // ReferenceID is the reference ID of the signal. |
| 14 | + ReferenceID string `json:"reference_id"` |
| 15 | + // Scope is the scope that the signal applies to |
| 16 | + Scope Scope `json:"scope"` |
| 17 | + // SignalID is the ID of the signal (auto generated). |
| 18 | + SignalID string `json:"id"` |
| 19 | + // UpdatedAt is the date and time in ISO 8601 format. |
| 20 | + UpdatedAt time.Time `json:"updated_at"` |
| 21 | +} |
| 22 | + |
| 23 | +// Signals is the API response structure for the list Signals operation. |
| 24 | +type Signals struct { |
| 25 | + // Data is the list of returned signals. |
| 26 | + Data []Signal `json:"data"` |
| 27 | + // Meta is the information for total signals. |
| 28 | + Meta MetaSignals `json:"meta"` |
| 29 | +} |
| 30 | + |
| 31 | +// MetaSignals is a subset of the signals response structure. |
| 32 | +type MetaSignals struct { |
| 33 | + // Limit is the limit of signals. |
| 34 | + Limit int `json:"limit"` |
| 35 | + // Total is the sum of signals. |
| 36 | + Total int `json:"total"` |
| 37 | +} |
| 38 | + |
| 39 | +// Scope is the definition of the scope that a signal applies to. |
| 40 | +type Scope struct { |
| 41 | + // Type is the type of scope |
| 42 | + Type string `json:"type"` |
| 43 | + // AppliesTo defines what scope the signal applies to. |
| 44 | + AppliesTo []string `json:"applies_to"` |
| 45 | +} |
| 46 | + |
| 47 | +// Reason is the signal that corresponds to the reason an event was triggered. |
| 48 | +type Reason struct { |
| 49 | + // Signal ID is the ID of the signal that triggered the event |
| 50 | + SignalID string `json:"signal_id"` |
| 51 | + // Count is the number of times this signal was detected |
| 52 | + Count int `json:"count"` |
| 53 | +} |
0 commit comments