// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.moderation.createBlock package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type ModerationCreateBlock_Input struct { LexiconTypeID string `json:"$type,omitempty"` // reason: Optional reason for the block. Reason *string `json:"reason,omitempty"` // streamer: The DID of the streamer whose chat this block applies to. Streamer string `json:"streamer"` // subject: The DID of the user being blocked from chat. Subject string `json:"subject"` } // RecordTypeID implements glex.Record. func (t *ModerationCreateBlock_Input) RecordTypeID() string { return "place.stream.moderation.createBlock" } func (t *ModerationCreateBlock_Input) 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.moderation.createBlock" return glex.MarshalCBOR(w, &cp) } func (t *ModerationCreateBlock_Input) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } type ModerationCreateBlock_Output struct { LexiconTypeID string `json:"$type,omitempty"` // cid: The CID of the created block record. Cid string `json:"cid"` // uri: The AT-URI of the created block record. Uri string `json:"uri"` } // RecordTypeID implements glex.Record. func (t *ModerationCreateBlock_Output) RecordTypeID() string { return "place.stream.moderation.createBlock" } func (t *ModerationCreateBlock_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.moderation.createBlock" return glex.MarshalCBOR(w, &cp) } func (t *ModerationCreateBlock_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // ModerationCreateBlock calls the XRPC method "place.stream.moderation.createBlock". // // Create a block (ban) on behalf of a streamer. Requires 'ban' permission. Creates an app.bsky.graph.block record in the streamer's repository. func ModerationCreateBlock(ctx context.Context, c glex.LexClient, input *ModerationCreateBlock_Input) (*ModerationCreateBlock_Output, error) { var out ModerationCreateBlock_Output if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.createBlock", nil, input, &out); err != nil { return nil, err } return &out, nil }