Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.6 kB · 57 lines
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758// Code generated by glex; DO NOT EDIT.
// Lexicon schema: place.stream.badge.getValidBadges
package placestream
import ( "context" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
type BadgeGetValidBadges_Output struct { LexiconTypeID string `json:"$type,omitempty"` Badges []BadgeDefs_BadgeView `json:"badges"`}
// RecordTypeID implements glex.Record.func (t *BadgeGetValidBadges_Output) RecordTypeID() string { return "place.stream.badge.getValidBadges"}
func (t *BadgeGetValidBadges_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.badge.getValidBadges" return glex.MarshalCBOR(w, &cp)}
func (t *BadgeGetValidBadges_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// BadgeGetValidBadges calls the XRPC method "place.stream.badge.getValidBadges".//// # Get valid badges for the authenticated user, optionally in the context of a specific streamer's chat//// streamer: Optional DID of the streamer for context-specific badges (mod, vip, etc)func BadgeGetValidBadges(ctx context.Context, c glex.LexClient, streamer string) (*BadgeGetValidBadges_Output, error) { var out BadgeGetValidBadges_Output
params := map[string]interface{}{} if streamer != "" { params["streamer"] = streamer }
if err := c.LexDo(ctx, glex.Query, "", "place.stream.badge.getValidBadges", params, nil, &out); err != nil { return nil, err } return &out, nil}