This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/graph/model/models_gen.go

466 lines
11 KiB
Go
Raw Normal View History

2021-02-02 20:34:10 +00:00
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package model
import (
"fmt"
"io"
"strconv"
"time"
"github.com/99designs/gqlgen/graphql"
)
type Album struct {
2021-02-04 10:16:13 +00:00
ID string `json:"id" gorm:"primaryKey;not null"`
2021-02-02 20:34:10 +00:00
CreatedAt *time.Time `json:"createdAt" `
UpdatedAt *time.Time `json:"updatedAt" `
Name string `json:"name" gorm:"unique;not null"`
2021-02-08 17:41:58 +00:00
UserID string `json:"userID" gorm:"not null"`
2021-02-02 20:34:10 +00:00
}
type AlbumFilter struct {
2021-02-08 17:41:58 +00:00
ID *IDFilter `json:"id" `
CreatedAt *TimeFilter `json:"createdAt" `
UpdatedAt *TimeFilter `json:"updatedAt" `
Name *StringFilter `json:"name" `
2021-02-02 20:34:10 +00:00
}
type AlbumResponse struct {
2021-02-09 00:42:20 +00:00
Data []*Album `json:"data" `
Page *PageResponse `json:"page" `
2021-02-02 20:34:10 +00:00
}
2021-02-03 03:55:35 +00:00
type AuthResponse struct {
2021-02-04 20:31:07 +00:00
Result AuthResult `json:"result" `
Device *Device `json:"device" `
Error *string `json:"error" `
2021-02-03 03:55:35 +00:00
}
2021-02-02 20:34:10 +00:00
type AuthTypeFilter struct {
2021-02-08 17:41:58 +00:00
EqualTo *AuthType `json:"equalTo" `
NotEqualTo *AuthType `json:"notEqualTo" `
2021-02-02 20:34:10 +00:00
}
type BooleanFilter struct {
EqualTo *bool `json:"equalTo" `
NotEqualTo *bool `json:"notEqualTo" `
}
type Device struct {
2021-02-04 10:16:13 +00:00
ID string `json:"id" gorm:"primaryKey;not null"`
2021-02-02 20:34:10 +00:00
CreatedAt *time.Time `json:"createdAt" `
UpdatedAt *time.Time `json:"updatedAt" `
Name string `json:"name" gorm:"not null"`
Type DeviceType `json:"type" gorm:"default:Unknown;not null"`
RefreshKey *string `json:"refreshKey" `
2021-02-08 17:41:58 +00:00
UserID string `json:"userID" gorm:"not null"`
2021-02-02 20:34:10 +00:00
}
type DeviceFilter struct {
ID *IDFilter `json:"id" `
CreatedAt *TimeFilter `json:"createdAt" `
UpdatedAt *TimeFilter `json:"updatedAt" `
Name *StringFilter `json:"name" `
Type *DeviceTypeFilter `json:"type" `
}
type DeviceResponse struct {
2021-02-09 00:42:20 +00:00
Data []*Device `json:"data" `
Page *PageResponse `json:"page" `
2021-02-02 20:34:10 +00:00
}
type DeviceTypeFilter struct {
2021-02-08 17:41:58 +00:00
EqualTo *DeviceType `json:"equalTo" `
NotEqualTo *DeviceType `json:"notEqualTo" `
2021-02-02 20:34:10 +00:00
}
type FloatFilter struct {
2021-02-08 17:41:58 +00:00
EqualTo *float64 `json:"equalTo" `
NotEqualTo *float64 `json:"notEqualTo" `
LessThan *float64 `json:"lessThan" `
LessThanOrEqualTo *float64 `json:"lessThanOrEqualTo" `
GreaterThan *float64 `json:"greaterThan" `
GreaterThanOrEqualTo *float64 `json:"greaterThanOrEqualTo" `
2021-02-02 20:34:10 +00:00
}
type IDFilter struct {
2021-02-08 17:41:58 +00:00
EqualTo *string `json:"equalTo" `
NotEqualTo *string `json:"notEqualTo" `
2021-02-02 20:34:10 +00:00
}
type IntFilter struct {
2021-02-08 17:41:58 +00:00
EqualTo *int `json:"equalTo" `
NotEqualTo *int `json:"notEqualTo" `
LessThan *int `json:"lessThan" `
LessThanOrEqualTo *int `json:"lessThanOrEqualTo" `
GreaterThan *int `json:"greaterThan" `
GreaterThanOrEqualTo *int `json:"greaterThanOrEqualTo" `
2021-02-02 20:34:10 +00:00
}
type MediaItem struct {
2021-02-04 10:16:13 +00:00
ID string `json:"id" gorm:"primaryKey;not null"`
2021-02-02 20:34:10 +00:00
CreatedAt *time.Time `json:"createdAt" `
UpdatedAt *time.Time `json:"updatedAt" `
ExifDate *time.Time `json:"exifDate" `
2021-02-08 17:41:58 +00:00
Latitude *float64 `json:"latitude" gorm:"precision:5"`
Longitude *float64 `json:"longitude" gorm:"precision:5"`
2021-02-02 20:34:10 +00:00
IsVideo bool `json:"isVideo" gorm:"default:false;not null"`
FileName string `json:"fileName" gorm:"not null"`
OrigName string `json:"origName" gorm:"not null"`
2021-02-08 17:41:58 +00:00
Tags []*Tag `json:"tags" gorm:"many2many:media_tags;foreignKey:ID,UserID;References:ID"`
Albums []*Album `json:"albums" gorm:"many2many:media_albums;foreignKey:ID,UserID;Refrences:ID"`
2021-02-04 10:16:13 +00:00
UserID string `json:"userID" gorm:"not null"`
2021-02-02 20:34:10 +00:00
}
type MediaItemFilter struct {
2021-02-08 17:41:58 +00:00
ID *IDFilter `json:"id" `
CreatedAt *TimeFilter `json:"createdAt" `
UpdatedAt *TimeFilter `json:"updatedAt" `
ExifDate *TimeFilter `json:"exifDate" `
Latitude *FloatFilter `json:"latitude" `
Longitude *FloatFilter `json:"longitude" `
IsVideo *BooleanFilter `json:"isVideo" `
OrigName *StringFilter `json:"origName" `
Tags *TagFilter `json:"tags" `
Albums *AlbumFilter `json:"albums" `
2021-02-02 20:34:10 +00:00
}
type MediaItemResponse struct {
2021-02-09 00:42:20 +00:00
Data []*MediaItem `json:"data" `
Page *PageResponse `json:"page" `
2021-02-02 20:34:10 +00:00
}
type NewAlbum struct {
Name string `json:"name" `
}
type NewMediaItem struct {
File graphql.Upload `json:"file" `
Tags []string `json:"tags" `
Albums []string `json:"albums" `
}
type NewTag struct {
Name string `json:"name" `
}
type NewUser struct {
Email string `json:"email" `
Username string `json:"username" `
FirstName *string `json:"firstName" `
LastName *string `json:"lastName" `
Role Role `json:"role" `
AuthType AuthType `json:"authType" `
Password *string `json:"password" `
}
2021-02-09 00:42:20 +00:00
type Order struct {
By *string `json:"by" `
Direction *OrderDirection `json:"direction" `
}
type Page struct {
Size *int `json:"size" `
Page *int `json:"page" `
}
type PageResponse struct {
Size int `json:"size" `
2021-02-02 20:34:10 +00:00
Page int `json:"page" `
Total int `json:"total" `
}
type RoleFilter struct {
2021-02-08 17:41:58 +00:00
EqualTo *Role `json:"equalTo" `
NotEqualTo *Role `json:"notEqualTo" `
2021-02-02 20:34:10 +00:00
}
type StringFilter struct {
2021-02-08 17:41:58 +00:00
EqualTo *string `json:"equalTo" `
NotEqualTo *string `json:"notEqualTo" `
StartsWith *string `json:"startsWith" `
NotStartsWith *string `json:"notStartsWith" `
EndsWith *string `json:"endsWith" `
NotEndsWith *string `json:"notEndsWith" `
Contains *string `json:"contains" `
NotContains *string `json:"notContains" `
2021-02-02 20:34:10 +00:00
}
type Tag struct {
2021-02-04 10:16:13 +00:00
ID string `json:"id" gorm:"primaryKey;not null"`
2021-02-02 20:34:10 +00:00
CreatedAt *time.Time `json:"createdAt" `
UpdatedAt *time.Time `json:"updatedAt" `
Name string `json:"name" gorm:"unique;not null"`
2021-02-08 17:41:58 +00:00
UserID string `json:"userID" gorm:"not null"`
2021-02-02 20:34:10 +00:00
}
type TagFilter struct {
2021-02-08 17:41:58 +00:00
ID *IDFilter `json:"id" `
CreatedAt *TimeFilter `json:"createdAt" `
UpdatedAt *TimeFilter `json:"updatedAt" `
Name *StringFilter `json:"name" `
2021-02-02 20:34:10 +00:00
}
type TagResponse struct {
2021-02-09 00:42:20 +00:00
Data []*Tag `json:"data" `
Page *PageResponse `json:"page" `
2021-02-02 20:34:10 +00:00
}
type TimeFilter struct {
2021-02-08 17:41:58 +00:00
EqualTo *time.Time `json:"equalTo" `
NotEqualTo *time.Time `json:"notEqualTo" `
LessThan *time.Time `json:"lessThan" `
LessThanOrEqualTo *time.Time `json:"lessThanOrEqualTo" `
GreaterThan *time.Time `json:"greaterThan" `
GreaterThanOrEqualTo *time.Time `json:"greaterThanOrEqualTo" `
2021-02-02 20:34:10 +00:00
}
type User struct {
2021-02-06 03:01:51 +00:00
ID string `json:"id" gorm:"primaryKey;not null"`
CreatedAt *time.Time `json:"createdAt" `
UpdatedAt *time.Time `json:"updatedAt" `
Email string `json:"email" gorm:"not null;unique"`
Username string `json:"username" gorm:"not null;unique"`
FirstName *string `json:"firstName" `
LastName *string `json:"lastName" `
Role Role `json:"role" gorm:"default:User;not null"`
AuthType AuthType `json:"authType" gorm:"default:Local;not null"`
Password *string `json:"password" `
Devices []*Device `json:"devices" gorm:"foreignKey:UserID"`
MediaItems []*MediaItem `json:"mediaItems" gorm:"foreignKey:UserID"`
2021-02-02 20:34:10 +00:00
}
type UserFilter struct {
ID *IDFilter `json:"id" `
CreatedAt *TimeFilter `json:"createdAt" `
UpdatedAt *TimeFilter `json:"updatedAt" `
Username *StringFilter `json:"username" `
FirstName *StringFilter `json:"firstName" `
LastName *StringFilter `json:"lastName" `
Role *RoleFilter `json:"role" `
AuthType *AuthTypeFilter `json:"authType" `
}
type UserResponse struct {
2021-02-09 00:42:20 +00:00
Data []*User `json:"data" `
Page *PageResponse `json:"page" `
2021-02-02 20:34:10 +00:00
}
2021-02-03 03:55:35 +00:00
type AuthResult string
const (
AuthResultSuccess AuthResult = "Success"
AuthResultFailure AuthResult = "Failure"
)
var AllAuthResult = []AuthResult{
AuthResultSuccess,
AuthResultFailure,
}
func (e AuthResult) IsValid() bool {
switch e {
case AuthResultSuccess, AuthResultFailure:
return true
}
return false
}
func (e AuthResult) String() string {
return string(e)
}
func (e *AuthResult) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = AuthResult(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid AuthResult", str)
}
return nil
}
func (e AuthResult) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
2021-02-02 20:34:10 +00:00
type AuthType string
const (
AuthTypeLocal AuthType = "Local"
AuthTypeLdap AuthType = "LDAP"
)
var AllAuthType = []AuthType{
AuthTypeLocal,
AuthTypeLdap,
}
func (e AuthType) IsValid() bool {
switch e {
case AuthTypeLocal, AuthTypeLdap:
return true
}
return false
}
func (e AuthType) String() string {
return string(e)
}
func (e *AuthType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = AuthType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid AuthType", str)
}
return nil
}
func (e AuthType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type DeviceType string
const (
DeviceTypeIOs DeviceType = "iOS"
DeviceTypeAndroid DeviceType = "Android"
DeviceTypeChrome DeviceType = "Chrome"
DeviceTypeFirefox DeviceType = "Firefox"
DeviceTypeInternetExplorer DeviceType = "InternetExplorer"
DeviceTypeEdge DeviceType = "Edge"
DeviceTypeSafari DeviceType = "Safari"
DeviceTypeUnknown DeviceType = "Unknown"
)
var AllDeviceType = []DeviceType{
DeviceTypeIOs,
DeviceTypeAndroid,
DeviceTypeChrome,
DeviceTypeFirefox,
DeviceTypeInternetExplorer,
DeviceTypeEdge,
DeviceTypeSafari,
DeviceTypeUnknown,
}
func (e DeviceType) IsValid() bool {
switch e {
case DeviceTypeIOs, DeviceTypeAndroid, DeviceTypeChrome, DeviceTypeFirefox, DeviceTypeInternetExplorer, DeviceTypeEdge, DeviceTypeSafari, DeviceTypeUnknown:
return true
}
return false
}
func (e DeviceType) String() string {
return string(e)
}
func (e *DeviceType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = DeviceType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid DeviceType", str)
}
return nil
}
func (e DeviceType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
2021-02-09 00:42:20 +00:00
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()))
}
2021-02-02 20:34:10 +00:00
type Role string
const (
RoleAdmin Role = "Admin"
RoleUser Role = "User"
)
var AllRole = []Role{
RoleAdmin,
RoleUser,
}
func (e Role) IsValid() bool {
switch e {
case RoleAdmin, RoleUser:
return true
}
return false
}
func (e Role) String() string {
return string(e)
}
func (e *Role) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = Role(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid Role", str)
}
return nil
}
func (e Role) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}