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

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

// SharedProcessorPoolCreate shared processor pool create
//
// swagger:model SharedProcessorPoolCreate
type SharedProcessorPoolCreate struct {

	// The host group; a host from the group will be automatically selected based on available resources
	// Required: true
	HostGroup *string `json:"hostGroup"`

	// The name of the Shared Processor Pool; minumum of 2 characters, maximum of 12, the only special character allowed is the underscore '_'.
	// Required: true
	Name *string `json:"name"`

	// The ID of the placement group
	PlacementGroupID string `json:"placementGroupID,omitempty"`

	// The amount of reserved processor cores for the Shared Processor Pool; only integers allowed, no fractional values
	// Required: true
	ReservedCores *int64 `json:"reservedCores"`
}

// Validate validates this shared processor pool create
func (m *SharedProcessorPoolCreate) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

func (m *SharedProcessorPoolCreate) validateHostGroup(formats strfmt.Registry) error {

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

	return nil
}

func (m *SharedProcessorPoolCreate) validateName(formats strfmt.Registry) error {

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

	return nil
}

func (m *SharedProcessorPoolCreate) validateReservedCores(formats strfmt.Registry) error {

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

	return nil
}

// ContextValidate validates this shared processor pool create based on context it is used
func (m *SharedProcessorPoolCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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