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

// V1alpha1RuleAction v1alpha1 rule action
//
// swagger:model v1alpha1RuleAction
type V1alpha1RuleAction string

func NewV1alpha1RuleAction(value V1alpha1RuleAction) *V1alpha1RuleAction {
	return &value
}

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

const (

	// V1alpha1RuleActionRULEACTIONUNSPECIFIED captures enum value "RULE_ACTION_UNSPECIFIED"
	V1alpha1RuleActionRULEACTIONUNSPECIFIED V1alpha1RuleAction = "RULE_ACTION_UNSPECIFIED"

	// V1alpha1RuleActionRULEACTIONALLOW captures enum value "RULE_ACTION_ALLOW"
	V1alpha1RuleActionRULEACTIONALLOW V1alpha1RuleAction = "RULE_ACTION_ALLOW"

	// V1alpha1RuleActionRULEACTIONDENY captures enum value "RULE_ACTION_DENY"
	V1alpha1RuleActionRULEACTIONDENY V1alpha1RuleAction = "RULE_ACTION_DENY"
)

// for schema
var v1alpha1RuleActionEnum []any

func init() {
	var res []V1alpha1RuleAction
	if err := json.Unmarshal([]byte(`["RULE_ACTION_UNSPECIFIED","RULE_ACTION_ALLOW","RULE_ACTION_DENY"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		v1alpha1RuleActionEnum = append(v1alpha1RuleActionEnum, v)
	}
}

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

// Validate validates this v1alpha1 rule action
func (m V1alpha1RuleAction) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this v1alpha1 rule action based on context it is used
func (m V1alpha1RuleAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
