// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.server.createWebhook package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type ServerCreateWebhook_Input struct { LexiconTypeID string `json:"$type,omitempty"` // active: Whether this webhook should be active upon creation. Active *bool `json:"active,omitempty"` // description: A description of what this webhook is used for. Description *string `json:"description,omitempty"` // events: The types of events this webhook should receive. Events []string `json:"events"` // muteWords: Words to filter out from chat messages. Messages containing any of these words will not be forwarded. MuteWords []string `json:"muteWords,omitempty"` // name: A user-friendly name for this webhook. Name *string `json:"name,omitempty"` // prefix: Text to prepend to webhook messages. Prefix *string `json:"prefix,omitempty"` // rewrite: Text replacement rules for webhook messages. Rewrite []ServerDefs_RewriteRule `json:"rewrite,omitempty"` // suffix: Text to append to webhook messages. Suffix *string `json:"suffix,omitempty"` // url: The webhook URL where events will be sent. Url string `json:"url"` } // RecordTypeID implements glex.Record. func (t *ServerCreateWebhook_Input) RecordTypeID() string { return "place.stream.server.createWebhook" } func (t *ServerCreateWebhook_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.server.createWebhook" return glex.MarshalCBOR(w, &cp) } func (t *ServerCreateWebhook_Input) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } type ServerCreateWebhook_Output struct { LexiconTypeID string `json:"$type,omitempty"` Webhook ServerDefs_Webhook `json:"webhook"` } // RecordTypeID implements glex.Record. func (t *ServerCreateWebhook_Output) RecordTypeID() string { return "place.stream.server.createWebhook" } func (t *ServerCreateWebhook_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.server.createWebhook" return glex.MarshalCBOR(w, &cp) } func (t *ServerCreateWebhook_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // ServerCreateWebhook calls the XRPC method "place.stream.server.createWebhook". // // Create a new webhook for receiving Streamplace events. func ServerCreateWebhook(ctx context.Context, c glex.LexClient, input *ServerCreateWebhook_Input) (*ServerCreateWebhook_Output, error) { var out ServerCreateWebhook_Output if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.server.createWebhook", nil, input, &out); err != nil { return nil, err } return &out, nil }