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

// EntityUserGroupSource entity user group source
//
// swagger:model entity.UserGroupSource
type EntityUserGroupSource string

func NewEntityUserGroupSource(value EntityUserGroupSource) *EntityUserGroupSource {
	return &value
}

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

const (

	// EntityUserGroupSourceCustom captures enum value "custom"
	EntityUserGroupSourceCustom EntityUserGroupSource = "custom"

	// EntityUserGroupSourceLark captures enum value "lark"
	EntityUserGroupSourceLark EntityUserGroupSource = "lark"
)

// for schema
var entityUserGroupSourceEnum []interface{}

func init() {
	var res []EntityUserGroupSource
	if err := json.Unmarshal([]byte(`["custom","lark"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		entityUserGroupSourceEnum = append(entityUserGroupSourceEnum, v)
	}
}

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

// Validate validates this entity user group source
func (m EntityUserGroupSource) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this entity user group source based on context it is used
func (m EntityUserGroupSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
