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

// HostRole host role
//
// swagger:model host-role
type HostRole string

func NewHostRole(value HostRole) *HostRole {
	return &value
}

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

const (

	// HostRoleAutoAssign captures enum value "auto-assign"
	HostRoleAutoAssign HostRole = "auto-assign"

	// HostRoleMaster captures enum value "master"
	HostRoleMaster HostRole = "master"

	// HostRoleWorker captures enum value "worker"
	HostRoleWorker HostRole = "worker"

	// HostRoleBootstrap captures enum value "bootstrap"
	HostRoleBootstrap HostRole = "bootstrap"
)

// for schema
var hostRoleEnum []interface{}

func init() {
	var res []HostRole
	if err := json.Unmarshal([]byte(`["auto-assign","master","worker","bootstrap"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		hostRoleEnum = append(hostRoleEnum, v)
	}
}

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

// Validate validates this host role
func (m HostRole) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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