func (m *IdmWorkspace) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
MarshalBinary interface implementation
package models
import (
	"strconv"
	strfmt "github.com/go-openapi/strfmt"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)
type IdmWorkspace struct {
	Attributes string `json:"Attributes,omitempty"`
	Description string `json:"Description,omitempty"`
	Label string `json:"Label,omitempty"`
	LastUpdated int32 `json:"LastUpdated,omitempty"`
	Policies []*ServiceResourcePolicy `json:"Policies"`
	PoliciesContextEditable bool `json:"PoliciesContextEditable,omitempty"`
	RootNodes map[string]TreeNode `json:"RootNodes,omitempty"`
	RootUuids []string `json:"RootUUIDs"`
	Scope IdmWorkspaceScope `json:"Scope,omitempty"`
	Slug string `json:"Slug,omitempty"`
	UUID string `json:"UUID,omitempty"`
}
func (m *IdmWorkspace) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validatePolicies(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateRootNodes(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateScope(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *IdmWorkspace) validatePolicies(formats strfmt.Registry) error {
	if swag.IsZero(m.Policies) {  
		return nil
	}
	for i := 0; i < len(m.Policies); i++ {
		if swag.IsZero(m.Policies[i]) {  
			continue
		}
		if m.Policies[i] != nil {
			if err := m.Policies[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("Policies" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *IdmWorkspace) validateRootNodes(formats strfmt.Registry) error {
	if swag.IsZero(m.RootNodes) {  
		return nil
	}
	for k := range m.RootNodes {
		if err := validate.Required("RootNodes"+"."+k, "body", m.RootNodes[k]); err != nil {
			return err
		}
		if val, ok := m.RootNodes[k]; ok {
			if err := val.Validate(formats); err != nil {
				return err
			}
		}
	}
	return nil
}
func (m *IdmWorkspace) validateScope(formats strfmt.Registry) error {
	if swag.IsZero(m.Scope) {  
		return nil
	}
	if err := m.Scope.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("Scope")
		}
		return err
	}
	return nil
}