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

// CommonDeviceClass  - CLASS_A: Class-A.
//   - CLASS_B: Class-B.
//   - CLASS_C: Class-C.
//
// swagger:model commonDeviceClass
type CommonDeviceClass string

func NewCommonDeviceClass(value CommonDeviceClass) *CommonDeviceClass {
	return &value
}

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

const (

	// CommonDeviceClassCLASSA captures enum value "CLASS_A"
	CommonDeviceClassCLASSA CommonDeviceClass = "CLASS_A"

	// CommonDeviceClassCLASSB captures enum value "CLASS_B"
	CommonDeviceClassCLASSB CommonDeviceClass = "CLASS_B"

	// CommonDeviceClassCLASSC captures enum value "CLASS_C"
	CommonDeviceClassCLASSC CommonDeviceClass = "CLASS_C"
)

// for schema
var commonDeviceClassEnum []interface{}

func init() {
	var res []CommonDeviceClass
	if err := json.Unmarshal([]byte(`["CLASS_A","CLASS_B","CLASS_C"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		commonDeviceClassEnum = append(commonDeviceClassEnum, v)
	}
}

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

// Validate validates this common device class
func (m CommonDeviceClass) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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