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

// OperatorType Kind of operator. Different types are monitored by the service differently.
//
// swagger:model operator-type
type OperatorType string

func NewOperatorType(value OperatorType) *OperatorType {
	return &value
}

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

const (

	// OperatorTypeBuiltin captures enum value "builtin"
	OperatorTypeBuiltin OperatorType = "builtin"

	// OperatorTypeOlm captures enum value "olm"
	OperatorTypeOlm OperatorType = "olm"
)

// for schema
var operatorTypeEnum []interface{}

func init() {
	var res []OperatorType
	if err := json.Unmarshal([]byte(`["builtin","olm"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		operatorTypeEnum = append(operatorTypeEnum, v)
	}
}

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

// Validate validates this operator type
func (m OperatorType) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this operator type based on context it is used
func (m OperatorType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
