// 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"
)

// APIInfluxDbPrecision api influx db precision
//
// swagger:model apiInfluxDbPrecision
type APIInfluxDbPrecision string

func NewAPIInfluxDbPrecision(value APIInfluxDbPrecision) *APIInfluxDbPrecision {
	return &value
}

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

const (

	// APIInfluxDbPrecisionNS captures enum value "NS"
	APIInfluxDbPrecisionNS APIInfluxDbPrecision = "NS"

	// APIInfluxDbPrecisionU captures enum value "U"
	APIInfluxDbPrecisionU APIInfluxDbPrecision = "U"

	// APIInfluxDbPrecisionMS captures enum value "MS"
	APIInfluxDbPrecisionMS APIInfluxDbPrecision = "MS"

	// APIInfluxDbPrecisionS captures enum value "S"
	APIInfluxDbPrecisionS APIInfluxDbPrecision = "S"

	// APIInfluxDbPrecisionM captures enum value "M"
	APIInfluxDbPrecisionM APIInfluxDbPrecision = "M"

	// APIInfluxDbPrecisionH captures enum value "H"
	APIInfluxDbPrecisionH APIInfluxDbPrecision = "H"
)

// for schema
var apiInfluxDbPrecisionEnum []interface{}

func init() {
	var res []APIInfluxDbPrecision
	if err := json.Unmarshal([]byte(`["NS","U","MS","S","M","H"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		apiInfluxDbPrecisionEnum = append(apiInfluxDbPrecisionEnum, v)
	}
}

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

// Validate validates this api influx db precision
func (m APIInfluxDbPrecision) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this api influx db precision based on context it is used
func (m APIInfluxDbPrecision) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
