// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.server.updateWebhook package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type ServerUpdateWebhook_Input struct { LexiconTypeID string `json:"$type,omitempty"` // active: Whether this webhook should be active. 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,omitempty"` // id: The ID of the webhook to update. Id string `json:"id"` // 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,omitempty"` } // RecordTypeID implements glex.Record. func (t *ServerUpdateWebhook_Input) RecordTypeID() string { return "place.stream.server.updateWebhook" } func (t *ServerUpdateWebhook_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.updateWebhook" return glex.MarshalCBOR(w, &cp) } func (t *ServerUpdateWebhook_Input) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } type ServerUpdateWebhook_Output struct { LexiconTypeID string `json:"$type,omitempty"` Webhook ServerDefs_Webhook `json:"webhook"` } // RecordTypeID implements glex.Record. func (t *ServerUpdateWebhook_Output) RecordTypeID() string { return "place.stream.server.updateWebhook" } func (t *ServerUpdateWebhook_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.updateWebhook" return glex.MarshalCBOR(w, &cp) } func (t *ServerUpdateWebhook_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // ServerUpdateWebhook calls the XRPC method "place.stream.server.updateWebhook". // // Update an existing webhook configuration. func ServerUpdateWebhook(ctx context.Context, c glex.LexClient, input *ServerUpdateWebhook_Input) (*ServerUpdateWebhook_Output, error) { var out ServerUpdateWebhook_Output if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.server.updateWebhook", nil, input, &out); err != nil { return nil, err } return &out, nil }