Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
4.3 kB · 121 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122// Code generated by glex; DO NOT EDIT.
// Lexicon schema: place.stream.badge.defs
package placestream
import ( "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
// BadgeDefs_BadgeIssuanceView is a "badgeIssuanceView" in the place.stream.badge.defs schema.//// A resolved view of a badge issuance, including def fields for display.type BadgeDefs_BadgeIssuanceView struct { LexiconTypeID string `json:"$type,omitempty"` BadgeType string `json:"badgeType"` // description: Description from the badge definition. Description *string `json:"description,omitempty"` // imageUrl: Resolved image URL for the badge icon. ImageUrl *string `json:"imageUrl,omitempty"` // issuanceCid: CID of the place.stream.badge.issuance record. IssuanceCid *string `json:"issuanceCid,omitempty"` // issuanceUri: AT URI of the place.stream.badge.issuance record. IssuanceUri string `json:"issuanceUri"` // issuer: DID of the badge issuer. Issuer string `json:"issuer"` // name: Display name from the badge definition. Name *string `json:"name,omitempty"` // selected: Whether this badge is currently in the user's chat profile selection. Selected *bool `json:"selected,omitempty"`}
// RecordTypeID implements glex.Record.func (t *BadgeDefs_BadgeIssuanceView) RecordTypeID() string { return "place.stream.badge.defs#badgeIssuanceView"}
func (t *BadgeDefs_BadgeIssuanceView) 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.defs#badgeIssuanceView" return glex.MarshalCBOR(w, &cp)}
func (t *BadgeDefs_BadgeIssuanceView) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// BadgeDefs_BadgeSlot is a "badgeSlot" in the place.stream.badge.defs schema.//// A display slot containing available issuance-based badges and which one (if any) is currently selected.type BadgeDefs_BadgeSlot struct { LexiconTypeID string `json:"$type,omitempty"` // available: All badges available for this slot. Available []BadgeDefs_BadgeIssuanceView `json:"available"` // selected: The currently selected badge in this slot, if any. Selected *BadgeDefs_BadgeIssuanceView `json:"selected,omitempty"`}
// RecordTypeID implements glex.Record.func (t *BadgeDefs_BadgeSlot) RecordTypeID() string { return "place.stream.badge.defs#badgeSlot" }
func (t *BadgeDefs_BadgeSlot) 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.defs#badgeSlot" return glex.MarshalCBOR(w, &cp)}
func (t *BadgeDefs_BadgeSlot) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// BadgeDefs_BadgeView is a "badgeView" in the place.stream.badge.defs schema.//// View of a badge record, with fields resolved for display. If the DID in issuer is not the current streamplace node, the signature field shall be required.type BadgeDefs_BadgeView struct { LexiconTypeID string `json:"$type,omitempty"` BadgeType string `json:"badgeType"` // description: Description from the badge definition. Description *string `json:"description,omitempty"` // imageUrl: Resolved image URL for the badge icon. ImageUrl *string `json:"imageUrl,omitempty"` // issuer: DID of the badge issuer. Issuer string `json:"issuer"` // name: Display name from the badge definition. Name *string `json:"name,omitempty"` // recipient: DID of the badge recipient. Recipient string `json:"recipient"` // signature: TODO: Cryptographic signature of the badge (of a place.stream.key). Signature *string `json:"signature,omitempty"`}
// RecordTypeID implements glex.Record.func (t *BadgeDefs_BadgeView) RecordTypeID() string { return "place.stream.badge.defs#badgeView" }
func (t *BadgeDefs_BadgeView) 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.defs#badgeView" return glex.MarshalCBOR(w, &cp)}
func (t *BadgeDefs_BadgeView) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}