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

// APIInfluxDbVersion api influx db version
//
// swagger:model apiInfluxDbVersion
type APIInfluxDbVersion string

func NewAPIInfluxDbVersion(value APIInfluxDbVersion) *APIInfluxDbVersion {
	return &value
}

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

const (

	// APIInfluxDbVersionINFLUXDB1 captures enum value "INFLUXDB_1"
	APIInfluxDbVersionINFLUXDB1 APIInfluxDbVersion = "INFLUXDB_1"

	// APIInfluxDbVersionINFLUXDB2 captures enum value "INFLUXDB_2"
	APIInfluxDbVersionINFLUXDB2 APIInfluxDbVersion = "INFLUXDB_2"
)

// for schema
var apiInfluxDbVersionEnum []interface{}

func init() {
	var res []APIInfluxDbVersion
	if err := json.Unmarshal([]byte(`["INFLUXDB_1","INFLUXDB_2"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		apiInfluxDbVersionEnum = append(apiInfluxDbVersionEnum, v)
	}
}

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

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

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

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

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