// 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 (
	"encoding/json"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/validate"
)

// CentralWriteStatus central write status
//
// swagger:model centralWriteStatus
type CentralWriteStatus string

const (

	// CentralWriteStatusWRITABLE captures enum value "WRITABLE"
	CentralWriteStatusWRITABLE CentralWriteStatus = "WRITABLE"

	// CentralWriteStatusREADONLY captures enum value "READONLY"
	CentralWriteStatusREADONLY CentralWriteStatus = "READONLY"
)

// for schema
var centralWriteStatusEnum []interface{}

func init() {
	var res []CentralWriteStatus
	if err := json.Unmarshal([]byte(`["WRITABLE","READONLY"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		centralWriteStatusEnum = append(centralWriteStatusEnum, v)
	}
}

func (m CentralWriteStatus) validateCentralWriteStatusEnum(path, location string, value CentralWriteStatus) error {
	if err := validate.Enum(path, location, value, centralWriteStatusEnum); err != nil {
		return err
	}
	return nil
}

// Validate validates this central write status
func (m CentralWriteStatus) Validate(formats strfmt.Registry) error {
	var res []error

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

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