Files
Elydora-Open-Source/sdks/go/webhooks.go
T
雷电芽衣 bc6983a62e chore(oss): audit the server package and resync the SDK mirrors
Split the 657-line operation service into eor, submit, and verify
modules, add the AGENT_REVOKED and KEY_RETIRED codes the Backend already
emits, and condense every multi-line comment. Mirror Node, Python, and
Go at 2.1.0 with the deep-health 503, non-idempotent retry, rotation
grace, and path-encoding fixes. Document which routes and response
fields the self-hosted server does not provide.

Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
2026-09-03 20:48:20 -04:00

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