// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"encoding/json"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/validate"
)

// CommonLocationSource  - UNKNOWN: Unknown.
//   - GPS: GPS.
//   - CONFIG: Manually configured.
//   - GEO_RESOLVER_TDOA: Geo resolver (TDOA).
//   - GEO_RESOLVER_RSSI: Geo resolver (RSSI).
//   - GEO_RESOLVER_GNSS: Geo resolver (GNSS).
//   - GEO_RESOLVER_WIFI: Geo resolver (WIFI).
//
// swagger:model commonLocationSource
type CommonLocationSource string

func NewCommonLocationSource(value CommonLocationSource) *CommonLocationSource {
	return &value
}

// Pointer returns a pointer to a freshly-allocated CommonLocationSource.
func (m CommonLocationSource) Pointer() *CommonLocationSource {
	return &m
}

const (

	// CommonLocationSourceUNKNOWN captures enum value "UNKNOWN"
	CommonLocationSourceUNKNOWN CommonLocationSource = "UNKNOWN"

	// CommonLocationSourceGPS captures enum value "GPS"
	CommonLocationSourceGPS CommonLocationSource = "GPS"

	// CommonLocationSourceCONFIG captures enum value "CONFIG"
	CommonLocationSourceCONFIG CommonLocationSource = "CONFIG"

	// CommonLocationSourceGEORESOLVERTDOA captures enum value "GEO_RESOLVER_TDOA"
	CommonLocationSourceGEORESOLVERTDOA CommonLocationSource = "GEO_RESOLVER_TDOA"

	// CommonLocationSourceGEORESOLVERRSSI captures enum value "GEO_RESOLVER_RSSI"
	CommonLocationSourceGEORESOLVERRSSI CommonLocationSource = "GEO_RESOLVER_RSSI"

	// CommonLocationSourceGEORESOLVERGNSS captures enum value "GEO_RESOLVER_GNSS"
	CommonLocationSourceGEORESOLVERGNSS CommonLocationSource = "GEO_RESOLVER_GNSS"

	// CommonLocationSourceGEORESOLVERWIFI captures enum value "GEO_RESOLVER_WIFI"
	CommonLocationSourceGEORESOLVERWIFI CommonLocationSource = "GEO_RESOLVER_WIFI"
)

// for schema
var commonLocationSourceEnum []interface{}

func init() {
	var res []CommonLocationSource
	if err := json.Unmarshal([]byte(`["UNKNOWN","GPS","CONFIG","GEO_RESOLVER_TDOA","GEO_RESOLVER_RSSI","GEO_RESOLVER_GNSS","GEO_RESOLVER_WIFI"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		commonLocationSourceEnum = append(commonLocationSourceEnum, v)
	}
}

func (m CommonLocationSource) validateCommonLocationSourceEnum(path, location string, value CommonLocationSource) error {
	if err := validate.EnumCase(path, location, value, commonLocationSourceEnum, true); err != nil {
		return err
	}
	return nil
}

// Validate validates this common location source
func (m CommonLocationSource) Validate(formats strfmt.Registry) error {
	var res []error

	// value enum
	if err := m.validateCommonLocationSourceEnum("", "body", m); err != nil {
		return err
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

// ContextValidate validates this common location source based on context it is used
func (m CommonLocationSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
