// Code generated by go-swagger; DO NOT EDIT.

package models

import (
	"context"
	"encoding/json"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/validate"
)

// OneofenumExampleEnum oneofenum example enum
//
// swagger:model oneofenumExampleEnum
type OneofenumExampleEnum string

func NewOneofenumExampleEnum(value OneofenumExampleEnum) *OneofenumExampleEnum {
	return &value
}

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

const (

	// OneofenumExampleEnumEXAMPLEENUMUNSPECIFIED captures enum value "EXAMPLE_ENUM_UNSPECIFIED"
	OneofenumExampleEnumEXAMPLEENUMUNSPECIFIED OneofenumExampleEnum = "EXAMPLE_ENUM_UNSPECIFIED"

	// OneofenumExampleEnumEXAMPLEENUMFIRST captures enum value "EXAMPLE_ENUM_FIRST"
	OneofenumExampleEnumEXAMPLEENUMFIRST OneofenumExampleEnum = "EXAMPLE_ENUM_FIRST"
)

// for schema
var oneofenumExampleEnumEnum []any

func init() {
	var res []OneofenumExampleEnum
	if err := json.Unmarshal([]byte(`["EXAMPLE_ENUM_UNSPECIFIED","EXAMPLE_ENUM_FIRST"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		oneofenumExampleEnumEnum = append(oneofenumExampleEnumEnum, v)
	}
}

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

// Validate validates this oneofenum example enum
func (m OneofenumExampleEnum) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this oneofenum example enum based on context it is used
func (m OneofenumExampleEnum) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
