func (m *PrivateSettlementResponseAO1Result) UnmarshalBinary(b []byte) error {
	var res PrivateSettlementResponseAO1Result
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
UnmarshalBinary 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 PrivateSettlementResponse struct {
	BaseMessage
	Result *PrivateSettlementResponseAO1Result `json:"result"`
}
func (m *PrivateSettlementResponse) UnmarshalJSON(raw []byte) error {
	var aO0 BaseMessage
	if err := swag.ReadJSON(raw, &aO0); err != nil {
		return err
	}
	m.BaseMessage = aO0
	var dataAO1 struct {
		Result *PrivateSettlementResponseAO1Result `json:"result"`
	}
	if err := swag.ReadJSON(raw, &dataAO1); err != nil {
		return err
	}
	m.Result = dataAO1.Result
	return nil
}
func (m PrivateSettlementResponse) MarshalJSON() ([]byte, error) {
	_parts := make([][]byte, 0, 2)
	aO0, err := swag.WriteJSON(m.BaseMessage)
	if err != nil {
		return nil, err
	}
	_parts = append(_parts, aO0)
	var dataAO1 struct {
		Result *PrivateSettlementResponseAO1Result `json:"result"`
	}
	dataAO1.Result = m.Result
	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
	if errAO1 != nil {
		return nil, errAO1
	}
	_parts = append(_parts, jsonDataAO1)
	return swag.ConcatJSON(_parts...), nil
}
func (m *PrivateSettlementResponse) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.BaseMessage.Validate(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateResult(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *PrivateSettlementResponse) validateResult(formats strfmt.Registry) error {
	if err := validate.Required("result", "body", m.Result); err != nil {
		return err
	}
	if m.Result != nil {
		if err := m.Result.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("result")
			}
			return err
		}
	}
	return nil
}
func (m *PrivateSettlementResponse) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
func (m *PrivateSettlementResponse) UnmarshalBinary(b []byte) error {
	var res PrivateSettlementResponse
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
type PrivateSettlementResponseAO1Result struct {
	Continuation Continuation `json:"continuation"`
	Settlements []*Settlement `json:"settlements"`
}
func (m *PrivateSettlementResponseAO1Result) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateContinuation(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateSettlements(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *PrivateSettlementResponseAO1Result) validateContinuation(formats strfmt.Registry) error {
	if err := m.Continuation.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("result" + "." + "continuation")
		}
		return err
	}
	return nil
}
func (m *PrivateSettlementResponseAO1Result) validateSettlements(formats strfmt.Registry) error {
	if err := validate.Required("result"+"."+"settlements", "body", m.Settlements); err != nil {
		return err
	}
	for i := 0; i < len(m.Settlements); i++ {
		if swag.IsZero(m.Settlements[i]) {  
			continue
		}
		if m.Settlements[i] != nil {
			if err := m.Settlements[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("result" + "." + "settlements" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *PrivateSettlementResponseAO1Result) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}