func (m *Deposit) UnmarshalBinary(b []byte) error {
	var res Deposit
	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 Deposit struct {
	Amount []*Coin `json:"amount"`
	Depositor Address `json:"depositor,omitempty"`
	ProposalID string `json:"proposal_id,omitempty"`
}
func (m *Deposit) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateAmount(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateDepositor(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *Deposit) validateAmount(formats strfmt.Registry) error {
	if swag.IsZero(m.Amount) {  
		return nil
	}
	for i := 0; i < len(m.Amount); i++ {
		if swag.IsZero(m.Amount[i]) {  
			continue
		}
		if m.Amount[i] != nil {
			if err := m.Amount[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("amount" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *Deposit) validateDepositor(formats strfmt.Registry) error {
	if swag.IsZero(m.Depositor) {  
		return nil
	}
	if err := m.Depositor.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("depositor")
		}
		return err
	}
	return nil
}
func (m *Deposit) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}