todosrht

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteTicketAssignByUser added in v0.2.0

func CompleteTicketAssignByUser(client *gqlclient.Client, ctx context.Context, username string, name string, id int32) (me *User, user *User, err error)

func PermissionIcon

func PermissionIcon(permission bool) string

Types

type ACL

type ACL struct {
	// Permission to view tickets
	Browse bool `json:"browse"`
	// Permission to submit tickets
	Submit bool `json:"submit"`
	// Permission to comment on tickets
	Comment bool `json:"comment"`
	// Permission to edit tickets
	Edit bool `json:"edit"`
	// Permission to resolve, re-open, transfer, or label tickets
	Triage bool `json:"triage"`

	// Underlying value of the GraphQL interface
	Value ACLValue `json:"-"`
}

func (*ACL) UnmarshalJSON added in v0.4.0

func (base *ACL) UnmarshalJSON(b []byte) error

type ACLCursor

type ACLCursor struct {
	Results []TrackerACL `json:"results"`
	Cursor  *Cursor      `json:"cursor,omitempty"`
}

A cursor for enumerating access control list entries

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type ACLInput

type ACLInput struct {
	// Permission to view tickets
	Browse bool `json:"browse"`
	// Permission to submit tickets
	Submit bool `json:"submit"`
	// Permission to comment on tickets
	Comment bool `json:"comment"`
	// Permission to edit tickets
	Edit bool `json:"edit"`
	// Permission to resolve, re-open, transfer, or label tickets
	Triage bool `json:"triage"`
}

type ACLValue added in v0.4.0

type ACLValue interface {
	// contains filtered or unexported methods
}

ACLValue is one of: TrackerACL | DefaultACL

type AccessKind

type AccessKind string
const (
	AccessKindRo AccessKind = "RO"
	AccessKindRw AccessKind = "RW"
)

type AccessScope

type AccessScope string
const (
	AccessScopeProfile       AccessScope = "PROFILE"
	AccessScopeTrackers      AccessScope = "TRACKERS"
	AccessScopeTickets       AccessScope = "TICKETS"
	AccessScopeAcls          AccessScope = "ACLS"
	AccessScopeEvents        AccessScope = "EVENTS"
	AccessScopeSubscriptions AccessScope = "SUBSCRIPTIONS"
)

type ActivitySubscription

type ActivitySubscription struct {
	Id      int32          `json:"id"`
	Created gqlclient.Time `json:"created"`

	// Underlying value of the GraphQL interface
	Value ActivitySubscriptionValue `json:"-"`
}

func (*ActivitySubscription) UnmarshalJSON added in v0.4.0

func (base *ActivitySubscription) UnmarshalJSON(b []byte) error

type ActivitySubscriptionCursor

type ActivitySubscriptionCursor struct {
	Results []ActivitySubscription `json:"results"`
	Cursor  *Cursor                `json:"cursor,omitempty"`
}

A cursor for enumerating subscriptions

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type ActivitySubscriptionValue added in v0.4.0

type ActivitySubscriptionValue interface {
	// contains filtered or unexported methods
}

ActivitySubscriptionValue is one of: TrackerSubscription | TicketSubscription

type Assignment

type Assignment struct {
	EventType EventType `json:"eventType"`
	Ticket    *Ticket   `json:"ticket"`
	Assigner  *Entity   `json:"assigner"`
	Assignee  *Entity   `json:"assignee"`
}

type Authenticity

type Authenticity string
const (
	// The server vouches for this information as entered verbatim by the
	// attributed entity.
	AuthenticityAuthentic Authenticity = "AUTHENTIC"
	// The server does not vouch for this information as entered by the attributed
	// entity, no authentication was provided.
	AuthenticityUnauthenticated Authenticity = "UNAUTHENTICATED"
	// The server has evidence that the information has likely been manipulated by
	// a third-party.
	AuthenticityTampered Authenticity = "TAMPERED"
)

type Comment

type Comment struct {
	EventType    EventType    `json:"eventType"`
	Ticket       *Ticket      `json:"ticket"`
	Author       *Entity      `json:"author"`
	Text         string       `json:"text"`
	Authenticity Authenticity `json:"authenticity"`
	// If this comment has been edited, this field points to the new revision.
	SupersededBy *Comment `json:"supersededBy,omitempty"`
}

type Created

type Created struct {
	EventType EventType `json:"eventType"`
	Ticket    *Ticket   `json:"ticket"`
	Author    *Entity   `json:"author"`
}

type Cursor

type Cursor string

type DefaultACL

type DefaultACL struct {
	Browse  bool `json:"browse"`
	Submit  bool `json:"submit"`
	Comment bool `json:"comment"`
	Edit    bool `json:"edit"`
	Triage  bool `json:"triage"`
}

