// Code generated by glex; DO NOT EDIT. // Lexicon schema: app.bsky.graph.verification package appbsky import ( "encoding/json" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { glex.RegisterType("app.bsky.graph.verification", &GraphVerification{}) } // Record declaring a verification relationship between two accounts. Verifications are only considered valid by an app if issued by an account the app considers trusted. type GraphVerification struct { LexiconTypeID string `json:"$type,omitempty"` // createdAt: Date of when the verification was created. CreatedAt string `json:"createdAt"` // displayName: Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying. DisplayName string `json:"displayName"` // handle: Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying. Handle string `json:"handle"` // subject: DID of the subject the verification applies to. Subject string `json:"subject"` } // RecordTypeID implements glex.Record. func (t *GraphVerification) RecordTypeID() string { return "app.bsky.graph.verification" } // MarshalJSON stamps the $type field, like MarshalCBOR does. The value // receiver operates on a copy, so the record is never mutated and both // GraphVerification and *GraphVerification marshal with $type. func (t GraphVerification) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "app.bsky.graph.verification" type alias GraphVerification return json.Marshal((alias)(t)) } func (t *GraphVerification) 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 = "app.bsky.graph.verification" return glex.MarshalCBOR(w, &cp) } func (t *GraphVerification) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }