gen

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gen provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountLinkEvent

type AccountLinkEvent struct {
	// Id Stable across retries and polls; Muster handles each id once. Printable ASCII without spaces, so that it can travel as the `webhook-id` header.
	Id string `json:"id"`

	// OccurredAt When it happened in the messenger, or when the bridge learned of it.
	OccurredAt time.Time   `json:"occurred_at"`
	Token      string      `json:"token"`
	Type       interface{} `json:"type"`
	User       Person      `json:"user"`
}

AccountLinkEvent defines model for AccountLinkEvent.

type AnswerEventJSONRequestBody

type AnswerEventJSONRequestBody = AnswerInput

AnswerEventJSONRequestBody defines body for AnswerEvent for application/json ContentType.

type AnswerEventParams

type AnswerEventParams struct {
	// IdempotencyKey Identifies the request across retries; a repeated key with the same token returns the first result without creating anything again. Keys are scoped per token.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`
}

AnswerEventParams defines parameters for AnswerEvent.

type AnswerInput

type AnswerInput struct {
	EventId string `json:"event_id"`

	// Text Plain text; a pop-up may shorten it.
	Text string `json:"text"`
}

AnswerInput defines model for AnswerInput.

type AnswerShown

type AnswerShown struct {
	Replayed bool `json:"replayed"`

	// ShownAs Where the person sees the answer; `notification` is told in the call or in the reply to the message of a notification.
	ShownAs AnswerShownShownAs `json:"shown_as"`
}

AnswerShown defines model for AnswerShown.

type AnswerShownShownAs

type AnswerShownShownAs string

AnswerShownShownAs Where the person sees the answer; `notification` is told in the call or in the reply to the message of a notification.

const (
	AnswerShownShownAsDirect       AnswerShownShownAs = "direct"
	AnswerShownShownAsEphemeral    AnswerShownShownAs = "ephemeral"
	AnswerShownShownAsNotification AnswerShownShownAs = "notification"
	AnswerShownShownAsPopup        AnswerShownShownAs = "popup"
	AnswerShownShownAsThread       AnswerShownShownAs = "thread"
)

Defines values for AnswerShownShownAs.

func (AnswerShownShownAs) Valid

func (e AnswerShownShownAs) Valid() bool

Valid indicates whether the value is a known member of the AnswerShownShownAs enum.

type BridgeEventJSONRequestBody

type BridgeEventJSONRequestBody = Event

BridgeEventJSONRequestBody defines body for BridgeEvent for application/json ContentType.

type BridgeEventParams

type BridgeEventParams struct {
	// WebhookId The event's `id`, kept across retries.
	WebhookId string `json:"webhook-id"`

	// WebhookTimestamp Unix time of this attempt, in seconds.
	WebhookTimestamp string `json:"webhook-timestamp"`

	// WebhookSignature `v1,<base64 HMAC-SHA256>`; several signatures separated by spaces are allowed while a secret is rotated.
	WebhookSignature string `json:"webhook-signature"`
}

BridgeEventParams defines parameters for BridgeEvent.

type Button

type Button struct {
	// Data Opaque, signed by Muster; return it unchanged with the press.
	Data  string `json:"data"`
	Label string `json:"label"`

	// Style A hint; the bridge maps it to the closest style its messenger has, or shows a plain button.
	Style ButtonStyle `json:"style"`
}

Button defines model for Button.

type ButtonStyle

type ButtonStyle string

ButtonStyle A hint; the bridge maps it to the closest style its messenger has, or shows a plain button.

const (
	Danger  ButtonStyle = "danger"
	Neutral ButtonStyle = "neutral"
	Primary ButtonStyle = "primary"
	Success ButtonStyle = "success"
)

Defines values for ButtonStyle.

func (ButtonStyle) Valid

func (e ButtonStyle) Valid() bool

Valid indicates whether the value is a known member of the ButtonStyle enum.

type Capabilities

type Capabilities struct {
	// Buttons The bridge shows buttons and reports presses on them.
	Buttons *struct {
		DataMaxBytes int `json:"data_max_bytes"`

		// MaxPerMessage Muster sends at most this many, dropping Snooze buttons first: the Snooze presets, then the durations from the longest.
		MaxPerMessage int `json:"max_per_message"`
		MaxPerRow     int `json:"max_per_row"`

		// Styles The style hints the messenger can show as such; the bridge maps the others to the closest one, or shows a plain button.
		Styles []ButtonStyle `json:"styles"`
	} `json:"buttons,omitempty"`

	// Delete The bot can delete its own messages (unused by Muster L1).
	Delete *struct {
		MaxAgeSeconds nullable.Nullable[int] `json:"max_age_seconds"`
	} `json:"delete,omitempty"`

	// DeletionEvents The bridge reports `message_deleted` when a message of the bot is deleted in the messenger.
	DeletionEvents *bool `json:"deletion_events,omitempty"`

	// DirectMessages The bot can send direct messages, which Account links by code need.
	DirectMessages *struct {
		// BotCanStart Whether the bot can write to a person who never wrote to it.
		BotCanStart bool `json:"bot_can_start"`
	} `json:"direct_messages,omitempty"`

	// EveryoneMentions The mentions of everyone in the chat that the bridge's messenger has, by their symbolic names. Muster sends only those listed here, each as a `mentions` entry of the kind `everyone`; missing or empty, none.
	EveryoneMentions *[]CapabilitiesEveryoneMentions `json:"everyone_mentions,omitempty"`

	// GroupMentions The bridge renders a group mention that Muster sends as a `mentions` entry of the kind `group`; the Team mentions and group entries of a Destination, and the `mention "group"` tokens of a template, need it. Missing or false, Muster offers no group mention for the bridge's Connections and sends none for a template's token.
	GroupMentions *bool `json:"group_mentions,omitempty"`

	// NativeMentions Mention markers become the messenger's own mentions, which notify the person.
	NativeMentions *bool `json:"native_mentions,omitempty"`

	// PrivateAnswers How the bridge can show an answer to one person only: an ephemeral message, a pop-up (short plain text), or both.
	PrivateAnswers *[]CapabilitiesPrivateAnswers `json:"private_answers,omitempty"`

	// QuietMessages The messenger can post a new message without notifying anyone (`notify` false).
	QuietMessages *bool `json:"quiet_messages,omitempty"`

	// StatusColor The messenger can colour a message by `color`; otherwise the bridge shows `emoji`.
	StatusColor *bool `json:"status_color,omitempty"`

	// ThreadMessages The bridge reports people's messages in Threads of the bot's messages — every one, or only those that mention the bot. Text commands need it.
	ThreadMessages *CapabilitiesThreadMessages `json:"thread_messages,omitempty"`
}

