func (m *ComplianceByResourceType) UnmarshalBinary(b []byte) error {
	var res ComplianceByResourceType
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
UnmarshalBinary interface implementation
package models
import (
	"strconv"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)
type ComplianceByResourceType struct {
	Compliant int64 `json:"compliant,omitempty"`
	Noncompliant []*NonCompliantResource `json:"noncompliant"`
	ResourceType string `json:"resource_type,omitempty"`
	Total int64 `json:"total,omitempty"`
}
func (m *ComplianceByResourceType) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateNoncompliant(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *ComplianceByResourceType) validateNoncompliant(formats strfmt.Registry) error {
	if swag.IsZero(m.Noncompliant) {  
		return nil
	}
	for i := 0; i < len(m.Noncompliant); i++ {
		if swag.IsZero(m.Noncompliant[i]) {  
			continue
		}
		if m.Noncompliant[i] != nil {
			if err := m.Noncompliant[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("noncompliant" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *ComplianceByResourceType) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}