Skip to content

Kr/deprecations #546

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .changes/unreleased/Docs-20250514-143029.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Docs
body: Update docs on input types to include their default value
time: 2025-05-14T14:30:29.248975-05:00
3 changes: 3 additions & 0 deletions .changes/unreleased/Feature-20250514-144247.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Feature
body: Add `client.CreateOrUpdateAlertSource` and `client.UpdateAlertSourceStatus` to interface with the new generic alert source APIs
time: 2025-05-14T14:42:47.635522-05:00
3 changes: 3 additions & 0 deletions .changes/unreleased/Feature-20250514-145109.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Feature
body: Add `client.InvokeAction` to support triggering actions via the API
time: 2025-05-14T14:51:09.396768-05:00
11 changes: 11 additions & 0 deletions actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,14 @@ func (client *Client) DeleteTriggerDefinition(input string) error {
err := client.Mutate(&m, v, WithName("TriggerDefinitionDelete"))
return HandleErrors(err, m.Payload.Errors)
}

func (client *Client) InvokeAction(input CustomActionsTriggerInvokeInput) error {
var m struct {
Payload BasePayload `graphql:"customActionsTriggerInvoke(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CustomActionsTriggerInvoke"))
return HandleErrors(err, m.Payload.Errors)
}
28 changes: 28 additions & 0 deletions alert_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ func NewAlertSource(kind AlertSourceTypeEnum, id string) *AlertSourceExternalIde
return &output
}

func (client *Client) CreateOrUpdateAlertSource(input AlertSourceInput) (*AlertSource, error) {
var m struct {
Payload struct {
AlertSource AlertSource
Errors []Error
} `graphql:"alertSourceUpsert(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("AlertSourceUpsert"))
return &m.Payload.AlertSource, HandleErrors(err, m.Payload.Errors)
}

func (client *Client) CreateAlertSourceService(input AlertSourceServiceCreateInput) (*AlertSourceService, error) {
var m struct {
Payload AlertSourceServiceCreatePayload `graphql:"alertSourceServiceCreate(input: $input)"`
Expand Down Expand Up @@ -51,6 +65,20 @@ func (client *Client) GetAlertSource(id ID) (*AlertSource, error) {
return &q.Account.AlertSource, HandleErrors(err, nil)
}

func (client *Client) UpdateAlertSourceStatus(input AlertSourceStatusUpdateInput) (*AlertSource, error) {
var m struct {
Payload struct {
AlertSource AlertSource
Errors []Error
} `graphql:"alertSourceStatusUpdate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("AlertSourceStatusUpdate"))
return &m.Payload.AlertSource, HandleErrors(err, m.Payload.Errors)
}

func (client *Client) DeleteAlertSourceService(id ID) error {
var m struct {
Payload BasePayload `graphql:"alertSourceServiceDelete(input: $input)"`
Expand Down
Loading
Loading