// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.server.listWebhooks package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type ServerListWebhooks_Output struct { LexiconTypeID string `json:"$type,omitempty"` // cursor: A cursor for pagination, if there are more results. Cursor *string `json:"cursor,omitempty"` Webhooks []ServerDefs_Webhook `json:"webhooks"` } // RecordTypeID implements glex.Record. func (t *ServerListWebhooks_Output) RecordTypeID() string { return "place.stream.server.listWebhooks" } func (t *ServerListWebhooks_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "place.stream.server.listWebhooks" return glex.MarshalCBOR(w, &cp) } func (t *ServerListWebhooks_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // ServerListWebhooks calls the XRPC method "place.stream.server.listWebhooks". // // List webhooks for the authenticated user. // // active: Filter webhooks by active status. // cursor: An optional cursor for pagination. // event: Filter webhooks that handle this event type. // limit: The number of webhooks to return. func ServerListWebhooks(ctx context.Context, c glex.LexClient, active *bool, cursor string, event string, limit *int64) (*ServerListWebhooks_Output, error) { var out ServerListWebhooks_Output params := map[string]interface{}{} if active != nil { params["active"] = *active } if cursor != "" { params["cursor"] = cursor } if event != "" { params["event"] = event } if limit != nil { params["limit"] = *limit } if err := c.LexDo(ctx, glex.Query, "", "place.stream.server.listWebhooks", params, nil, &out); err != nil { return nil, err } return &out, nil }