- Mark Register() and Login() as Deprecated (use Better Auth directly) - Add admin_events.go, members.go, webhooks.go to match backend API - Sync types with backend changes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
30 lines
842 B
Go
30 lines
842 B
Go
package elydora
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
// ListWebhooks retrieves all registered webhooks for the organization.
|
|
func (c *Client) ListWebhooks() (*ListWebhooksResponse, error) {
|
|
var result ListWebhooksResponse
|
|
if err := c.doGet("/v1/webhooks", &result); err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|
|
|
|
// RegisterWebhook registers a new webhook endpoint for the organization.
|
|
func (c *Client) RegisterWebhook(req *RegisterWebhookRequest) (*RegisterWebhookResponse, error) {
|
|
var result RegisterWebhookResponse
|
|
if err := c.doPost("/v1/webhooks", req, &result); err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|
|
|
|
// DeleteWebhook deletes a registered webhook by ID.
|
|
func (c *Client) DeleteWebhook(webhookID string) error {
|
|
return c.doRequest(http.MethodDelete, fmt.Sprintf("/v1/webhooks/%s", webhookID), nil, nil)
|
|
}
|