1
Fork 0
photoview/api/graphql/models/generated.go

145 lines
3.1 KiB
Go

// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package models
import (
"fmt"
"io"
"strconv"
)
type AuthorizeResult struct {
Success bool `json:"success"`
Status string `json:"status"`
Token *string `json:"token"`
}
type Filter struct {
OrderBy *string `json:"order_by"`
OrderDirection *OrderDirection `json:"order_direction"`
Limit *int `json:"limit"`
Offset *int `json:"offset"`
}
type Notification struct {
Key string `json:"key"`
Type NotificationType `json:"type"`
Header string `json:"header"`
Content string `json:"content"`
Progress *float64 `json:"progress"`
Positive bool `json:"positive"`
Negative bool `json:"negative"`
// Time in milliseconds before the notification will close
Timeout *int `json:"timeout"`
}
type PhotoDownload struct {
Title string `json:"title"`
Width int `json:"width"`
Height int `json:"height"`
URL string `json:"url"`
}
type ScannerResult struct {
Finished bool `json:"finished"`
Success bool `json:"success"`
Progress *float64 `json:"progress"`
Message *string `json:"message"`
}
type SearchResult struct {
Query string `json:"query"`
Albums []*Album `json:"albums"`
Photos []*Photo `json:"photos"`
}
// General public information about the site
type SiteInfo struct {
InitialSetup bool `json:"initialSetup"`
}
type NotificationType string
const (
NotificationTypeMessage NotificationType = "Message"
NotificationTypeProgress NotificationType = "Progress"
// Close a notification with a given key
NotificationTypeClose NotificationType = "Close"
)
var AllNotificationType = []NotificationType{
NotificationTypeMessage,
NotificationTypeProgress,
NotificationTypeClose,
}
func (e NotificationType) IsValid() bool {
switch e {
case NotificationTypeMessage, NotificationTypeProgress, NotificationTypeClose:
return true
}
return false
}
func (e NotificationType) String() string {
return string(e)
}
func (e *NotificationType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = NotificationType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid NotificationType", str)
}
return nil
}
func (e NotificationType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type OrderDirection string
const (
OrderDirectionAsc OrderDirection = "ASC"
OrderDirectionDesc OrderDirection = "DESC"
)
var AllOrderDirection = []OrderDirection{
OrderDirectionAsc,
OrderDirectionDesc,
}
func (e OrderDirection) IsValid() bool {
switch e {
case OrderDirectionAsc, OrderDirectionDesc:
return true
}
return false
}
func (e OrderDirection) String() string {
return string(e)
}
func (e *OrderDirection) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = OrderDirection(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid OrderDirection", str)
}
return nil
}
func (e OrderDirection) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}