func (o *FindScriptsOKBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}
MarshalBinary interface implementation
package operations
import (
	"net/http"
	"strconv"
	errors "github.com/go-openapi/errors"
	middleware "github.com/go-openapi/runtime/middleware"
	strfmt "github.com/go-openapi/strfmt"
	swag "github.com/go-openapi/swag"
	models "github.com/MontFerret/ferret-server/server/http/api/models"
)
type FindScriptsHandlerFunc func(FindScriptsParams) middleware.Responder
func (fn FindScriptsHandlerFunc) Handle(params FindScriptsParams) middleware.Responder {
	return fn(params)
}
type FindScriptsHandler interface {
	Handle(FindScriptsParams) middleware.Responder
}
func NewFindScripts(ctx *middleware.Context, handler FindScriptsHandler) *FindScripts {
	return &FindScripts{Context: ctx, Handler: handler}
}
type FindScripts struct {
	Context *middleware.Context
	Handler FindScriptsHandler
}
func (o *FindScripts) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
	route, rCtx, _ := o.Context.RouteInfo(r)
	if rCtx != nil {
		r = rCtx
	}
	var Params = NewFindScriptsParams()
	if err := o.Context.BindValidRequest(r, route, &Params); err != nil {  
		o.Context.Respond(rw, r, route.Produces, route, err)
		return
	}
	res := o.Handler.Handle(Params)  
	o.Context.Respond(rw, r, route.Produces, route, res)
}
type FindScriptsOKBody struct {
	models.SearchResult
	Data []*models.ScriptOutput `json:"data"`
}
func (o *FindScriptsOKBody) UnmarshalJSON(raw []byte) error {
	var findScriptsOKBodyAO0 models.SearchResult
	if err := swag.ReadJSON(raw, &findScriptsOKBodyAO0); err != nil {
		return err
	}
	o.SearchResult = findScriptsOKBodyAO0
	var dataFindScriptsOKBodyAO1 struct {
		Data []*models.ScriptOutput `json:"data"`
	}
	if err := swag.ReadJSON(raw, &dataFindScriptsOKBodyAO1); err != nil {
		return err
	}
	o.Data = dataFindScriptsOKBodyAO1.Data
	return nil
}
func (o FindScriptsOKBody) MarshalJSON() ([]byte, error) {
	_parts := make([][]byte, 0, 2)
	findScriptsOKBodyAO0, err := swag.WriteJSON(o.SearchResult)
	if err != nil {
		return nil, err
	}
	_parts = append(_parts, findScriptsOKBodyAO0)
	var dataFindScriptsOKBodyAO1 struct {
		Data []*models.ScriptOutput `json:"data"`
	}
	dataFindScriptsOKBodyAO1.Data = o.Data
	jsonDataFindScriptsOKBodyAO1, errFindScriptsOKBodyAO1 := swag.WriteJSON(dataFindScriptsOKBodyAO1)
	if errFindScriptsOKBodyAO1 != nil {
		return nil, errFindScriptsOKBodyAO1
	}
	_parts = append(_parts, jsonDataFindScriptsOKBodyAO1)
	return swag.ConcatJSON(_parts...), nil
}
func (o *FindScriptsOKBody) Validate(formats strfmt.Registry) error {
	var res []error
	if err := o.SearchResult.Validate(formats); err != nil {
		res = append(res, err)
	}
	if err := o.validateData(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (o *FindScriptsOKBody) validateData(formats strfmt.Registry) error {
	if swag.IsZero(o.Data) {  
		return nil
	}
	for i := 0; i < len(o.Data); i++ {
		if swag.IsZero(o.Data[i]) {  
			continue
		}
		if o.Data[i] != nil {
			if err := o.Data[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("findScriptsOK" + "." + "data" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}