Capabilities The optional features of the bridge. A missing member means the feature is not offered.

type CapabilitiesEveryoneMentions

type CapabilitiesEveryoneMentions string

CapabilitiesEveryoneMentions defines model for Capabilities.EveryoneMentions.

const (
	EveryoneMentionAll      CapabilitiesEveryoneMentions = "all"
	EveryoneMentionChannel  CapabilitiesEveryoneMentions = "channel"
	EveryoneMentionEveryone CapabilitiesEveryoneMentions = "everyone"
	EveryoneMentionHere     CapabilitiesEveryoneMentions = "here"
)

Defines values for CapabilitiesEveryoneMentions.

func (CapabilitiesEveryoneMentions) Valid

Valid indicates whether the value is a known member of the CapabilitiesEveryoneMentions enum.

type CapabilitiesPrivateAnswers

type CapabilitiesPrivateAnswers string

CapabilitiesPrivateAnswers defines model for Capabilities.PrivateAnswers.

const (
	CapabilitiesPrivateAnswersEphemeral CapabilitiesPrivateAnswers = "ephemeral"
	CapabilitiesPrivateAnswersPopup     CapabilitiesPrivateAnswers = "popup"
)

Defines values for CapabilitiesPrivateAnswers.

func (CapabilitiesPrivateAnswers) Valid

func (e CapabilitiesPrivateAnswers) Valid() bool

Valid indicates whether the value is a known member of the CapabilitiesPrivateAnswers enum.

type CapabilitiesThreadMessages

type CapabilitiesThreadMessages string

CapabilitiesThreadMessages The bridge reports people's messages in Threads of the bot's messages — every one, or only those that mention the bot. Text commands need it.

const (
	All          CapabilitiesThreadMessages = "all"
	MentionsOnly CapabilitiesThreadMessages = "mentions_only"
)

Defines values for CapabilitiesThreadMessages.

func (CapabilitiesThreadMessages) Valid

func (e CapabilitiesThreadMessages) Valid() bool

Valid indicates whether the value is a known member of the CapabilitiesThreadMessages enum.

type ChannelCheck

type ChannelCheck struct {
	ChannelId string `json:"channel_id"`

	// Name The channel's name as people see it; Muster shows it on the Destination.
	Name string `json:"name"`
}

ChannelCheck defines model for ChannelCheck.

type ChannelId

type ChannelId = string

ChannelId defines model for ChannelId.

type DirectMessageInput

type DirectMessageInput struct {
	// Body CommonMark.
	Body           string `json:"body"`
	UserExternalId string `json:"user_external_id"`
}

DirectMessageInput defines model for DirectMessageInput.

type DirectMessageSent

type DirectMessageSent struct {
	MessageId string `json:"message_id"`
	Replayed  bool   `json:"replayed"`
}

DirectMessageSent defines model for DirectMessageSent.

type EditMessageJSONRequestBody

type EditMessageJSONRequestBody = MessageContent

EditMessageJSONRequestBody defines body for EditMessage for application/json ContentType.

type ErrorClass

type ErrorClass string

ErrorClass defines model for ErrorClass.

const (
	ErrorClassForbidden   ErrorClass = "forbidden"
	ErrorClassGone        ErrorClass = "gone"
	ErrorClassInvalid     ErrorClass = "invalid"
	ErrorClassRateLimited ErrorClass = "rate_limited"
	ErrorClassTransient   ErrorClass = "transient"
)

Defines values for ErrorClass.

func (ErrorClass) Valid

func (e ErrorClass) Valid() bool

Valid indicates whether the value is a known member of the ErrorClass enum.

type Event

type Event struct {
	// contains filtered or unexported fields
}

Event One event; `type` selects the variant. A bridge in the role `messenger` always sends `account_link` events and the others only with the feature they belong to (`buttons`, `thread_messages`, `deletion_events`); a bridge in the role `gateway` sends `notification_acknowledged`.

func (Event) AsAccountLinkEvent

func (t Event) AsAccountLinkEvent() (AccountLinkEvent, error)

AsAccountLinkEvent returns the union data inside the Event as a AccountLinkEvent

func (Event) AsMessageDeletedEvent

