// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package model
import (
"fmt"
"io"
"strconv"
)
type Node interface {
IsNode()
GetID() string
}
type Book struct {
ID string `json:"id"`
Title *string `json:"title,omitempty"`
Year *int `json:"year,omitempty"`
Synopsis *string `json:"synopsis,omitempty"`
Series *Series `json:"series,omitempty"`
}
func (Book) IsNode() {}
func (this Book) GetID() string { return this.ID }
type BookDetails struct {
ID string `json:"id"`
Title *string `json:"title,omitempty"`
Year *int `json:"year,omitempty"`
Synopsis *string `json:"synopsis,omitempty"`
SeriesPart *string `json:"seriesPart,omitempty"`
SubseriesPart *string `json:"subseriesPart,omitempty"`
Genre []string `json:"genre"`
CreatorNames []string `json:"creatorNames"`
CreatorIds []string `json:"creatorIds"`
Created *string `json:"created,omitempty"`
Updated *string `json:"updated,omitempty"`
}
func (BookDetails) IsNode() {}
func (this BookDetails) GetID() string { return this.ID }
type BookEdge struct {
Cursor string `json:"cursor"`
Node *Book `json:"node,omitempty"`
}
type BooksConnection struct {
Edges []*BookEdge `json:"edges,omitempty"`
PageInfo *PageInfo `json:"pageInfo,omitempty"`
}
type Creator struct {
ID string `json:"id"`
Firstname *string `json:"firstname,omitempty"`
Lastname *string `json:"lastname,omitempty"`
}
func (Creator) IsNode() {}
func (this Creator) GetID() string { return this.ID }
type CreatorCreateInput struct {
Firstname *string `json:"firstname,omitempty"`
Lastname *string `json:"lastname,omitempty"`
Birth *int `json:"birth,omitempty"`
Death *int `json:"death,omitempty"`
Bio *string `json:"bio,omitempty"`
}
type CreatorDetails struct {
ID string `json:"id"`
Firstname *string `json:"firstname,omitempty"`
Lastname *string `json:"lastname,omitempty"`
Birth *int `json:"birth,omitempty"`
Death *int `json:"death,omitempty"`
Bio *string `json:"bio,omitempty"`
Created *string `json:"created,omitempty"`
Updated *string `json:"updated,omitempty"`
}
func (CreatorDetails) IsNode() {}
func (this CreatorDetails) GetID() string { return this.ID }
type CreatorEdge struct {
Cursor string `json:"cursor"`
Node *Creator `json:"node,omitempty"`
}
type CreatorsConnection struct {
Edges []*CreatorEdge `json:"edges,omitempty"`
PageInfo *PageInfo `json:"pageInfo,omitempty"`
}
type Genre struct {
ID string `json:"id"`
Genre *string `json:"genre,omitempty"`
Enum *string `json:"enum,omitempty"`
}
func (Genre) IsNode() {}
func (this Genre) GetID() string { return this.ID }
type GenreEdge struct {
Cursor string `json:"cursor"`
Node *Genre `json:"node,omitempty"`
}
type GenreInput struct {
Genre *string `json:"genre,omitempty"`
}
type GenresConnection struct {
Edges []*GenreEdge `json:"edges,omitempty"`
PageInfo *PageInfo `json:"pageInfo,omitempty"`
}
type PageInfo struct {
HasNextPage bool `json:"hasNextPage"`
HasPreviousPage bool `json:"hasPreviousPage"`
StartCursor bool `json:"startCursor"`
EndCursor bool `json:"endCursor"`
}
type RoleRequest struct {
Role *Role `json:"role,omitempty"`
Reason *string `json:"reason,omitempty"`
Denied *bool `json:"denied,omitempty"`
DenyReason *string `json:"denyReason,omitempty"`
Created *string `json:"created,omitempty"`
}
type Series struct {
ID string `json:"id"`
Title *string `json:"title,omitempty"`
Synopsis *string `json:"synopsis,omitempty"`
TotalBookMembers *int `json:"totalBookMembers,omitempty"`
TotalSubseries *int `json:"totalSubseries,omitempty"`
Created *string `json:"created,omitempty"`
Updated *string `json:"updated,omitempty"`
Subseries *SubseriesConnection `json:"subseries,omitempty"`
}
func (Series) IsNode() {}
func (this Series) GetID() string { return this.ID }
type SeriesInput struct {
Title *string `json:"title,omitempty"`
Synopsis *string `json:"synopsis,omitempty"`
TotalBookMembers *int `json:"totalBookMembers,omitempty"`
TotalSubseries *int `json:"totalSubseries,omitempty"`
}
type Subseries struct {
ID string `json:"id"`
Title *string `json:"title,omitempty"`
Synopsis *string `json:"synopsis,omitempty"`
TotalBookMembers *int `json:"totalBookMembers,omitempty"`
SeriesID *int `json:"seriesId,omitempty"`
Created *string `json:"created,omitempty"`
Updated *string `json:"updated,omitempty"`
}
type SubseriesConnection struct {
Edges []*SubseriesEdge `json:"edges,omitempty"`
PageInfo *PageInfo `json:"pageInfo,omitempty"`
}
type SubseriesEdge struct {
Cursor string `json:"cursor"`
Node *Subseries `json:"node,omitempty"`
}
type SubseriesInput struct {
Title *string `json:"title,omitempty"`
Synopsis *string `json:"synopsis,omitempty"`
TotalBookMembers *int `json:"totalBookMembers,omitempty"`
SeriesID int `json:"seriesId"`
}
type TitleInput struct {
Title *string `json:"title,omitempty"`
Year *int `json:"year,omitempty"`
Synopsis *string `json:"synopsis,omitempty"`
SeriesPart *string `json:"seriesPart,omitempty"`
SubseriesPart *string `json:"subseriesPart,omitempty"`
GenreIds []string `json:"genreIds,omitempty"`
CreatorIds []string `json:"creatorIds,omitempty"`
}
type User struct {
ID string `json:"id"`
Username *string `json:"username,omitempty"`
Email *string `json:"email,omitempty"`
}
func (User) IsNode() {}
func (this User) GetID() string { return this.ID }
type Viewer struct {
User *User `json:"user,omitempty"`
Roles []Role `json:"roles,omitempty"`
PendingRoles []*RoleRequest `json:"pendingRoles,omitempty"`
}
type Role string
const (
RoleAnonymous Role = "ANONYMOUS"
RoleViewer Role = "VIEWER"
RoleBorrower Role = "BORROWER"
RoleLender Role = "LENDER"
RoleServerAdmin Role = "SERVER_ADMIN"
RoleAddBooks Role = "ADD_BOOKS"
RoleEditBooks Role = "EDIT_BOOKS"
RoleDeleteBooks Role = "DELETE_BOOKS"
RoleRoleGranter Role = "ROLE_GRANTER"
)
var AllRole = []Role{
RoleAnonymous,
RoleViewer,
RoleBorrower,
RoleLender,
RoleServerAdmin,
RoleAddBooks,
RoleEditBooks,
RoleDeleteBooks,
RoleRoleGranter,
}
func (e Role) IsValid() bool {
switch e {
case RoleAnonymous, RoleViewer, RoleBorrower, RoleLender, RoleServerAdmin, RoleAddBooks, RoleEditBooks, RoleDeleteBooks, RoleRoleGranter:
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()))
}