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

package graphql

import (
	"fmt"
	"io"
	"strconv"

	"github.com/aristat/golang-example-app/app/db/domain"
)

type ProductsListOut struct {
	Products []*domain.Product `json:"products"`
}

type ProductsQuery struct {
	List *ProductsListOut `json:"list"`
}

type UsersCreateOut struct {
	Status UsersCreateOutStatus `json:"status"`
	ID     string               `json:"id"`
	Email  string               `json:"email"`
}

type UsersMutation struct {
	CreateUser *UsersCreateOut `json:"createUser"`
}

type UsersOneOut struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

type UsersQuery struct {
	One *UsersOneOut `json:"one"`
}

type UsersCreateOutStatus string

const (
	UsersCreateOutStatusOk                  UsersCreateOutStatus = "OK"
	UsersCreateOutStatusBadRequest          UsersCreateOutStatus = "BAD_REQUEST"
	UsersCreateOutStatusServerInternalError UsersCreateOutStatus = "SERVER_INTERNAL_ERROR"
)

var AllUsersCreateOutStatus = []UsersCreateOutStatus{
	UsersCreateOutStatusOk,
	UsersCreateOutStatusBadRequest,
	UsersCreateOutStatusServerInternalError,
}

func (e UsersCreateOutStatus) IsValid() bool {
	switch e {
	case UsersCreateOutStatusOk, UsersCreateOutStatusBadRequest, UsersCreateOutStatusServerInternalError:
		return true
	}
	return false
}

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

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

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

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

type UsersPermissionEnum string

const (
	UsersPermissionEnumRead  UsersPermissionEnum = "READ"
	UsersPermissionEnumWrite UsersPermissionEnum = "WRITE"
)

var AllUsersPermissionEnum = []UsersPermissionEnum{
	UsersPermissionEnumRead,
	UsersPermissionEnumWrite,
}

func (e UsersPermissionEnum) IsValid() bool {
	switch e {
	case UsersPermissionEnumRead, UsersPermissionEnumWrite:
		return true
	}
	return false
}

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

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

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

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