package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.Webhooks.UpdateWebhookEndpoint(ctx, "<value>", components.WebhookEndpointUpdate{
URL: polargo.String("https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0"),
Secret: polargo.String("f_z6mfSpxkjogyw3FkA2aH2gYE5huxruNf34MpdWMcA"),
})
if err != nil {
log.Fatal(err)
}
if res.WebhookEndpoint != nil {
// handle response
}
}