These ACL policies are applied non-specifically, e.g. the default ACL for all authenticated users.

func (DefaultACL) TermString

func (acl DefaultACL) TermString() string

type EmailAddress

type EmailAddress struct {
	CanonicalName string `json:"canonicalName"`
	// "jdoe@example.org" of "Jane Doe <jdoe@example.org>"
	Mailbox string `json:"mailbox"`
	// "Jane Doe" of "Jane Doe <jdoe@example.org>"
	Name *string `json:"name,omitempty"`
}

type EmailCmd added in v0.2.0

type EmailCmd string
const (
	EmailCmdResolve EmailCmd = "RESOLVE"
	EmailCmdReopen  EmailCmd = "REOPEN"
	EmailCmdLabel   EmailCmd = "LABEL"
	EmailCmdUnlabel EmailCmd = "UNLABEL"
)

type Entity

type Entity struct {
	CanonicalName string `json:"canonicalName"`

	// Underlying value of the GraphQL interface
	Value EntityValue `json:"-"`
}

func (*Entity) UnmarshalJSON added in v0.4.0

func (base *Entity) UnmarshalJSON(b []byte) error

type EntityValue added in v0.4.0

type EntityValue interface {
	// contains filtered or unexported methods
}

EntityValue is one of: User | EmailAddress | ExternalUser

type Event

type Event struct {
	Id      int32          `json:"id"`
	Created gqlclient.Time `json:"created"`
	Changes []EventDetail  `json:"changes"`
	Ticket  *Ticket        `json:"ticket"`
}

Represents an event which affects a ticket. Multiple changes can occur in a single event, and are enumerated in the "changes" field.

func AssignUser

func AssignUser(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32, userId int32) (assignUser *Event, err error)

func LabelTicket added in v0.3.0

func LabelTicket(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32, labelId int32) (labelTicket *Event, err error)

func SubmitComment

func SubmitComment(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32, input SubmitCommentInput) (submitComment *Event, err error)

func UnassignUser

func UnassignUser(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32, userId int32) (unassignUser *Event, err error)

func UnlabelTicket added in v0.3.0

func UnlabelTicket(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32, labelId int32) (unlabelTicket *Event, err error)

func UpdateTicketStatus

func UpdateTicketStatus(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32, input UpdateStatusInput) (updateTicketStatus *Event, err error)

type EventCreated added in v0.2.0

type EventCreated struct {
	Uuid     string         `json:"uuid"`
	Event    WebhookEvent   `json:"event"`
	Date     gqlclient.Time `json:"date"`
	NewEvent *Event         `json:"newEvent"`
}

type EventCursor

type EventCursor struct {
	Results []Event `json:"results"`
	Cursor  *Cursor `json:"cursor,omitempty"`
}

A cursor for enumerating events

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type EventDetail

type EventDetail struct {
	EventType EventType `json:"eventType"`
	Ticket    *Ticket   `json:"ticket"`

	// Underlying value of the GraphQL interface
	Value EventDetailValue `json:"-"`
}

func (*EventDetail) UnmarshalJSON added in v0.4.0

func (base *EventDetail) UnmarshalJSON(b []byte) error

type EventDetailValue added in v0.4.0

type EventDetailValue interface {
	// contains filtered or unexported methods
}

EventDetailValue is one of: Created | Assignment | Comment | LabelUpdate | StatusChange | UserMention | TicketMention

type EventType

type EventType string
const (
	EventTypeCreated         EventType = "CREATED"
	EventTypeComment         EventType = "COMMENT"
	EventTypeStatusChange    EventType = "STATUS_CHANGE"
	EventTypeLabelAdded      EventType = "LABEL_ADDED"
	EventTypeLabelRemoved    EventType = "LABEL_REMOVED"
	EventTypeAssignedUser    EventType = "ASSIGNED_USER"
	EventTypeUnassignedUser  EventType = "UNASSIGNED_USER"
	EventTypeUserMentioned   EventType = "USER_MENTIONED"
	EventTypeTicketMentioned EventType = "TICKET_MENTIONED"
)

type ExternalUser

type ExternalUser struct {
	CanonicalName string `json:"canonicalName"`
	// <service>:<service specific details...>
	// e.g. github:ddevault
	ExternalId string `json:"externalId"`
	// The canonical external URL for this user, e.g. https://github.com/ddevault
	ExternalUrl *string `json:"externalUrl,omitempty"`
}

type ImportInput

type ImportInput struct {
	Created gqlclient.Time `json:"created"`
	// External user ID. By convention this should be "service:username", e.g.
	// "codeberg:ddevault".
	ExternalId string `json:"externalId"`
	// A URL at which the user's external profile may be found, e.g.
	// "https://codeberg.org/ddevault".
	ExternalUrl string `json:"externalUrl"`
}