func (t Event) AsMessageDeletedEvent() (MessageDeletedEvent, error)

AsMessageDeletedEvent returns the union data inside the Event as a MessageDeletedEvent

func (Event) AsNotificationAcknowledgedEvent

func (t Event) AsNotificationAcknowledgedEvent() (NotificationAcknowledgedEvent, error)

AsNotificationAcknowledgedEvent returns the union data inside the Event as a NotificationAcknowledgedEvent

func (Event) AsPressEvent

func (t Event) AsPressEvent() (PressEvent, error)

AsPressEvent returns the union data inside the Event as a PressEvent

func (Event) AsThreadMessageEvent

func (t Event) AsThreadMessageEvent() (ThreadMessageEvent, error)

AsThreadMessageEvent returns the union data inside the Event as a ThreadMessageEvent

func (Event) Discriminator

func (t Event) Discriminator() (string, error)

func (*Event) FromAccountLinkEvent

func (t *Event) FromAccountLinkEvent(v AccountLinkEvent) error

FromAccountLinkEvent overwrites any union data inside the Event as the provided AccountLinkEvent

func (*Event) FromMessageDeletedEvent

func (t *Event) FromMessageDeletedEvent(v MessageDeletedEvent) error

FromMessageDeletedEvent overwrites any union data inside the Event as the provided MessageDeletedEvent

func (*Event) FromNotificationAcknowledgedEvent

func (t *Event) FromNotificationAcknowledgedEvent(v NotificationAcknowledgedEvent) error

FromNotificationAcknowledgedEvent overwrites any union data inside the Event as the provided NotificationAcknowledgedEvent

func (*Event) FromPressEvent

func (t *Event) FromPressEvent(v PressEvent) error

FromPressEvent overwrites any union data inside the Event as the provided PressEvent

func (*Event) FromThreadMessageEvent

func (t *Event) FromThreadMessageEvent(v ThreadMessageEvent) error

FromThreadMessageEvent overwrites any union data inside the Event as the provided ThreadMessageEvent

func (Event) MarshalJSON

func (t Event) MarshalJSON() ([]byte, error)

func (*Event) MergeAccountLinkEvent

func (t *Event) MergeAccountLinkEvent(v AccountLinkEvent) error

MergeAccountLinkEvent performs a merge with any union data inside the Event, using the provided AccountLinkEvent

func (*Event) MergeMessageDeletedEvent

func (t *Event) MergeMessageDeletedEvent(v MessageDeletedEvent) error

MergeMessageDeletedEvent performs a merge with any union data inside the Event, using the provided MessageDeletedEvent

func (*Event) MergeNotificationAcknowledgedEvent

func (t *Event) MergeNotificationAcknowledgedEvent(v NotificationAcknowledgedEvent) error

MergeNotificationAcknowledgedEvent performs a merge with any union data inside the Event, using the provided NotificationAcknowledgedEvent

func (*Event) MergePressEvent

func (t *Event) MergePressEvent(v PressEvent) error

MergePressEvent performs a merge with any union data inside the Event, using the provided PressEvent

func (*Event) MergeThreadMessageEvent

func (t *Event) MergeThreadMessageEvent(v ThreadMessageEvent) error

MergeThreadMessageEvent performs a merge with any union data inside the Event, using the provided ThreadMessageEvent

func (*Event) UnmarshalJSON

func (t *Event) UnmarshalJSON(b []byte) error

func (Event) ValueByDiscriminator

func (t Event) ValueByDiscriminator() (interface{}, error)

type EventBase

type EventBase struct {
	// Id Stable across retries and polls; Muster handles each id once. Printable ASCII without spaces, so that it can travel as the `webhook-id` header.
	Id string `json:"id"`

	// OccurredAt When it happened in the messenger, or when the bridge learned of it.
	OccurredAt time.Time `json:"occurred_at"`
	Type       string    `json:"type"`
}

EventBase defines model for EventBase.

type EventBatch

type EventBatch struct {
	Events []Event `json:"events"`

	// NextCursor Send it as `cursor` with the next call; opaque to Muster.
	NextCursor string `json:"next_cursor"`
}

EventBatch defines model for EventBatch.

type FindUsersParams

type FindUsersParams struct {
	// Handle The handle as the person entered it, in the kind `user_lookup` declares.
	Handle string `form:"handle" json:"handle"`
}

FindUsersParams defines parameters for FindUsers.

type Forbidden

type Forbidden = Problem

Forbidden RFC 9457 problem details with the Bridge protocol's members.

type Gone

type Gone = Problem

Gone RFC 9457 problem details with the Bridge protocol's members.

type IdempotencyKey

type IdempotencyKey = string

IdempotencyKey defines model for IdempotencyKey.

type Info

