// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.multistream.listTargets package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type MultistreamListTargets_Output struct { LexiconTypeID string `json:"$type,omitempty"` Cursor *string `json:"cursor,omitempty"` Targets []MultistreamDefs_TargetView `json:"targets"` } // RecordTypeID implements glex.Record. func (t *MultistreamListTargets_Output) RecordTypeID() string { return "place.stream.multistream.listTargets" } func (t *MultistreamListTargets_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.multistream.listTargets" return glex.MarshalCBOR(w, &cp) } func (t *MultistreamListTargets_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // MultistreamListTargets calls the XRPC method "place.stream.multistream.listTargets". // // List a range of targets for rebroadcasting a Streamplace stream. // // limit: The number of targets to return. func MultistreamListTargets(ctx context.Context, c glex.LexClient, cursor string, limit *int64) (*MultistreamListTargets_Output, error) { var out MultistreamListTargets_Output params := map[string]interface{}{} if cursor != "" { params["cursor"] = cursor } if limit != nil { params["limit"] = *limit } if err := c.LexDo(ctx, glex.Query, "", "place.stream.multistream.listTargets", params, nil, &out); err != nil { return nil, err } return &out, nil } // MultistreamListTargets_Record is a "record" in the place.stream.multistream.listTargets schema. type MultistreamListTargets_Record struct { LexiconTypeID string `json:"$type,omitempty"` Cid string `json:"cid"` Uri string `json:"uri"` Value *glex.LexiconTypeDecoder `json:"value"` } // RecordTypeID implements glex.Record. func (t *MultistreamListTargets_Record) RecordTypeID() string { return "place.stream.multistream.listTargets#record" } func (t *MultistreamListTargets_Record) 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.multistream.listTargets#record" return glex.MarshalCBOR(w, &cp) } func (t *MultistreamListTargets_Record) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }