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

package model

import (
	"fmt"
	"io"
	"strconv"
)

type ApiaryInput struct {
	Name string  `json:"name"`
	Lat  *string `json:"lat"`
	Lng  *string `json:"lng"`
}

type BoxInput struct {
	ID       *string `json:"id"`
	Position int     `json:"position"`
	Color    *string `json:"color"`
	Type     BoxType `json:"type"`
	// ignored, added for frontend ease
	HiveID *int         `json:"hiveId"`
	Family *FamilyInput `json:"family"`
}

type FamilyInput struct {
	ID    *string `json:"id"`
	Race  *string `json:"race"`
	Added *string `json:"added"`
}

type FrameInput struct {
	ID       string    `json:"id"`
	Position int       `json:"position"`
	Type     FrameType `json:"type"`
	// ignored, added for frontend ease
	BoxID string `json:"boxId"`
	// ignored, added for frontend ease
	HiveID *int `json:"hiveId"`
}

type HiveInput struct {
	ApiaryID   string    `json:"apiaryId"`
	Name       string    `json:"name"`
	BoxCount   int       `json:"boxCount"`
	FrameCount int       `json:"frameCount"`
	Colors     []*string `json:"colors"`
}

type HiveUpdateInput struct {
	ID     string       `json:"id"`
	Name   *string      `json:"name"`
	Notes  *string      `json:"notes"`
	Family *FamilyInput `json:"family"`
}

type InspectionInput struct {
	HiveID int    `json:"hiveId"`
	Data   string `json:"data"`
}

type TreatmentOfBoxInput struct {
	HiveID string `json:"hiveId"`
	BoxID  string `json:"boxId"`
	Type   string `json:"type"`
}

type TreatmentOfHiveInput struct {
	HiveID string `json:"hiveId"`
	Type   string `json:"type"`
}

type BoxType string

const (
	BoxTypeDeep             BoxType = "DEEP"
	BoxTypeSuper            BoxType = "SUPER"
	BoxTypeGate             BoxType = "GATE"
	BoxTypeVentilation      BoxType = "VENTILATION"
	BoxTypeQueenExcluder    BoxType = "QUEEN_EXCLUDER"
	BoxTypeHorizontalFeeder BoxType = "HORIZONTAL_FEEDER"
)

var AllBoxType = []BoxType{
	BoxTypeDeep,
	BoxTypeSuper,
	BoxTypeGate,
	BoxTypeVentilation,
	BoxTypeQueenExcluder,
	BoxTypeHorizontalFeeder,
}

func (e BoxType) IsValid() bool {
	switch e {
	case BoxTypeDeep, BoxTypeSuper, BoxTypeGate, BoxTypeVentilation, BoxTypeQueenExcluder, BoxTypeHorizontalFeeder:
		return true
	}
	return false
}

func (e BoxType) String() string {
	return string(e)
}

func (e *BoxType) UnmarshalGQL(v interface{}) error {
	str, ok := v.(string)
	if !ok {
		return fmt.Errorf("enums must be strings")
	}

	*e = BoxType(str)
	if !e.IsValid() {
		return fmt.Errorf("%s is not a valid BoxType", str)
	}
	return nil
}

func (e BoxType) MarshalGQL(w io.Writer) {
	fmt.Fprint(w, strconv.Quote(e.String()))
}

type FrameType string

const (
	FrameTypeVoid       FrameType = "VOID"
	FrameTypeFoundation FrameType = "FOUNDATION"
	FrameTypeEmptyComb  FrameType = "EMPTY_COMB"
	FrameTypePartition  FrameType = "PARTITION"
	FrameTypeFeeder     FrameType = "FEEDER"
)

var AllFrameType = []FrameType{
	FrameTypeVoid,
	FrameTypeFoundation,
	FrameTypeEmptyComb,
	FrameTypePartition,
	FrameTypeFeeder,
}

func (e FrameType) IsValid() bool {
	switch e {
	case FrameTypeVoid, FrameTypeFoundation, FrameTypeEmptyComb, FrameTypePartition, FrameTypeFeeder:
		return true
	}
	return false
}

func (e FrameType) String() string {
	return string(e)
}

func (e *FrameType) UnmarshalGQL(v interface{}) error {
	str, ok := v.(string)
	if !ok {
		return fmt.Errorf("enums must be strings")
	}

	*e = FrameType(str)
	if !e.IsValid() {
		return fmt.Errorf("%s is not a valid FrameType", str)
	}
	return nil
}

func (e FrameType) MarshalGQL(w io.Writer) {
	fmt.Fprint(w, strconv.Quote(e.String()))
}
