func (o *PostGovProposalsBody) UnmarshalBinary(b []byte) error {
	var res PostGovProposalsBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}
UnmarshalBinary interface implementation
package governance
import (
	"fmt"
	"io"
	"strconv"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/terra-project/mantle-sdk/lcd/models"
)
type PostGovProposalsReader struct {
	formats strfmt.Registry
}
func (o *PostGovProposalsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostGovProposalsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostGovProposalsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostGovProposalsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}
func NewPostGovProposalsOK() *PostGovProposalsOK {
	return &PostGovProposalsOK{}
}
type PostGovProposalsOK struct {
	Payload *models.StdTx
}
func (o *PostGovProposalsOK) Error() string {
	return fmt.Sprintf("[POST /gov/proposals][%d] postGovProposalsOK  %+v", 200, o.Payload)
}
func (o *PostGovProposalsOK) GetPayload() *models.StdTx {
	return o.Payload
}
func (o *PostGovProposalsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	o.Payload = new(models.StdTx)
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}
	return nil
}
func NewPostGovProposalsBadRequest() *PostGovProposalsBadRequest {
	return &PostGovProposalsBadRequest{}
}
type PostGovProposalsBadRequest struct {
}
func (o *PostGovProposalsBadRequest) Error() string {
	return fmt.Sprintf("[POST /gov/proposals][%d] postGovProposalsBadRequest ", 400)
}
func (o *PostGovProposalsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	return nil
}
func NewPostGovProposalsInternalServerError() *PostGovProposalsInternalServerError {
	return &PostGovProposalsInternalServerError{}
}
type PostGovProposalsInternalServerError struct {
}
func (o *PostGovProposalsInternalServerError) Error() string {
	return fmt.Sprintf("[POST /gov/proposals][%d] postGovProposalsInternalServerError ", 500)
}
func (o *PostGovProposalsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
	return nil
}
type PostGovProposalsBody struct {
	BaseReq *models.BaseReq `json:"base_req,omitempty"`
	Description string `json:"description,omitempty"`
	InitialDeposit []*models.Coin `json:"initial_deposit"`
	ProposalType string `json:"proposal_type,omitempty"`
	Proposer models.Address `json:"proposer,omitempty"`
	Title string `json:"title,omitempty"`
}
func (o *PostGovProposalsBody) Validate(formats strfmt.Registry) error {
	var res []error
	if err := o.validateBaseReq(formats); err != nil {
		res = append(res, err)
	}
	if err := o.validateInitialDeposit(formats); err != nil {
		res = append(res, err)
	}
	if err := o.validateProposer(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (o *PostGovProposalsBody) validateBaseReq(formats strfmt.Registry) error {
	if swag.IsZero(o.BaseReq) {  
		return nil
	}
	if o.BaseReq != nil {
		if err := o.BaseReq.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("post_proposal_body" + "." + "base_req")
			}
			return err
		}
	}
	return nil
}
func (o *PostGovProposalsBody) validateInitialDeposit(formats strfmt.Registry) error {
	if swag.IsZero(o.InitialDeposit) {  
		return nil
	}
	for i := 0; i < len(o.InitialDeposit); i++ {
		if swag.IsZero(o.InitialDeposit[i]) {  
			continue
		}
		if o.InitialDeposit[i] != nil {
			if err := o.InitialDeposit[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("post_proposal_body" + "." + "initial_deposit" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (o *PostGovProposalsBody) validateProposer(formats strfmt.Registry) error {
	if swag.IsZero(o.Proposer) {  
		return nil
	}
	if err := o.Proposer.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("post_proposal_body" + "." + "proposer")
		}
		return err
	}
	return nil
}
func (o *PostGovProposalsBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}