todosrht

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteTicketAssign

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

func CompleteTicketAssignByOwner

func CompleteTicketAssignByOwner(client *gqlclient.Client, ctx context.Context, owner string, tracker string, id int32) (me *User, trackerByOwner *Tracker, 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"`
}

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 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 time.Time `json:"created"`
}

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 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 Entity

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

type Event

type Event struct {
	Id      int32         `json:"id"`
	Created time.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 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 UpdateTicketStatus

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

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"`
}

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 time.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 time.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, foreground string, background 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 LabelUpdate

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

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 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 SubmitTicketInput

type SubmitTicketInput struct {
	Subject     string    `json:"subject"`
	Body        *string   `json:"body,omitempty"`
	Created     time.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   time.Time `json:"created"`
	Updated   time.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"`
}

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 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"
	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 time.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 Tracker

type Tracker struct {
	Id          int32         `json:"id"`
	Created     time.Time     `json:"created"`
	Updated     time.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"`
	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"`
}

func AclByTrackerName

func AclByTrackerName(client *gqlclient.Client, ctx context.Context, name string) (trackerByName *Tracker, err error)

func Assignees

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

func AssigneesByOwner

func AssigneesByOwner(client *gqlclient.Client, ctx context.Context, owner string, tracker string, id int32) (trackerByOwner *Tracker, err error)

func CompleteTicketId

func CompleteTicketId(client *gqlclient.Client, ctx context.Context, name string) (trackerByName *Tracker, err error)

func CompleteTicketIdByOwner

func CompleteTicketIdByOwner(client *gqlclient.Client, ctx context.Context, owner string, tracker string) (trackerByOwner *Tracker, err error)

func DeleteTracker

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

func Labels

func Labels(client *gqlclient.Client, ctx context.Context, name string) (trackerByName *Tracker, err error)

func LabelsByOwner

func LabelsByOwner(client *gqlclient.Client, ctx context.Context, owner string, tracker string) (trackerByOwner *Tracker, err error)

func Tickets

func Tickets(client *gqlclient.Client, ctx context.Context, name string) (trackerByName *Tracker, err error)

func TicketsByOwner

func TicketsByOwner(client *gqlclient.Client, ctx context.Context, owner string, tracker string) (trackerByOwner *Tracker, err error)

func TrackerIDByName

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

func TrackerIDByOwner

func TrackerIDByOwner(client *gqlclient.Client, ctx context.Context, owner string, tracker string) (trackerByOwner *Tracker, err error)

type TrackerACL

type TrackerACL struct {
	Id      int32     `json:"id"`
	Created time.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 TrackerNames

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

func Trackers

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

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 time.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 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       time.Time      `json:"created"`
	Updated       time.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"`
	Trackers      *TrackerCursor `json:"trackers"`
}

func TrackersByUser

func TrackersByUser(client *gqlclient.Client, ctx context.Context, username string) (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 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 time.Time `json:"deprecationDate,omitempty"`
}

type Visibility

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

func (Visibility) TermString

func (visibility Visibility) TermString() string

Jump to

Keyboard shortcuts

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