// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.

package model

import (
	"time"

	"git.kmsign.ru/royalcat/tstor/src/host/controller"
	"git.kmsign.ru/royalcat/tstor/src/host/vfs"
	"github.com/anacrolix/torrent"
)

type Dir interface {
	IsFsEntry()
	IsDir()
	GetName() string
	GetEntries() []FsEntry
}

type File interface {
	IsFsEntry()
	IsFile()
	GetName() string
	GetSize() int64
}

type FsEntry interface {
	IsFsEntry()
	GetName() string
}

type Progress interface {
	IsProgress()
	GetCurrent() int64
	GetTotal() int64
}

type ArchiveFs struct {
	Name    string         `json:"name"`
	Entries []FsEntry      `json:"entries"`
	Size    int64          `json:"size"`
	FS      *vfs.ArchiveFS `json:"-"`
}

func (ArchiveFs) IsDir()               {}
func (this ArchiveFs) GetName() string { return this.Name }
func (this ArchiveFs) GetEntries() []FsEntry {
	if this.Entries == nil {
		return nil
	}
	interfaceSlice := make([]FsEntry, 0, len(this.Entries))
	for _, concrete := range this.Entries {
		interfaceSlice = append(interfaceSlice, concrete)
	}
	return interfaceSlice
}

func (ArchiveFs) IsFsEntry() {}

type BooleanFilter struct {
	Eq *bool `json:"eq,omitempty"`
}

type CleanupResponse struct {
	Count int64    `json:"count"`
	List  []string `json:"list"`
}

type DateTimeFilter struct {
	Eq  *time.Time `json:"eq,omitempty"`
	Gt  *time.Time `json:"gt,omitempty"`
	Lt  *time.Time `json:"lt,omitempty"`
	Gte *time.Time `json:"gte,omitempty"`
	Lte *time.Time `json:"lte,omitempty"`
}

type DownloadTorrentResponse struct {
	Task *Task `json:"task,omitempty"`
}

type IntFilter struct {
	Eq  *int64  `json:"eq,omitempty"`
	Gt  *int64  `json:"gt,omitempty"`
	Lt  *int64  `json:"lt,omitempty"`
	Gte *int64  `json:"gte,omitempty"`
	Lte *int64  `json:"lte,omitempty"`
	In  []int64 `json:"in,omitempty"`
}

type Mutation struct {
}

type Pagination struct {
	Offset int64 `json:"offset"`
	Limit  int64 `json:"limit"`
}

type Query struct {
}

type ResolverFs struct {
	Name    string          `json:"name"`
	Entries []FsEntry       `json:"entries"`
	FS      *vfs.ResolverFS `json:"-"`
}

func (ResolverFs) IsDir()               {}
func (this ResolverFs) GetName() string { return this.Name }
func (this ResolverFs) GetEntries() []FsEntry {
	if this.Entries == nil {
		return nil
	}
	interfaceSlice := make([]FsEntry, 0, len(this.Entries))
	for _, concrete := range this.Entries {
		interfaceSlice = append(interfaceSlice, concrete)
	}
	return interfaceSlice
}

func (ResolverFs) IsFsEntry() {}

type Schema struct {
	Query    *Query    `json:"query,omitempty"`
	Mutation *Mutation `json:"mutation,omitempty"`
}

type SimpleDir struct {
	Name    string         `json:"name"`
	Entries []FsEntry      `json:"entries"`
	FS      vfs.Filesystem `json:"-"`
	Path    string         `json:"-"`
}

func (SimpleDir) IsDir()               {}
func (this SimpleDir) GetName() string { return this.Name }
func (this SimpleDir) GetEntries() []FsEntry {
	if this.Entries == nil {
		return nil
	}
	interfaceSlice := make([]FsEntry, 0, len(this.Entries))
	for _, concrete := range this.Entries {
		interfaceSlice = append(interfaceSlice, concrete)
	}
	return interfaceSlice
}

func (SimpleDir) IsFsEntry() {}

type SimpleFile struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
}

func (SimpleFile) IsFile()              {}
func (this SimpleFile) GetName() string { return this.Name }
func (this SimpleFile) GetSize() int64  { return this.Size }

func (SimpleFile) IsFsEntry() {}

type StringFilter struct {
	Eq     *string  `json:"eq,omitempty"`
	Substr *string  `json:"substr,omitempty"`
	In     []string `json:"in,omitempty"`
}

type Subscription struct {
}

type Task struct {
	ID string `json:"id"`
}

type Torrent struct {
	Name            string              `json:"name"`
	Infohash        string              `json:"infohash"`
	BytesCompleted  int64               `json:"bytesCompleted"`
	TorrentFilePath string              `json:"torrentFilePath"`
	BytesMissing    int64               `json:"bytesMissing"`
	Files           []*TorrentFile      `json:"files"`
	ExcludedFiles   []*TorrentFile      `json:"excludedFiles"`
	Peers           []*TorrentPeer      `json:"peers"`
	Downloading     bool                `json:"downloading"`
	T               *controller.Torrent `json:"-"`
}

type TorrentFs struct {
	Name    string         `json:"name"`
	Torrent *Torrent       `json:"torrent"`
	Entries []FsEntry      `json:"entries"`
	FS      *vfs.TorrentFS `json:"-"`
}

func (TorrentFs) IsDir()               {}
func (this TorrentFs) GetName() string { return this.Name }
func (this TorrentFs) GetEntries() []FsEntry {
	if this.Entries == nil {
		return nil
	}
	interfaceSlice := make([]FsEntry, 0, len(this.Entries))
	for _, concrete := range this.Entries {
		interfaceSlice = append(interfaceSlice, concrete)
	}
	return interfaceSlice
}

func (TorrentFs) IsFsEntry() {}

type TorrentFile struct {
	Filename       string        `json:"filename"`
	Size           int64         `json:"size"`
	BytesCompleted int64         `json:"bytesCompleted"`
	F              *torrent.File `json:"-"`
}

type TorrentFileEntry struct {
	Name    string   `json:"name"`
	Torrent *Torrent `json:"torrent"`
	Size    int64    `json:"size"`
}

func (TorrentFileEntry) IsFile()              {}
func (this TorrentFileEntry) GetName() string { return this.Name }
func (this TorrentFileEntry) GetSize() int64  { return this.Size }

func (TorrentFileEntry) IsFsEntry() {}

type TorrentFilter struct {
	Everything *bool   `json:"everything,omitempty"`
	Infohash   *string `json:"infohash,omitempty"`
}

type TorrentPeer struct {
	IP           string            `json:"ip"`
	DownloadRate float64           `json:"downloadRate"`
	Discovery    string            `json:"discovery"`
	Port         int64             `json:"port"`
	ClientName   string            `json:"clientName"`
	F            *torrent.PeerConn `json:"-"`
}

type TorrentProgress struct {
	Torrent *Torrent `json:"torrent"`
	Current int64    `json:"current"`
	Total   int64    `json:"total"`
}

func (TorrentProgress) IsProgress()            {}
func (this TorrentProgress) GetCurrent() int64 { return this.Current }
func (this TorrentProgress) GetTotal() int64   { return this.Total }

type TorrentsFilter struct {
	Infohash       *StringFilter  `json:"infohash,omitempty"`
	Name           *StringFilter  `json:"name,omitempty"`
	BytesCompleted *IntFilter     `json:"bytesCompleted,omitempty"`
	BytesMissing   *IntFilter     `json:"bytesMissing,omitempty"`
	PeersCount     *IntFilter     `json:"peersCount,omitempty"`
	Downloading    *BooleanFilter `json:"downloading,omitempty"`
}