type Info struct {
	Bridge struct {
		Name    string `json:"name"`
		Version string `json:"version"`
	} `json:"bridge"`

	// Capabilities The optional features of the bridge. A missing member means the feature is not offered.
	Capabilities Capabilities `json:"capabilities"`

	// EventDelivery The event delivery modes the bridge offers; each Connection chooses one.
	EventDelivery []InfoEventDelivery `json:"event_delivery"`
	Limits        Limits              `json:"limits"`

	// LinkUrlTemplate An `http` or `https` link that opens a chat with the bot and hands it the Account link token, with `{token}` where the token goes, such as `https://chat.example.org/bots/muster?start={token}`. Muster shows the link next to the token in the profile; without one it shows only the token. Another scheme makes `info` fail the Connection check.
	LinkUrlTemplate nullable.Nullable[string] `json:"link_url_template,omitempty"`
	Messenger       struct {
		// Name The messenger's name as people know it; Muster shows it on the Connection and the Destinations.
		Name string `json:"name"`
	} `json:"messenger"`

	// ProtocolVersion The major version of this protocol the bridge speaks.
	ProtocolVersion InfoProtocolVersion `json:"protocol_version"`

	// Roles What the bridge is (see Roles); `messenger` when it is missing, so a bridge written before roles existed is a messenger.
	Roles *[]InfoRole `json:"roles,omitempty"`

	// UserLookup What a person enters to be found for an Account link by code, and what `findUsers` searches by. `none` offers only the token sent to the bot.
	UserLookup InfoUserLookup `json:"user_lookup"`
}

Info defines model for Info.

type InfoEventDelivery

type InfoEventDelivery string

InfoEventDelivery defines model for Info.EventDelivery.

const (
	Poll InfoEventDelivery = "poll"
	Push InfoEventDelivery = "push"
)

Defines values for InfoEventDelivery.

func (InfoEventDelivery) Valid

func (e InfoEventDelivery) Valid() bool

Valid indicates whether the value is a known member of the InfoEventDelivery enum.

type InfoProtocolVersion

type InfoProtocolVersion string

InfoProtocolVersion The major version of this protocol the bridge speaks.

const (
	N1 InfoProtocolVersion = "1"
)

Defines values for InfoProtocolVersion.

func (InfoProtocolVersion) Valid

func (e InfoProtocolVersion) Valid() bool

Valid indicates whether the value is a known member of the InfoProtocolVersion enum.

type InfoRole

type InfoRole string

InfoRole `messenger`: a bridge to a messenger, whose channels are Destinations; `gateway`: a Notification gateway, which Muster calls with `sendNotification`.

const (
	Gateway   InfoRole = "gateway"
	Messenger InfoRole = "messenger"
)

Defines values for InfoRole.

func (InfoRole) Valid

func (e InfoRole) Valid() bool

Valid indicates whether the value is a known member of the InfoRole enum.

type InfoUserLookup

type InfoUserLookup string

InfoUserLookup What a person enters to be found for an Account link by code, and what `findUsers` searches by. `none` offers only the token sent to the bot.

const (
	Email    InfoUserLookup = "email"
	Login    InfoUserLookup = "login"
	None     InfoUserLookup = "none"
	UserId   InfoUserLookup = "user_id"
	Username InfoUserLookup = "username"
)

Defines values for InfoUserLookup.

func (InfoUserLookup) Valid

func (e InfoUserLookup) Valid() bool

Valid indicates whether the value is a known member of the InfoUserLookup enum.

type Invalid

type Invalid = Problem

Invalid RFC 9457 problem details with the Bridge protocol's members.

type Layout

type Layout struct {
	// Alerts The Alerts by the label that tells them apart; null for an Alert Group of one Alert, or when shortening removed them.
	Alerts nullable.Nullable[LayoutAlerts] `json:"alerts"`

	// Assignees The Assignees, the people the Escalation chains Paged last and reached, each with the owning Team of their chain in `team` where it has one, before an acknowledgement; empty until Muster Pages people through Escalation chains.
	Assignees []LayoutPerson `json:"assignees"`

	// Description The `description` annotation of the first Alert that has one; empty when there is none, or when shortening removed it.
	Description string `json:"description"`

	// Fields Severity, Route, Teams (left out when the Alert Group has none) and Started, in order.
	Fields []LayoutField `json:"fields"`

	// Labels The key labels the Route shows in its messages, each as key and value; the value of a label whose values differ among the firing Alerts says how many there are, "3 values" in the Route's language.
	Labels []LayoutLabel `json:"labels"`

	// Links The links, "Open in Muster" to the Alert Group page first.
	Links []LayoutLink `json:"links"`

	// Notices The notices that apply, such as "Reopened ×2", then the footer — who snoozed or resolved the Alert Group, or why it resolved — each as a line. Who acknowledged it is `owner`, not a line, and "Escalation chains stopped" after an acknowledgement that stopped them is the last line; the Assignees are `assignees`, not a line.
	Notices []string `json:"notices"`

	// Number The Alert Group's number alone, without `#`, as a field of its own, because `#N` in text becomes a hashtag in some messengers.
	Number int `json:"number"`

	// Owner Who acknowledged the Alert Group, without a Team, while it is acknowledged; null otherwise.
	Owner  nullable.Nullable[LayoutPerson] `json:"owner"`
	Status LayoutStatus                    `json:"status"`

	// Summary The Alert Group's summary; empty when there is none, or when shortening removed it.
	Summary string `json:"summary"`

	// Title The Alert Group's title without the number.
	Title string `json:"title"`
}

Layout The content of a Root message or a test message as structured data, for a bridge that renders it natively instead of rendering `body`: the same content in the same order, without the buttons, which stay in `buttons`. Muster sends it only when this is the whole content: a Root message that a Route's own Root message template or line template, or Muster's fallback template, renders has no `layout`, and the bridge renders its `body`. A test message has the mark of a test as its first notice, as `body` has it first. Every value is plain text, never CommonMark — the bridge escapes it for its messenger — and alert data in it cannot mention anyone. When Muster shortens `body` to `limits.max_body_length`, `layout` loses the same parts: the description first, then the Alerts, the summary and the labels, while the title, the status, the fields, the people and the links always stay; a bridge that has to cut more cuts in the same order.

