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

// Copyright Authors of Cilium
// SPDX-License-Identifier: Apache-2.0

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

// ConfiguredDatapathMode Configured datapath mode
//
// swagger:model ConfiguredDatapathMode
type ConfiguredDatapathMode string

func NewConfiguredDatapathMode(value ConfiguredDatapathMode) *ConfiguredDatapathMode {
	return &value
}

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

const (

	// ConfiguredDatapathModeAuto captures enum value "auto"
	ConfiguredDatapathModeAuto ConfiguredDatapathMode = "auto"

	// ConfiguredDatapathModeVeth captures enum value "veth"
	ConfiguredDatapathModeVeth ConfiguredDatapathMode = "veth"

	// ConfiguredDatapathModeNetkit captures enum value "netkit"
	ConfiguredDatapathModeNetkit ConfiguredDatapathMode = "netkit"

	// ConfiguredDatapathModeNetkitDashL2 captures enum value "netkit-l2"
	ConfiguredDatapathModeNetkitDashL2 ConfiguredDatapathMode = "netkit-l2"
)

// for schema
var configuredDatapathModeEnum []any

func init() {
	var res []ConfiguredDatapathMode
	if err := json.Unmarshal([]byte(`["auto","veth","netkit","netkit-l2"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		configuredDatapathModeEnum = append(configuredDatapathModeEnum, v)
	}
}

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

// Validate validates this configured datapath mode
func (m ConfiguredDatapathMode) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this configured datapath mode based on context it is used
func (m ConfiguredDatapathMode) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
