Skip to content

Latest commit

 

History

History
executable file
·
66 lines (50 loc) · 3.23 KB

File metadata and controls

executable file
·
66 lines (50 loc) · 3.23 KB

WebhookNotifications

Available Operations

  • Toggle - Toggle webhook notifications for the workspace

Toggle

Toggle webhook notifications for the workspace

Example Usage

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
    }
}

Parameters

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.

Response

*operations.ToggleWebhookNotificationsResponse, error