// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. package model import ( "fmt" "io" "strconv" ) type Inventory interface { IsInventory() GetSn() *string GetMac() *string } type ComputeNode struct { Sn *string `json:"SN,omitempty"` Mac *string `json:"MAC,omitempty"` Name *string `json:"Name,omitempty"` Cores *int `json:"Cores,omitempty"` Cycles *int `json:"Cycles,omitempty"` } func (ComputeNode) IsInventory() {} func (this ComputeNode) GetSn() *string { return this.Sn } func (this ComputeNode) GetMac() *string { return this.Mac } type HardDrive struct { Sn *string `json:"SN,omitempty"` Mac *string `json:"MAC,omitempty"` Name *string `json:"Name,omitempty"` Type *HardDriveType `json:"Type,omitempty"` Capacity *int `json:"Capacity,omitempty"` } func (HardDrive) IsInventory() {} func (this HardDrive) GetSn() *string { return this.Sn } func (this HardDrive) GetMac() *string { return this.Mac } type NewTodo struct { Text string `json:"text"` UserID string `json:"userId"` } type Todo struct { ID string `json:"id"` Text string `json:"text"` Done bool `json:"done"` User *User `json:"user"` } type User struct { ID string `json:"id"` Name string `json:"name"` } type HardDriveType string const ( HardDriveTypeHdd HardDriveType = "HDD" HardDriveTypeSsd HardDriveType = "SSD" HardDriveTypeNvme HardDriveType = "NVME" ) var AllHardDriveType = []HardDriveType{ HardDriveTypeHdd, HardDriveTypeSsd, HardDriveTypeNvme, } func (e HardDriveType) IsValid() bool { switch e { case HardDriveTypeHdd, HardDriveTypeSsd, HardDriveTypeNvme: return true } return false } func (e HardDriveType) String() string { return string(e) } func (e *HardDriveType) UnmarshalGQL(v interface{}) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") } *e = HardDriveType(str) if !e.IsValid() { return fmt.Errorf("%s is not a valid HardDriveType", str) } return nil } func (e HardDriveType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) }