-
Notifications
You must be signed in to change notification settings - Fork 504
/
incident_alerts.go
35 lines (33 loc) · 1.03 KB
/
incident_alerts.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
package incidents
import (
"github.com/PagerDuty/go-pagerduty"
"github.com/apache/arrow/go/v15/arrow"
"github.com/cloudquery/plugin-sdk/v4/schema"
"github.com/cloudquery/plugin-sdk/v4/transformers"
)
func IncidentAlerts() *schema.Table {
return &schema.Table{
Name: "pagerduty_incident_alerts",
Description: `https://developer.pagerduty.com/api-reference/4bc42e7ac0c59-list-alerts-for-an-incident`,
Resolver: fetchIncidentAlerts,
Transform: transformers.TransformWithStruct(&pagerduty.IncidentAlert{}, transformers.WithUnwrapAllEmbeddedStructs(), transformers.WithSkipFields("HTMLURL")),
Columns: []schema.Column{
{
Name: "id",
Type: arrow.BinaryTypes.String,
Resolver: schema.PathResolver("ID"),
PrimaryKey: true,
},
{
Name: "created_at",
Type: arrow.FixedWidthTypes.Timestamp_us,
Resolver: schema.PathResolver("CreatedAt"),
},
{
Name: "html_url",
Type: arrow.BinaryTypes.String,
Resolver: schema.PathResolver("HTMLURL"),
},
},
}
}