func (m *MigrateContractReq) UnmarshalBinary(b []byte) error {
	var res MigrateContractReq
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
UnmarshalBinary interface implementation
package models
import (
	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)
type MigrateContractReq struct {
	BaseReq *BaseReq `json:"base_req,omitempty"`
	MigrateMsg string `json:"migrate_msg,omitempty"`
	NewCodeID int64 `json:"new_code_id,omitempty"`
}
func (m *MigrateContractReq) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateBaseReq(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *MigrateContractReq) validateBaseReq(formats strfmt.Registry) error {
	if swag.IsZero(m.BaseReq) {  
		return nil
	}
	if m.BaseReq != nil {
		if err := m.BaseReq.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("base_req")
			}
			return err
		}
	}
	return nil
}
func (m *MigrateContractReq) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}