webhooks

package
v0.0.0-...-8d94386 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeliverLegacyEventCreate

func DeliverLegacyEventCreate(ctx context.Context,
	tracker *model.Tracker, ticket *model.Ticket, event *model.Event)

func DeliverLegacyLabelCreate

func DeliverLegacyLabelCreate(ctx context.Context,
	tracker *model.Tracker, label *model.Label)

func DeliverLegacyLabelDelete

func DeliverLegacyLabelDelete(ctx context.Context, trackerID, labelID int)

func DeliverLegacyTicketCreate

func DeliverLegacyTicketCreate(ctx context.Context,
	tracker *model.Tracker, ticket *model.Ticket)

func DeliverLegacyTrackerDelete

func DeliverLegacyTrackerDelete(ctx context.Context, trackerId, userId int)

func DeliverLegacyTrackerEvent

func DeliverLegacyTrackerEvent(ctx context.Context,
	tracker *model.Tracker, ev string)

func DeliverTicketDeletedEvent

func DeliverTicketDeletedEvent(ctx context.Context, ticketID int, ticket *model.Ticket)

func DeliverTicketEvent

func DeliverTicketEvent(ctx context.Context,
	event model.WebhookEvent, ticketID int, ticket *model.Ticket)

func DeliverTicketEventCreated

func DeliverTicketEventCreated(ctx context.Context, ticketID int, newEvent *model.Event)

func DeliverTrackerEvent

func DeliverTrackerEvent(ctx context.Context,
	event model.WebhookEvent, tracker *model.Tracker)

func DeliverTrackerEventCreated

func DeliverTrackerEventCreated(ctx context.Context, trackerID int, newEvent *model.Event)

func DeliverTrackerLabelEvent

func DeliverTrackerLabelEvent(ctx context.Context,
	event model.WebhookEvent, trackerID int, label *model.Label)

func DeliverTrackerTicketDeletedEvent

func DeliverTrackerTicketDeletedEvent(ctx context.Context, trackerID int, ticket *model.Ticket)

func DeliverTrackerTicketEvent

func DeliverTrackerTicketEvent(ctx context.Context,
	event model.WebhookEvent, trackerID int, ticket *model.Ticket)

func DeliverUserTicketEvent

func DeliverUserTicketEvent(ctx context.Context,
	event model.WebhookEvent, ticket *model.Ticket)

func DeliverUserTrackerEvent

func DeliverUserTrackerEvent(ctx context.Context,
	event model.WebhookEvent, tracker *model.Tracker)

Types

type CommentWebhookPayload

type CommentWebhookPayload struct {
	ID      int       `json:"id"`
	Created time.Time `json:"created"`
	Text    string    `json:"text"`
}

type EventWebhookPayload

type EventWebhookPayload struct {
	ID            int       `json:"id"`
	Created       time.Time `json:"created"`
	EventType     []string  `json:"event_type"`
	OldStatus     *string   `json:"old_status"`
	OldResolution *string   `json:"old_resolution"`
	NewStatus     *string   `json:"new_status"`
	NewResolution *string   `json:"new_resolution"`

	User       *ParticipantWebhookPayload `json:"user"`
	Ticket     *TicketWebhookPayload      `json:"ticket"`
	Comment    *CommentWebhookPayload     `json:"comment"`
	Label      *LabelWebhookPayload       `json:"label"`
	ByUser     *ParticipantWebhookPayload `json:"by_user"`
	FromTicket *TicketWebhookPayload      `json:"from_ticket"`
}

type LabelWebhookPayload

type LabelWebhookPayload struct {
	Name    string    `json:"name"`
	Created time.Time `json:"created"`

	Colors struct {
		Background string `json:"background"`
		Text       string `json:"text"`
	} `json:"colors"`

	Tracker struct {
		ID      int       `json:"id"`
		Created time.Time `json:"created"`
		Updated time.Time `json:"updated"`
		Name    string    `json:"name"`

		Owner struct {
			CanonicalName string `json:"canonical_name"`
			Name          string `json:"name"`
		} `json:"owner"`
	} `json:"tracker"`
}

type ParticipantWebhookPayload

type ParticipantWebhookPayload struct {
	Type string `json:"type"`

	// User
	Name          string `json:"name,omitempty"`
	CanonicalName string `json:"canonical_name,omitempty"`

	// Email address
	Address string `json:"address,omitempty"`

	// External
	ExternalID  string `json:"external_id,omitempty"`
	ExternalURL string `json:"external_url,omitempty"`
}

type TicketWebhookPayload

type TicketWebhookPayload struct {
	ID          int       `json:"id"`
	Ref         string    `json:"ref"`
	Created     time.Time `json:"created"`
	Updated     time.Time `json:"updated"`
	Title       string    `json:"title"`
	Description *string   `json:"description"`
	Status      string    `json:"status"`
	Resolution  string    `json:"resolution"`

	Submitter *ParticipantWebhookPayload `json:"submitter,omitempty"`
	Tracker   *TrackerWebhookPayload     `json:"tracker"`

	// In the interest of keeping the legacy code simple, these are left unused:
	Labels    []string      `json:"labels"`
	Assignees []interface{} `json:"assignees"`
}

type TrackerWebhookPayload

type TrackerWebhookPayload struct {
	ID            int       `json:"id"`
	Created       time.Time `json:"created"`
	Updated       time.Time `json:"updated"`
	Name          string    `json:"name"`
	Description   *string   `json:"description,omitempty"`
	Visibility    string    `json:"visibility,omitempty"`
	DefaultAccess []string  `json:"default_access,omitempty"`

	Owner UserWebhookPayload `json:"owner"`
}

type UserWebhookPayload

type UserWebhookPayload struct {
	Name          string `json:"name"`
	CanonicalName string `json:"canonical_name"`
}

Jump to

Keyboard shortcuts

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