type LayoutAlertValue

type LayoutAlertValue struct {
	// Resolved The Alert is resolved; Muster strikes its value through in `body`.
	Resolved bool   `json:"resolved"`
	Value    string `json:"value"`
}

LayoutAlertValue defines model for LayoutAlertValue.

type LayoutAlerts

type LayoutAlerts struct {
	// Label The label that tells the Alerts apart.
	Label string `json:"label"`

	// Total How many Alerts the Alert Group has, listed or not, so that the bridge counts the ones it does not show itself — "…and 7 more" — also when it lists fewer values than `values` holds.
	Total int `json:"total"`

	// Values Its values, firing Alerts first, at most as many as Muster lists in a message.
	Values []LayoutAlertValue `json:"values"`
}

LayoutAlerts defines model for LayoutAlerts.

type LayoutField

type LayoutField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

LayoutField defines model for LayoutField.

type LayoutLabel

type LayoutLabel struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

LayoutLabel defines model for LayoutLabel.

type LayoutLink struct {
	Label string `json:"label"`

	// Url An absolute http or https link as the Route gives it, the same as the body links; it may be an IRI, with characters outside ASCII in its host or path.
	Url string `json:"url"`
}

LayoutLink defines model for LayoutLink.

type LayoutPerson

type LayoutPerson struct {
	// Name The person's display name in Muster, which may differ from the `display_name` of their entry in `mentions`, the name of their account in the messenger.
	Name string `json:"name"`

	// Ref The `ref` of the person's entry in `mentions` where the message carries their Mention — a new message to a bridge with `native_mentions`, for a person whose account is linked through the Connection — so that the bridge mentions them by its own user id; null otherwise, and always in an edit.
	Ref nullable.Nullable[string] `json:"ref"`

	// Team The person's Team, where Muster knows it.
	Team *struct {
		Name string `json:"name"`
	} `json:"team,omitempty"`
}

LayoutPerson defines model for LayoutPerson.

type LayoutStatus

type LayoutStatus struct {
	Key LayoutStatusKey `json:"key"`

	// Word The status as a word in the Route's language, "Firing".
	Word string `json:"word"`
}

LayoutStatus defines model for LayoutStatus.

type LayoutStatusKey

type LayoutStatusKey string

LayoutStatusKey defines model for LayoutStatus.Key.

const (
	LayoutStatusKeyAcknowledged LayoutStatusKey = "acknowledged"
	LayoutStatusKeyFiring       LayoutStatusKey = "firing"
	LayoutStatusKeyResolved     LayoutStatusKey = "resolved"
	LayoutStatusKeySnoozed      LayoutStatusKey = "snoozed"
)

Defines values for LayoutStatusKey.

func (LayoutStatusKey) Valid

func (e LayoutStatusKey) Valid() bool

Valid indicates whether the value is a known member of the LayoutStatusKey enum.

type Limits

type Limits struct {
	// EditMaxAgeSeconds How long after posting the bot can still edit a message; `null` when edits never expire. Muster stops editing a minute earlier.
	EditMaxAgeSeconds nullable.Nullable[int] `json:"edit_max_age_seconds"`

	// MaxBodyLength The longest `body`, in Unicode code points of the CommonMark Muster sends, that the bridge always accepts for a post and for an edit alike, after its own rendering.
	MaxBodyLength int `json:"max_body_length"`

	// SendPerSecond A hint for the Connection limiter, over all channels of the bot.
	SendPerSecond *float32 `json:"send_per_second,omitempty"`

	// SendPerSecondPerChannel A hint for the Destination limiter; `rate_limited` stays the truth.
	SendPerSecondPerChannel *float32 `json:"send_per_second_per_channel,omitempty"`
}

Limits defines model for Limits.

type Link struct {
	Label string `json:"label"`
	Url   string `json:"url"`
}

Link defines model for Link.

type Mention

type Mention struct {
	// DisplayName The name the marker shows; for a group its name and for everyone in the chat its symbolic name, as `external_id`.
	DisplayName string `json:"display_name"`

	// ExternalId For a person, the account's id in the messenger, as the bridge reported it when the account was linked; for a group, the name an Admin typed for the Team mention or the Destination's entry, 1 to 64 letters, digits, `.`, `_` and `-` starting with a letter or a digit, which the bridge maps to its messenger's group; for everyone in the chat, the symbolic name: `channel`, `here`, `all` or `everyone`.
	ExternalId string `json:"external_id"`

	// Kind What the Mention names; missing, it is `user`. Muster sends the Mention of a person without it.
	Kind *MentionKind `json:"kind,omitempty"`

	// Ref Names the marker `muster-mention:<ref>` in the body.
	Ref string `json:"ref"`
}

Mention One Mention of the envelope, which a marker `[@Display Name](muster-mention:<ref>)` in the body places: a person (`kind` `user`, the default), a group of the messenger (`group`), or everyone in the chat (`everyone`). Muster sends `group` only while its copy of the bridge's `info`, at most `bridge.info_max_age` (10 minutes) old, declares `group_mentions`, and `everyone` only with a symbolic name that copy lists in `everyone_mentions`; it sends a person without `kind`. A `group` entry comes from a Team mention, a group entry of a Destination or a `mention "group"` token of a template; the token keeps its place in the body as text.

type MentionKind

type MentionKind string

MentionKind What the Mention names; missing, it is `user`. Muster sends the Mention of a person without it.

