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

package ops

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

// EntityApplyStrategy entity apply strategy
//
// swagger:model entity.ApplyStrategy
type EntityApplyStrategy string

func NewEntityApplyStrategy(value EntityApplyStrategy) *EntityApplyStrategy {
	return &value
}

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

const (

	// EntityApplyStrategyHotReload captures enum value "HotReload"
	EntityApplyStrategyHotReload EntityApplyStrategy = "HotReload"

	// EntityApplyStrategyRollingRestart captures enum value "RollingRestart"
	EntityApplyStrategyRollingRestart EntityApplyStrategy = "RollingRestart"

	// EntityApplyStrategyChangeCMOnly captures enum value "ChangeCMOnly"
	EntityApplyStrategyChangeCMOnly EntityApplyStrategy = "ChangeCMOnly"
)

// for schema
var entityApplyStrategyEnum []interface{}

func init() {
	var res []EntityApplyStrategy
	if err := json.Unmarshal([]byte(`["HotReload","RollingRestart","ChangeCMOnly"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		entityApplyStrategyEnum = append(entityApplyStrategyEnum, v)
	}
}

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

// Validate validates this entity apply strategy
func (m EntityApplyStrategy) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this entity apply strategy based on context it is used
func (m EntityApplyStrategy) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
