Share one request, decode, and error path across the client, public endpoints, and export download; align types with the Backend contract and split types_api.go. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
17 lines
427 B
Go
17 lines
427 B
Go
package elydora
|
|
|
|
import "fmt"
|
|
|
|
// ListAdminEvents retrieves recent administrative events; limit 0 uses the server default.
|
|
func (c *Client) ListAdminEvents(limit int) (*ListAdminEventsResponse, error) {
|
|
path := "/v1/admin/events"
|
|
if limit > 0 {
|
|
path = fmt.Sprintf("%s?limit=%d", path, limit)
|
|
}
|
|
var result ListAdminEventsResponse
|
|
if err := c.doGet(path, &result); err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|