const (
	MentionKindEveryone MentionKind = "everyone"
	MentionKindGroup    MentionKind = "group"
	MentionKindUser     MentionKind = "user"
)

Defines values for MentionKind.

func (MentionKind) Valid

func (e MentionKind) Valid() bool

Valid indicates whether the value is a known member of the MentionKind enum.

type MessageContent

type MessageContent struct {
	// Body CommonMark, as the description of this protocol says; at most `limits.max_body_length` code points.
	Body string `json:"body"`

	// Buttons In order. Empty when the message has none, always empty without `capabilities.buttons`.
	Buttons []Button `json:"buttons"`

	// Color The colour of the status, for messengers that colour messages.
	Color string `json:"color"`

	// Emoji The status as an emoji (🔴 🟠 ⚪ 🟢 ⛈), for messengers without colours.
	Emoji string `json:"emoji"`

	// Layout The content of a Root message or a test message as structured data, for a bridge that renders it natively
	// instead of rendering `body`: the same content in the same order, without the buttons, which stay in `buttons`.
	// Muster sends it only when this is the whole content: a Root message that a Route's own Root message template
	// or line template, or Muster's fallback template, renders has no `layout`, and the bridge renders its `body`.
	// A test message has the mark of a test as its first notice, as `body` has it first.
	// Every value is plain text, never CommonMark — the bridge escapes it for its messenger — and alert data in it
	// cannot mention anyone. When Muster shortens `body` to `limits.max_body_length`, `layout` loses the same parts:
	// the description first, then the Alerts, the summary and the labels, while the title, the status, the fields,
	// the people and the links always stay; a bridge that has to cut more cuts in the same order.
	Layout *Layout `json:"layout,omitempty"`
	Link   Link    `json:"link"`

	// Status The status of the Alert Group the message shows; `storm` for a Storm summary.
	Status Status `json:"status"`

	// Title `#N` and the Alert Group's title, plain text; shown as the heading and linked to `link`.
	Title string `json:"title"`
}

MessageContent The envelope of a message. A Root message and a test message also carry `layout`, the same content as `body` as plain-text data; a bridge renders either `body` or `layout`, and a bridge that ignores `layout` is unaffected. A message without `layout` is rendered from `body`, always — a Storm summary, a Root message whose Route renders it with a Root message template or a line template of its own, or with Muster's fallback template, whose content only `body` holds, or a message of an earlier version of Muster.

type MessageDeletedEvent

type MessageDeletedEvent struct {
	// Id Stable across retries and polls; Muster handles each id once. Printable ASCII without spaces, so that it can travel as the `webhook-id` header.
	Id        string `json:"id"`
	MessageId string `json:"message_id"`

	// OccurredAt When it happened in the messenger, or when the bridge learned of it.
	OccurredAt time.Time   `json:"occurred_at"`
	Type       interface{} `json:"type"`
}

MessageDeletedEvent defines model for MessageDeletedEvent.

type MessageEdited

type MessageEdited struct {
	Truncated bool `json:"truncated"`
}

MessageEdited defines model for MessageEdited.

type MessageId

type MessageId = string

MessageId defines model for MessageId.

type MessageInput

type MessageInput struct {
	// Body CommonMark, as the description of this protocol says; at most `limits.max_body_length` code points.
	Body string `json:"body"`

	// Buttons In order. Empty when the message has none, always empty without `capabilities.buttons`.
	Buttons   []Button `json:"buttons"`
	ChannelId string   `json:"channel_id"`

	// Color The colour of the status, for messengers that colour messages.
	Color string `json:"color"`

	// Emoji The status as an emoji (🔴 🟠 ⚪ 🟢 ⛈), for messengers without colours.
	Emoji string `json:"emoji"`

	// Kind A Root message of an Alert Group, a Storm summary, or a test message sent from the Destination page.
	Kind MessageKind `json:"kind"`

	// Layout The content of a Root message or a test message as structured data, for a bridge that renders it natively
	// instead of rendering `body`: the same content in the same order, without the buttons, which stay in `buttons`.
	// Muster sends it only when this is the whole content: a Root message that a Route's own Root message template
	// or line template, or Muster's fallback template, renders has no `layout`, and the bridge renders its `body`.
	// A test message has the mark of a test as its first notice, as `body` has it first.
	// Every value is plain text, never CommonMark — the bridge escapes it for its messenger — and alert data in it
	// cannot mention anyone. When Muster shortens `body` to `limits.max_body_length`, `layout` loses the same parts:
	// the description first, then the Alerts, the summary and the labels, while the title, the status, the fields,
	// the people and the links always stay; a bridge that has to cut more cuts in the same order.
	Layout   *Layout   `json:"layout,omitempty"`
	Link     Link      `json:"link"`
	Mentions []Mention `json:"mentions"`

	// Notify Loud (`true`) or Quiet (`false`).
	Notify bool `json:"notify"`

	// Status The status of the Alert Group the message shows; `storm` for a Storm summary.
	Status Status `json:"status"`

	// Title `#N` and the Alert Group's title, plain text; shown as the heading and linked to `link`.
	Title string `json:"title"`
}

MessageInput defines model for MessageInput.

type MessageKind

type MessageKind string

MessageKind A Root message of an Alert Group, a Storm summary, or a test message sent from the Destination page.

const (
	Root         MessageKind = "root"
	StormSummary MessageKind = "storm_summary"
	Test         MessageKind = "test"
)

