// 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/swag"
	"github.com/go-openapi/validate"
)

// VolumeGroupActionStart Performs start action on a volume group
//
// swagger:model VolumeGroupActionStart
type VolumeGroupActionStart struct {

	// Indicates the source of the action
	// Required: true
	// Enum: [master aux]
	Source *string `json:"source"`
}

// Validate validates this volume group action start
func (m *VolumeGroupActionStart) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateSource(formats); err != nil {
		res = append(res, err)
	}

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

var volumeGroupActionStartTypeSourcePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["master","aux"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		volumeGroupActionStartTypeSourcePropEnum = append(volumeGroupActionStartTypeSourcePropEnum, v)
	}
}

const (

	// VolumeGroupActionStartSourceMaster captures enum value "master"
	VolumeGroupActionStartSourceMaster string = "master"

	// VolumeGroupActionStartSourceAux captures enum value "aux"
	VolumeGroupActionStartSourceAux string = "aux"
)

// prop value enum
func (m *VolumeGroupActionStart) validateSourceEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, volumeGroupActionStartTypeSourcePropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *VolumeGroupActionStart) validateSource(formats strfmt.Registry) error {

	if err := validate.Required("source", "body", m.Source); err != nil {
		return err
	}

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

	return nil
}

// ContextValidate validates this volume group action start based on context it is used
func (m *VolumeGroupActionStart) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (m *VolumeGroupActionStart) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *VolumeGroupActionStart) UnmarshalBinary(b []byte) error {
	var res VolumeGroupActionStart
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
