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

// APICodecRuntime  - NONE: None.
//   - CAYENNE_LPP: Cayenne LPP.
//   - JS: JavaScript.
//
// swagger:model apiCodecRuntime
type APICodecRuntime string

func NewAPICodecRuntime(value APICodecRuntime) *APICodecRuntime {
	return &value
}

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

const (

	// APICodecRuntimeNONE captures enum value "NONE"
	APICodecRuntimeNONE APICodecRuntime = "NONE"

	// APICodecRuntimeCAYENNELPP captures enum value "CAYENNE_LPP"
	APICodecRuntimeCAYENNELPP APICodecRuntime = "CAYENNE_LPP"

	// APICodecRuntimeJS captures enum value "JS"
	APICodecRuntimeJS APICodecRuntime = "JS"
)

// for schema
var apiCodecRuntimeEnum []interface{}

func init() {
	var res []APICodecRuntime
	if err := json.Unmarshal([]byte(`["NONE","CAYENNE_LPP","JS"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		apiCodecRuntimeEnum = append(apiCodecRuntimeEnum, v)
	}
}

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

// Validate validates this api codec runtime
func (m APICodecRuntime) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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