This is used for importing tickets from third-party services, and may only be used by the tracker owner. It causes a ticket submission, update, or comment to be attributed to an external user and appear as if it were submitted at a specific time.

type Label

type Label struct {
	Id      int32          `json:"id"`
	Created gqlclient.Time `json:"created"`
	Name    string         `json:"name"`
	Tracker *Tracker       `json:"tracker"`
	// In CSS hexadecimal format
	BackgroundColor string        `json:"backgroundColor"`
	ForegroundColor string        `json:"foregroundColor"`
	Tickets         *TicketCursor `json:"tickets"`
}

func CreateLabel

func CreateLabel(client *gqlclient.Client, ctx context.Context, trackerId int32, name string, foregroundColor string, backgroundColor string) (createLabel *Label, err error)

func DeleteLabel

func DeleteLabel(client *gqlclient.Client, ctx context.Context, id int32) (deleteLabel *Label, err error)

func (Label) TermString

func (label Label) TermString() string

type LabelCursor

type LabelCursor struct {
	Results []Label `json:"results"`
	Cursor  *Cursor `json:"cursor,omitempty"`
}

A cursor for enumerating labels

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type LabelEvent added in v0.2.0

type LabelEvent struct {
	Uuid  string         `json:"uuid"`
	Event WebhookEvent   `json:"event"`
	Date  gqlclient.Time `json:"date"`
	Label *Label         `json:"label"`
}

type LabelUpdate

type LabelUpdate struct {
	EventType EventType `json:"eventType"`
	Ticket    *Ticket   `json:"ticket"`
	Labeler   *Entity   `json:"labeler"`
	Label     *Label    `json:"label"`
}

type OAuthClient added in v0.2.0

type OAuthClient struct {
	Uuid string `json:"uuid"`
}

type StatusChange

type StatusChange struct {
	EventType     EventType        `json:"eventType"`
	Ticket        *Ticket          `json:"ticket"`
	Editor        *Entity          `json:"editor"`
	OldStatus     TicketStatus     `json:"oldStatus"`
	NewStatus     TicketStatus     `json:"newStatus"`
	OldResolution TicketResolution `json:"oldResolution"`
	NewResolution TicketResolution `json:"newResolution"`
}

type SubmitCommentEmailInput added in v0.2.0

type SubmitCommentEmailInput struct {
	Text       string            `json:"text"`
	SenderId   int32             `json:"senderId"`
	Cmd        *EmailCmd         `json:"cmd,omitempty"`
	Resolution *TicketResolution `json:"resolution,omitempty"`
	LabelIds   []int32           `json:"labelIds,omitempty"`
}

type SubmitCommentInput

type SubmitCommentInput struct {
	Text       string            `json:"text"`
	Status     *TicketStatus     `json:"status,omitempty"`
	Resolution *TicketResolution `json:"resolution,omitempty"`
	// For use by the tracker owner only
	Import *ImportInput `json:"import,omitempty"`
}

You may omit the status or resolution fields to leave them unchanged (or if you do not have permission to change them). "resolution" is required if status is RESOLVED.

type SubmitTicketEmailInput added in v0.2.0

type SubmitTicketEmailInput struct {
	Subject   string  `json:"subject"`
	Body      *string `json:"body,omitempty"`
	SenderId  int32   `json:"senderId"`
	MessageId string  `json:"messageId"`
}

type SubmitTicketInput

type SubmitTicketInput struct {
	Subject     string         `json:"subject"`
	Body        *string        `json:"body,omitempty"`
	Created     gqlclient.Time `json:"created,omitempty"`
	ExternalId  *string        `json:"externalId,omitempty"`
	ExternalUrl *string        `json:"externalUrl,omitempty"`
}

type Ticket

type Ticket struct {
	// The ticket ID is unique within each tracker, but is not globally unique.
	// The first ticket opened on a given tracker will have ID 1, then 2, and so
	// on.
	Id        int32          `json:"id"`
	Created   gqlclient.Time `json:"created"`
	Updated   gqlclient.Time `json:"updated"`
	Submitter *Entity        `json:"submitter"`
	Tracker   *Tracker       `json:"tracker"`
	// Canonical ticket reference string; may be used in comments to identify the
	// ticket from anywhere.
	Ref          string           `json:"ref"`
	Subject      string           `json:"subject"`
	Body         *string          `json:"body,omitempty"`
	Status       TicketStatus     `json:"status"`
	Resolution   TicketResolution `json:"resolution"`
	Authenticity Authenticity     `json:"authenticity"`
	Labels       []Label          `json:"labels"`
	Assignees    []Entity         `json:"assignees"`
	Events       *EventCursor     `json:"events"`
	// If the authenticated user is subscribed to this ticket, this is that
	// subscription.
	Subscription *TicketSubscription `json:"subscription,omitempty"`
	// Returns a list of ticket webhook subscriptions. For clients
	// authenticated with a personal access token, this returns all webhooks
	// configured by all GraphQL clients for your account. For clients
	// authenticated with an OAuth 2.0 access token, this returns only webhooks
	// registered for your client.
	Webhooks *WebhookSubscriptionCursor `json:"webhooks"`
	// Returns details of a ticket webhook subscription by its ID.
	Webhook *WebhookSubscription `json:"webhook,omitempty"`
}