Defines values for MessageKind.

func (MessageKind) Valid

func (e MessageKind) Valid() bool

Valid indicates whether the value is a known member of the MessageKind enum.

type MessagePosted

type MessagePosted struct {
	// MessageId Opaque to Muster; it encodes whatever the bridge needs to edit the message and reply under it.
	MessageId string `json:"message_id"`

	// Replayed The `Idempotency-Key` was seen before, and this is its first result.
	Replayed bool `json:"replayed"`

	// ThreadRef The message's Thread, when known at once; otherwise the first `replyInThread` returns it.
	ThreadRef nullable.Nullable[string] `json:"thread_ref,omitempty"`

	// Truncated The bridge shortened the body to fit its messenger.
	Truncated bool `json:"truncated"`

	// Url A link that opens the message in the messenger, if it has one; Muster shows it on the Alert Group page and links to it from the Thread of an older Root message.
	Url nullable.Nullable[string] `json:"url,omitempty"`
}

MessagePosted defines model for MessagePosted.

type NotificationAcknowledgedEvent

type NotificationAcknowledgedEvent struct {
	// Data The notification's `action.data`, unchanged.
	Data string `json:"data"`

	// Id Stable across retries and polls; Muster handles each id once. Printable ASCII without spaces, so that it can travel as the `webhook-id` header.
	Id string `json:"id"`

	// NotificationId The `notification_id` that `sendNotification` answered.
	NotificationId string `json:"notification_id"`

	// OccurredAt When it happened in the messenger, or when the bridge learned of it.
	OccurredAt time.Time   `json:"occurred_at"`
	Type       interface{} `json:"type"`
}

NotificationAcknowledgedEvent defines model for NotificationAcknowledgedEvent.

type NotificationAction

type NotificationAction struct {
	// Data Opaque, signed by Muster like a button's data; return it unchanged with `notification_acknowledged`.
	Data string `json:"data"`

	// Label How the person acknowledges, in their language, such as "Press 1 to acknowledge"; the bridge may say it in its own words.
	Label string `json:"label"`
}

NotificationAction How the person acknowledges the notification. Absent when there is nothing to acknowledge, as for a confirmation code.

type NotificationInput

type NotificationInput struct {
	// Action How the person acknowledges the notification. Absent when there is nothing to acknowledge, as for a confirmation code.
	Action *NotificationAction `json:"action,omitempty"`

	// Contact Where the bridge reaches the person, as they entered it in Muster and the bridge understands it, such as a phone number.
	Contact string `json:"contact"`

	// Language The language of the person, which the text is in.
	Language NotificationInputLanguage `json:"language"`

	// Text Plain text, which the bridge reads out or sends as it can.
	Text string `json:"text"`
}

NotificationInput defines model for NotificationInput.

type NotificationInputLanguage

type NotificationInputLanguage string

NotificationInputLanguage The language of the person, which the text is in.

Defines values for NotificationInputLanguage.

func (NotificationInputLanguage) Valid

func (e NotificationInputLanguage) Valid() bool

Valid indicates whether the value is a known member of the NotificationInputLanguage enum.

type NotificationSent

type NotificationSent struct {
	// NotificationId Names the notification in its `notification_acknowledged`; opaque to Muster.
	NotificationId string `json:"notification_id"`
	Replayed       bool   `json:"replayed"`
}

NotificationSent defines model for NotificationSent.

type Person

type Person struct {
	DisplayName string `json:"display_name"`

	// ExternalId The account's stable id in the messenger.
	ExternalId string `json:"external_id"`

	// Handle The account's handle of the kind `user_lookup` declares, when the bridge knows it.
	Handle nullable.Nullable[string] `json:"handle,omitempty"`
}

Person defines model for Person.

type PersonList

type PersonList struct {
	Items []Person `json:"items"`
}

PersonList defines model for PersonList.

type PollEventsParams

type PollEventsParams struct {
	// Cursor The `next_cursor` of the previous answer; opaque to Muster.
	Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"`

	// Wait How long to hold the request open when there are no events, in seconds.
	Wait *int `form:"wait,omitempty" json:"wait,omitempty"`
}

PollEventsParams defines parameters for PollEvents.

type PostMessageJSONRequestBody

type PostMessageJSONRequestBody = MessageInput

PostMessageJSONRequestBody defines body for PostMessage for application/json ContentType.

type PostMessageParams

type PostMessageParams struct {
	// IdempotencyKey Identifies the request across retries; a repeated key with the same token returns the first result without creating anything again. Keys are scoped per token.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`
}

PostMessageParams defines parameters for PostMessage.

type PressEvent

type PressEvent struct {
	// Data The button's `data`, unchanged.
	Data string `json:"data"`

	// Id Stable across retries and polls; Muster handles each id once. Printable ASCII without spaces, so that it can travel as the `webhook-id` header.
	Id string `json:"id"`

	// MessageId The message the button belongs to, a Root message or a Thread reply.
	MessageId string `json:"message_id"`

	// OccurredAt When it happened in the messenger, or when the bridge learned of it.
	OccurredAt time.Time   `json:"occurred_at"`
	Type       interface{} `json:"type"`
	User       Person      `json:"user"`
}

PressEvent defines model for PressEvent.

type Problem

