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

// VipType The vip type.
//
// swagger:model vip_type
type VipType string

func NewVipType(value VipType) *VipType {
	return &value
}

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

const (

	// VipTypeAPI captures enum value "api"
	VipTypeAPI VipType = "api"

	// VipTypeIngress captures enum value "ingress"
	VipTypeIngress VipType = "ingress"
)

// for schema
var vipTypeEnum []interface{}

func init() {
	var res []VipType
	if err := json.Unmarshal([]byte(`["api","ingress"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		vipTypeEnum = append(vipTypeEnum, v)
	}
}

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

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

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

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

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