func DeleteTicket added in v0.2.0

func DeleteTicket(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32) (deleteTicket *Ticket, err error)

func SubmitTicket added in v0.3.0

func SubmitTicket(client *gqlclient.Client, ctx context.Context, trackerId int32, input SubmitTicketInput) (submitTicket *Ticket, err error)

func UpdateTicket added in v0.5.0

func UpdateTicket(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32, input UpdateTicketInput) (updateTicket *Ticket, err error)

type TicketCursor

type TicketCursor struct {
	Results []Ticket `json:"results"`
	Cursor  *Cursor  `json:"cursor,omitempty"`
}

A cursor for enumerating tickets

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type TicketDeletedEvent added in v0.2.0

type TicketDeletedEvent struct {
	Uuid      string         `json:"uuid"`
	Event     WebhookEvent   `json:"event"`
	Date      gqlclient.Time `json:"date"`
	TrackerId int32          `json:"trackerId"`
	TicketId  int32          `json:"ticketId"`
}

type TicketEvent added in v0.2.0

type TicketEvent struct {
	Uuid   string         `json:"uuid"`
	Event  WebhookEvent   `json:"event"`
	Date   gqlclient.Time `json:"date"`
	Ticket *Ticket        `json:"ticket"`
}

type TicketMention

type TicketMention struct {
	EventType EventType `json:"eventType"`
	Ticket    *Ticket   `json:"ticket"`
	Author    *Entity   `json:"author"`
	Mentioned *Ticket   `json:"mentioned"`
}

type TicketResolution

type TicketResolution string
const (
	TicketResolutionUnresolved  TicketResolution = "UNRESOLVED"
	TicketResolutionClosed      TicketResolution = "CLOSED"
	TicketResolutionFixed       TicketResolution = "FIXED"
	TicketResolutionImplemented TicketResolution = "IMPLEMENTED"
	TicketResolutionWontFix     TicketResolution = "WONT_FIX"
	TicketResolutionByDesign    TicketResolution = "BY_DESIGN"
	TicketResolutionInvalid     TicketResolution = "INVALID"
	TicketResolutionDuplicate   TicketResolution = "DUPLICATE"
	TicketResolutionNotOurBug   TicketResolution = "NOT_OUR_BUG"
)

func ParseTicketResolution

func ParseTicketResolution(s string) (TicketResolution, error)

type TicketStatus

type TicketStatus string
const (
	TicketStatusReported   TicketStatus = "REPORTED"
	TicketStatusConfirmed  TicketStatus = "CONFIRMED"
	TicketStatusInProgress TicketStatus = "IN_PROGRESS"
	TicketStatusPending    TicketStatus = "PENDING"
	TicketStatusResolved   TicketStatus = "RESOLVED"
)

func ParseTicketStatus

func ParseTicketStatus(s string) (TicketStatus, error)

func (TicketStatus) TermString

func (status TicketStatus) TermString() string

type TicketSubscription

type TicketSubscription struct {
	Id      int32          `json:"id"`
	Created gqlclient.Time `json:"created"`
	Ticket  *Ticket        `json:"ticket"`
}

A ticket subscription will notify a participant when activity occurs on a ticket.

func TicketSubscribe

func TicketSubscribe(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32) (ticketSubscribe *TicketSubscription, err error)

func TicketUnsubscribe

func TicketUnsubscribe(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32) (ticketUnsubscribe *TicketSubscription, err error)

type TicketWebhookInput added in v0.2.0

type TicketWebhookInput struct {
	Url    string         `json:"url"`
	Events []WebhookEvent `json:"events"`
	Query  string         `json:"query"`
}

type TicketWebhookSubscription added in v0.2.0

type TicketWebhookSubscription struct {
	Id         int32                  `json:"id"`
	Events     []WebhookEvent         `json:"events"`
	Query      string                 `json:"query"`
	Url        string                 `json:"url"`
	Client     *OAuthClient           `json:"client,omitempty"`
	Deliveries *WebhookDeliveryCursor `json:"deliveries"`
	Sample     string                 `json:"sample"`
	Ticket     *Ticket                `json:"ticket"`
}

