Documentation ¶
Index ¶
- Constants
- Variables
- func CanManageChannelProperties(userID, channelID string, pluginAPI *pluginapi.Client) bool
- func CanPostToChannel(userID, channelID string, pluginAPI *pluginapi.Client) bool
- func GeneratePlaybookExport(playbook Playbook) ([]byte, error)
- func GetPlaybookDetailsRelativeURL(playbookID string) string
- func GetRunDetailsRelativeURL(playbookRunID string) string
- func IsChannelActiveInTeam(channelID string, expectedTeamID string, pluginAPI *pluginapi.Client) error
- func IsGuest(userID string, pluginAPI *pluginapi.Client) (bool, error)
- func IsMemberOfTeam(userID, teamID string, pluginAPI *pluginapi.Client) bool
- func IsSystemAdmin(userID string, pluginAPI *pluginapi.Client) bool
- func IsValidChecklistItemIndex(checklists []Checklist, checklistNum, itemNum int) bool
- func IsValidChecklistItemState(state string) bool
- func IsValidDirection(direction SortDirection) bool
- func ProcessSignalAnyKeywords(keywords []string) []string
- func ValidateCategoryName(categoryName string) error
- func ValidateWebhookURLs(urls []string) error
- type ActionType
- type AssignedRun
- type AssignedTask
- type CategorizeChannelPayload
- type Category
- type CategoryItem
- type CategoryItemType
- type CategoryService
- type CategoryStore
- type CategoryTelemetry
- type ChannelActionService
- type ChannelActionStore
- type ChannelActionTelemetry
- type Checklist
- type ChecklistItem
- type DialogState
- type DialogStateAddToTimeline
- type DigestNotificationSettings
- type GenericChannelAction
- type GenericChannelActionWithoutPayload
- type GetChannelActionOptions
- type GetPlaybookRunsResults
- type GetPlaybooksResults
- type JobOnceScheduler
- type KeywordsThreadIgnorer
- type LicenseChecker
- type Metadata
- type OwnerInfo
- type PermissionsService
- func (p *PermissionsService) ChannelActionCreate(userID, channelID string) error
- func (p *PermissionsService) ChannelActionUpdate(userID, channelID string) error
- func (p *PermissionsService) ChannelActionView(userID, channelID string) error
- func (p *PermissionsService) DeletePlaybook(userID string, playbook Playbook) error
- func (p *PermissionsService) FilterInvitedGroupIDs(invitedGroupIDs []string) []string
- func (p *PermissionsService) FilterInvitedUserIDs(invitedUserIDs []string, teamID string) []string
- func (p *PermissionsService) NoAddedBroadcastChannelsWithoutPermission(userID string, broadcastChannelIDs, oldBroadcastChannelIDs []string) error
- func (p *PermissionsService) PlaybookCreate(userID string, playbook Playbook) error
- func (p *PermissionsService) PlaybookIsPublic(playbook Playbook) bool
- func (p *PermissionsService) PlaybookList(userID, teamID string) error
- func (p *PermissionsService) PlaybookMakePrivate(userID string, playbook Playbook) error
- func (p *PermissionsService) PlaybookMakePublic(userID string, playbook Playbook) error
- func (p *PermissionsService) PlaybookManageMembers(userID string, playbook Playbook) error
- func (p *PermissionsService) PlaybookManageProperties(userID string, playbook Playbook) error
- func (p *PermissionsService) PlaybookManageRoles(userID string, playbook Playbook) error
- func (p *PermissionsService) PlaybookModifyWithFixes(userID string, playbook *Playbook, oldPlaybook Playbook) error
- func (p *PermissionsService) PlaybookView(userID string, playbookID string) error
- func (p *PermissionsService) PlaybookViewWithPlaybook(userID string, playbook Playbook) error
- func (p *PermissionsService) RunCreate(userID string, playbook Playbook) error
- func (p *PermissionsService) RunManageProperties(userID, runID string) error
- func (p *PermissionsService) RunManagePropertiesByChannel(userID, channelID string) error
- func (p *PermissionsService) RunView(userID, runID string) error
- func (p *PermissionsService) RunViewByChannel(userID, channelID string) error
- type Playbook
- type PlaybookFilterOptions
- type PlaybookGetter
- type PlaybookInsight
- type PlaybookMember
- type PlaybookMetricConfig
- type PlaybookRun
- type PlaybookRunFilterOptions
- type PlaybookRunService
- type PlaybookRunServiceImpl
- func (s *PlaybookRunServiceImpl) AddChecklist(playbookRunID, userID string, checklist Checklist) error
- func (s *PlaybookRunServiceImpl) AddChecklistItem(playbookRunID, userID string, checklistNumber int, checklistItem ChecklistItem) error
- func (s *PlaybookRunServiceImpl) AddPostToTimeline(playbookRunID, userID, postID, summary string) error
- func (s *PlaybookRunServiceImpl) CancelRetrospective(playbookRunID, cancelerID string) error
- func (s *PlaybookRunServiceImpl) ChangeCreationDate(playbookRunID string, creationTimestamp time.Time) error
- func (s *PlaybookRunServiceImpl) ChangeOwner(playbookRunID, userID, ownerID string) error
- func (s *PlaybookRunServiceImpl) CreatePlaybookRun(playbookRun *PlaybookRun, pb *Playbook, userID string, public bool) (*PlaybookRun, error)
- func (s *PlaybookRunServiceImpl) DMTodoDigestToUser(userID string, force bool) error
- func (s *PlaybookRunServiceImpl) DuplicateChecklist(playbookRunID, userID string, checklistNumber int) error
- func (s *PlaybookRunServiceImpl) DuplicateChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int) error
- func (s *PlaybookRunServiceImpl) EditChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int, ...) error
- func (s *PlaybookRunServiceImpl) EphemeralPostTodoDigestToUser(userID string, channelID string, force bool) error
- func (s *PlaybookRunServiceImpl) FinishPlaybookRun(playbookRunID, userID string) error
- func (s *PlaybookRunServiceImpl) Follow(playbookRunID, userID string) error
- func (s *PlaybookRunServiceImpl) GetChecklistAutocomplete(playbookRunID string) ([]model.AutocompleteListItem, error)
- func (s *PlaybookRunServiceImpl) GetChecklistItemAutocomplete(playbookRunID string) ([]model.AutocompleteListItem, error)
- func (s *PlaybookRunServiceImpl) GetFollowers(playbookRunID string) ([]string, error)
- func (s *PlaybookRunServiceImpl) GetOverdueUpdateRuns(userID string) ([]RunLink, error)
- func (s *PlaybookRunServiceImpl) GetOwners(requesterInfo RequesterInfo, options PlaybookRunFilterOptions) ([]OwnerInfo, error)
- func (s *PlaybookRunServiceImpl) GetParticipatingRuns(userID string) ([]RunLink, error)
- func (s *PlaybookRunServiceImpl) GetPlaybookRun(playbookRunID string) (*PlaybookRun, error)
- func (s *PlaybookRunServiceImpl) GetPlaybookRunIDForChannel(channelID string) (string, error)
- func (s *PlaybookRunServiceImpl) GetPlaybookRunMetadata(playbookRunID string) (*Metadata, error)
- func (s *PlaybookRunServiceImpl) GetPlaybookRuns(requesterInfo RequesterInfo, options PlaybookRunFilterOptions) (*GetPlaybookRunsResults, error)
- func (s *PlaybookRunServiceImpl) GetRunsWithAssignedTasks(userID string) ([]AssignedRun, error)
- func (s *PlaybookRunServiceImpl) GetSchemeRolesForChannel(channel *model.Channel) (string, string, string)
- func (s *PlaybookRunServiceImpl) HandleReminder(key string)
- func (s *PlaybookRunServiceImpl) IsOwner(playbookRunID, userID string) bool
- func (s *PlaybookRunServiceImpl) Leave(playbookRunID, requesterID string) error
- func (s *PlaybookRunServiceImpl) ModifyCheckedState(playbookRunID, userID, newState string, checklistNumber, itemNumber int) error
- func (s *PlaybookRunServiceImpl) MoveChecklist(playbookRunID, userID string, sourceChecklistIdx, destChecklistIdx int) error
- func (s *PlaybookRunServiceImpl) MoveChecklistItem(playbookRunID, userID string, ...) error
- func (s *PlaybookRunServiceImpl) NukeDB() error
- func (s *PlaybookRunServiceImpl) OpenAddChecklistItemDialog(triggerID, playbookRunID string, checklist int) error
- func (s *PlaybookRunServiceImpl) OpenAddToTimelineDialog(requesterInfo RequesterInfo, postID, teamID, triggerID string) error
- func (s *PlaybookRunServiceImpl) OpenCreatePlaybookRunDialog(teamID, requesterID, triggerID, postID, clientID string, playbooks []Playbook, ...) error
- func (s *PlaybookRunServiceImpl) OpenFinishPlaybookRunDialog(playbookRunID, triggerID string) error
- func (s *PlaybookRunServiceImpl) OpenUpdateStatusDialog(playbookRunID, triggerID string) error
- func (s *PlaybookRunServiceImpl) PublishRetrospective(playbookRunID, publisherID string, retrospective RetrospectiveUpdate) error
- func (s *PlaybookRunServiceImpl) RemoveChecklist(playbookRunID, userID string, checklistNumber int) error
- func (s *PlaybookRunServiceImpl) RemoveChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int) error
- func (s *PlaybookRunServiceImpl) RemoveReminder(playbookRunID string)
- func (s *PlaybookRunServiceImpl) RemoveTimelineEvent(playbookRunID, userID, eventID string) error
- func (s *PlaybookRunServiceImpl) RenameChecklist(playbookRunID, userID string, checklistNumber int, newTitle string) error
- func (s *PlaybookRunServiceImpl) RequestGetInvolved(playbookRunID, requesterID string) error
- func (s *PlaybookRunServiceImpl) RequestUpdate(playbookRunID, requesterID string) error
- func (s *PlaybookRunServiceImpl) ResetReminder(playbookRunID string, newReminder time.Duration) error
- func (s *PlaybookRunServiceImpl) RestoreChecklist(playbookRunID, userID string, checklistNumber int) error
- func (s *PlaybookRunServiceImpl) RestoreChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int) error
- func (s *PlaybookRunServiceImpl) RestorePlaybookRun(playbookRunID, userID string) error
- func (s *PlaybookRunServiceImpl) RunChecklistItemSlashCommand(playbookRunID, userID string, checklistNumber, itemNumber int) (string, error)
- func (s *PlaybookRunServiceImpl) SetAssignee(playbookRunID, userID, assigneeID string, checklistNumber, itemNumber int) error
- func (s *PlaybookRunServiceImpl) SetCommandToChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int, ...) error
- func (s *PlaybookRunServiceImpl) SetDueDate(playbookRunID, userID string, duedate int64, checklistNumber, itemNumber int) error
- func (s *PlaybookRunServiceImpl) SetNewReminder(playbookRunID string, newReminder time.Duration) error
- func (s *PlaybookRunServiceImpl) SetReminder(playbookRunID string, fromNow time.Duration) error
- func (s *PlaybookRunServiceImpl) SkipChecklist(playbookRunID, userID string, checklistNumber int) error
- func (s *PlaybookRunServiceImpl) SkipChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int) error
- func (s *PlaybookRunServiceImpl) ToggleCheckedState(playbookRunID, userID string, checklistNumber, itemNumber int) error
- func (s *PlaybookRunServiceImpl) Unfollow(playbookRunID, userID string) error
- func (s *PlaybookRunServiceImpl) UpdateDescription(playbookRunID, description string) error
- func (s *PlaybookRunServiceImpl) UpdateRetrospective(playbookRunID, updaterID string, newRetrospective RetrospectiveUpdate) error
- func (s *PlaybookRunServiceImpl) UpdateRunActions(playbookRunID, userID string, settings RunAction) error
- func (s *PlaybookRunServiceImpl) UpdateStatus(playbookRunID, userID string, options StatusUpdateOptions) error
- func (s *PlaybookRunServiceImpl) UserHasJoinedChannel(userID, channelID, actorID string)
- func (s *PlaybookRunServiceImpl) UserHasLeftChannel(userID, channelID, actorID string)
- type PlaybookRunStore
- type PlaybookRunTelemetry
- type PlaybookRunWebhookEvent
- type PlaybookRunWebhookPayload
- type PlaybookService
- type PlaybookStore
- type PlaybookTelemetry
- type PlaybooksInsightsList
- type PromptRunPlaybookFromKeywordsPayload
- type RequesterInfo
- type RetrospectiveUpdate
- type RunAction
- type RunLink
- type RunMetricData
- type SQLStatusPost
- type SortDirection
- type SortField
- type StatusPost
- type StatusPostComplete
- type StatusUpdateOptions
- type TimelineEvent
- type TriggerType
- type UpdateOptions
- type UserInfo
- type UserInfoStore
- type UserInfoTelemetry
- type WelcomeMessagePayload
Constants ¶
const ( // Action types: add new types to the ValidTriggerTypes array below ActionTypeWelcomeMessage ActionType = "send_welcome_message" ActionTypePromptRunPlaybook ActionType = "prompt_run_playbook" ActionTypeCategorizeChannel ActionType = "categorize_channel" // Trigger types: add new types to the ValidTriggerTypes array below TriggerTypeNewMemberJoins TriggerType = "new_member_joins" TriggerTypeKeywordsPosted TriggerType = "keywords" )
const ( PlaybookRoleMember = "playbook_member" PlaybookRoleAdmin = "playbook_admin" )
const ( MetricTypeDuration = "metric_duration" MetricTypeCurrency = "metric_currency" MetricTypeInteger = "metric_integer" )
const ( ChecklistItemStateOpen = "" ChecklistItemStateInProgress = "in_progress" ChecklistItemStateClosed = "closed" ChecklistItemStateSkipped = "skipped" )
const ( StatusInProgress = "InProgress" StatusFinished = "Finished" )
const ( RunRoleMember = "run_member" RunRoleAdmin = "run_admin" )
const ( PlaybookRunCreated timelineEventType = "incident_created" TaskStateModified timelineEventType = "task_state_modified" StatusUpdated timelineEventType = "status_updated" StatusUpdateRequested timelineEventType = "status_update_requested" OwnerChanged timelineEventType = "owner_changed" AssigneeChanged timelineEventType = "assignee_changed" RanSlashCommand timelineEventType = "ran_slash_command" EventFromPost timelineEventType = "event_from_post" UserJoinedLeft timelineEventType = "user_joined_left" PublishedRetrospective timelineEventType = "published_retrospective" CanceledRetrospective timelineEventType = "canceled_retrospective" RunFinished timelineEventType = "run_finished" RunRestored timelineEventType = "run_restored" StatusUpdateSnoozed timelineEventType = "status_update_snoozed" )
const ( ActionTypeBroadcastChannels = "broadcast_to_channels" ActionTypeBroadcastWebhooks = "broadcast_to_webhooks" TriggerTypeStatusUpdatePosted = "status_update_posted" )
const ( PlaybooksPath = "/playbooks/playbooks" RunsPath = "/playbooks/runs" )
const CurrentPlaybookExportVersion = 1
const DialogFieldDescriptionKey = "description"
DialogFieldDescriptionKey is the key for the description textarea field used in UpdatePlaybookRunDialog
const DialogFieldFinishRun = "finish_run"
DialogFieldFinishRun is the key for the "Finish run" bool field used in UpdatePlaybookRunDialog
const DialogFieldItemCommandKey = "command"
DialogFieldCommandKey is the key for the command in AddChecklistItemDialog
const DialogFieldItemDescriptionKey = "description"
DialogFieldDescriptionKey is the key for the description in AddChecklistItemDialog
const DialogFieldItemNameKey = "name"
DialogFieldItemName is the key for the playbook run name in AddChecklistItemDialog
const DialogFieldMessageKey = "message"
DialogFieldMessageKey is the key for the message textarea field used in UpdatePlaybookRunDialog
const DialogFieldNameKey = "playbookRunName"
DialogFieldNameKey is the key for the playbook run name field used in OpenCreatePlaybookRunDialog.
const DialogFieldPlaybookIDKey = "playbookID"
DialogFieldPlaybookIDKey is the key for the playbook ID field used in OpenCreatePlaybookRunDialog.
const DialogFieldPlaybookRunKey = "playbook_run"
DialogFieldPlaybookRunKey is the key for the playbook run chosen in AddToTimelineDialog
const DialogFieldReminderInSecondsKey = "reminder"
DialogFieldReminderInSecondsKey is the key for the reminder select field used in UpdatePlaybookRunDialog
const DialogFieldSummary = "summary"
DialogFieldSummary is the key for the summary in AddToTimelineDialog
const MaxMetricsPerPlaybook = 4
const PerPageDefault = 1000
const (
// PlaybookRunCreatedWSEvent is for playbook run creation.
PlaybookRunCreatedWSEvent = "playbook_run_created"
)
const RetrospectivePrefix = "retro_"
Variables ¶
var ( ErrChannelNotFound = errors.Errorf("channel not found") ErrChannelDeleted = errors.Errorf("channel deleted") ErrChannelNotInExpectedTeam = errors.Errorf("channel in different team") )
var ErrChannelDisplayNameInvalid = errors.New("channel name is invalid or too long")
ErrChannelDisplayNameInvalid is used when a channel name is too long.
var ErrDuplicateEntry = errors.New("duplicate entry")
ErrDuplicateEntry occurs when failing to insert because the entry already existed.
var ErrLicensedFeature = errors.New("not covered by current server license")
ErrLicensedFeature if the error is caused by the server not having the needed license for the feature
var ErrMalformedPlaybookRun = errors.New("malformed")
ErrMalformedPlaybookRun occurs when a playbook run is not valid.
var ErrNoPermissions = errors.New("does not have permissions")
ErrNoPermissions if the error is caused by the user not having permissions
var ErrNotFound = errors.New("not found")
ErrNotFound used when an entity is not found.
var ErrPlaybookRunActive = errors.New("already active")
ErrPlaybookRunActive occurs when trying to run a command on a playbook run that is active.
var ErrPlaybookRunNotActive = errors.New("already ended")
ErrPlaybookRunNotActive occurs when trying to run a command on a playbook run that has ended.
var ValidActionTypes = []ActionType{ ActionTypeWelcomeMessage, ActionTypePromptRunPlaybook, ActionTypeCategorizeChannel, }
var ValidTriggerTypes = []TriggerType{ TriggerTypeNewMemberJoins, TriggerTypeKeywordsPosted, }
Functions ¶
func CanManageChannelProperties ¶ added in v1.26.0
CanManageChannelProperties returns true if the userID is allowed to manage the properties of channelID
func CanPostToChannel ¶
func GeneratePlaybookExport ¶
GeneratePlaybookExport returns a playbook in export format. Fields marked with the stuct tag "export" are included using the given string.
func GetPlaybookDetailsRelativeURL ¶ added in v1.26.0
func GetRunDetailsRelativeURL ¶ added in v1.26.0
relative urls
func IsChannelActiveInTeam ¶
func IsSystemAdmin ¶
IsSystemAdmin returns true if the userID is a system admin
func IsValidDirection ¶
func IsValidDirection(direction SortDirection) bool
func ProcessSignalAnyKeywords ¶ added in v1.28.0
func ValidateCategoryName ¶ added in v1.28.0
func ValidateWebhookURLs ¶ added in v1.28.0
Types ¶
type ActionType ¶ added in v1.26.0
type ActionType string
type AssignedRun ¶
type AssignedRun struct { RunLink Tasks []AssignedTask }
AssignedRun represents all the info needed to display a Run & ChecklistItem to a user
type AssignedTask ¶
type AssignedTask struct { // ID is the identifier of the containing checklist. ChecklistID string // Title is the name of the containing checklist. ChecklistTitle string ChecklistItem }
AssignedTask represents a ChecklistItem + extra info needed to display to a user
type CategorizeChannelPayload ¶ added in v1.26.0
type CategorizeChannelPayload struct {
CategoryName string `json:"category_name" mapstructure:"category_name"`
}
type Category ¶ added in v1.31.0
type Category struct { ID string `json:"id"` Name string `json:"name"` TeamID string `json:"team_id"` UserID string `json:"user_id"` Collapsed bool `json:"collapsed"` CreateAt int64 `json:"create_at"` UpdateAt int64 `json:"update_at"` DeleteAt int64 `json:"delete_at"` Items []CategoryItem `json:"items"` }
Category represents sidebar category with items
func (*Category) ContainsItem ¶ added in v1.31.0
func (c *Category) ContainsItem(item CategoryItem) bool
type CategoryItem ¶ added in v1.31.0
type CategoryItem struct { ItemID string `json:"item_id"` Type CategoryItemType `json:"type"` Name string `json:"name"` Public bool `json:"public"` }
type CategoryItemType ¶ added in v1.31.0
type CategoryItemType string
const ( PlaybookItemType CategoryItemType = "p" RunItemType CategoryItemType = "r" )
func StringToItemType ¶ added in v1.31.0
func StringToItemType(item string) (CategoryItemType, error)
type CategoryService ¶ added in v1.31.0
type CategoryService interface { // Create creates a new Category Create(category Category) (string, error) // Get retrieves category with categoryID for user for team Get(categoryID string) (Category, error) // GetCategories retrieves all categories for user for team GetCategories(teamID, userID string) ([]Category, error) // Update updates a category Update(category Category) error // Delete deletes a category Delete(categoryID string) error // AddFavorite favorites an item, which may be either run or playbook AddFavorite(item CategoryItem, teamID, userID string) error // DeleteFavorite unfavorites an item, which may be either run or playbook DeleteFavorite(item CategoryItem, teamID, userID string) error // IsItemFavorite returns whether item was favorited or not IsItemFavorite(item CategoryItem, teamID, userID string) (bool, error) }
CategoryService is the category service for managing categories
func NewCategoryService ¶ added in v1.31.0
func NewCategoryService(store CategoryStore, api *pluginapi.Client, categoryTelemetry CategoryTelemetry) CategoryService
NewPlaybookService returns a new playbook service
type CategoryStore ¶ added in v1.31.0
type CategoryStore interface { // Get retrieves a Category. Returns ErrNotFound if not found. Get(id string) (Category, error) // Create creates a new Category Create(category Category) error // GetCategories retrieves all categories for user for team GetCategories(teamID, userID string) ([]Category, error) // Update updates a category Update(category Category) error // Delete deletes a category Delete(categoryID string) error // GetFavoriteCategory returns favorite category GetFavoriteCategory(teamID, userID string) (Category, error) // AddItemToFavoriteCategory adds an item to favorite category, // if favorite category does not exist it creates one AddItemToFavoriteCategory(item CategoryItem, teamID, userID string) error // AddItemToCategory adds an item to category AddItemToCategory(item CategoryItem, categoryID string) error // DeleteItemFromCategory adds an item to category DeleteItemFromCategory(item CategoryItem, categoryID string) error }
type CategoryTelemetry ¶ added in v1.31.0
type CategoryTelemetry interface { // FavoriteItem tracks run favoriting of an item. Item can be run or a playbook FavoriteItem(item CategoryItem, userID string) // UnfavoriteItem tracks run unfavoriting of an item. Item can be run or a playbook UnfavoriteItem(item CategoryItem, userID string) }
type ChannelActionService ¶ added in v1.26.0
type ChannelActionService interface { // Create creates a new action Create(action GenericChannelAction) (string, error) // Get returns the action identified by id Get(id string) (GenericChannelAction, error) // GetChannelActions returns all actions in channelID, // filtered with the options if different from its zero value GetChannelActions(channelID string, options GetChannelActionOptions) ([]GenericChannelAction, error) // Validate checks that the action type, trigger type and // payload are all valid and consistent with each other Validate(action GenericChannelAction) error // Update updates an existing action identified by action.ID Update(action GenericChannelAction, userID string) error // UserHasJoinedChannel is called when userID has joined channelID. If actorID is not blank, userID // was invited by actorID. UserHasJoinedChannel(userID, channelID, actorID string) // CheckAndSendMessageOnJoin checks if userID has viewed channelID and sends // the registered welcome message action. Returns true if the message was sent. CheckAndSendMessageOnJoin(userID, channelID string) bool // MessageHasBeenPosted suggests playbooks to the user if triggered MessageHasBeenPosted(sessionID string, post *model.Post) }
func NewChannelActionsService ¶ added in v1.26.0
func NewChannelActionsService(api *pluginapi.Client, logger bot.Logger, poster bot.Poster, configService config.Service, store ChannelActionStore, playbookGetter PlaybookGetter, keywordsThreadIgnorer KeywordsThreadIgnorer, telemetry ChannelActionTelemetry) ChannelActionService
type ChannelActionStore ¶ added in v1.26.0
type ChannelActionStore interface { // Create creates a new action Create(action GenericChannelAction) (string, error) // Get returns the action identified by id Get(id string) (GenericChannelAction, error) // GetChannelActions returns all actions in channelID, // filtered with the options if different from its zero value GetChannelActions(channelID string, options GetChannelActionOptions) ([]GenericChannelAction, error) // Update updates an existing action identified by action.ID Update(action GenericChannelAction) error // HasViewedChannel returns true if userID has viewed channelID HasViewedChannel(userID, channelID string) bool // SetViewedChannel records that userID has viewed channelID. NOTE: does not check if there is already a // record of that userID/channelID (i.e., will create duplicate rows) SetViewedChannel(userID, channelID string) error // SetViewedChannel records that all users in userIDs have viewed channelID. SetMultipleViewedChannel(userIDs []string, channelID string) error }
type ChannelActionTelemetry ¶ added in v1.26.0
type ChannelActionTelemetry interface { // RunChannelAction tracks the execution of a channel action, performed by the specified user. RunChannelAction(action GenericChannelAction, userID string) // UpdateChannelAction tracks the update of a channel action, performed by the specified user. UpdateChannelAction(action GenericChannelAction, userID string) }
ChannelActionTelemetry defines the methods that the ChannelAction service needs from RudderTelemetry. userID is the user initiating the event.
type Checklist ¶
type Checklist struct { // ID is the identifier of the checklist. ID string `json:"id" export:"-"` // Title is the name of the checklist. Title string `json:"title" export:"title"` // Items is an array of all the items in the checklist. Items []ChecklistItem `json:"items" export:"-"` }
Checklist represents a checklist in a playbook.
type ChecklistItem ¶
type ChecklistItem struct { // ID is the identifier of the checklist item. ID string `json:"id" export:"-"` // Title is the content of the checklist item. Title string `json:"title" export:"title"` // State is the state of the checklist item: "closed" if it's checked, "skipped" if it has // been skipped, the empty string otherwise. State string `json:"state" export:"-"` // StateModified is the timestamp, in milliseconds since epoch, of the last time the item's // state was modified. 0 if it was never modified. StateModified int64 `json:"state_modified" export:"-"` // AssigneeID is the identifier of the user to whom this item is assigned. AssigneeID string `json:"assignee_id" export:"-"` // AssigneeModified is the timestamp, in milliseconds since epoch, of the last time the item's // assignee was modified. 0 if it was never modified. AssigneeModified int64 `json:"assignee_modified" export:"-"` // Command, if not empty, is the slash command that can be run as part of this item. Command string `json:"command" export:"command"` // CommandLastRun is the timestamp, in milliseconds since epoch, of the last time the item's // slash command was run. 0 if it was never run. CommandLastRun int64 `json:"command_last_run" export:"-"` // Description is a string with the markdown content of the long description of the item. Description string `json:"description" export:"description"` // LastSkipped is the timestamp, in milliseconds since epoch, of the last time the item // was skipped. 0 if it was never skipped. LastSkipped int64 `json:"delete_at" export:"-"` // DueDate is the timestamp, in milliseconds since epoch. indicates relative or absolute due date // of the checklist item. 0 if not set. // Playbook can have only relative timstamp, run can have only absolute timestamp. DueDate int64 `json:"due_date" export:"due_date"` }
ChecklistItem represents an item in a checklist.
type DialogState ¶
type DialogState struct { PostID string `json:"post_id"` ClientID string `json:"client_id"` PromptPostID string `json:"prompt_post_id"` }
DialogState holds the start playbook run interactive dialog's state as it appears in the client and is submitted back to the server.
type DialogStateAddToTimeline ¶
type DialogStateAddToTimeline struct {
PostID string `json:"post_id"`
}
type DigestNotificationSettings ¶
type DigestNotificationSettings struct {
DisableDailyDigest bool `json:"disable_daily_digest"`
}
DigestNotificationSettings is a separate type to make it easy to marshal/unmarshal it into JSON in the sqlstore. It is set by the user with the `/playbook settings digest [on/off]` slash command.
type GenericChannelAction ¶ added in v1.26.0
type GenericChannelAction struct { GenericChannelActionWithoutPayload Payload interface{} `json:"payload"` }
type GenericChannelActionWithoutPayload ¶ added in v1.26.0
type GenericChannelActionWithoutPayload struct { ID string `json:"id"` ChannelID string `json:"channel_id"` Enabled bool `json:"enabled"` DeleteAt int64 `json:"delete_at"` ActionType ActionType `json:"action_type"` TriggerType TriggerType `json:"trigger_type"` }
type GetChannelActionOptions ¶ added in v1.26.0
type GetChannelActionOptions struct { ActionType ActionType TriggerType TriggerType }
type GetPlaybookRunsResults ¶
type GetPlaybookRunsResults struct { TotalCount int `json:"total_count"` PageCount int `json:"page_count"` HasMore bool `json:"has_more"` Items []PlaybookRun `json:"items"` }
GetPlaybookRunsResults collects the results of the GetPlaybookRuns call: the list of PlaybookRuns matching the HeaderFilterOptions, and the TotalCount of the matching playbook runs before paging was applied.
func (GetPlaybookRunsResults) Clone ¶
func (r GetPlaybookRunsResults) Clone() GetPlaybookRunsResults
func (GetPlaybookRunsResults) MarshalJSON ¶
func (r GetPlaybookRunsResults) MarshalJSON() ([]byte, error)
type GetPlaybooksResults ¶
type GetPlaybooksResults struct { TotalCount int `json:"total_count"` PageCount int `json:"page_count"` HasMore bool `json:"has_more"` Items []Playbook `json:"items"` }
func (GetPlaybooksResults) MarshalJSON ¶
func (r GetPlaybooksResults) MarshalJSON() ([]byte, error)
MarshalJSON customizes the JSON marshalling for GetPlaybooksResults by rendering a nil Items as an empty slice instead.
type JobOnceScheduler ¶
type KeywordsThreadIgnorer ¶
type KeywordsThreadIgnorer interface { Ignore(postID, userID string) IsIgnored(postID, userID string) bool }
func NewKeywordsThreadIgnorer ¶
func NewKeywordsThreadIgnorer() KeywordsThreadIgnorer
type LicenseChecker ¶
type Metadata ¶
type Metadata struct { ChannelName string `json:"channel_name"` ChannelDisplayName string `json:"channel_display_name"` TeamName string `json:"team_name"` NumParticipants int64 `json:"num_participants"` TotalPosts int64 `json:"total_posts"` Followers []string `json:"followers"` }
Metadata tracks ancillary metadata about a playbook run.
type OwnerInfo ¶
type OwnerInfo struct { UserID string `json:"user_id"` Username string `json:"username"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Nickname string `json:"nickname"` }
OwnerInfo holds the summary information of a owner.
type PermissionsService ¶
type PermissionsService struct {
// contains filtered or unexported fields
}
func NewPermissionsService ¶
func NewPermissionsService( playbookService PlaybookService, runService PlaybookRunService, pluginAPI *pluginapi.Client, configService config.Service, licenseChecker LicenseChecker, ) *PermissionsService
func (*PermissionsService) ChannelActionCreate ¶ added in v1.26.0
func (p *PermissionsService) ChannelActionCreate(userID, channelID string) error
func (*PermissionsService) ChannelActionUpdate ¶ added in v1.26.0
func (p *PermissionsService) ChannelActionUpdate(userID, channelID string) error
func (*PermissionsService) ChannelActionView ¶ added in v1.26.0
func (p *PermissionsService) ChannelActionView(userID, channelID string) error
func (*PermissionsService) DeletePlaybook ¶
func (p *PermissionsService) DeletePlaybook(userID string, playbook Playbook) error
func (*PermissionsService) FilterInvitedGroupIDs ¶ added in v1.28.0
func (p *PermissionsService) FilterInvitedGroupIDs(invitedGroupIDs []string) []string
func (*PermissionsService) FilterInvitedUserIDs ¶ added in v1.28.0
func (p *PermissionsService) FilterInvitedUserIDs(invitedUserIDs []string, teamID string) []string
func (*PermissionsService) NoAddedBroadcastChannelsWithoutPermission ¶ added in v1.28.0
func (p *PermissionsService) NoAddedBroadcastChannelsWithoutPermission(userID string, broadcastChannelIDs, oldBroadcastChannelIDs []string) error
func (*PermissionsService) PlaybookCreate ¶
func (p *PermissionsService) PlaybookCreate(userID string, playbook Playbook) error
func (*PermissionsService) PlaybookIsPublic ¶
func (p *PermissionsService) PlaybookIsPublic(playbook Playbook) bool
func (*PermissionsService) PlaybookList ¶
func (p *PermissionsService) PlaybookList(userID, teamID string) error
func (*PermissionsService) PlaybookMakePrivate ¶
func (p *PermissionsService) PlaybookMakePrivate(userID string, playbook Playbook) error
func (*PermissionsService) PlaybookMakePublic ¶
func (p *PermissionsService) PlaybookMakePublic(userID string, playbook Playbook) error
func (*PermissionsService) PlaybookManageMembers ¶
func (p *PermissionsService) PlaybookManageMembers(userID string, playbook Playbook) error
func (*PermissionsService) PlaybookManageProperties ¶
func (p *PermissionsService) PlaybookManageProperties(userID string, playbook Playbook) error
func (*PermissionsService) PlaybookManageRoles ¶ added in v1.26.0
func (p *PermissionsService) PlaybookManageRoles(userID string, playbook Playbook) error
func (*PermissionsService) PlaybookModifyWithFixes ¶
func (p *PermissionsService) PlaybookModifyWithFixes(userID string, playbook *Playbook, oldPlaybook Playbook) error
PlaybookodifyWithFixes checks both ManageProperties and ManageMembers permissions performs permissions checks that can be resolved though modification of the input. This function modifies the playbook argument.
func (*PermissionsService) PlaybookView ¶
func (p *PermissionsService) PlaybookView(userID string, playbookID string) error
func (*PermissionsService) PlaybookViewWithPlaybook ¶
func (p *PermissionsService) PlaybookViewWithPlaybook(userID string, playbook Playbook) error
func (*PermissionsService) RunCreate ¶
func (p *PermissionsService) RunCreate(userID string, playbook Playbook) error
func (*PermissionsService) RunManageProperties ¶
func (p *PermissionsService) RunManageProperties(userID, runID string) error
func (*PermissionsService) RunManagePropertiesByChannel ¶
func (p *PermissionsService) RunManagePropertiesByChannel(userID, channelID string) error
func (*PermissionsService) RunView ¶
func (p *PermissionsService) RunView(userID, runID string) error
func (*PermissionsService) RunViewByChannel ¶
func (p *PermissionsService) RunViewByChannel(userID, channelID string) error
type Playbook ¶
type Playbook struct { ID string `json:"id" export:"-"` Title string `json:"title" export:"title"` Description string `json:"description" export:"description"` Public bool `json:"public" export:"-"` TeamID string `json:"team_id" export:"-"` CreatePublicPlaybookRun bool `json:"create_public_playbook_run" export:"-"` CreateAt int64 `json:"create_at" export:"-"` UpdateAt int64 `json:"update_at" export:"-"` DeleteAt int64 `json:"delete_at" export:"-"` NumStages int64 `json:"num_stages" export:"-"` NumSteps int64 `json:"num_steps" export:"-"` NumRuns int64 `json:"num_runs" export:"-"` NumActions int64 `json:"num_actions" export:"-"` LastRunAt int64 `json:"last_run_at" export:"-"` Checklists []Checklist `json:"checklists" export:"-"` Members []PlaybookMember `json:"members" export:"-"` ReminderMessageTemplate string `json:"reminder_message_template" export:"reminder_message_template"` ReminderTimerDefaultSeconds int64 `json:"reminder_timer_default_seconds" export:"reminder_timer_default_seconds"` StatusUpdateEnabled bool `json:"status_update_enabled" export:"status_update_enabled"` InvitedUserIDs []string `json:"invited_user_ids" export:"-"` InvitedGroupIDs []string `json:"invited_group_ids" export:"-"` InviteUsersEnabled bool `json:"invite_users_enabled" export:"-"` DefaultOwnerID string `json:"default_owner_id" export:"-"` DefaultOwnerEnabled bool `json:"default_owner_enabled" export:"-"` BroadcastChannelIDs []string `json:"broadcast_channel_ids" export:"-"` WebhookOnCreationURLs []string `json:"webhook_on_creation_urls" export:"-"` WebhookOnCreationEnabled bool `json:"webhook_on_creation_enabled" export:"-"` MessageOnJoin string `json:"message_on_join" export:"message_on_join"` MessageOnJoinEnabled bool `json:"message_on_join_enabled" export:"message_on_join_enabled"` RetrospectiveReminderIntervalSeconds int64 `json:"retrospective_reminder_interval_seconds" export:"retrospective_reminder_interval_seconds"` RetrospectiveTemplate string `json:"retrospective_template" export:"retrospective_template"` RetrospectiveEnabled bool `json:"retrospective_enabled" export:"retrospective_enabled"` WebhookOnStatusUpdateURLs []string `json:"webhook_on_status_update_urls" export:"-"` SignalAnyKeywords []string `json:"signal_any_keywords" export:"signal_any_keywords"` SignalAnyKeywordsEnabled bool `json:"signal_any_keywords_enabled" export:"signal_any_keywords_enabled"` CategorizeChannelEnabled bool `json:"categorize_channel_enabled" export:"categorize_channel_enabled"` CategoryName string `json:"category_name" export:"category_name"` RunSummaryTemplateEnabled bool `json:"run_summary_template_enabled" export:"run_summary_template_enabled"` RunSummaryTemplate string `json:"run_summary_template" export:"run_summary_template"` ChannelNameTemplate string `json:"channel_name_template" export:"channel_name_template"` DefaultPlaybookAdminRole string `json:"default_playbook_admin_role" export:"-"` DefaultPlaybookMemberRole string `json:"default_playbook_member_role" export:"-"` DefaultRunAdminRole string `json:"default_run_admin_role" export:"-"` DefaultRunMemberRole string `json:"default_run_member_role" export:"-"` Metrics []PlaybookMetricConfig `json:"metrics" export:"metrics"` ActiveRuns int64 `json:"active_runs" export:"-"` // Deprecated: preserved for backwards compatibility with v1.27 BroadcastEnabled bool `json:"broadcast_enabled" export:"-"` WebhookOnStatusUpdateEnabled bool `json:"webhook_on_status_update_enabled" export:"-"` }
Playbook represents a desired business outcome, from which playbook runs are started to solve a specific instance. The tag export supports the export/import feature. If the field makes sense for export, the value should be the JSON name of the item in the export format. If the field should not be exported the value should be "-". Fields should be exported if they are not server specific like InvitedUserIDs or are tracking metadata like CreateAt.
func (Playbook) MarshalJSON ¶
type PlaybookFilterOptions ¶
type PlaybookFilterOptions struct { Sort SortField Direction SortDirection SearchTerm string WithArchived bool WithMembershipOnly bool //if true will return only playbooks you are a member of // Pagination options. Page int PerPage int }
PlaybookFilterOptions specifies the parameters when getting playbooks.
func (*PlaybookFilterOptions) Clone ¶
func (o *PlaybookFilterOptions) Clone() PlaybookFilterOptions
Clone duplicates the given options.
func (PlaybookFilterOptions) Validate ¶
func (o PlaybookFilterOptions) Validate() (PlaybookFilterOptions, error)
Validate returns a new, validated filter options or returns an error if invalid.
type PlaybookGetter ¶ added in v1.26.0
type PlaybookInsight ¶ added in v1.32.0
type PlaybookInsight struct { // ID of the playbook // required: true PlaybookID string `json:"playbook_id"` // Run count of playbook // required: true NumRuns int `json:"num_runs"` // Title of playbook // required: true Title string `json:"title"` // Time the playbook was last run. // required: false LastRunAt int64 `json:"last_run_at"` }
type PlaybookMember ¶
type PlaybookMember struct { UserID string `json:"user_id"` Roles []string `json:"roles"` SchemeRoles []string `json:"scheme_roles"` }
func (PlaybookMember) Clone ¶
func (pm PlaybookMember) Clone() PlaybookMember
type PlaybookMetricConfig ¶
type PlaybookMetricConfig struct { ID string `json:"id" export:"-"` PlaybookID string `json:"playbook_id" export:"-"` Title string `json:"title" export:"title"` Description string `json:"description" export:"description"` Type string `json:"type" export:"type"` Target null.Int `json:"target" export:"target"` }
type PlaybookRun ¶
type PlaybookRun struct { // ID is the unique identifier of the playbook run. ID string `json:"id"` // Name is the name of the playbook run's channel. Name string `json:"name"` // Summary is a short string, in Markdown, describing what the run is. Summary string `json:"summary"` // SummaryModifiedAt is date when the summary was modified SummaryModifiedAt int64 `json:"summary_modified_at"` // OwnerUserID is the user identifier of the playbook run's owner. OwnerUserID string `json:"owner_user_id"` // ReporterUserID is the user identifier of the playbook run's reporter; i.e., the user that created the run. ReporterUserID string `json:"reporter_user_id"` // TeamID is the identifier of the team the playbook run lives in. TeamID string `json:"team_id"` // ChannelID is the identifier of the playbook run's channel. ChannelID string `json:"channel_id"` // CreateAt is the timestamp, in milliseconds since epoch, of when the playbook run was created. CreateAt int64 `json:"create_at"` // EndAt is the timestamp, in milliseconds since epoch, of when the playbook run was ended. // If 0, the run is still ongoing. EndAt int64 `json:"end_at"` // Deprecated: preserved for backwards compatibility with v1.2. DeleteAt int64 `json:"delete_at"` // Deprecated: preserved for backwards compatibility with v1.2. ActiveStage int `json:"active_stage"` // Deprecated: preserved for backwards compatibility with v1.2. ActiveStageTitle string `json:"active_stage_title"` // PostID, if not empty, is the identifier of the post from which this playbook run was originally created. PostID string `json:"post_id"` // PlaybookID is the identifier of the playbook from which this run was created. PlaybookID string `json:"playbook_id"` // Checklists is an array of the checklists in the run. Checklists []Checklist `json:"checklists"` // StatusPosts is an array of all the status updates posted in the run. StatusPosts []StatusPost `json:"status_posts"` // CurrentStatus is the current status of the playbook run. // It can be StatusInProgress ("InProgress") or StatusFinished ("Finished") CurrentStatus string `json:"current_status"` // LastStatusUpdateAt is the timestamp, in milliseconds since epoch, of the time the last // status update was posted. LastStatusUpdateAt int64 `json:"last_status_update_at"` // ReminderPostID, if not empty, is the identifier of the reminder posted to the channel to // update the status. ReminderPostID string `json:"reminder_post_id"` // PreviousReminder, if not empty, is the time.Duration (nanoseconds) at which the next // scheduled status update will be posted. PreviousReminder time.Duration `json:"previous_reminder"` // ReminderMessageTemplate, if not empty, is the template shown when updating the status of the // playbook run for the first time. ReminderMessageTemplate string `json:"reminder_message_template"` // ReminderTimerDefaultSeconds is the expected default interval, in seconds, // between every status update ReminderTimerDefaultSeconds int64 `json:"reminder_timer_default_seconds"` //Defines if status update functionality is enabled StatusUpdateEnabled bool `json:"status_update_enabled"` // InvitedUserIDs, if not empty, is an array containing the identifiers of the users that were // automatically invited to the playbook run when it was created. InvitedUserIDs []string `json:"invited_user_ids"` // InvitedGroupIDs, if not empty, is an array containing the identifiers of the user groups that // were automatically invited to the playbook run when it was created. InvitedGroupIDs []string `json:"invited_group_ids"` // TimelineEvents is an array of the events saved to the timeline of the playbook run. TimelineEvents []TimelineEvent `json:"timeline_events"` // DefaultOwnerID, if not empty, is the identifier of the user that was automatically assigned // as owner of the playbook run when it was created. DefaultOwnerID string `json:"default_owner_id"` // BroadcastChannelIDs is an array of the identifiers of the channels where the playbook run // creation and status updates are announced. BroadcastChannelIDs []string `json:"broadcast_channel_ids"` // WebhookOnCreationURLs, if not empty, is the URL to which a POST request is made with the whole // playbook run as payload when the run is created. WebhookOnCreationURLs []string `json:"webhook_on_creation_urls"` // WebhookOnStatusUpdateURLs, if not empty, is the URL to which a POST request is made with the // whole playbook run as payload every time the status of the playbook run is updated. WebhookOnStatusUpdateURLs []string `json:"webhook_on_status_update_urls"` // StatusUpdateBroadcastChannelsEnabled is true if the channels broadcast action is enabled for // the run status update event, false otherwise. StatusUpdateBroadcastChannelsEnabled bool `json:"status_update_broadcast_channels_enabled"` // StatusUpdateBroadcastWebhooksEnabled is true if the webhooks broadcast action is enabled for // the run status update event, false otherwise. StatusUpdateBroadcastWebhooksEnabled bool `json:"status_update_broadcast_webhooks_enabled"` // Retrospective is a string containing the currently saved retrospective. // If RetrospectivePublishedAt is different than 0, this is the final published retrospective. Retrospective string `json:"retrospective"` // RetrospectivePublishedAt is the timestamp, in milliseconds since epoch, of the last time a // retrospective was published. If 0, the retrospective has not been published yet. RetrospectivePublishedAt int64 `json:"retrospective_published_at"` // RetrospectiveWasCanceled is true if the retrospective was cancelled, false otherwise. RetrospectiveWasCanceled bool `json:"retrospective_was_canceled"` // RetrospectiveReminderIntervalSeconds is the interval, in seconds, between subsequent reminders // to fill the retrospective. RetrospectiveReminderIntervalSeconds int64 `json:"retrospective_reminder_interval_seconds"` // Defines if retrospective functionality is enabled RetrospectiveEnabled bool `json:"retrospective_enabled"` // MessageOnJoin, if not empty, is the message shown to every user that joins the channel of // the playbook run. MessageOnJoin string `json:"message_on_join"` // ParticipantIDs is an array of the identifiers of all the participants in the playbook run. // A participant is any member of the playbook run channel that isn't a bot. ParticipantIDs []string `json:"participant_ids"` // CategoryName, if not empty, is the name of the category where the run channel will live. CategoryName string `json:"category_name"` // Playbook run metric values MetricsData []RunMetricData `json:"metrics_data"` }
PlaybookRun holds the detailed information of a playbook run.
NOTE: When adding a column to the db, search for "When adding a PlaybookRun column" to see where that column needs to be added in the sqlstore code.
func (*PlaybookRun) Clone ¶
func (r *PlaybookRun) Clone() *PlaybookRun
func (*PlaybookRun) MarshalJSON ¶
func (r *PlaybookRun) MarshalJSON() ([]byte, error)
func (*PlaybookRun) SetChecklistFromPlaybook ¶ added in v1.31.0
func (r *PlaybookRun) SetChecklistFromPlaybook(playbook Playbook)
SetChecklistFromPlaybook overwrites this run's checklists with the ones in the provided playbook.
func (*PlaybookRun) SetConfigurationFromPlaybook ¶ added in v1.31.0
func (r *PlaybookRun) SetConfigurationFromPlaybook(playbook Playbook)
SetConfigurationFromPlaybook overwrites this run's configuration with the data from the provided playbook, effectively snapshoting the playbook's configuration in this moment of time.
type PlaybookRunFilterOptions ¶
type PlaybookRunFilterOptions struct { // Gets all the headers with this TeamID. TeamID string `url:"team_id,omitempty"` // Pagination options. Page int `url:"page,omitempty"` PerPage int `url:"per_page,omitempty"` // Sort sorts by this header field in json format (eg, "create_at", "end_at", "name", etc.); // defaults to "create_at". Sort SortField `url:"sort,omitempty"` // Direction orders by ascending or descending, defaulting to ascending. Direction SortDirection `url:"direction,omitempty"` // Statuses filters by all statuses in the list (inclusive) Statuses []string // OwnerID filters by owner's Mattermost user ID. Defaults to blank (no filter). OwnerID string `url:"owner_user_id,omitempty"` // ParticipantID filters playbook runs that have this member. Defaults to blank (no filter). ParticipantID string `url:"participant_id,omitempty"` // ParticipantOrFollowerID filters playbook runs that have this user as member or as follower. Defaults to blank (no filter). ParticipantOrFollowerID string `url:"participant_or_follower,omitempty"` // IncludeFavorites filters playbook runs that ParticipantOrFollowerID has marked as favorite. // There's no impact if ParticipantOrFollowerID is empty. IncludeFavorites bool `url:"include_favorites,omitempty"` // SearchTerm returns results of the search term and respecting the other header filter options. // The search term acts as a filter and respects the Sort and Direction fields (i.e., results are // not returned in relevance order). SearchTerm string `url:"search_term,omitempty"` // PlaybookID filters playbook runs that are derived from this playbook id. // Defaults to blank (no filter). PlaybookID string `url:"playbook_id,omitempty"` // ActiveGTE filters playbook runs that were active after (or equal) to the unix time given (in millis). // A value of 0 means the filter is ignored (which is the default). ActiveGTE int64 `url:"active_gte,omitempty"` // ActiveLT filters playbook runs that were active before the unix time given (in millis). // A value of 0 means the filter is ignored (which is the default). ActiveLT int64 `url:"active_lt,omitempty"` // StartedGTE filters playbook runs that were started after (or equal) to the unix time given (in millis). // A value of 0 means the filter is ignored (which is the default). StartedGTE int64 `url:"started_gte,omitempty"` // StartedLT filters playbook runs that were started before the unix time given (in millis). // A value of 0 means the filter is ignored (which is the default). StartedLT int64 `url:"started_lt,omitempty"` }
PlaybookRunFilterOptions specifies the optional parameters when getting playbook runs.
func (*PlaybookRunFilterOptions) Clone ¶
func (o *PlaybookRunFilterOptions) Clone() PlaybookRunFilterOptions
Clone duplicates the given options.
func (PlaybookRunFilterOptions) Validate ¶
func (o PlaybookRunFilterOptions) Validate() (PlaybookRunFilterOptions, error)
Validate returns a new, validated filter options or returns an error if invalid.
type PlaybookRunService ¶
type PlaybookRunService interface { // GetPlaybookRuns returns filtered playbook runs and the total count before paging. GetPlaybookRuns(requesterInfo RequesterInfo, options PlaybookRunFilterOptions) (*GetPlaybookRunsResults, error) // CreatePlaybookRun creates a new playbook run. userID is the user who initiated the CreatePlaybookRun. CreatePlaybookRun(playbookRun *PlaybookRun, playbook *Playbook, userID string, public bool) (*PlaybookRun, error) // OpenCreatePlaybookRunDialog opens an interactive dialog to start a new playbook run. OpenCreatePlaybookRunDialog(teamID, ownerID, triggerID, postID, clientID string, playbooks []Playbook, isMobileApp bool, promptPostID string) error // OpenUpdateStatusDialog opens an interactive dialog so the user can update the playbook run's status. OpenUpdateStatusDialog(playbookRunID, triggerID string) error // OpenAddToTimelineDialog opens an interactive dialog so the user can add a post to the playbook run timeline. OpenAddToTimelineDialog(requesterInfo RequesterInfo, postID, teamID, triggerID string) error // OpenAddChecklistItemDialog opens an interactive dialog so the user can add a post to the playbook run timeline. OpenAddChecklistItemDialog(triggerID, playbookRunID string, checklist int) error // AddPostToTimeline adds an event based on a post to a playbook run's timeline. AddPostToTimeline(playbookRunID, userID, postID, summary string) error // RemoveTimelineEvent removes the timeline event (sets the DeleteAt to the current time). RemoveTimelineEvent(playbookRunID, userID, eventID string) error // UpdateStatus updates a playbook run's status. UpdateStatus(playbookRunID, userID string, options StatusUpdateOptions) error // OpenFinishPlaybookRunDialog opens the dialog to confirm the run should be finished. OpenFinishPlaybookRunDialog(playbookRunID, triggerID string) error // FinishPlaybookRun changes a run's state to Finished. If run is already in Finished state, the call is a noop. FinishPlaybookRun(playbookRunID, userID string) error // GetPlaybookRun gets a playbook run by ID. Returns error if it could not be found. GetPlaybookRun(playbookRunID string) (*PlaybookRun, error) // GetPlaybookRunMetadata gets ancillary metadata about a playbook run. GetPlaybookRunMetadata(playbookRunID string) (*Metadata, error) // GetPlaybookRunIDForChannel get the playbookRunID associated with this channel. Returns ErrNotFound // if there is no playbook run associated with this channel. GetPlaybookRunIDForChannel(channelID string) (string, error) // GetOwners returns all the owners of playbook runs selected GetOwners(requesterInfo RequesterInfo, options PlaybookRunFilterOptions) ([]OwnerInfo, error) // IsOwner returns true if the userID is the owner for playbookRunID. IsOwner(playbookRunID string, userID string) bool // ChangeOwner processes a request from userID to change the owner for playbookRunID // to ownerID. Changing to the same ownerID is a no-op. ChangeOwner(playbookRunID string, userID string, ownerID string) error // ModifyCheckedState modifies the state of the specified checklist item // Idempotent, will not perform any actions if the checklist item is already in the specified state ModifyCheckedState(playbookRunID, userID, newState string, checklistNumber int, itemNumber int) error // ToggleCheckedState checks or unchecks the specified checklist item ToggleCheckedState(playbookRunID, userID string, checklistNumber, itemNumber int) error // SetAssignee sets the assignee for the specified checklist item // Idempotent, will not perform any actions if the checklist item is already assigned to assigneeID SetAssignee(playbookRunID, userID, assigneeID string, checklistNumber, itemNumber int) error // SetCommandToChecklistItem sets command to checklist item SetCommandToChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int, newCommand string) error // SetDueDate sets absolute due date timestamp for the specified checklist item SetDueDate(playbookRunID, userID string, duedate int64, checklistNumber, itemNumber int) error // RunChecklistItemSlashCommand executes the slash command associated with the specified checklist item. RunChecklistItemSlashCommand(playbookRunID, userID string, checklistNumber, itemNumber int) (string, error) // DuplicateChecklistItem duplicates the checklist item. DuplicateChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int) error // AddChecklistItem adds an item to the specified checklist AddChecklistItem(playbookRunID, userID string, checklistNumber int, checklistItem ChecklistItem) error // RemoveChecklistItem removes an item from the specified checklist RemoveChecklistItem(playbookRunID, userID string, checklistNumber int, itemNumber int) error // DuplicateChecklist duplicates a checklist DuplicateChecklist(playbookRunID, userID string, checklistNumber int) error // SkipChecklist skips a checklist SkipChecklist(playbookRunID, userID string, checklistNumber int) error // RestoreChecklist restores a skipped checklist RestoreChecklist(playbookRunID, userID string, checklistNumber int) error // SkipChecklistItem removes an item from the specified checklist SkipChecklistItem(playbookRunID, userID string, checklistNumber int, itemNumber int) error // RestoreChecklistItem restores a skipped item from the specified checklist RestoreChecklistItem(playbookRunID, userID string, checklistNumber int, itemNumber int) error // EditChecklistItem changes the title, command and description of a specified checklist item. EditChecklistItem(playbookRunID, userID string, checklistNumber int, itemNumber int, newTitle, newCommand, newDescription string) error // MoveChecklistItem moves a checklist item from one position to another. MoveChecklist(playbookRunID, userID string, sourceChecklistIdx, destChecklistIdx int) error // MoveChecklistItem moves a checklist item from one position to another. MoveChecklistItem(playbookRunID, userID string, sourceChecklistIdx, sourceItemIdx, destChecklistIdx, destItemIdx int) error // GetChecklistItemAutocomplete returns the list of checklist items for playbookRunID to be used in autocomplete GetChecklistItemAutocomplete(playbookRunID string) ([]model.AutocompleteListItem, error) // GetChecklistAutocomplete returns the list of checklists for playbookRunID to be used in autocomplete GetChecklistAutocomplete(playbookRunID string) ([]model.AutocompleteListItem, error) // AddChecklist prepends a new checklist to the specified run AddChecklist(playbookRunID, userID string, checklist Checklist) error // RemoveChecklist removes the specified checklist. RemoveChecklist(playbookRunID, userID string, checklistNumber int) error // RenameChecklist renames the specified checklist RenameChecklist(playbookRunID, userID string, checklistNumber int, newTitle string) error // NukeDB removes all playbook run related data. NukeDB() error // SetReminder sets a reminder. After time.Now().Add(fromNow) in the future, // the owner will be reminded to update the playbook run's status. SetReminder(playbookRunID string, fromNow time.Duration) error // RemoveReminder removes the pending reminder for playbookRunID (if any). RemoveReminder(playbookRunID string) // HandleReminder is the handler for all reminder events. HandleReminder(key string) // SetNewReminder sets a new reminder for playbookRunID, removes any pending reminder, removes the // reminder post in the playbookRun's channel, and resets the PreviousReminder and // LastStatusUpdateAt (so the countdown timer to "update due" shows the correct time) SetNewReminder(playbookRunID string, newReminder time.Duration) error // ResetReminder records an event for snoozing a reminder, then calls SetNewReminder to create // the next reminder ResetReminder(playbookRunID string, newReminder time.Duration) error // ChangeCreationDate changes the creation date of the specified playbook run. ChangeCreationDate(playbookRunID string, creationTimestamp time.Time) error // UserHasJoinedChannel is called when userID has joined channelID. If actorID is not blank, userID // was invited by actorID. UserHasJoinedChannel(userID, channelID, actorID string) // UserHasLeftChannel is called when userID has left channelID. If actorID is not blank, userID // was removed from the channel by actorID. UserHasLeftChannel(userID, channelID, actorID string) // UpdateRetrospective updates the retrospective for the given playbook run. UpdateRetrospective(playbookRunID, userID string, retrospective RetrospectiveUpdate) error // PublishRetrospective publishes the retrospective. PublishRetrospective(playbookRunID, userID string, retrospective RetrospectiveUpdate) error // CancelRetrospective cancels the retrospective. CancelRetrospective(playbookRunID, userID string) error // UpdateDescription updates the description of the specified playbook run. UpdateDescription(playbookRunID, description string) error // EphemeralPostTodoDigestToUser gathers the list of assigned tasks, participating runs, and overdue updates, // and sends an ephemeral post to userID on channelID. Use force = true to post even if there are no items. EphemeralPostTodoDigestToUser(userID string, channelID string, force bool) error // DMTodoDigestToUser gathers the list of assigned tasks, participating runs, and overdue updates, // and DMs the message to userID. Use force = true to DM even if there are no items. DMTodoDigestToUser(userID string, force bool) error // GetRunsWithAssignedTasks returns the list of runs that have tasks assigned to userID GetRunsWithAssignedTasks(userID string) ([]AssignedRun, error) // GetParticipatingRuns returns the list of active runs with userID as participant GetParticipatingRuns(userID string) ([]RunLink, error) // GetOverdueUpdateRuns returns the list of userID's runs that have overdue updates GetOverdueUpdateRuns(userID string) ([]RunLink, error) // Follow method lets user follow a specific playbook run Follow(playbookRunID, userID string) error // UnFollow method lets user unfollow a specific playbook run Unfollow(playbookRunID, userID string) error // GetFollowers returns list of followers for a specific playbook run GetFollowers(playbookRunID string) ([]string, error) // RestorePlaybookRun reverts a run from the Finished state. If run was not in Finished state, the call is a noop. RestorePlaybookRun(playbookRunID, userID string) error // UpdateRunActions updates status update broadcast settings UpdateRunActions(playbookRunID, userID string, settings RunAction) error // RequestUpdate posts a status update request message in the run's channel RequestUpdate(playbookRunID, requesterID string) error // RequestGetInvolved posts a join request message in the run's channel RequestGetInvolved(playbookRunID, requesterID string) error // Leave removes user from the run's participants&followers list Leave(playbookRunID, requesterID string) error }
PlaybookRunService is the playbook run service interface.
type PlaybookRunServiceImpl ¶
type PlaybookRunServiceImpl struct {
// contains filtered or unexported fields
}
PlaybookRunServiceImpl holds the information needed by the PlaybookRunService's methods to complete their functions.
func NewPlaybookRunService ¶
func NewPlaybookRunService( pluginAPI *pluginapi.Client, store PlaybookRunStore, poster bot.Poster, logger bot.Logger, configService config.Service, scheduler JobOnceScheduler, telemetry PlaybookRunTelemetry, api plugin.API, playbookService PlaybookService, channelActionService ChannelActionService, licenseChecker LicenseChecker, metricsService *metrics.Metrics, ) *PlaybookRunServiceImpl
NewPlaybookRunService creates a new PlaybookRunServiceImpl.
func (*PlaybookRunServiceImpl) AddChecklist ¶
func (s *PlaybookRunServiceImpl) AddChecklist(playbookRunID, userID string, checklist Checklist) error
AddChecklist adds a checklist to the specified run
func (*PlaybookRunServiceImpl) AddChecklistItem ¶
func (s *PlaybookRunServiceImpl) AddChecklistItem(playbookRunID, userID string, checklistNumber int, checklistItem ChecklistItem) error
AddChecklistItem adds an item to the specified checklist
func (*PlaybookRunServiceImpl) AddPostToTimeline ¶
func (s *PlaybookRunServiceImpl) AddPostToTimeline(playbookRunID, userID, postID, summary string) error
func (*PlaybookRunServiceImpl) CancelRetrospective ¶
func (s *PlaybookRunServiceImpl) CancelRetrospective(playbookRunID, cancelerID string) error
func (*PlaybookRunServiceImpl) ChangeCreationDate ¶
func (s *PlaybookRunServiceImpl) ChangeCreationDate(playbookRunID string, creationTimestamp time.Time) error
ChangeCreationDate changes the creation date of the playbook run.
func (*PlaybookRunServiceImpl) ChangeOwner ¶
func (s *PlaybookRunServiceImpl) ChangeOwner(playbookRunID, userID, ownerID string) error
ChangeOwner processes a request from userID to change the owner for playbookRunID to ownerID. Changing to the same ownerID is a no-op.
func (*PlaybookRunServiceImpl) CreatePlaybookRun ¶
func (s *PlaybookRunServiceImpl) CreatePlaybookRun(playbookRun *PlaybookRun, pb *Playbook, userID string, public bool) (*PlaybookRun, error)
CreatePlaybookRun creates a new playbook run. userID is the user who initiated the CreatePlaybookRun.
func (*PlaybookRunServiceImpl) DMTodoDigestToUser ¶
func (s *PlaybookRunServiceImpl) DMTodoDigestToUser(userID string, force bool) error
DMTodoDigestToUser DMs the message to userID. Use force = true to DM even if there are no items.
func (*PlaybookRunServiceImpl) DuplicateChecklist ¶ added in v1.28.0
func (s *PlaybookRunServiceImpl) DuplicateChecklist(playbookRunID, userID string, checklistNumber int) error
DuplicateChecklist duplicates a checklist
func (*PlaybookRunServiceImpl) DuplicateChecklistItem ¶ added in v1.27.0
func (s *PlaybookRunServiceImpl) DuplicateChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int) error
func (*PlaybookRunServiceImpl) EditChecklistItem ¶
func (s *PlaybookRunServiceImpl) EditChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int, newTitle, newCommand, newDescription string) error
EditChecklistItem changes the title of a specified checklist item
func (*PlaybookRunServiceImpl) EphemeralPostTodoDigestToUser ¶ added in v1.26.0
func (s *PlaybookRunServiceImpl) EphemeralPostTodoDigestToUser(userID string, channelID string, force bool) error
EphemeralPostTodoDigestToUser builds todo digest message and sends an ephemeral post to userID, channelID. Use force = true to send post even if there are no items.
func (*PlaybookRunServiceImpl) FinishPlaybookRun ¶
func (s *PlaybookRunServiceImpl) FinishPlaybookRun(playbookRunID, userID string) error
FinishPlaybookRun changes a run's state to Finished. If run is already in Finished state, the call is a noop.
func (*PlaybookRunServiceImpl) Follow ¶
func (s *PlaybookRunServiceImpl) Follow(playbookRunID, userID string) error
Follow method lets user follow a specific playbook run
func (*PlaybookRunServiceImpl) GetChecklistAutocomplete ¶
func (s *PlaybookRunServiceImpl) GetChecklistAutocomplete(playbookRunID string) ([]model.AutocompleteListItem, error)
GetChecklistAutocomplete returns the list of checklist items for playbookRunID to be used in autocomplete
func (*PlaybookRunServiceImpl) GetChecklistItemAutocomplete ¶
func (s *PlaybookRunServiceImpl) GetChecklistItemAutocomplete(playbookRunID string) ([]model.AutocompleteListItem, error)
GetChecklistAutocomplete returns the list of checklist items for playbookRunID to be used in autocomplete
func (*PlaybookRunServiceImpl) GetFollowers ¶
func (s *PlaybookRunServiceImpl) GetFollowers(playbookRunID string) ([]string, error)
GetFollowers returns list of followers for a specific playbook run
func (*PlaybookRunServiceImpl) GetOverdueUpdateRuns ¶
func (s *PlaybookRunServiceImpl) GetOverdueUpdateRuns(userID string) ([]RunLink, error)
GetOverdueUpdateRuns returns the list of userID's runs that have overdue updates
func (*PlaybookRunServiceImpl) GetOwners ¶
func (s *PlaybookRunServiceImpl) GetOwners(requesterInfo RequesterInfo, options PlaybookRunFilterOptions) ([]OwnerInfo, error)
GetOwners returns all the owners of the playbook runs selected by options
func (*PlaybookRunServiceImpl) GetParticipatingRuns ¶
func (s *PlaybookRunServiceImpl) GetParticipatingRuns(userID string) ([]RunLink, error)
GetParticipatingRuns returns the list of active runs with userID as a participant
func (*PlaybookRunServiceImpl) GetPlaybookRun ¶
func (s *PlaybookRunServiceImpl) GetPlaybookRun(playbookRunID string) (*PlaybookRun, error)
GetPlaybookRun gets a playbook run by ID. Returns error if it could not be found.
func (*PlaybookRunServiceImpl) GetPlaybookRunIDForChannel ¶
func (s *PlaybookRunServiceImpl) GetPlaybookRunIDForChannel(channelID string) (string, error)
GetPlaybookRunIDForChannel get the playbookRunID associated with this channel. Returns ErrNotFound if there is no playbook run associated with this channel.
func (*PlaybookRunServiceImpl) GetPlaybookRunMetadata ¶
func (s *PlaybookRunServiceImpl) GetPlaybookRunMetadata(playbookRunID string) (*Metadata, error)
GetPlaybookRunMetadata gets ancillary metadata about a playbook run.
func (*PlaybookRunServiceImpl) GetPlaybookRuns ¶
func (s *PlaybookRunServiceImpl) GetPlaybookRuns(requesterInfo RequesterInfo, options PlaybookRunFilterOptions) (*GetPlaybookRunsResults, error)
GetPlaybookRuns returns filtered playbook runs and the total count before paging.
func (*PlaybookRunServiceImpl) GetRunsWithAssignedTasks ¶
func (s *PlaybookRunServiceImpl) GetRunsWithAssignedTasks(userID string) ([]AssignedRun, error)
GetRunsWithAssignedTasks returns the list of runs that have tasks assigned to userID
func (*PlaybookRunServiceImpl) GetSchemeRolesForChannel ¶ added in v1.32.0
func (*PlaybookRunServiceImpl) HandleReminder ¶
func (s *PlaybookRunServiceImpl) HandleReminder(key string)
HandleReminder is the handler for all reminder events.
func (*PlaybookRunServiceImpl) IsOwner ¶
func (s *PlaybookRunServiceImpl) IsOwner(playbookRunID, userID string) bool
IsOwner returns true if the userID is the owner for playbookRunID.
func (*PlaybookRunServiceImpl) Leave ¶ added in v1.31.0
func (s *PlaybookRunServiceImpl) Leave(playbookRunID, requesterID string) error
Leave removes user from the run's participants&followers lists
func (*PlaybookRunServiceImpl) ModifyCheckedState ¶
func (s *PlaybookRunServiceImpl) ModifyCheckedState(playbookRunID, userID, newState string, checklistNumber, itemNumber int) error
ModifyCheckedState checks or unchecks the specified checklist item. Idempotent, will not perform any action if the checklist item is already in the given checked state
func (*PlaybookRunServiceImpl) MoveChecklist ¶
func (s *PlaybookRunServiceImpl) MoveChecklist(playbookRunID, userID string, sourceChecklistIdx, destChecklistIdx int) error
MoveChecklist moves a checklist to a new location
func (*PlaybookRunServiceImpl) MoveChecklistItem ¶
func (s *PlaybookRunServiceImpl) MoveChecklistItem(playbookRunID, userID string, sourceChecklistIdx, sourceItemIdx, destChecklistIdx, destItemIdx int) error
MoveChecklistItem moves a checklist item to a new location
func (*PlaybookRunServiceImpl) NukeDB ¶
func (s *PlaybookRunServiceImpl) NukeDB() error
NukeDB removes all playbook run related data.
func (*PlaybookRunServiceImpl) OpenAddChecklistItemDialog ¶
func (s *PlaybookRunServiceImpl) OpenAddChecklistItemDialog(triggerID, playbookRunID string, checklist int) error
func (*PlaybookRunServiceImpl) OpenAddToTimelineDialog ¶
func (s *PlaybookRunServiceImpl) OpenAddToTimelineDialog(requesterInfo RequesterInfo, postID, teamID, triggerID string) error
func (*PlaybookRunServiceImpl) OpenCreatePlaybookRunDialog ¶
func (s *PlaybookRunServiceImpl) OpenCreatePlaybookRunDialog(teamID, requesterID, triggerID, postID, clientID string, playbooks []Playbook, isMobileApp bool, promptPostID string) error
OpenCreatePlaybookRunDialog opens a interactive dialog to start a new playbook run.
func (*PlaybookRunServiceImpl) OpenFinishPlaybookRunDialog ¶
func (s *PlaybookRunServiceImpl) OpenFinishPlaybookRunDialog(playbookRunID, triggerID string) error
func (*PlaybookRunServiceImpl) OpenUpdateStatusDialog ¶
func (s *PlaybookRunServiceImpl) OpenUpdateStatusDialog(playbookRunID, triggerID string) error
func (*PlaybookRunServiceImpl) PublishRetrospective ¶
func (s *PlaybookRunServiceImpl) PublishRetrospective(playbookRunID, publisherID string, retrospective RetrospectiveUpdate) error
func (*PlaybookRunServiceImpl) RemoveChecklist ¶
func (s *PlaybookRunServiceImpl) RemoveChecklist(playbookRunID, userID string, checklistNumber int) error
RemoveChecklist removes the specified checklist
func (*PlaybookRunServiceImpl) RemoveChecklistItem ¶
func (s *PlaybookRunServiceImpl) RemoveChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int) error
RemoveChecklistItem removes the item at the given index from the given checklist
func (*PlaybookRunServiceImpl) RemoveReminder ¶
func (s *PlaybookRunServiceImpl) RemoveReminder(playbookRunID string)
RemoveReminder removes the pending reminder for the given playbook run, if any.
func (*PlaybookRunServiceImpl) RemoveTimelineEvent ¶
func (s *PlaybookRunServiceImpl) RemoveTimelineEvent(playbookRunID, userID, eventID string) error
RemoveTimelineEvent removes the timeline event (sets the DeleteAt to the current time).
func (*PlaybookRunServiceImpl) RenameChecklist ¶
func (s *PlaybookRunServiceImpl) RenameChecklist(playbookRunID, userID string, checklistNumber int, newTitle string) error
RenameChecklist adds a checklist to the specified run
func (*PlaybookRunServiceImpl) RequestGetInvolved ¶ added in v1.31.0
func (s *PlaybookRunServiceImpl) RequestGetInvolved(playbookRunID, requesterID string) error
RequestUpdate posts a status update request message in the run's channel
func (*PlaybookRunServiceImpl) RequestUpdate ¶ added in v1.31.0
func (s *PlaybookRunServiceImpl) RequestUpdate(playbookRunID, requesterID string) error
RequestUpdate posts a status update request message in the run's channel
func (*PlaybookRunServiceImpl) ResetReminder ¶ added in v1.31.0
func (s *PlaybookRunServiceImpl) ResetReminder(playbookRunID string, newReminder time.Duration) error
ResetReminder creates a timeline event for a reminder being reset and then creates a new reminder
func (*PlaybookRunServiceImpl) RestoreChecklist ¶ added in v1.27.0
func (s *PlaybookRunServiceImpl) RestoreChecklist(playbookRunID, userID string, checklistNumber int) error
RestoreChecklist restores the skipped checklist
func (*PlaybookRunServiceImpl) RestoreChecklistItem ¶
func (s *PlaybookRunServiceImpl) RestoreChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int) error
RestoreChecklistItem restores the item at the given index from the given checklist
func (*PlaybookRunServiceImpl) RestorePlaybookRun ¶
func (s *PlaybookRunServiceImpl) RestorePlaybookRun(playbookRunID, userID string) error
RestorePlaybookRun reverts a run from the Finished state. If run was not in Finished state, the call is a noop.
func (*PlaybookRunServiceImpl) RunChecklistItemSlashCommand ¶
func (s *PlaybookRunServiceImpl) RunChecklistItemSlashCommand(playbookRunID, userID string, checklistNumber, itemNumber int) (string, error)
RunChecklistItemSlashCommand executes the slash command associated with the specified checklist item.
func (*PlaybookRunServiceImpl) SetAssignee ¶
func (s *PlaybookRunServiceImpl) SetAssignee(playbookRunID, userID, assigneeID string, checklistNumber, itemNumber int) error
SetAssignee sets the assignee for the specified checklist item Idempotent, will not perform any actions if the checklist item is already assigned to assigneeID
func (*PlaybookRunServiceImpl) SetCommandToChecklistItem ¶ added in v1.27.0
func (s *PlaybookRunServiceImpl) SetCommandToChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int, newCommand string) error
SetCommandToChecklistItem sets command to checklist item
func (*PlaybookRunServiceImpl) SetDueDate ¶ added in v1.27.0
func (s *PlaybookRunServiceImpl) SetDueDate(playbookRunID, userID string, duedate int64, checklistNumber, itemNumber int) error
SetDueDate sets absolute due date timestamp for the specified checklist item
func (*PlaybookRunServiceImpl) SetNewReminder ¶
func (s *PlaybookRunServiceImpl) SetNewReminder(playbookRunID string, newReminder time.Duration) error
SetNewReminder sets a new reminder for playbookRunID, removes any pending reminder, removes the reminder post in the playbookRun's channel, and resets the PreviousReminder and LastStatusUpdateAt (so the countdown timer to "update due" shows the correct time)
func (*PlaybookRunServiceImpl) SetReminder ¶
func (s *PlaybookRunServiceImpl) SetReminder(playbookRunID string, fromNow time.Duration) error
SetReminder sets a reminder. After timeInMinutes in the future, the owner will be reminded to update the playbook run's status.
func (*PlaybookRunServiceImpl) SkipChecklist ¶ added in v1.27.0
func (s *PlaybookRunServiceImpl) SkipChecklist(playbookRunID, userID string, checklistNumber int) error
SkipChecklist skips the checklist
func (*PlaybookRunServiceImpl) SkipChecklistItem ¶
func (s *PlaybookRunServiceImpl) SkipChecklistItem(playbookRunID, userID string, checklistNumber, itemNumber int) error
SkipChecklistItem skips the item at the given index from the given checklist
func (*PlaybookRunServiceImpl) ToggleCheckedState ¶
func (s *PlaybookRunServiceImpl) ToggleCheckedState(playbookRunID, userID string, checklistNumber, itemNumber int) error
ToggleCheckedState checks or unchecks the specified checklist item
func (*PlaybookRunServiceImpl) Unfollow ¶
func (s *PlaybookRunServiceImpl) Unfollow(playbookRunID, userID string) error
UnFollow method lets user unfollow a specific playbook run
func (*PlaybookRunServiceImpl) UpdateDescription ¶
func (s *PlaybookRunServiceImpl) UpdateDescription(playbookRunID, description string) error
func (*PlaybookRunServiceImpl) UpdateRetrospective ¶
func (s *PlaybookRunServiceImpl) UpdateRetrospective(playbookRunID, updaterID string, newRetrospective RetrospectiveUpdate) error
func (*PlaybookRunServiceImpl) UpdateRunActions ¶ added in v1.28.0
func (s *PlaybookRunServiceImpl) UpdateRunActions(playbookRunID, userID string, settings RunAction) error
UpdateRunActions updates status update broadcast settings
func (*PlaybookRunServiceImpl) UpdateStatus ¶
func (s *PlaybookRunServiceImpl) UpdateStatus(playbookRunID, userID string, options StatusUpdateOptions) error
UpdateStatus updates a playbook run's status.
func (*PlaybookRunServiceImpl) UserHasJoinedChannel ¶
func (s *PlaybookRunServiceImpl) UserHasJoinedChannel(userID, channelID, actorID string)
UserHasJoinedChannel is called when userID has joined channelID. If actorID is not blank, userID was invited by actorID.
func (*PlaybookRunServiceImpl) UserHasLeftChannel ¶
func (s *PlaybookRunServiceImpl) UserHasLeftChannel(userID, channelID, actorID string)
UserHasLeftChannel is called when userID has left channelID. If actorID is not blank, userID was removed from the channel by actorID.
type PlaybookRunStore ¶
type PlaybookRunStore interface { // GetPlaybookRuns returns filtered playbook runs and the total count before paging. GetPlaybookRuns(requesterInfo RequesterInfo, options PlaybookRunFilterOptions) (*GetPlaybookRunsResults, error) // CreatePlaybookRun creates a new playbook run. If playbook run has an ID, that ID will be used. CreatePlaybookRun(playbookRun *PlaybookRun) (*PlaybookRun, error) // UpdatePlaybookRun updates a playbook run. UpdatePlaybookRun(playbookRun *PlaybookRun) error // UpdateStatus updates the status of a playbook run. UpdateStatus(statusPost *SQLStatusPost) error // FinishPlaybookRun finishes a run at endAt (in millis) FinishPlaybookRun(playbookRunID string, endAt int64) error // RestorePlaybookRun restores a run at restoreAt (in millis) RestorePlaybookRun(playbookRunID string, restoreAt int64) error // GetTimelineEvent returns the timeline event for playbookRunID by the timeline event ID. GetTimelineEvent(playbookRunID, eventID string) (*TimelineEvent, error) // CreateTimelineEvent inserts the timeline event into the DB and returns the new event ID CreateTimelineEvent(event *TimelineEvent) (*TimelineEvent, error) // UpdateTimelineEvent updates an existing timeline event UpdateTimelineEvent(event *TimelineEvent) error // GetPlaybookRun gets a playbook run by ID. GetPlaybookRun(playbookRunID string) (*PlaybookRun, error) // GetPlaybookRunByChannel gets a playbook run associated with the given channel id. GetPlaybookRunIDForChannel(channelID string) (string, error) // GetHistoricalPlaybookRunParticipantsCount returns the count of all participants of the // playbook run associated with the given channel id since the beginning of the // playbook run, excluding bots. GetHistoricalPlaybookRunParticipantsCount(channelID string) (int64, error) // GetOwners returns the owners of the playbook runs selected by options GetOwners(requesterInfo RequesterInfo, options PlaybookRunFilterOptions) ([]OwnerInfo, error) // NukeDB removes all playbook run related data. NukeDB() error // ChangeCreationDate changes the creation date of the specified playbook run. ChangeCreationDate(playbookRunID string, creationTimestamp time.Time) error // GetBroadcastChannelIDsToRootIDs takes a playbookRunID and returns the mapping of // broadcastChannelID->rootID (to keep track of the status updates thread in each of the // playbook's broadcast channels). GetBroadcastChannelIDsToRootIDs(playbookRunID string) (map[string]string, error) // SetBroadcastChannelIDsToRootID sets the broadcastChannelID->rootID mappings for playbookRunID SetBroadcastChannelIDsToRootID(playbookRunID string, channelIDsToRootIDs map[string]string) error // GetRunsWithAssignedTasks returns the list of runs that have tasks assigned to userID GetRunsWithAssignedTasks(userID string) ([]AssignedRun, error) // GetParticipatingRuns returns the list of active runs with userID as a participant GetParticipatingRuns(userID string) ([]RunLink, error) // GetOverdueUpdateRuns returns the list of runs that userID is participating in that have overdue updates GetOverdueUpdateRuns(userID string) ([]RunLink, error) // Follow method lets user follow a specific playbook run Follow(playbookRunID, userID string) error // UnFollow method lets user unfollow a specific playbook run Unfollow(playbookRunID, userID string) error // GetFollowers returns list of followers for a specific playbook run GetFollowers(playbookRunID string) ([]string, error) // GetRunsActiveTotal returns number of active runs GetRunsActiveTotal() (int64, error) // GetOverdueUpdateRunsTotal returns number of runs that have overdue status updates GetOverdueUpdateRunsTotal() (int64, error) // GetOverdueRetroRunsTotal returns the number of completed runs without retro and with reminder GetOverdueRetroRunsTotal() (int64, error) // GetFollowersActiveTotal returns total number of active followers, including duplicates // if a user is following more than one run, it will be counted multiple times GetFollowersActiveTotal() (int64, error) // GetParticipantsActiveTotal returns number of active participants // (i.e. members of the playbook run channel when the run is active) // if a user is member of more than one channel, it will be counted multiple times GetParticipantsActiveTotal() (int64, error) // GetSchemeRolesForChannel scheme role ids for the channel GetSchemeRolesForChannel(channelID string) (string, string, string, error) // GetSchemeRolesForTeam scheme role ids for the team GetSchemeRolesForTeam(teamID string) (string, string, string, error) }
PlaybookRunStore defines the methods the PlaybookRunServiceImpl needs from the interfaceStore.
type PlaybookRunTelemetry ¶
type PlaybookRunTelemetry interface { // CreatePlaybookRun tracks the creation of a new playbook run. CreatePlaybookRun(playbookRun *PlaybookRun, userID string, public bool) // FinishPlaybookRun tracks the end of a playbook run. FinishPlaybookRun(playbookRun *PlaybookRun, userID string) // RestorePlaybookRun tracks the restoration of a playbook run. RestorePlaybookRun(playbookRun *PlaybookRun, userID string) // RestartPlaybookRun tracks the restart of a playbook run. RestartPlaybookRun(playbookRun *PlaybookRun, userID string) // ChangeOwner tracks changes in owner. ChangeOwner(playbookRun *PlaybookRun, userID string) // UpdateStatus tracks when a playbook run's status has been updated UpdateStatus(playbookRun *PlaybookRun, userID string) // FrontendTelemetryForPlaybookRun tracks an event originating from the frontend FrontendTelemetryForPlaybookRun(playbookRun *PlaybookRun, userID, action string) // AddPostToTimeline tracks userID creating a timeline event from a post. AddPostToTimeline(playbookRun *PlaybookRun, userID string) // RemoveTimelineEvent tracks userID removing a timeline event. RemoveTimelineEvent(playbookRun *PlaybookRun, userID string) // ModifyCheckedState tracks the checking and unchecking of items. ModifyCheckedState(playbookRunID, userID string, task ChecklistItem, wasOwner bool) // SetAssignee tracks the changing of an assignee on an item. SetAssignee(playbookRunID, userID string, task ChecklistItem) // AddTask tracks the creation of a new checklist item. AddTask(playbookRunID, userID string, task ChecklistItem) // RemoveTask tracks the removal of a checklist item. RemoveTask(playbookRunID, userID string, task ChecklistItem) // SkipChecklist tracks the skipping of a checklist. SkipChecklist(playbookRunID, userID string, checklist Checklist) // RestoreChecklist tracks the restoring of a checklist. RestoreChecklist(playbookRunID, userID string, checklist Checklist) // SkipTask tracks the skipping of a checklist item. SkipTask(playbookRunID, userID string, task ChecklistItem) // RestoreTask tracks the restoring of a checklist item. RestoreTask(playbookRunID, userID string, task ChecklistItem) // RenameTask tracks the update of a checklist item. RenameTask(playbookRunID, userID string, task ChecklistItem) // MoveChecklist tracks the movement of a checklist MoveChecklist(playbookRunID, userID string, task Checklist) // MoveTask tracks the movement of a checklist item MoveTask(playbookRunID, userID string, task ChecklistItem) // RunTaskSlashCommand tracks the execution of a slash command attached to // a checklist item. RunTaskSlashCommand(playbookRunID, userID string, task ChecklistItem) // AddChecklsit tracks the creation of a new checklist. AddChecklist(playbookRunID, userID string, checklist Checklist) // RemoveChecklist tracks the removal of a checklist. RemoveChecklist(playbookRunID, userID string, checklist Checklist) // RenameChecklsit tracks the creation of a new checklist. RenameChecklist(playbookRunID, userID string, checklist Checklist) // UpdateRetrospective event UpdateRetrospective(playbookRun *PlaybookRun, userID string) // PublishRetrospective event PublishRetrospective(playbookRun *PlaybookRun, userID string) // Follow tracks userID following a playbook run. Follow(playbookRun *PlaybookRun, userID string) // Unfollow tracks userID following a playbook run. Unfollow(playbookRun *PlaybookRun, userID string) // RunAction tracks the run actions, i.e., status broadcast action RunAction(playbookRun *PlaybookRun, userID, triggerType, actionType string, numBroadcasts int) // UpdateRunActions tracks actions settings update UpdateRunActions(playbookRun *PlaybookRun, userID string) }
PlaybookRunTelemetry defines the methods that the PlaybookRunServiceImpl needs from the RudderTelemetry. Unless otherwise noted, userID is the user initiating the event.
type PlaybookRunWebhookEvent ¶ added in v1.31.0
type PlaybookRunWebhookEvent struct { // Type is the type of event emitted. Type timelineEventType `json:"type"` // At is the time when the event occurred. At int64 `json:"at"` // UserId is the user who triggered the event. UserID string `json:"user_id"` // Payload is optional, event-specific metadata. Payload interface{} `json:"payload"` }
type PlaybookRunWebhookPayload ¶
type PlaybookRunWebhookPayload struct { PlaybookRun // ChannelURL is the absolute URL of the playbook run channel. ChannelURL string `json:"channel_url"` // DetailsURL is the absolute URL of the playbook run overview page. DetailsURL string `json:"details_url"` // Event is metadata concerning the event that triggered this webhook. Event PlaybookRunWebhookEvent `json:"event"` }
PlaybookRunWebhookPayload is the body of the payload sent via playbook run webhooks.
type PlaybookService ¶
type PlaybookService interface { // Get retrieves a playbook. Returns ErrNotFound if not found. Get(id string) (Playbook, error) // Create creates a new playbook Create(playbook Playbook, userID string) (string, error) // Import imports a new playbook Import(playbook Playbook, userID string) (string, error) // GetPlaybooks retrieves all playbooks GetPlaybooks() ([]Playbook, error) // GetPlaybooksForTeam retrieves all playbooks on the specified team given the provided options GetPlaybooksForTeam(requesterInfo RequesterInfo, teamID string, opts PlaybookFilterOptions) (GetPlaybooksResults, error) // Update updates a playbook Update(playbook Playbook, userID string) error // Archive archives a playbook Archive(playbook Playbook, userID string) error // Restores an archived playbook Restore(playbook Playbook, userID string) error // AutoFollow method lets user auto-follow all runs of a specific playbook AutoFollow(playbookID, userID string) error // AutoUnfollow method lets user to not auto-follow the newly created playbook runs AutoUnfollow(playbookID, userID string) error // GetAutoFollows returns list of users who auto-follows a playbook GetAutoFollows(playbookID string) ([]string, error) // Duplicate duplicates a playbook Duplicate(playbook Playbook, userID string) (string, error) // Get top playbooks for teams GetTopPlaybooksForTeam(teamID, userID string, opts *model.InsightsOpts) (*PlaybooksInsightsList, error) // Get top playbooks for users GetTopPlaybooksForUser(teamID, userID string, opts *model.InsightsOpts) (*PlaybooksInsightsList, error) }
PlaybookService is the playbook service for managing playbooks userID is the user initiating the event.
func NewPlaybookService ¶
func NewPlaybookService(store PlaybookStore, poster bot.Poster, telemetry PlaybookTelemetry, api *pluginapi.Client, metricsService *metrics.Metrics) PlaybookService
NewPlaybookService returns a new playbook service
type PlaybookStore ¶
type PlaybookStore interface { // Get retrieves a playbook Get(id string) (Playbook, error) // Create creates a new playbook Create(playbook Playbook) (string, error) // GetPlaybooks retrieves all playbooks GetPlaybooks() ([]Playbook, error) // GetPlaybooksForTeam retrieves all playbooks on the specified team GetPlaybooksForTeam(requesterInfo RequesterInfo, teamID string, opts PlaybookFilterOptions) (GetPlaybooksResults, error) // GetPlaybooksWithKeywords retrieves all playbooks with keywords enabled GetPlaybooksWithKeywords(opts PlaybookFilterOptions) ([]Playbook, error) // GetTimeLastUpdated retrieves time last playbook was updated at. // Passed argument determins whether to include playbooks with // SignalAnyKeywordsEnabled flag or not. GetTimeLastUpdated(onlyPlaybooksWithKeywordsEnabled bool) (int64, error) // GetPlaybookIDsForUser retrieves playbooks user can access GetPlaybookIDsForUser(userID, teamID string) ([]string, error) // Update updates a playbook Update(playbook Playbook) error // GraphqlUpdate taking a setmap for graphql GraphqlUpdate(id string, setmap map[string]interface{}) error // Archive archives a playbook Archive(id string) error // Restore restores a deleted playbook Restore(id string) error // AutoFollow method lets user auto-follow all runs of a specific playbook AutoFollow(playbookID, userID string) error // AutoUnfollow method lets user to not auto-follow the newly created playbook runs AutoUnfollow(playbookID, userID string) error // GetAutoFollows returns list of users who auto-follows a playbook GetAutoFollows(playbookID string) ([]string, error) // GetPlaybooksActiveTotal returns number of active playbooks GetPlaybooksActiveTotal() (int64, error) // GetMetric retrieves a metric by ID GetMetric(id string) (*PlaybookMetricConfig, error) // AddMetric adds a metric AddMetric(playbookID string, config PlaybookMetricConfig) error // UpdateMetric updates a metric UpdateMetric(id string, setmap map[string]interface{}) error // DeleteMetric deletes a metric DeleteMetric(id string) error // Get top playbooks for teams GetTopPlaybooksForTeam(teamID, userID string, opts *model.InsightsOpts) (*PlaybooksInsightsList, error) // Get top playbooks for users GetTopPlaybooksForUser(teamID, userID string, opts *model.InsightsOpts) (*PlaybooksInsightsList, error) // AddPlaybookMember adds a user as a member to a playbook AddPlaybookMember(id string, memberID string) error // RemovePlaybookMember removes a user from a playbook RemovePlaybookMember(id string, memberID string) error }
PlaybookStore is an interface for storing playbooks
type PlaybookTelemetry ¶
type PlaybookTelemetry interface { // CreatePlaybook tracks the creation of a playbook. CreatePlaybook(playbook Playbook, userID string) // ImportPlaybook tracks the import of a playbook. ImportPlaybook(playbook Playbook, userID string) // UpdatePlaybook tracks the update of a playbook. UpdatePlaybook(playbook Playbook, userID string) // DeletePlaybook tracks the deletion of a playbook. DeletePlaybook(playbook Playbook, userID string) // RestorePlaybook tracks the restoration of a playbook. RestorePlaybook(playbook Playbook, userID string) // FrontendTelemetryForPlaybook tracks an event originating from the frontend FrontendTelemetryForPlaybook(playbook Playbook, userID, action string) // FrontendTelemetryForPlaybookTemplate tracks an event originating from the frontend FrontendTelemetryForPlaybookTemplate(templateName string, userID, action string) // AutoFollowPlaybook tracks the auto-follow of a playbook. AutoFollowPlaybook(playbook Playbook, userID string) // AutoUnfollowPlaybook tracks the auto-unfollow of a playbook. AutoUnfollowPlaybook(playbook Playbook, userID string) }
PlaybookTelemetry defines the methods that the Playbook service needs from the RudderTelemetry. userID is the user initiating the event.
type PlaybooksInsightsList ¶ added in v1.32.0
type PlaybooksInsightsList struct { HasNext bool `json:"has_next"` Items []*PlaybookInsight `json:"items"` }
PlaybooksInsightsList is a response type with pagination support.
type PromptRunPlaybookFromKeywordsPayload ¶ added in v1.26.0
type RequesterInfo ¶
RequesterInfo holds the userID and teamID that this request is regarding, and permissions for the user making the request
func GetRequesterInfo ¶
func GetRequesterInfo(userID string, pluginAPI *pluginapi.Client) (RequesterInfo, error)
type RetrospectiveUpdate ¶
type RetrospectiveUpdate struct { Text string `json:"retrospective"` Metrics []RunMetricData `json:"metrics"` }
type RunAction ¶ added in v1.28.0
type RunAction struct { BroadcastChannelIDs []string `json:"broadcast_channel_ids"` WebhookOnStatusUpdateURLs []string `json:"webhook_on_status_update_urls"` StatusUpdateBroadcastChannelsEnabled bool `json:"status_update_broadcast_channels_enabled"` StatusUpdateBroadcastWebhooksEnabled bool `json:"status_update_broadcast_webhooks_enabled"` }
RunAction represents the run action settings. Frontend passes this struct to update settings.
type RunLink ¶
type RunLink struct { PlaybookRunID string TeamName string ChannelName string ChannelDisplayName string }
RunLink represents the info needed to display and link to a run
type RunMetricData ¶
type RunMetricData struct { MetricConfigID string `json:"metric_config_id"` Value null.Int `json:"value"` }
type SQLStatusPost ¶
type SortDirection ¶
type SortDirection string
SortDirection is the type used to specify the ascending or descending order of returned results.
const ( // DirectionDesc is descending order. DirectionDesc SortDirection = "DESC" // DirectionAsc is ascending order. DirectionAsc SortDirection = "ASC" )
type SortField ¶
type SortField string
SortField enumerates the available fields we can sort on.
const ( // SortByTitle sorts by the title field of a playbook. SortByTitle SortField = "title" // SortByStages sorts by the number of checklists in a playbook. SortByStages SortField = "stages" // SortBySteps sorts by the number of steps in a playbook. SortBySteps SortField = "steps" // SortByRuns sorts by the number of times a playbook has been run. SortByRuns SortField = "runs" // SortByCreateAt sorts by the created time of a playbook or playbook run. SortByCreateAt SortField = "create_at" // SortByID sorts by the primary key of a playbook or playbook run. SortByID SortField = "id" // SortByName sorts by the name of a playbook run. SortByName SortField = "name" // SortByOwnerUserID sorts by the user id of the owner of a playbook run. SortByOwnerUserID SortField = "owner_user_id" // SortByTeamID sorts by the team id of a playbook or playbook run. SortByTeamID SortField = "team_id" // SortByEndAt sorts by the end time of a playbook run. SortByEndAt SortField = "end_at" // SortByStatus sorts by the status of a playbook run. SortByStatus SortField = "status" // SortByLastStatusUpdateAt sorts by when the playbook run was last updated. SortByLastStatusUpdateAt SortField = "last_status_update_at" // SortByLastStatusUpdateAt sorts by when the playbook was last run. SortByLastRunAt SortField = "last_run_at" // SortByActiveRuns sorts by number of active runs in the playbook. SortByActiveRuns SortField = "active_runs" // SortByMetric0 ..3 sorts by the playbook's metric index SortByMetric0 SortField = "metric0" SortByMetric1 SortField = "metric1" SortByMetric2 SortField = "metric2" SortByMetric3 SortField = "metric3" )
type StatusPost ¶
type StatusPost struct { // ID is the identifier of the post containing the status update. ID string `json:"id"` // CreateAt is the timestamp, in milliseconds since epoch, of the time this status update was // posted. CreateAt int64 `json:"create_at"` // DeleteAt is the timestamp, in milliseconds since epoch, of the time the post containing this // status update was deleted. 0 if it was never deleted. DeleteAt int64 `json:"delete_at"` }
type StatusPostComplete ¶ added in v1.31.0
type StatusPostComplete struct { // ID is the identifier of the post containing the status update. ID string `json:"id"` // CreateAt is the timestamp, in milliseconds since epoch, of the time this status update was // posted. CreateAt int64 `json:"create_at"` // DeleteAt is the timestamp, in milliseconds since epoch, of the time the post containing this // status update was deleted. 0 if it was never deleted. DeleteAt int64 `json:"delete_at"` // Message is the content of the status update. It supports markdown. Message string `json:"message"` // AuthorUserName is the username of the user who sent the status update. AuthorUserName string `json:"author_user_name"` }
StatusPostComplete is the "complete" representation of a status update
This type is part of an effort to decopuple channels and playbooks, where status updates will stop being -only- Posts in a channel.
func NewStatusPostComplete ¶ added in v1.31.0
func NewStatusPostComplete(post *model.Post) *StatusPostComplete
NewStatusPostComplete creates a StatusUpdate from a channel Post
type StatusUpdateOptions ¶
type StatusUpdateOptions struct { Message string `json:"message"` Reminder time.Duration `json:"reminder"` FinishRun bool `json:"finish_run"` }
StatusUpdateOptions encapsulates the fields that can be set when updating a playbook run's status NOTE: changes made to this should be reflected in the client package.
type TimelineEvent ¶
type TimelineEvent struct { // ID is the identifier of this event. ID string `json:"id"` // PlaybookRunID is the identifier of the playbook run this event lives in. PlaybookRunID string `json:"playbook_run_id"` // CreateAt is the timestamp, in milliseconds since epoch, of the time this event was created. CreateAt int64 `json:"create_at"` // DeleteAt is the timestamp, in milliseconds since epoch, of the time this event was deleted. // 0 if it was never deleted. DeleteAt int64 `json:"delete_at"` // EventAt is the timestamp, in milliseconds since epoch, of the actual situation this event is // describing. EventAt int64 `json:"event_at"` // EventType is the type of this event. It can be "incident_created", "task_state_modified", // "status_updated", "owner_changed", "assignee_changed", "ran_slash_command", // "event_from_post", "user_joined_left", "published_retrospective", "canceled_retrospective" or "status_update_snoozed". EventType timelineEventType `json:"event_type"` // Summary is a short description of the event. Summary string `json:"summary"` // Details is the longer description of the event. Details string `json:"details"` // PostID, if not empty, is the identifier of the post announcing in the channel this event // happened. If the event is of type "event_from_post", this is the identifier of that post. PostID string `json:"post_id"` // SubjectUserID is the identifier of the user involved in the event. For example, if the event // is of type "owner_changed", this is the identifier of the new owner. SubjectUserID string `json:"subject_user_id"` // CreatorUserID is the identifier of the user that created the event. CreatorUserID string `json:"creator_user_id"` }
type TriggerType ¶ added in v1.26.0
type TriggerType string
type UpdateOptions ¶
type UpdateOptions struct { }
type UserInfo ¶
type UserInfo struct { ID string LastDailyTodoDMAt int64 DigestNotificationSettings }
type UserInfoStore ¶
type UserInfoTelemetry ¶
type UserInfoTelemetry interface { // ChangeDigestSettings tracks when a user changes one of the digest settings ChangeDigestSettings(userID string, old DigestNotificationSettings, new DigestNotificationSettings) }
UserInfoTelemetry defines the methods that the UserInfo store needs from the RudderTelemetry. userID is the user initiating the event.
type WelcomeMessagePayload ¶ added in v1.26.0
type WelcomeMessagePayload struct {
Message string `json:"message" mapstructure:"message"`
}