Remove models_gen.go

This commit is contained in:
Drew DeVault 2022-03-24 14:44:27 +01:00
parent 3b09ea2026
commit a1a6e3ffd4
2 changed files with 1 additions and 331 deletions

2
.gitignore vendored
View File

@ -15,4 +15,4 @@ overrides/
.pgp
api/api
api/graph/api/generated.go
api/loaders/*_gen.go
*_gen.go

View File

@ -1,330 +0,0 @@
// 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 Entity interface {
IsEntity()
}
type WebhookPayload interface {
IsWebhookPayload()
}
type WebhookSubscription interface {
IsWebhookSubscription()
}
// A cursor for enumerating a list of audit log 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 AuditLogCursor struct {
Results []*AuditLogEntry `json:"results"`
Cursor *model.Cursor `json:"cursor"`
}
// A cursor for enumerating a list of invoices
//
// 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 InvoiceCursor struct {
Results []*Invoice `json:"results"`
Cursor *model.Cursor `json:"cursor"`
}
type OAuthClientRegistration struct {
Client *OAuthClient `json:"client"`
Secret string `json:"secret"`
}
type OAuthGrantRegistration struct {
Grant *OAuthGrant `json:"grant"`
Grants string `json:"grants"`
Secret string `json:"secret"`
}
type OAuthPersonalTokenRegistration struct {
Token *OAuthPersonalToken `json:"token"`
Secret string `json:"secret"`
}
// A cursor for enumerating a list of PGP keys
//
// 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 PGPKeyCursor struct {
Results []*PGPKey `json:"results"`
Cursor *model.Cursor `json:"cursor"`
}
type PGPKeyEvent struct {
UUID string `json:"uuid"`
Event WebhookEvent `json:"event"`
Date time.Time `json:"date"`
Key *PGPKey `json:"key"`
}
func (PGPKeyEvent) IsWebhookPayload() {}
type ProfileUpdateEvent struct {
UUID string `json:"uuid"`
Event WebhookEvent `json:"event"`
Date time.Time `json:"date"`
Profile *User `json:"profile"`
}
func (ProfileUpdateEvent) IsWebhookPayload() {}
type ProfileWebhookInput struct {
URL string `json:"url"`
Events []WebhookEvent `json:"events"`
Query string `json:"query"`
}
// A cursor for enumerating a list of SSH keys
//
// 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 SSHKeyCursor struct {
Results []*SSHKey `json:"results"`
Cursor *model.Cursor `json:"cursor"`
}
type SSHKeyEvent struct {
UUID string `json:"uuid"`
Event WebhookEvent `json:"event"`
Date time.Time `json:"date"`
Key *SSHKey `json:"key"`
}
func (SSHKeyEvent) IsWebhookPayload() {}
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"`
}
// 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 WebhookDeliveryCursor struct {
Results []*WebhookDelivery `json:"results"`
Cursor *model.Cursor `json:"cursor"`
}
// 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.
type WebhookSubscriptionCursor struct {
Results []WebhookSubscription `json:"results"`
Cursor *model.Cursor `json:"cursor"`
}
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 (
AccessScopeAuditLog AccessScope = "AUDIT_LOG"
AccessScopeBilling AccessScope = "BILLING"
AccessScopePGPKeys AccessScope = "PGP_KEYS"
AccessScopeSSHKeys AccessScope = "SSH_KEYS"
AccessScopeProfile AccessScope = "PROFILE"
)
var AllAccessScope = []AccessScope{
AccessScopeAuditLog,
AccessScopeBilling,
AccessScopePGPKeys,
AccessScopeSSHKeys,
AccessScopeProfile,
}
func (e AccessScope) IsValid() bool {
switch e {
case AccessScopeAuditLog, AccessScopeBilling, AccessScopePGPKeys, AccessScopeSSHKeys, AccessScopeProfile:
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 UserType string
const (
UserTypeUnconfirmed UserType = "UNCONFIRMED"
UserTypeActiveNonPaying UserType = "ACTIVE_NON_PAYING"
UserTypeActiveFree UserType = "ACTIVE_FREE"
UserTypeActivePaying UserType = "ACTIVE_PAYING"
UserTypeActiveDelinquent UserType = "ACTIVE_DELINQUENT"
UserTypeAdmin UserType = "ADMIN"
UserTypeSuspended UserType = "SUSPENDED"
)
var AllUserType = []UserType{
UserTypeUnconfirmed,
UserTypeActiveNonPaying,
UserTypeActiveFree,
UserTypeActivePaying,
UserTypeActiveDelinquent,
UserTypeAdmin,
UserTypeSuspended,
}
func (e UserType) IsValid() bool {
switch e {
case UserTypeUnconfirmed, UserTypeActiveNonPaying, UserTypeActiveFree, UserTypeActivePaying, UserTypeActiveDelinquent, UserTypeAdmin, UserTypeSuspended:
return true
}
return false
}
func (e UserType) String() string {
return string(e)
}
func (e *UserType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = UserType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid UserType", str)
}
return nil
}
func (e UserType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type WebhookEvent string
const (
// Used for user profile webhooks
WebhookEventProfileUpdate WebhookEvent = "PROFILE_UPDATE"
WebhookEventPGPKeyAdded WebhookEvent = "PGP_KEY_ADDED"
WebhookEventPGPKeyRemoved WebhookEvent = "PGP_KEY_REMOVED"
WebhookEventSSHKeyAdded WebhookEvent = "SSH_KEY_ADDED"
WebhookEventSSHKeyRemoved WebhookEvent = "SSH_KEY_REMOVED"
)
var AllWebhookEvent = []WebhookEvent{
WebhookEventProfileUpdate,
WebhookEventPGPKeyAdded,
WebhookEventPGPKeyRemoved,
WebhookEventSSHKeyAdded,
WebhookEventSSHKeyRemoved,
}
func (e WebhookEvent) IsValid() bool {
switch e {
case WebhookEventProfileUpdate, WebhookEventPGPKeyAdded, WebhookEventPGPKeyRemoved, WebhookEventSSHKeyAdded, WebhookEventSSHKeyRemoved:
return true
}
return false
}
func (e WebhookEvent) String() string {
return string(e)
}
func (e *WebhookEvent) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = WebhookEvent(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid WebhookEvent", str)
}
return nil
}
func (e WebhookEvent) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}