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

// APICadPeriodicity - SEC_1: 1 second.
//   - MS_500: 500 milliseconds
//   - MS_250: 250 milliseconds
//   - MS_100: 100 milliseconds
//   - MS_50: 50 milliseconds
//   - MS_20: 20 milliseconds
//
// swagger:model apiCadPeriodicity
type APICadPeriodicity string

func NewAPICadPeriodicity(value APICadPeriodicity) *APICadPeriodicity {
	return &value
}

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

const (

	// APICadPeriodicitySEC1 captures enum value "SEC_1"
	APICadPeriodicitySEC1 APICadPeriodicity = "SEC_1"

	// APICadPeriodicityMS500 captures enum value "MS_500"
	APICadPeriodicityMS500 APICadPeriodicity = "MS_500"

	// APICadPeriodicityMS250 captures enum value "MS_250"
	APICadPeriodicityMS250 APICadPeriodicity = "MS_250"

	// APICadPeriodicityMS100 captures enum value "MS_100"
	APICadPeriodicityMS100 APICadPeriodicity = "MS_100"

	// APICadPeriodicityMS50 captures enum value "MS_50"
	APICadPeriodicityMS50 APICadPeriodicity = "MS_50"

	// APICadPeriodicityMS20 captures enum value "MS_20"
	APICadPeriodicityMS20 APICadPeriodicity = "MS_20"
)

// for schema
var apiCadPeriodicityEnum []interface{}

func init() {
	var res []APICadPeriodicity
	if err := json.Unmarshal([]byte(`["SEC_1","MS_500","MS_250","MS_100","MS_50","MS_20"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		apiCadPeriodicityEnum = append(apiCadPeriodicityEnum, v)
	}
}

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

// Validate validates this api cad periodicity
func (m APICadPeriodicity) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this api cad periodicity based on context it is used
func (m APICadPeriodicity) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
