//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//

package model

import "errors"

// most volues are determined by our geocoding API provider, mapbox. You can read more details at https://docs.mapbox.com/api/search/geocoding/#point-accuracy-for-address-features.
type Accuracytype string

const (
	Accuracytype_Rooftop      Accuracytype = "rooftop"
	Accuracytype_Parcel       Accuracytype = "parcel"
	Accuracytype_Point        Accuracytype = "point"
	Accuracytype_Interpolated Accuracytype = "interpolated"
	Accuracytype_Approximate  Accuracytype = "approximate"
	Accuracytype_Intersection Accuracytype = "intersection"
	Accuracytype_Centroid     Accuracytype = "centroid"
	Accuracytype_Browser      Accuracytype = "browser"
	Accuracytype_None         Accuracytype = "none"
)

var AccuracytypeAllValues = []Accuracytype{
	Accuracytype_Rooftop,
	Accuracytype_Parcel,
	Accuracytype_Point,
	Accuracytype_Interpolated,
	Accuracytype_Approximate,
	Accuracytype_Intersection,
	Accuracytype_Centroid,
	Accuracytype_Browser,
	Accuracytype_None,
}

func (e *Accuracytype) Scan(value interface{}) error {
	var enumValue string
	switch val := value.(type) {
	case string:
		enumValue = val
	case []byte:
		enumValue = string(val)
	default:
		return errors.New("jet: Invalid scan value for AllTypesEnum enum. Enum value has to be of type string or []byte")
	}

	switch enumValue {
	case "rooftop":
		*e = Accuracytype_Rooftop
	case "parcel":
		*e = Accuracytype_Parcel
	case "point":
		*e = Accuracytype_Point
	case "interpolated":
		*e = Accuracytype_Interpolated
	case "approximate":
		*e = Accuracytype_Approximate
	case "intersection":
		*e = Accuracytype_Intersection
	case "centroid":
		*e = Accuracytype_Centroid
	case "browser":
		*e = Accuracytype_Browser
	case "none":
		*e = Accuracytype_None
	default:
		return errors.New("jet: Invalid scan value '" + enumValue + "' for Accuracytype enum")
	}

	return nil
}

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