type Problem struct {
	Class *ErrorClass `json:"class,omitempty"`

	// Detail Shown to the Admin as the reason, as untrusted text; never put a secret in it.
	Detail   *string `json:"detail,omitempty"`
	Instance *string `json:"instance,omitempty"`

	// Reason For `gone`, `edit_window_closed` when the messenger refuses the edit only because of the message's age.
	Reason *ProblemReason `json:"reason,omitempty"`

	// Scope For `rate_limited`, whether the wait holds one channel or every channel of the bot.
	Scope  *ProblemScope `json:"scope,omitempty"`
	Status *int          `json:"status,omitempty"`
	Title  *string       `json:"title,omitempty"`
	Type   *string       `json:"type,omitempty"`
}

Problem RFC 9457 problem details with the Bridge protocol's members.

type ProblemReason

type ProblemReason string

ProblemReason For `gone`, `edit_window_closed` when the messenger refuses the edit only because of the message's age.

const (
	EditWindowClosed ProblemReason = "edit_window_closed"
)

Defines values for ProblemReason.

func (ProblemReason) Valid

func (e ProblemReason) Valid() bool

Valid indicates whether the value is a known member of the ProblemReason enum.

type ProblemScope

type ProblemScope string

ProblemScope For `rate_limited`, whether the wait holds one channel or every channel of the bot.

const (
	Bot     ProblemScope = "bot"
	Channel ProblemScope = "channel"
)

Defines values for ProblemScope.

func (ProblemScope) Valid

func (e ProblemScope) Valid() bool

Valid indicates whether the value is a known member of the ProblemScope enum.

type RateLimited

type RateLimited = Problem

RateLimited RFC 9457 problem details with the Bridge protocol's members.

type ReplyInThreadJSONRequestBody

type ReplyInThreadJSONRequestBody = ThreadReplyInput

ReplyInThreadJSONRequestBody defines body for ReplyInThread for application/json ContentType.

type ReplyInThreadParams

type ReplyInThreadParams struct {
	// IdempotencyKey Identifies the request across retries; a repeated key with the same token returns the first result without creating anything again. Keys are scoped per token.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`
}

ReplyInThreadParams defines parameters for ReplyInThread.

type SendDirectMessageJSONRequestBody

type SendDirectMessageJSONRequestBody = DirectMessageInput

SendDirectMessageJSONRequestBody defines body for SendDirectMessage for application/json ContentType.

type SendDirectMessageParams

type SendDirectMessageParams struct {
	// IdempotencyKey Identifies the request across retries; a repeated key with the same token returns the first result without creating anything again. Keys are scoped per token.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`
}

SendDirectMessageParams defines parameters for SendDirectMessage.

type SendNotificationJSONRequestBody

type SendNotificationJSONRequestBody = NotificationInput

SendNotificationJSONRequestBody defines body for SendNotification for application/json ContentType.

type SendNotificationParams

type SendNotificationParams struct {
	// IdempotencyKey Identifies the request across retries; a repeated key with the same token returns the first result without creating anything again. Keys are scoped per token.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`
}

SendNotificationParams defines parameters for SendNotification.

type Status

type Status string

Status The status of the Alert Group the message shows; `storm` for a Storm summary.

const (
	StatusAcknowledged Status = "acknowledged"
	StatusFiring       Status = "firing"
	StatusResolved     Status = "resolved"
	StatusSnoozed      Status = "snoozed"
	StatusStorm        Status = "storm"
)

Defines values for Status.

func (Status) Valid

func (e Status) Valid() bool

Valid indicates whether the value is a known member of the Status enum.

type ThreadMessageEvent

type ThreadMessageEvent struct {
	// Id Stable across retries and polls; Muster handles each id once. Printable ASCII without spaces, so that it can travel as the `webhook-id` header.
	Id string `json:"id"`

	// MessageId The message whose Thread it is in — the `message_id` in the path of `replyInThread`, usually a Root message, never the id of a reply.
	MessageId string `json:"message_id"`

	// OccurredAt When it happened in the messenger, or when the bridge learned of it.
	OccurredAt time.Time `json:"occurred_at"`

	// Text The message as plain text, mentions of the bot removed.
	Text      string                    `json:"text"`
	ThreadRef nullable.Nullable[string] `json:"thread_ref"`
	Type      interface{}               `json:"type"`
	User      Person                    `json:"user"`
}

ThreadMessageEvent defines model for ThreadMessageEvent.

type ThreadReplyInput

type ThreadReplyInput struct {
	// Body CommonMark, at most `limits.max_body_length` code points.
	Body     string    `json:"body"`
	Buttons  []Button  `json:"buttons"`
	Mentions []Mention `json:"mentions"`

	// Notify Loud (`true`) or Quiet (`false`).
	Notify bool `json:"notify"`

	// ThreadRef The last `thread_ref` Muster received for the message — from `postMessage` or an earlier reply — or `null` when it has none.
	ThreadRef nullable.Nullable[string] `json:"thread_ref"`
}

ThreadReplyInput defines model for ThreadReplyInput.

type ThreadReplyPosted

type ThreadReplyPosted struct {
	// MessageId The reply; presses on its buttons name it.
	MessageId string `json:"message_id"`
	Replayed  bool   `json:"replayed"`
	ThreadRef string `json:"thread_ref"`
	Truncated bool   `json:"truncated"`
}

ThreadReplyPosted defines model for ThreadReplyPosted.

type Transient

type Transient = Problem

Transient RFC 9457 problem details with the Bridge protocol's members.

type Unauthorized

type Unauthorized = Problem

Unauthorized RFC 9457 problem details with the Bridge protocol's members.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL