- Toggle - Toggle webhook notifications for the workspace
Toggle webhook notifications for the workspace
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
ctx := context.Background()
res, err := s.WebhookNotifications.Toggle(ctx, operations.ToggleWebhookNotificationsRequestBody{
Enabled: hookdeck.Bool(false),
SourceID: hookdeck.String("voluptatibus"),
Topics: []shared.TopicsValue{
shared.TopicsValueEventSuccessful,
shared.TopicsValueDeprecatedAttemptFailed,
shared.TopicsValueIssueUpdated,
shared.TopicsValueIssueOpened,
},
})
if err != nil {
log.Fatal(err)
}
if res.ToggleWebhookNotifications != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ToggleWebhookNotificationsRequestBody | ✔️ | The request object to use for the request. |