type Tracker

type Tracker struct {
	Id          int32          `json:"id"`
	Created     gqlclient.Time `json:"created"`
	Updated     gqlclient.Time `json:"updated"`
	Owner       *Entity        `json:"owner"`
	Name        string         `json:"name"`
	Description *string        `json:"description,omitempty"`
	Visibility  Visibility     `json:"visibility"`
	Ticket      *Ticket        `json:"ticket"`
	Tickets     *TicketCursor  `json:"tickets"`
	Label       *Label         `json:"label,omitempty"`
	Labels      *LabelCursor   `json:"labels"`
	// If the authenticated user is subscribed to this tracker, this is that
	// subscription.
	Subscription *TrackerSubscription `json:"subscription,omitempty"`
	// The access control list entry (or the default ACL) which describes the
	// authenticated user's permissions with respect to this tracker.
	Acl        *ACL        `json:"acl,omitempty"`
	DefaultACL *DefaultACL `json:"defaultACL"`
	Acls       *ACLCursor  `json:"acls"`
	// Returns a URL from which the tracker owner may download a gzipped JSON
	// archive of the tracker.
	Export URL `json:"export"`
	// Returns a list of tracker webhook subscriptions. For clients
	// authenticated with a personal access token, this returns all webhooks
	// configured by all GraphQL clients for your account. For clients
	// authenticated with an OAuth 2.0 access token, this returns only webhooks
	// registered for your client.
	Webhooks *WebhookSubscriptionCursor `json:"webhooks"`
	// Returns details of a tracker webhook subscription by its ID.
	Webhook *WebhookSubscription `json:"webhook,omitempty"`
}

func CreateTracker added in v0.2.0

func CreateTracker(client *gqlclient.Client, ctx context.Context, name string, description *string, visibility Visibility) (createTracker *Tracker, err error)

func DeleteTracker

func DeleteTracker(client *gqlclient.Client, ctx context.Context, id int32) (deleteTracker *Tracker, err error)

func ImportTracker added in v0.5.0

func ImportTracker(client *gqlclient.Client, ctx context.Context, name string, description *string, visibility Visibility, dump gqlclient.Upload) (createTracker *Tracker, err error)

type TrackerACL

type TrackerACL struct {
	Id      int32          `json:"id"`
	Created gqlclient.Time `json:"created"`
	Tracker *Tracker       `json:"tracker"`
	Entity  *Entity        `json:"entity"`
	Browse  bool           `json:"browse"`
	Submit  bool           `json:"submit"`
	Comment bool           `json:"comment"`
	Edit    bool           `json:"edit"`
	Triage  bool           `json:"triage"`
}

These ACLs are configured for specific entities, and may be used to expand or constrain the rights of a participant.

func DeleteACL

func DeleteACL(client *gqlclient.Client, ctx context.Context, id int32) (deleteACL *TrackerACL, err error)

type TrackerCursor

type TrackerCursor struct {
	Results []Tracker `json:"results"`
	Cursor  *Cursor   `json:"cursor,omitempty"`
}

A cursor for enumerating trackers

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

func ExportTrackers added in v0.4.0

