309 lines
7.3 KiB
Go
309 lines
7.3 KiB
Go
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
package model
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"strconv"
|
|
"time"
|
|
|
|
"git.sr.ht/~sircmpwn/core-go/model"
|
|
)
|
|
|
|
type ACL interface {
|
|
IsACL()
|
|
}
|
|
|
|
type ActivitySubscription interface {
|
|
IsActivitySubscription()
|
|
}
|
|
|
|
type Entity interface {
|
|
IsEntity()
|
|
}
|
|
|
|
type ACLInput struct {
|
|
Browse bool `json:"browse"`
|
|
Reply bool `json:"reply"`
|
|
Post bool `json:"post"`
|
|
Moderate bool `json:"moderate"`
|
|
}
|
|
|
|
// 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 ActivitySubscriptionCursor struct {
|
|
Results []ActivitySubscription `json:"results"`
|
|
Cursor *model.Cursor `json:"cursor"`
|
|
}
|
|
|
|
// A cursor for enumerating emails
|
|
//
|
|
// 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 EmailCursor struct {
|
|
Results []*Email `json:"results"`
|
|
Cursor *model.Cursor `json:"cursor"`
|
|
}
|
|
|
|
// A cursor for enumerating ACL 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 MailingListACLCursor struct {
|
|
Results []*MailingListACL `json:"results"`
|
|
Cursor *model.Cursor `json:"cursor"`
|
|
}
|
|
|
|
// A cursor for enumerating mailing lists
|
|
//
|
|
// 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 MailingListCursor struct {
|
|
Results []*MailingList `json:"results"`
|
|
Cursor *model.Cursor `json:"cursor"`
|
|
}
|
|
|
|
// Information parsed from the subject line of a patch, such that the following:
|
|
//
|
|
// [PATCH myproject v2 3/4] Add foo to bar
|
|
//
|
|
// Will produce:
|
|
//
|
|
// index: 3
|
|
// count: 4
|
|
// version: 2
|
|
// prefix: "myproject"
|
|
// subject: "Add foo to bar"
|
|
type Patch struct {
|
|
Index *int `json:"index"`
|
|
Count *int `json:"count"`
|
|
Version *int `json:"version"`
|
|
Prefix *string `json:"prefix"`
|
|
Subject *string `json:"subject"`
|
|
}
|
|
|
|
// A cursor for enumerating patchsets
|
|
//
|
|
// 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 PatchsetCursor struct {
|
|
Results []*Patchset `json:"results"`
|
|
Cursor *model.Cursor `json:"cursor"`
|
|
}
|
|
|
|
// A cursor for enumerating threads
|
|
//
|
|
// 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 ThreadCursor struct {
|
|
Results []*Thread `json:"results"`
|
|
Cursor *model.Cursor `json:"cursor"`
|
|
}
|
|
|
|
type Version struct {
|
|
Major int `json:"major"`
|
|
Minor int `json:"minor"`
|
|
Patch int `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"`
|
|
}
|
|
|
|
type AccessKind string
|
|
|
|
const (
|
|
AccessKindRo AccessKind = "RO"
|
|
AccessKindRw AccessKind = "RW"
|
|
)
|
|
|
|
var AllAccessKind = []AccessKind{
|
|
AccessKindRo,
|
|
AccessKindRw,
|
|
}
|
|
|
|
func (e AccessKind) IsValid() bool {
|
|
switch e {
|
|
case AccessKindRo, AccessKindRw:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e AccessKind) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e *AccessKind) UnmarshalGQL(v interface{}) error {
|
|
str, ok := v.(string)
|
|
if !ok {
|
|
return fmt.Errorf("enums must be strings")
|
|
}
|
|
|
|
*e = AccessKind(str)
|
|
if !e.IsValid() {
|
|
return fmt.Errorf("%s is not a valid AccessKind", str)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (e AccessKind) MarshalGQL(w io.Writer) {
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
}
|
|
|
|
type AccessScope string
|
|
|
|
const (
|
|
AccessScopeACLS AccessScope = "ACLS"
|
|
AccessScopeEmails AccessScope = "EMAILS"
|
|
AccessScopeLists AccessScope = "LISTS"
|
|
AccessScopePatches AccessScope = "PATCHES"
|
|
AccessScopeProfile AccessScope = "PROFILE"
|
|
AccessScopeSubscriptions AccessScope = "SUBSCRIPTIONS"
|
|
)
|
|
|
|
var AllAccessScope = []AccessScope{
|
|
AccessScopeACLS,
|
|
AccessScopeEmails,
|
|
AccessScopeLists,
|
|
AccessScopePatches,
|
|
AccessScopeProfile,
|
|
AccessScopeSubscriptions,
|
|
}
|
|
|
|
func (e AccessScope) IsValid() bool {
|
|
switch e {
|
|
case AccessScopeACLS, AccessScopeEmails, AccessScopeLists, AccessScopePatches, AccessScopeProfile, AccessScopeSubscriptions:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e AccessScope) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e *AccessScope) UnmarshalGQL(v interface{}) error {
|
|
str, ok := v.(string)
|
|
if !ok {
|
|
return fmt.Errorf("enums must be strings")
|
|
}
|
|
|
|
*e = AccessScope(str)
|
|
if !e.IsValid() {
|
|
return fmt.Errorf("%s is not a valid AccessScope", str)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (e AccessScope) MarshalGQL(w io.Writer) {
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
}
|
|
|
|
type PatchsetStatus string
|
|
|
|
const (
|
|
PatchsetStatusUnknown PatchsetStatus = "UNKNOWN"
|
|
PatchsetStatusProposed PatchsetStatus = "PROPOSED"
|
|
PatchsetStatusNeedsRevision PatchsetStatus = "NEEDS_REVISION"
|
|
PatchsetStatusSuperseded PatchsetStatus = "SUPERSEDED"
|
|
PatchsetStatusApproved PatchsetStatus = "APPROVED"
|
|
PatchsetStatusRejected PatchsetStatus = "REJECTED"
|
|
PatchsetStatusApplied PatchsetStatus = "APPLIED"
|
|
)
|
|
|
|
var AllPatchsetStatus = []PatchsetStatus{
|
|
PatchsetStatusUnknown,
|
|
PatchsetStatusProposed,
|
|
PatchsetStatusNeedsRevision,
|
|
PatchsetStatusSuperseded,
|
|
PatchsetStatusApproved,
|
|
PatchsetStatusRejected,
|
|
PatchsetStatusApplied,
|
|
}
|
|
|
|
func (e PatchsetStatus) IsValid() bool {
|
|
switch e {
|
|
case PatchsetStatusUnknown, PatchsetStatusProposed, PatchsetStatusNeedsRevision, PatchsetStatusSuperseded, PatchsetStatusApproved, PatchsetStatusRejected, PatchsetStatusApplied:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e PatchsetStatus) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e *PatchsetStatus) UnmarshalGQL(v interface{}) error {
|
|
str, ok := v.(string)
|
|
if !ok {
|
|
return fmt.Errorf("enums must be strings")
|
|
}
|
|
|
|
*e = PatchsetStatus(str)
|
|
if !e.IsValid() {
|
|
return fmt.Errorf("%s is not a valid PatchsetStatus", str)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (e PatchsetStatus) MarshalGQL(w io.Writer) {
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
}
|
|
|
|
type ToolIcon string
|
|
|
|
const (
|
|
ToolIconPending ToolIcon = "PENDING"
|
|
ToolIconWaiting ToolIcon = "WAITING"
|
|
ToolIconSuccess ToolIcon = "SUCCESS"
|
|
ToolIconFailed ToolIcon = "FAILED"
|
|
ToolIconCancelled ToolIcon = "CANCELLED"
|
|
)
|
|
|
|
var AllToolIcon = []ToolIcon{
|
|
ToolIconPending,
|
|
ToolIconWaiting,
|
|
ToolIconSuccess,
|
|
ToolIconFailed,
|
|
ToolIconCancelled,
|
|
}
|
|
|
|
func (e ToolIcon) IsValid() bool {
|
|
switch e {
|
|
case ToolIconPending, ToolIconWaiting, ToolIconSuccess, ToolIconFailed, ToolIconCancelled:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e ToolIcon) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e *ToolIcon) UnmarshalGQL(v interface{}) error {
|
|
str, ok := v.(string)
|
|
if !ok {
|
|
return fmt.Errorf("enums must be strings")
|
|
}
|
|
|
|
*e = ToolIcon(str)
|
|
if !e.IsValid() {
|
|
return fmt.Errorf("%s is not a valid ToolIcon", str)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (e ToolIcon) MarshalGQL(w io.Writer) {
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
}
|