func ExportTrackers(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (trackers *TrackerCursor, err error)

func TrackerNames

func TrackerNames(client *gqlclient.Client, ctx context.Context) (trackers *TrackerCursor, err error)

func Trackers

func Trackers(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (trackers *TrackerCursor, err error)

type TrackerEvent added in v0.2.0

type TrackerEvent struct {
	Uuid    string         `json:"uuid"`
	Event   WebhookEvent   `json:"event"`
	Date    gqlclient.Time `json:"date"`
	Tracker *Tracker       `json:"tracker"`
}

type TrackerInput

type TrackerInput struct {
	Description *string     `json:"description,omitempty"`
	Visibility  *Visibility `json:"visibility,omitempty"`
}

You may omit any fields to leave them unchanged.

type TrackerSubscription

type TrackerSubscription struct {
	Id      int32          `json:"id"`
	Created gqlclient.Time `json:"created"`
	Tracker *Tracker       `json:"tracker"`
}

A tracker subscription will notify a participant of all activity for a tracker, including all new tickets and their events.

func TrackerSubscribe

func TrackerSubscribe(client *gqlclient.Client, ctx context.Context, trackerId int32) (trackerSubscribe *TrackerSubscription, err error)

func TrackerUnsubscribe

func TrackerUnsubscribe(client *gqlclient.Client, ctx context.Context, trackerId int32) (trackerUnsubscribe *TrackerSubscription, err error)

type TrackerWebhookInput added in v0.2.0

type TrackerWebhookInput struct {
	Url    string         `json:"url"`
	Events []WebhookEvent `json:"events"`
	Query  string         `json:"query"`
}

type TrackerWebhookSubscription added in v0.2.0

type TrackerWebhookSubscription struct {
	Id         int32                  `json:"id"`
	Events     []WebhookEvent         `json:"events"`
	Query      string                 `json:"query"`
	Url        string                 `json:"url"`
	Client     *OAuthClient           `json:"client,omitempty"`
	Deliveries *WebhookDeliveryCursor `json:"deliveries"`
	Sample     string                 `json:"sample"`
	Tracker    *Tracker               `json:"tracker"`
}

type URL

type URL string

type UpdateLabelInput

type UpdateLabelInput struct {
	Name            *string `json:"name,omitempty"`
	ForegroundColor *string `json:"foregroundColor,omitempty"`
	BackgroundColor *string `json:"backgroundColor,omitempty"`
}

You may omit any fields to leave them unchanged.

type UpdateStatusInput

type UpdateStatusInput struct {
	Status     TicketStatus      `json:"status"`
	Resolution *TicketResolution `json:"resolution,omitempty"`
	// For use by the tracker owner only
	Import *ImportInput `json:"import,omitempty"`
}

"resolution" is required if status is RESOLVED.

type UpdateTicketInput

type UpdateTicketInput struct {
	Subject *string `json:"subject,omitempty"`
	Body    *string `json:"body,omitempty"`
	// For use by the tracker owner only
	Import *ImportInput `json:"import,omitempty"`
}

You may omit any fields to leave them unchanged. To remove the ticket body, set it to null.

type User

type User struct {
	Id            int32          `json:"id"`
	Created       gqlclient.Time `json:"created"`
	Updated       gqlclient.Time `json:"updated"`
	CanonicalName string         `json:"canonicalName"`
	Username      string         `json:"username"`
	Email         string         `json:"email"`
	Url           *string        `json:"url,omitempty"`
	Location      *string        `json:"location,omitempty"`
	Bio           *string        `json:"bio,omitempty"`
	// Returns a specific tracker.
	Tracker  *Tracker       `json:"tracker,omitempty"`
	Trackers *TrackerCursor `json:"trackers"`
}

func AclByTrackerName

func AclByTrackerName(client *gqlclient.Client, ctx context.Context, name string, cursor *Cursor) (me *User, err error)

func AclByUser added in v0.4.0

func AclByUser(client *gqlclient.Client, ctx context.Context, username string, name string, cursor *Cursor) (user *User, err error)

func Assignees

func Assignees(client *gqlclient.Client, ctx context.Context, name string, id int32) (me *User, err error)

func AssigneesByUser added in v0.2.0

func AssigneesByUser(client *gqlclient.Client, ctx context.Context, username string, name string, id int32) (user *User, err error)

func CompleteLabel added in v0.3.0

func CompleteLabel(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)

func CompleteLabelByUser added in v0.3.0

func CompleteLabelByUser(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)

func CompleteTicketAssign

func CompleteTicketAssign(client *gqlclient.Client, ctx context.Context, name string, id int32) (me *User, err error)

func CompleteTicketId

func CompleteTicketId(client *gqlclient.Client, ctx context.Context, name string, subscription bool) (me *User, err error)

func CompleteTicketIdByUser added in v0.2.0

func CompleteTicketIdByUser(client *gqlclient.Client, ctx context.Context, username string, name string, subscription bool) (user *User, err error)

func ExportTracker added in v0.5.0

func ExportTracker(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)

func LabelIDByName added in v0.3.0

func LabelIDByName(client *gqlclient.Client, ctx context.Context, trackerName string, labelName string) (me *User, err error)

func LabelIDByUser added in v0.3.0

func LabelIDByUser(client *gqlclient.Client, ctx context.Context, username string, trackerName string, labelName string) (user *User, err error)

func Labels

func Labels(client *gqlclient.Client, ctx context.Context, name string, cursor *Cursor) (me *User, err error)

func LabelsByUser added in v0.2.0

func LabelsByUser(client *gqlclient.Client, ctx context.Context, username string, name string, cursor *Cursor) (user *User, err error)

func TicketBodyByName added in v0.5.0

func TicketBodyByName(client *gqlclient.Client, ctx context.Context, name string, id int32) (me *User, err error)

func TicketBodyByUser added in v0.5.0

func TicketBodyByUser(client *gqlclient.Client, ctx context.Context, username string, tracker string, id int32) (user *User, err error)

func TicketByName added in v0.3.0

func TicketByName(client *gqlclient.Client, ctx context.Context, name string, id int32) (me *User, err error)

func TicketByUser added in v0.3.0

func TicketByUser(client *gqlclient.Client, ctx context.Context, username string, tracker string, id int32) (user *User, err error)

func TicketWebhooks added in v0.2.0

func TicketWebhooks(client *gqlclient.Client, ctx context.Context, name string, id int32, cursor *Cursor) (me *User, err error)

func TicketWebhooksByUser added in v0.2.0

func TicketWebhooksByUser(client *gqlclient.Client, ctx context.Context, username string, name string, id int32, cursor *Cursor) (user *User, err error)

func Tickets

func Tickets(client *gqlclient.Client, ctx context.Context, name string, cursor *Cursor) (me *User, err error)

func TicketsByUser added in v0.2.0

func TicketsByUser(client *gqlclient.Client, ctx context.Context, username string, name string, cursor *Cursor) (user *User, err error)

func TrackerIDByName

func TrackerIDByName(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)

func TrackerIDByUser added in v0.2.0

func TrackerIDByUser(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)

func TrackerWebhooks added in v0.2.0

func TrackerWebhooks(client *gqlclient.Client, ctx context.Context, name string, cursor *Cursor) (me *User, err error)

func TrackerWebhooksByUser added in v0.2.0

func TrackerWebhooksByUser(client *gqlclient.Client, ctx context.Context, username string, name string, cursor *Cursor) (user *User, err error)

func TrackersByUser

func TrackersByUser(client *gqlclient.Client, ctx context.Context, username string, cursor *Cursor) (user *User, err error)

func UserIDByName

func UserIDByName(client *gqlclient.Client, ctx context.Context, username string) (user *User, err error)

type UserMention

type UserMention struct {
	EventType EventType `json:"eventType"`
	Ticket    *Ticket   `json:"ticket"`
	Author    *Entity   `json:"author"`
	Mentioned *Entity   `json:"mentioned"`
}

type UserWebhookInput added in v0.2.0

type UserWebhookInput struct {
	Url    string         `json:"url"`
	Events []WebhookEvent `json:"events"`
	Query  string         `json:"query"`
}

type UserWebhookSubscription added in v0.2.0

type UserWebhookSubscription struct {
	Id         int32                  `json:"id"`
	Events     []WebhookEvent         `json:"events"`
	Query      string                 `json:"query"`
	Url        string                 `json:"url"`
	Client     *OAuthClient           `json:"client,omitempty"`
	Deliveries *WebhookDeliveryCursor `json:"deliveries"`
	Sample     string                 `json:"sample"`
}

type Version

type Version struct {
	Major int32 `json:"major"`
	Minor int32 `json:"minor"`
	Patch int32 `json:"patch"`
	// If this API version is scheduled for deprecation, this is the date on which
	// it will stop working; or null if this API version is not scheduled for
	// deprecation.
	DeprecationDate gqlclient.Time `json:"deprecationDate,omitempty"`
}

type Visibility

type Visibility string
const (
	VisibilityPublic   Visibility = "PUBLIC"
	VisibilityUnlisted Visibility = "UNLISTED"
	VisibilityPrivate  Visibility = "PRIVATE"
)

func ParseVisibility added in v0.2.0

func ParseVisibility(s string) (Visibility, error)

func (Visibility) TermString

func (visibility Visibility) TermString() string

type WebhookDelivery added in v0.2.0

type WebhookDelivery struct {
	Uuid         string               `json:"uuid"`
	Date         gqlclient.Time       `json:"date"`
	Event        WebhookEvent         `json:"event"`
	Subscription *WebhookSubscription `json:"subscription"`
	RequestBody  string               `json:"requestBody"`
	// These details are provided only after a response is received from the
	// remote server. If a response is sent whose Content-Type is not text/*, or
	// cannot be decoded as UTF-8, the response body will be null. It will be
	// truncated after 64 KiB.
	ResponseBody    *string `json:"responseBody,omitempty"`
	ResponseHeaders *string `json:"responseHeaders,omitempty"`
	ResponseStatus  *int32  `json:"responseStatus,omitempty"`
}

type WebhookDeliveryCursor added in v0.2.0

type WebhookDeliveryCursor struct {
	Results []WebhookDelivery `json:"results"`
	Cursor  *Cursor           `json:"cursor,omitempty"`
}

A cursor for enumerating a list of webhook deliveries

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type WebhookEvent added in v0.2.0

type WebhookEvent string
const (
	WebhookEventTrackerCreated WebhookEvent = "TRACKER_CREATED"
	WebhookEventTrackerUpdate  WebhookEvent = "TRACKER_UPDATE"
	WebhookEventTrackerDeleted WebhookEvent = "TRACKER_DELETED"
	WebhookEventTicketCreated  WebhookEvent = "TICKET_CREATED"
	WebhookEventTicketUpdate   WebhookEvent = "TICKET_UPDATE"
	WebhookEventTicketDeleted  WebhookEvent = "TICKET_DELETED"
	WebhookEventLabelCreated   WebhookEvent = "LABEL_CREATED"
	WebhookEventLabelUpdate    WebhookEvent = "LABEL_UPDATE"
	WebhookEventLabelDeleted   WebhookEvent = "LABEL_DELETED"
	WebhookEventEventCreated   WebhookEvent = "EVENT_CREATED"
)

func ParseTicketWebhookEvents added in v0.2.0

func ParseTicketWebhookEvents(events []string) ([]WebhookEvent, error)

func ParseTrackerWebhookEvents added in v0.2.0

func ParseTrackerWebhookEvents(events []string) ([]WebhookEvent, error)

func ParseUserEvents added in v0.2.0

func ParseUserEvents(events []string) ([]WebhookEvent, error)

type WebhookPayload added in v0.2.0

type WebhookPayload struct {
	Uuid  string         `json:"uuid"`
	Event WebhookEvent   `json:"event"`
	Date  gqlclient.Time `json:"date"`

	// Underlying value of the GraphQL interface
	Value WebhookPayloadValue `json:"-"`
}

func (*WebhookPayload) UnmarshalJSON added in v0.4.0

func (base *WebhookPayload) UnmarshalJSON(b []byte) error

type WebhookPayloadValue added in v0.4.0

type WebhookPayloadValue interface {
	// contains filtered or unexported methods
}

WebhookPayloadValue is one of: TrackerEvent | TicketEvent | TicketDeletedEvent | EventCreated | LabelEvent

type WebhookSubscription added in v0.2.0

type WebhookSubscription struct {
	Id     int32          `json:"id"`
	Events []WebhookEvent `json:"events"`
	Query  string         `json:"query"`
	Url    string         `json:"url"`
	// If this webhook was registered by an authorized OAuth 2.0 client, this
	// field is non-null.
	Client *OAuthClient `json:"client,omitempty"`
	// All deliveries which have been sent to this webhook.
	Deliveries *WebhookDeliveryCursor `json:"deliveries"`
	// Returns a sample payload for this subscription, for testing purposes
	Sample string `json:"sample"`

	// Underlying value of the GraphQL interface
	Value WebhookSubscriptionValue `json:"-"`
}

func CreateTicketWebhook added in v0.2.0

func CreateTicketWebhook(client *gqlclient.Client, ctx context.Context, trackerId int32, ticketId int32, config TicketWebhookInput) (createTicketWebhook *WebhookSubscription, err error)

func CreateTrackerWebhook added in v0.2.0

func CreateTrackerWebhook(client *gqlclient.Client, ctx context.Context, trackerId int32, config TrackerWebhookInput) (createTrackerWebhook *WebhookSubscription, err error)

func CreateUserWebhook added in v0.2.0

func CreateUserWebhook(client *gqlclient.Client, ctx context.Context, config UserWebhookInput) (createUserWebhook *WebhookSubscription, err error)

func DeleteTicketWebhook added in v0.2.0

func DeleteTicketWebhook(client *gqlclient.Client, ctx context.Context, id int32) (deleteTicketWebhook *WebhookSubscription, err error)

func DeleteTrackerWebhook added in v0.2.0

func DeleteTrackerWebhook(client *gqlclient.Client, ctx context.Context, id int32) (deleteTrackerWebhook *WebhookSubscription, err error)

func DeleteUserWebhook added in v0.2.0

func DeleteUserWebhook(client *gqlclient.Client, ctx context.Context, id int32) (deleteUserWebhook *WebhookSubscription, err error)

func (*WebhookSubscription) UnmarshalJSON added in v0.4.0

func (base *WebhookSubscription) UnmarshalJSON(b []byte) error

type WebhookSubscriptionCursor added in v0.2.0

type WebhookSubscriptionCursor struct {
	Results []WebhookSubscription `json:"results"`
	Cursor  *Cursor               `json:"cursor,omitempty"`
}

A cursor for enumerating a list of webhook subscriptions

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

func UserWebhooks added in v0.2.0

func UserWebhooks(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (userWebhooks *WebhookSubscriptionCursor, err error)

type WebhookSubscriptionValue added in v0.4.0

type WebhookSubscriptionValue interface {
	// contains filtered or unexported methods
}

WebhookSubscriptionValue is one of: UserWebhookSubscription | TrackerWebhookSubscription | TicketWebhookSubscription

Jump to

Keyboard shortcuts

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