github.com/goadesign/goa/http/codegen/testdata


testdata

import "github.com/goadesign/goa/http/codegen/testdata"

Overview

Index

Package files

error_encoder_code.go error_response_dsls.go handler_init_functions.go multi_endpoint_dsls.go multipart_code.go parse_endpoint_functions.go path_dsls.go path_functions.go payload_constructor_functions.go payload_decode_functions.go payload_dsls.go payload_encode_functions.go result_decode_functions.go result_dsls.go result_encode_functions.go server_dsls.go server_init_functions.go streaming_code.go streaming_dsls.go transform_helper_functions.go

Variables

var BidirectionalStreamingClientEndpointCode = `// BidirectionalStreamingMethod returns an endpoint that makes HTTP requests to
// the BidirectionalStreamingService service BidirectionalStreamingMethod
// server.
func (c *Client) BidirectionalStreamingMethod() goa.Endpoint {
    var (
        encodeRequest  = EncodeBidirectionalStreamingMethodRequest(c.encoder)
        decodeResponse = DecodeBidirectionalStreamingMethodResponse(c.decoder, c.RestoreResponseBody)
    )
    return func(ctx context.Context, v interface{}) (interface{}, error) {
        req, err := c.BuildBidirectionalStreamingMethodRequest(ctx, v)
        if err != nil {
            return nil, err
        }
        err = encodeRequest(req, v)
        if err != nil {
            return nil, err
        }
        conn, resp, err := c.dialer.Dial(req.URL.String(), req.Header)
        if err != nil {
            if resp != nil {
                return decodeResponse(resp)
            }
            return nil, goahttp.ErrRequestError("BidirectionalStreamingService", "BidirectionalStreamingMethod", err)
        }
        if c.connConfigFn != nil {
            conn = c.connConfigFn(conn)
        }
        stream := &BidirectionalStreamingMethodClientStream{conn: conn}
        return stream, nil
    }
}
`
var BidirectionalStreamingClientStreamCloseCode = `// Close closes the "BidirectionalStreamingMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingMethodClientStream) Close() error {
    defer s.conn.Close()
    var err error
    // Send a nil payload to the server implying client closing connection.
    if err = s.conn.WriteJSON(nil); err != nil {
        return err
    }
    return nil
}
`
var BidirectionalStreamingClientStreamRecvCode = `// Recv reads instances of "bidirectionalstreamingservice.UserType" from the
// "BidirectionalStreamingMethod" endpoint websocket connection.
func (s *BidirectionalStreamingMethodClientStream) Recv() (*bidirectionalstreamingservice.UserType, error) {
    var (
        rv   *bidirectionalstreamingservice.UserType
        body BidirectionalStreamingMethodResponseBody
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    res := NewBidirectionalStreamingMethodUserTypeOK(&body)
    return res, nil
}
`
var BidirectionalStreamingClientStreamSendCode = `// Send streams instances of "bidirectionalstreamingservice.Request" to the
// "BidirectionalStreamingMethod" endpoint websocket connection.
func (s *BidirectionalStreamingMethodClientStream) Send(v *bidirectionalstreamingservice.Request) error {
    body := NewBidirectionalStreamingMethodStreamingBody(v)
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingDSL = func() {
    var Request = Type("Request", func() {
        Attribute("x", String)
    })
    var PayloadType = Type("Payload", func() {
        Attribute("p", String)
        Attribute("q", String)
        Attribute("r", String)
    })
    var ResultType = Type("UserType", func() {
        Attribute("a", String)
    })
    Service("BidirectionalStreamingService", func() {
        Method("BidirectionalStreamingMethod", func() {
            Payload(PayloadType)
            StreamingPayload(Request)
            StreamingResult(ResultType)
            HTTP(func() {
                GET("/{p}")
                Param("q")
                Header("r:Location")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingNoPayloadClientEndpointCode = `// BidirectionalStreamingNoPayloadMethod returns an endpoint that makes HTTP
// requests to the BidirectionalStreamingNoPayloadService service
// BidirectionalStreamingNoPayloadMethod server.
func (c *Client) BidirectionalStreamingNoPayloadMethod() goa.Endpoint {
    var (
        decodeResponse = DecodeBidirectionalStreamingNoPayloadMethodResponse(c.decoder, c.RestoreResponseBody)
    )
    return func(ctx context.Context, v interface{}) (interface{}, error) {
        req, err := c.BuildBidirectionalStreamingNoPayloadMethodRequest(ctx, v)
        if err != nil {
            return nil, err
        }
        conn, resp, err := c.dialer.Dial(req.URL.String(), req.Header)
        if err != nil {
            if resp != nil {
                return decodeResponse(resp)
            }
            return nil, goahttp.ErrRequestError("BidirectionalStreamingNoPayloadService", "BidirectionalStreamingNoPayloadMethod", err)
        }
        if c.connConfigFn != nil {
            conn = c.connConfigFn(conn)
        }
        stream := &BidirectionalStreamingNoPayloadMethodClientStream{conn: conn}
        return stream, nil
    }
}
`
var BidirectionalStreamingNoPayloadClientStreamCloseCode = `// Close closes the "BidirectionalStreamingNoPayloadMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingNoPayloadMethodClientStream) Close() error {
    defer s.conn.Close()
    var err error
    // Send a nil payload to the server implying client closing connection.
    if err = s.conn.WriteJSON(nil); err != nil {
        return err
    }
    return nil
}
`
var BidirectionalStreamingNoPayloadClientStreamRecvCode = `// Recv reads instances of "bidirectionalstreamingnopayloadservice.UserType"
// from the "BidirectionalStreamingNoPayloadMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingNoPayloadMethodClientStream) Recv() (*bidirectionalstreamingnopayloadservice.UserType, error) {
    var (
        rv   *bidirectionalstreamingnopayloadservice.UserType
        body BidirectionalStreamingNoPayloadMethodResponseBody
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    res := NewBidirectionalStreamingNoPayloadMethodUserTypeOK(&body)
    return res, nil
}
`
var BidirectionalStreamingNoPayloadClientStreamSendCode = `// Send streams instances of "bidirectionalstreamingnopayloadservice.Request"
// to the "BidirectionalStreamingNoPayloadMethod" endpoint websocket connection.
func (s *BidirectionalStreamingNoPayloadMethodClientStream) Send(v *bidirectionalstreamingnopayloadservice.Request) error {
    body := NewBidirectionalStreamingNoPayloadMethodStreamingBody(v)
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingNoPayloadDSL = func() {
    var Request = Type("Request", func() {
        Attribute("x", String)
    })
    var ResultType = Type("UserType", func() {
        Attribute("a", String)
    })
    Service("BidirectionalStreamingNoPayloadService", func() {
        Method("BidirectionalStreamingNoPayloadMethod", func() {
            StreamingPayload(Request)
            StreamingResult(ResultType)
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingNoPayloadServerHandlerInitCode = `// NewBidirectionalStreamingNoPayloadMethodHandler creates a HTTP handler which
// loads the HTTP request and calls the
// "BidirectionalStreamingNoPayloadService" service
// "BidirectionalStreamingNoPayloadMethod" endpoint.
func NewBidirectionalStreamingNoPayloadMethodHandler(
    endpoint goa.Endpoint,
    mux goahttp.Muxer,
    dec func(*http.Request) goahttp.Decoder,
    enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
    eh func(context.Context, http.ResponseWriter, error),
    up goahttp.Upgrader,
    connConfigFn goahttp.ConnConfigureFunc,
) http.Handler {
    var (
        encodeError = goahttp.ErrorEncoder(enc)
    )
    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
        ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
        ctx = context.WithValue(ctx, goa.MethodKey, "BidirectionalStreamingNoPayloadMethod")
        ctx = context.WithValue(ctx, goa.ServiceKey, "BidirectionalStreamingNoPayloadService")

        v := &bidirectionalstreamingnopayloadservice.BidirectionalStreamingNoPayloadMethodEndpointInput{
            Stream: &BidirectionalStreamingNoPayloadMethodServerStream{
                upgrader:     up,
                connConfigFn: connConfigFn,
                w:            w,
                r:            r,
            },
        }
        _, err = endpoint(ctx, v)

        if err != nil {
            if _, ok := err.(websocket.HandshakeError); ok {
                return
            }
            if err := encodeError(ctx, w, err); err != nil {
                eh(ctx, w, err)
            }
            return
        }
    })
}
`
var BidirectionalStreamingNoPayloadServerStreamCloseCode = `// Close closes the "BidirectionalStreamingNoPayloadMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingNoPayloadMethodServerStream) Close() error {
    defer s.conn.Close()
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Close().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    if err = s.conn.WriteControl(
        websocket.CloseMessage,
        websocket.FormatCloseMessage(websocket.CloseNormalClosure, "server closing connection"),
        time.Now().Add(time.Second),
    ); err != nil {
        return err
    }
    return nil
}
`
var BidirectionalStreamingPrimitiveArrayClientStreamRecvCode = `// Recv reads instances of "[]string" from the
// "BidirectionalStreamingPrimitiveArrayMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveArrayMethodClientStream) Recv() ([]string, error) {
    var (
        rv   []string
        body []string
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    return body, nil
}
`
var BidirectionalStreamingPrimitiveArrayClientStreamSendCode = `// Send streams instances of "[]int32" to the
// "BidirectionalStreamingPrimitiveArrayMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveArrayMethodClientStream) Send(v []int32) error {
    return s.conn.WriteJSON(v)
}
`
var BidirectionalStreamingPrimitiveArrayDSL = func() {
    Service("BidirectionalStreamingPrimitiveArrayService", func() {
        Method("BidirectionalStreamingPrimitiveArrayMethod", func() {
            StreamingPayload(ArrayOf(Int32))
            StreamingResult(ArrayOf(String))
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingPrimitiveArrayServerStreamRecvCode = `// Recv reads instances of "[]int32" from the
// "BidirectionalStreamingPrimitiveArrayMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveArrayMethodServerStream) Recv() ([]int32, error) {
    var (
        rv  []int32
        msg *[]int32
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return body, nil
}
`
var BidirectionalStreamingPrimitiveArrayServerStreamSendCode = `// Send streams instances of "[]string" to the
// "BidirectionalStreamingPrimitiveArrayMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveArrayMethodServerStream) Send(v []string) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := v
    return s.conn.WriteJSON(res)
}
`
var BidirectionalStreamingPrimitiveClientStreamRecvCode = `// Recv reads instances of "string" from the
// "BidirectionalStreamingPrimitiveMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveMethodClientStream) Recv() (string, error) {
    var (
        rv   string
        body string
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    return body, nil
}
`
var BidirectionalStreamingPrimitiveClientStreamSendCode = `// Send streams instances of "string" to the
// "BidirectionalStreamingPrimitiveMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveMethodClientStream) Send(v string) error {
    return s.conn.WriteJSON(v)
}
`
var BidirectionalStreamingPrimitiveDSL = func() {
    Service("BidirectionalStreamingPrimitiveService", func() {
        Method("BidirectionalStreamingPrimitiveMethod", func() {
            StreamingPayload(String)
            StreamingResult(String)
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingPrimitiveMapClientStreamRecvCode = `// Recv reads instances of "map[int]int" from the
// "BidirectionalStreamingPrimitiveMapMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveMapMethodClientStream) Recv() (map[int]int, error) {
    var (
        rv   map[int]int
        body map[int]int
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    return body, nil
}
`
var BidirectionalStreamingPrimitiveMapClientStreamSendCode = `// Send streams instances of "map[string]int32" to the
// "BidirectionalStreamingPrimitiveMapMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveMapMethodClientStream) Send(v map[string]int32) error {
    return s.conn.WriteJSON(v)
}
`
var BidirectionalStreamingPrimitiveMapDSL = func() {
    Service("BidirectionalStreamingPrimitiveMapService", func() {
        Method("BidirectionalStreamingPrimitiveMapMethod", func() {
            StreamingPayload(MapOf(String, Int32))
            StreamingResult(MapOf(Int, Int))
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingPrimitiveMapServerStreamRecvCode = `// Recv reads instances of "map[string]int32" from the
// "BidirectionalStreamingPrimitiveMapMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveMapMethodServerStream) Recv() (map[string]int32, error) {
    var (
        rv  map[string]int32
        msg *map[string]int32
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return body, nil
}
`
var BidirectionalStreamingPrimitiveMapServerStreamSendCode = `// Send streams instances of "map[int]int" to the
// "BidirectionalStreamingPrimitiveMapMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveMapMethodServerStream) Send(v map[int]int) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := v
    return s.conn.WriteJSON(res)
}
`
var BidirectionalStreamingPrimitiveServerStreamRecvCode = `// Recv reads instances of "string" from the
// "BidirectionalStreamingPrimitiveMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveMethodServerStream) Recv() (string, error) {
    var (
        rv  string
        msg *string
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return body, nil
}
`
var BidirectionalStreamingPrimitiveServerStreamSendCode = `// Send streams instances of "string" to the
// "BidirectionalStreamingPrimitiveMethod" endpoint websocket connection.
func (s *BidirectionalStreamingPrimitiveMethodServerStream) Send(v string) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := v
    return s.conn.WriteJSON(res)
}
`
var BidirectionalStreamingResultCollectionWithExplicitViewClientStreamRecvCode = `// Recv reads instances of
// "bidirectionalstreamingresultcollectionwithexplicitviewservice.UsertypeCollection"
// from the "BidirectionalStreamingResultCollectionWithExplicitViewMethod"
// endpoint websocket connection.
func (s *BidirectionalStreamingResultCollectionWithExplicitViewMethodClientStream) Recv() (bidirectionalstreamingresultcollectionwithexplicitviewservice.UsertypeCollection, error) {
    var (
        rv   bidirectionalstreamingresultcollectionwithexplicitviewservice.UsertypeCollection
        body BidirectionalStreamingResultCollectionWithExplicitViewMethodResponseBody
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    res := NewBidirectionalStreamingResultCollectionWithExplicitViewMethodUsertypeCollectionOK(body)
    vres := bidirectionalstreamingresultcollectionwithexplicitviewserviceviews.UsertypeCollection{res, "tiny"}
    if err := vres.Validate(); err != nil {
        return rv, goahttp.ErrValidationError("BidirectionalStreamingResultCollectionWithExplicitViewService", "BidirectionalStreamingResultCollectionWithExplicitViewMethod", err)
    }
    return bidirectionalstreamingresultcollectionwithexplicitviewservice.NewUsertypeCollection(vres), nil
}
`
var BidirectionalStreamingResultCollectionWithExplicitViewClientStreamSendCode = `// Send streams instances of "interface{}" to the
// "BidirectionalStreamingResultCollectionWithExplicitViewMethod" endpoint
// websocket connection.
func (s *BidirectionalStreamingResultCollectionWithExplicitViewMethodClientStream) Send(v interface{}) error {
    return s.conn.WriteJSON(v)
}
`
var BidirectionalStreamingResultCollectionWithExplicitViewDSL = func() {
    var ResultT = ResultType("UserType", func() {
        Attributes(func() {
            Attribute("a", String)
            Attribute("b", Int)
            Attribute("c", String)
        })
        View("tiny", func() {
            Attribute("a", String)
        })
        View("extended", func() {
            Attribute("a")
            Attribute("b")
            Attribute("c")
        })
    })
    Service("BidirectionalStreamingResultCollectionWithExplicitViewService", func() {
        Method("BidirectionalStreamingResultCollectionWithExplicitViewMethod", func() {
            StreamingPayload(Any)
            StreamingResult(CollectionOf(ResultT), func() {
                View("tiny")
            })
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingResultCollectionWithExplicitViewServerStreamRecvCode = `// Recv reads instances of "interface{}" from the
// "BidirectionalStreamingResultCollectionWithExplicitViewMethod" endpoint
// websocket connection.
func (s *BidirectionalStreamingResultCollectionWithExplicitViewMethodServerStream) Recv() (interface{}, error) {
    var (
        rv  interface{}
        msg *interface{}
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return body, nil
}
`
var BidirectionalStreamingResultCollectionWithExplicitViewServerStreamSendCode = `// Send streams instances of
// "bidirectionalstreamingresultcollectionwithexplicitviewservice.UsertypeCollection"
// to the "BidirectionalStreamingResultCollectionWithExplicitViewMethod"
// endpoint websocket connection.
func (s *BidirectionalStreamingResultCollectionWithExplicitViewMethodServerStream) Send(v bidirectionalstreamingresultcollectionwithexplicitviewservice.UsertypeCollection) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := bidirectionalstreamingresultcollectionwithexplicitviewservice.NewViewedUsertypeCollection(v, "tiny")
    body := NewUsertypeResponseBodyTinyCollection(res.Projected)
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingResultCollectionWithViewsClientStreamRecvCode = `// Recv reads instances of
// "bidirectionalstreamingresultcollectionwithviewsservice.UsertypeCollection"
// from the "BidirectionalStreamingResultCollectionWithViewsMethod" endpoint
// websocket connection.
func (s *BidirectionalStreamingResultCollectionWithViewsMethodClientStream) Recv() (bidirectionalstreamingresultcollectionwithviewsservice.UsertypeCollection, error) {
    var (
        rv   bidirectionalstreamingresultcollectionwithviewsservice.UsertypeCollection
        body BidirectionalStreamingResultCollectionWithViewsMethodResponseBody
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    res := NewBidirectionalStreamingResultCollectionWithViewsMethodUsertypeCollectionOK(body)
    vres := bidirectionalstreamingresultcollectionwithviewsserviceviews.UsertypeCollection{res, s.view}
    if err := vres.Validate(); err != nil {
        return rv, goahttp.ErrValidationError("BidirectionalStreamingResultCollectionWithViewsService", "BidirectionalStreamingResultCollectionWithViewsMethod", err)
    }
    return bidirectionalstreamingresultcollectionwithviewsservice.NewUsertypeCollection(vres), nil
}
`
var BidirectionalStreamingResultCollectionWithViewsClientStreamSendCode = `// Send streams instances of "interface{}" to the
// "BidirectionalStreamingResultCollectionWithViewsMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingResultCollectionWithViewsMethodClientStream) Send(v interface{}) error {
    return s.conn.WriteJSON(v)
}
`
var BidirectionalStreamingResultCollectionWithViewsClientStreamSetViewCode = `// SetView sets the view to render the interface{} type before sending to the
// "BidirectionalStreamingResultCollectionWithViewsMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingResultCollectionWithViewsMethodClientStream) SetView(view string) {
    s.view = view
}
`
var BidirectionalStreamingResultCollectionWithViewsDSL = func() {
    var ResultT = ResultType("UserType", func() {
        Attributes(func() {
            Attribute("a", String)
            Attribute("b", Int)
            Attribute("c", String)
        })
        View("tiny", func() {
            Attribute("a", String)
        })
        View("extended", func() {
            Attribute("a")
            Attribute("b")
            Attribute("c")
        })
    })
    Service("BidirectionalStreamingResultCollectionWithViewsService", func() {
        Method("BidirectionalStreamingResultCollectionWithViewsMethod", func() {
            StreamingPayload(Any)
            StreamingResult(CollectionOf(ResultT))
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingResultCollectionWithViewsServerStreamRecvCode = `// Recv reads instances of "interface{}" from the
// "BidirectionalStreamingResultCollectionWithViewsMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingResultCollectionWithViewsMethodServerStream) Recv() (interface{}, error) {
    var (
        rv  interface{}
        msg *interface{}
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return body, nil
}
`
var BidirectionalStreamingResultCollectionWithViewsServerStreamSendCode = `// Send streams instances of
// "bidirectionalstreamingresultcollectionwithviewsservice.UsertypeCollection"
// to the "BidirectionalStreamingResultCollectionWithViewsMethod" endpoint
// websocket connection.
func (s *BidirectionalStreamingResultCollectionWithViewsMethodServerStream) Send(v bidirectionalstreamingresultcollectionwithviewsservice.UsertypeCollection) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        respHdr := make(http.Header)
        respHdr.Add("goa-view", s.view)
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, respHdr)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := bidirectionalstreamingresultcollectionwithviewsservice.NewViewedUsertypeCollection(v, s.view)
    var body interface{}
    switch s.view {
    case "tiny":
        body = NewUsertypeResponseBodyTinyCollection(res.Projected)
    case "extended":
        body = NewUsertypeResponseBodyExtendedCollection(res.Projected)
    case "default", "":
        body = NewUsertypeResponseBodyCollection(res.Projected)
    }
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingResultCollectionWithViewsServerStreamSetViewCode = `// SetView sets the view to render the
// bidirectionalstreamingresultcollectionwithviewsservice.UsertypeCollection
// type before sending to the
// "BidirectionalStreamingResultCollectionWithViewsMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingResultCollectionWithViewsMethodServerStream) SetView(view string) {
    s.view = view
}
`
var BidirectionalStreamingResultWithExplicitViewClientStreamRecvCode = `// Recv reads instances of
// "bidirectionalstreamingresultwithexplicitviewservice.Usertype" from the
// "BidirectionalStreamingResultWithExplicitViewMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingResultWithExplicitViewMethodClientStream) Recv() (*bidirectionalstreamingresultwithexplicitviewservice.Usertype, error) {
    var (
        rv   *bidirectionalstreamingresultwithexplicitviewservice.Usertype
        body BidirectionalStreamingResultWithExplicitViewMethodResponseBody
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    res := NewBidirectionalStreamingResultWithExplicitViewMethodUsertypeOK(&body)
    vres := &bidirectionalstreamingresultwithexplicitviewserviceviews.Usertype{res, "extended"}
    if err := vres.Validate(); err != nil {
        return rv, goahttp.ErrValidationError("BidirectionalStreamingResultWithExplicitViewService", "BidirectionalStreamingResultWithExplicitViewMethod", err)
    }
    return bidirectionalstreamingresultwithexplicitviewservice.NewUsertype(vres), nil
}
`
var BidirectionalStreamingResultWithExplicitViewClientStreamSendCode = `// Send streams instances of "float32" to the
// "BidirectionalStreamingResultWithExplicitViewMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingResultWithExplicitViewMethodClientStream) Send(v float32) error {
    return s.conn.WriteJSON(v)
}
`
var BidirectionalStreamingResultWithExplicitViewDSL = func() {
    var ResultT = ResultType("UserType", func() {
        Attributes(func() {
            Attribute("a", String)
            Attribute("b", Int)
            Attribute("c", String)
        })
        View("tiny", func() {
            Attribute("a", String)
        })
        View("extended", func() {
            Attribute("a")
            Attribute("b")
            Attribute("c")
        })
    })
    Service("BidirectionalStreamingResultWithExplicitViewService", func() {
        Method("BidirectionalStreamingResultWithExplicitViewMethod", func() {
            StreamingPayload(Float32)
            StreamingResult(ResultT, func() {
                View("extended")
            })
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingResultWithExplicitViewServerStreamRecvCode = `// Recv reads instances of "float32" from the
// "BidirectionalStreamingResultWithExplicitViewMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingResultWithExplicitViewMethodServerStream) Recv() (float32, error) {
    var (
        rv  float32
        msg *float32
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return body, nil
}
`
var BidirectionalStreamingResultWithExplicitViewServerStreamSendCode = `// Send streams instances of
// "bidirectionalstreamingresultwithexplicitviewservice.Usertype" to the
// "BidirectionalStreamingResultWithExplicitViewMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingResultWithExplicitViewMethodServerStream) Send(v *bidirectionalstreamingresultwithexplicitviewservice.Usertype) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := bidirectionalstreamingresultwithexplicitviewservice.NewViewedUsertype(v, "extended")
    body := NewBidirectionalStreamingResultWithExplicitViewMethodResponseBodyExtended(res.Projected)
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingResultWithViewsClientStreamCloseCode = `// Close closes the "BidirectionalStreamingResultWithViewsMethod" endpoint
// websocket connection.
func (s *BidirectionalStreamingResultWithViewsMethodClientStream) Close() error {
    defer s.conn.Close()
    var err error
    // Send a nil payload to the server implying client closing connection.
    if err = s.conn.WriteJSON(nil); err != nil {
        return err
    }
    return nil
}
`
var BidirectionalStreamingResultWithViewsClientStreamRecvCode = `// Recv reads instances of
// "bidirectionalstreamingresultwithviewsservice.Usertype" from the
// "BidirectionalStreamingResultWithViewsMethod" endpoint websocket connection.
func (s *BidirectionalStreamingResultWithViewsMethodClientStream) Recv() (*bidirectionalstreamingresultwithviewsservice.Usertype, error) {
    var (
        rv   *bidirectionalstreamingresultwithviewsservice.Usertype
        body BidirectionalStreamingResultWithViewsMethodResponseBody
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    res := NewBidirectionalStreamingResultWithViewsMethodUsertypeOK(&body)
    vres := &bidirectionalstreamingresultwithviewsserviceviews.Usertype{res, s.view}
    if err := vres.Validate(); err != nil {
        return rv, goahttp.ErrValidationError("BidirectionalStreamingResultWithViewsService", "BidirectionalStreamingResultWithViewsMethod", err)
    }
    return bidirectionalstreamingresultwithviewsservice.NewUsertype(vres), nil
}
`
var BidirectionalStreamingResultWithViewsClientStreamSendCode = `// Send streams instances of "float32" to the
// "BidirectionalStreamingResultWithViewsMethod" endpoint websocket connection.
func (s *BidirectionalStreamingResultWithViewsMethodClientStream) Send(v float32) error {
    return s.conn.WriteJSON(v)
}
`
var BidirectionalStreamingResultWithViewsClientStreamSetViewCode = `// SetView sets the view to render the float32 type before sending to the
// "BidirectionalStreamingResultWithViewsMethod" endpoint websocket connection.
func (s *BidirectionalStreamingResultWithViewsMethodClientStream) SetView(view string) {
    s.view = view
}
`
var BidirectionalStreamingResultWithViewsDSL = func() {
    var ResultT = ResultType("UserType", func() {
        Attributes(func() {
            Attribute("a", String)
            Attribute("b", Int)
            Attribute("c", String)
        })
        View("tiny", func() {
            Attribute("a", String)
        })
        View("extended", func() {
            Attribute("a")
            Attribute("b")
            Attribute("c")
        })
    })
    Service("BidirectionalStreamingResultWithViewsService", func() {
        Method("BidirectionalStreamingResultWithViewsMethod", func() {
            StreamingPayload(Float32)
            StreamingResult(ResultT)
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingResultWithViewsServerStreamCloseCode = `// Close closes the "BidirectionalStreamingResultWithViewsMethod" endpoint
// websocket connection.
func (s *BidirectionalStreamingResultWithViewsMethodServerStream) Close() error {
    defer s.conn.Close()
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Close().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    if err = s.conn.WriteControl(
        websocket.CloseMessage,
        websocket.FormatCloseMessage(websocket.CloseNormalClosure, "server closing connection"),
        time.Now().Add(time.Second),
    ); err != nil {
        return err
    }
    return nil
}
`
var BidirectionalStreamingResultWithViewsServerStreamRecvCode = `// Recv reads instances of "float32" from the
// "BidirectionalStreamingResultWithViewsMethod" endpoint websocket connection.
func (s *BidirectionalStreamingResultWithViewsMethodServerStream) Recv() (float32, error) {
    var (
        rv  float32
        msg *float32
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return body, nil
}
`
var BidirectionalStreamingResultWithViewsServerStreamSendCode = `// Send streams instances of
// "bidirectionalstreamingresultwithviewsservice.Usertype" to the
// "BidirectionalStreamingResultWithViewsMethod" endpoint websocket connection.
func (s *BidirectionalStreamingResultWithViewsMethodServerStream) Send(v *bidirectionalstreamingresultwithviewsservice.Usertype) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        respHdr := make(http.Header)
        respHdr.Add("goa-view", s.view)
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, respHdr)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := bidirectionalstreamingresultwithviewsservice.NewViewedUsertype(v, s.view)
    var body interface{}
    switch s.view {
    case "tiny":
        body = NewBidirectionalStreamingResultWithViewsMethodResponseBodyTiny(res.Projected)
    case "extended":
        body = NewBidirectionalStreamingResultWithViewsMethodResponseBodyExtended(res.Projected)
    case "default", "":
        body = NewBidirectionalStreamingResultWithViewsMethodResponseBody(res.Projected)
    }
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingResultWithViewsServerStreamSetViewCode = `// SetView sets the view to render the
// bidirectionalstreamingresultwithviewsservice.Usertype type before sending to
// the "BidirectionalStreamingResultWithViewsMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingResultWithViewsMethodServerStream) SetView(view string) {
    s.view = view
}
`
var BidirectionalStreamingServerHandlerInitCode = `// NewBidirectionalStreamingMethodHandler creates a HTTP handler which loads
// the HTTP request and calls the "BidirectionalStreamingService" service
// "BidirectionalStreamingMethod" endpoint.
func NewBidirectionalStreamingMethodHandler(
    endpoint goa.Endpoint,
    mux goahttp.Muxer,
    dec func(*http.Request) goahttp.Decoder,
    enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
    eh func(context.Context, http.ResponseWriter, error),
    up goahttp.Upgrader,
    connConfigFn goahttp.ConnConfigureFunc,
) http.Handler {
    var (
        decodeRequest = DecodeBidirectionalStreamingMethodRequest(mux, dec)
        encodeError   = goahttp.ErrorEncoder(enc)
    )
    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
        ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept"))
        ctx = context.WithValue(ctx, goa.MethodKey, "BidirectionalStreamingMethod")
        ctx = context.WithValue(ctx, goa.ServiceKey, "BidirectionalStreamingService")
        payload, err := decodeRequest(r)
        if err != nil {
            eh(ctx, w, err)
            return
        }

        v := &bidirectionalstreamingservice.BidirectionalStreamingMethodEndpointInput{
            Stream: &BidirectionalStreamingMethodServerStream{
                upgrader:     up,
                connConfigFn: connConfigFn,
                w:            w,
                r:            r,
            },
            Payload: payload.(*bidirectionalstreamingservice.Payload),
        }
        _, err = endpoint(ctx, v)

        if err != nil {
            if _, ok := err.(websocket.HandshakeError); ok {
                return
            }
            if err := encodeError(ctx, w, err); err != nil {
                eh(ctx, w, err)
            }
            return
        }
    })
}
`
var BidirectionalStreamingServerStreamCloseCode = `// Close closes the "BidirectionalStreamingMethod" endpoint websocket
// connection.
func (s *BidirectionalStreamingMethodServerStream) Close() error {
    defer s.conn.Close()
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Close().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    if err = s.conn.WriteControl(
        websocket.CloseMessage,
        websocket.FormatCloseMessage(websocket.CloseNormalClosure, "server closing connection"),
        time.Now().Add(time.Second),
    ); err != nil {
        return err
    }
    return nil
}
`
var BidirectionalStreamingServerStreamRecvCode = `// Recv reads instances of "bidirectionalstreamingservice.Request" from the
// "BidirectionalStreamingMethod" endpoint websocket connection.
func (s *BidirectionalStreamingMethodServerStream) Recv() (*bidirectionalstreamingservice.Request, error) {
    var (
        rv  *bidirectionalstreamingservice.Request
        msg **BidirectionalStreamingMethodStreamingBody
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return NewBidirectionalStreamingMethodStreamingBody(body), nil
}
`
var BidirectionalStreamingServerStreamSendCode = `// Send streams instances of "bidirectionalstreamingservice.UserType" to the
// "BidirectionalStreamingMethod" endpoint websocket connection.
func (s *BidirectionalStreamingMethodServerStream) Send(v *bidirectionalstreamingservice.UserType) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := v
    body := NewBidirectionalStreamingMethodResponseBody(res)
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingUserTypeArrayClientStreamRecvCode = `// Recv reads instances of
// "[]*bidirectionalstreamingusertypearrayservice.ResultType" from the
// "BidirectionalStreamingUserTypeArrayMethod" endpoint websocket connection.
func (s *BidirectionalStreamingUserTypeArrayMethodClientStream) Recv() ([]*bidirectionalstreamingusertypearrayservice.ResultType, error) {
    var (
        rv   []*bidirectionalstreamingusertypearrayservice.ResultType
        body BidirectionalStreamingUserTypeArrayMethodResponseBody
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    res := NewBidirectionalStreamingUserTypeArrayMethodResultTypeOK(body)
    return res, nil
}
`
var BidirectionalStreamingUserTypeArrayClientStreamSendCode = `// Send streams instances of
// "[]*bidirectionalstreamingusertypearrayservice.RequestType" to the
// "BidirectionalStreamingUserTypeArrayMethod" endpoint websocket connection.
func (s *BidirectionalStreamingUserTypeArrayMethodClientStream) Send(v []*bidirectionalstreamingusertypearrayservice.RequestType) error {
    body := NewRequestType(v)
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingUserTypeArrayDSL = func() {
    var RequestType = Type("RequestType", func() {
        Attribute("a", String)
    })
    var ResultT = Type("ResultType", func() {
        Attribute("b", String)
    })
    Service("BidirectionalStreamingUserTypeArrayService", func() {
        Method("BidirectionalStreamingUserTypeArrayMethod", func() {
            StreamingPayload(ArrayOf(RequestType))
            StreamingResult(ArrayOf(ResultT))
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingUserTypeArrayServerStreamRecvCode = `// Recv reads instances of
// "[]*bidirectionalstreamingusertypearrayservice.RequestType" from the
// "BidirectionalStreamingUserTypeArrayMethod" endpoint websocket connection.
func (s *BidirectionalStreamingUserTypeArrayMethodServerStream) Recv() ([]*bidirectionalstreamingusertypearrayservice.RequestType, error) {
    var (
        rv  []*bidirectionalstreamingusertypearrayservice.RequestType
        msg *[]*RequestType
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return NewBidirectionalStreamingUserTypeArrayMethodArray(body), nil
}
`
var BidirectionalStreamingUserTypeArrayServerStreamSendCode = `// Send streams instances of
// "[]*bidirectionalstreamingusertypearrayservice.ResultType" to the
// "BidirectionalStreamingUserTypeArrayMethod" endpoint websocket connection.
func (s *BidirectionalStreamingUserTypeArrayMethodServerStream) Send(v []*bidirectionalstreamingusertypearrayservice.ResultType) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := v
    body := NewResultTypeResponseBody(res)
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingUserTypeMapClientStreamRecvCode = `// Recv reads instances of
// "map[string]*bidirectionalstreamingusertypemapservice.ResultType" from the
// "BidirectionalStreamingUserTypeMapMethod" endpoint websocket connection.
func (s *BidirectionalStreamingUserTypeMapMethodClientStream) Recv() (map[string]*bidirectionalstreamingusertypemapservice.ResultType, error) {
    var (
        rv   map[string]*bidirectionalstreamingusertypemapservice.ResultType
        body BidirectionalStreamingUserTypeMapMethodResponseBody
        err  error
    )
    err = s.conn.ReadJSON(&body)
    if websocket.IsCloseError(err, websocket.CloseNormalClosure) {
        return rv, io.EOF
    }
    if err != nil {
        return rv, err
    }
    res := NewBidirectionalStreamingUserTypeMapMethodMapStringResultTypeOK(body)
    return res, nil
}
`
var BidirectionalStreamingUserTypeMapClientStreamSendCode = `// Send streams instances of
// "map[string]*bidirectionalstreamingusertypemapservice.RequestType" to the
// "BidirectionalStreamingUserTypeMapMethod" endpoint websocket connection.
func (s *BidirectionalStreamingUserTypeMapMethodClientStream) Send(v map[string]*bidirectionalstreamingusertypemapservice.RequestType) error {
    body := NewMapStringRequestType(v)
    return s.conn.WriteJSON(body)
}
`
var BidirectionalStreamingUserTypeMapDSL = func() {
    var RequestType = Type("RequestType", func() {
        Attribute("a", String)
    })
    var ResultT = Type("ResultType", func() {
        Attribute("b", String)
    })
    Service("BidirectionalStreamingUserTypeMapService", func() {
        Method("BidirectionalStreamingUserTypeMapMethod", func() {
            StreamingPayload(MapOf(String, RequestType))
            StreamingResult(MapOf(String, ResultT))
            HTTP(func() {
                GET("/")
                Response(StatusOK)
            })
        })
    })
}
var BidirectionalStreamingUserTypeMapServerStreamRecvCode = `// Recv reads instances of
// "map[string]*bidirectionalstreamingusertypemapservice.RequestType" from the
// "BidirectionalStreamingUserTypeMapMethod" endpoint websocket connection.
func (s *BidirectionalStreamingUserTypeMapMethodServerStream) Recv() (map[string]*bidirectionalstreamingusertypemapservice.RequestType, error) {
    var (
        rv  map[string]*bidirectionalstreamingusertypemapservice.RequestType
        msg *map[string]*RequestType
        err error
    )
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Recv().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return rv, err
    }
    if err = s.conn.ReadJSON(&msg); err != nil {
        return rv, err
    }
    if msg == nil {
        return rv, io.EOF
    }
    body := *msg
    return NewBidirectionalStreamingUserTypeMapMethodMap(body), nil
}
`
var BidirectionalStreamingUserTypeMapServerStreamSendCode = `// Send streams instances of
// "map[string]*bidirectionalstreamingusertypemapservice.ResultType" to the
// "BidirectionalStreamingUserTypeMapMethod" endpoint websocket connection.
func (s *BidirectionalStreamingUserTypeMapMethodServerStream) Send(v map[string]*bidirectionalstreamingusertypemapservice.ResultType) error {
    var err error
    // Upgrade the HTTP connection to a websocket connection only once. Connection
    // upgrade is done here so that authorization logic in the endpoint is executed
    // before calling the actual service method which may call Send().
    s.once.Do(func() {
        var conn *websocket.Conn
        conn, err = s.upgrader.Upgrade(s.w, s.r, nil)
        if err != nil {
            return
        }
        if s.connConfigFn != nil {
            conn = s.connConfigFn(conn)
        }
        s.conn = conn
    })
    if err != nil {
        return err
    }
    res := v
    body := NewMapStringResultTypeResponseBody(res)
    return s.conn.WriteJSON(body)
}
`
var BodyQueryPathObjectBuildCode = `// BuildMethodBodyQueryPathObjectPayload builds the payload for the
// ServiceBodyQueryPathObject MethodBodyQueryPathObject endpoint from CLI flags.
func BuildMethodBodyQueryPathObjectPayload(serviceBodyQueryPathObjectMethodBodyQueryPathObjectBody string, serviceBodyQueryPathObjectMethodBodyQueryPathObjectC string, serviceBodyQueryPathObjectMethodBodyQueryPathObjectB string) (*servicebodyquerypathobject.MethodBodyQueryPathObjectPayload, error) {
    var err error
    var body MethodBodyQueryPathObjectRequestBody
    {
        err = json.Unmarshal([]byte(serviceBodyQueryPathObjectMethodBodyQueryPathObjectBody), &body)
        if err != nil {
            return nil, fmt.Errorf("invalid JSON for body, example of valid JSON:\n%s", "'{\n      \"a\": \"Ullam aut.\"\n   }'")
        }
    }
    var c *string
    {
        if serviceBodyQueryPathObjectMethodBodyQueryPathObjectC != "" {
            c = &serviceBodyQueryPathObjectMethodBodyQueryPathObjectC
        }
    }
    var b *string
    {
        if serviceBodyQueryPathObjectMethodBodyQueryPathObjectB != "" {
            b = &serviceBodyQueryPathObjectMethodBodyQueryPathObjectB
        }
    }
    if err != nil {
        return nil, err
    }
    v := &servicebodyquerypathobject.MethodBodyQueryPathObjectPayload{
        A: body.A,
    }
    v.C = c
    v.B = b
    return v, nil
}
`
var DefaultErrorResponseDSL = func() {
    Service("ServiceDefaultErrorResponse", func() {
        Method("MethodDefaultErrorResponse", func() {
            Error("bad_request")
            HTTP(func() {
                GET("/one/two")
                Response("bad_request", StatusBadRequest)
            })
        })
    })
}
var DefaultErrorResponseEncoderCode = `// EncodeMethodDefaultErrorResponseError returns an encoder for errors returned
// by the MethodDefaultErrorResponse ServiceDefaultErrorResponse endpoint.
func EncodeMethodDefaultErrorResponseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, error) error {
    encodeError := goahttp.ErrorEncoder(encoder)
    return func(ctx context.Context, w http.ResponseWriter, v error) error {
        en, ok := v.(ErrorNamer)
        if !ok {
            return encodeError(ctx, w, v)
        }
        switch en.ErrorName() {
        case "bad_request":
            res := v.(*goa.ServiceError)
            enc := encoder(ctx, w)
            body := NewMethodDefaultErrorResponseBadRequestResponseBody(res)
            w.Header().Set("goa-error", "bad_request")
            w.WriteHeader(http.StatusBadRequest)
            return enc.Encode(body)
        default:
            return encodeError(ctx, w, v)
        }
    }
}
`
var EmptyBodyBuildCode = `// BuildMethodBodyPrimitiveArrayUserPayload builds the payload for the
// ServiceBodyPrimitiveArrayUser MethodBodyPrimitiveArrayUser endpoint from CLI
// flags.
func BuildMethodBodyPrimitiveArrayUserPayload(serviceBodyPrimitiveArrayUserMethodBodyPrimitiveArrayUserA string) (*servicebodyprimitivearrayuser.PayloadType, error) {
    var err error
    var a []string
    {
        if serviceBodyPrimitiveArrayUserMethodBodyPrimitiveArrayUserA != "" {
            err = json.Unmarshal([]byte(serviceBodyPrimitiveArrayUserMethodBodyPrimitiveArrayUserA), &a)
            if err != nil {
                return nil, fmt.Errorf("invalid JSON for a, example of valid JSON:\n%s", "'[\n      \"Perspiciatis repellendus harum et est.\",\n      \"Nisi quibusdam nisi sint sunt beatae.\"\n   ]'")
            }
        }
    }
    if err != nil {
        return nil, err
    }
    payload := &servicebodyprimitivearrayuser.PayloadType{
        A: a,
    }
    return payload, nil
}
`
var EmptyBodyResultMultipleViewsDSL = func() {
    var ResultType = ResultType("ResultTypeMultipleViews", func() {
        Attribute("a", String)
        Attribute("b", String)
        Attribute("c", String)
        View("default", func() {
            Attribute("a")
            Attribute("c")
        })
        View("tiny", func() {
            Attribute("c")
        })
    })
    Service("ServiceEmptyBodyResultMultipleView", func() {
        Method("MethodEmptyBodyResultMultipleView", func() {
            Result(ResultType)
            HTTP(func() {
                POST("/")
                Response(StatusOK, func() {
                    Header("c:Location")
                    Body(Empty)
                })
            })
        })
    })
}
var EmptyBodyResultMultipleViewsDecodeCode = `// DecodeMethodEmptyBodyResultMultipleViewResponse returns a decoder for
// responses returned by the ServiceEmptyBodyResultMultipleView
// MethodEmptyBodyResultMultipleView endpoint. restoreBody controls whether the
// response body should be restored after having been read.
func DecodeMethodEmptyBodyResultMultipleViewResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) {
    return func(resp *http.Response) (interface{}, error) {
        if restoreBody {
            b, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                return nil, err
            }
            resp.Body = ioutil.NopCloser(bytes.NewBuffer(b))
            defer func() {
                resp.Body = ioutil.NopCloser(bytes.NewBuffer(b))
            }()
        } else {
            defer resp.Body.Close()
        }
        switch resp.StatusCode {
        case http.StatusOK:
            var (
                c *string
            )
            cRaw := resp.Header.Get("Location")
            if cRaw != "" {
                c = &cRaw
            }
            p := NewMethodEmptyBodyResultMultipleViewResulttypemultipleviewsOK(c)
            view := resp.Header.Get("goa-view")
            vres := &serviceemptybodyresultmultipleviewviews.Resulttypemultipleviews{p, view}
            return serviceemptybodyresultmultipleview.NewResulttypemultipleviews(vres), nil
        default:
            body, _ := ioutil.ReadAll(resp.Body)
            return nil, goahttp.ErrInvalidResponse("ServiceEmptyBodyResultMultipleView", "MethodEmptyBodyResultMultipleView", resp.StatusCode, string(body))
        }
    }
}
`
var EmptyBodyResultMultipleViewsEncodeCode = `// EncodeMethodEmptyBodyResultMultipleViewResponse returns an encoder for
// responses returned by the ServiceEmptyBodyResultMultipleView
// MethodEmptyBodyResultMultipleView endpoint.
func EncodeMethodEmptyBodyResultMultipleViewResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
    return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
        res := v.(*serviceemptybodyresultmultipleviewviews.Resulttypemultipleviews)
        w.Header().Set("goa-view", res.View)
        if res.Projected.C != nil {
            w.Header().Set("Location", *res.Projected.C)
        }
        w.WriteHeader(http.StatusOK)
        return nil
    }
}
`
var EmptyServerResponseDSL = func() {
    Service("ServiceEmptyServerResponse", func() {
        Method("MethodEmptyServerResponse", func() {
            Result(func() {
                Attribute("h", String)
                Required("h")
            })
            HTTP(func() {
                GET("/")
                Response(StatusOK, func() {
                    Body(Empty)
                })
            })
        })
    })
}
var EmptyServerResponseDecodeCode = `// DecodeMethodEmptyServerResponseResponse returns a decoder for responses
// returned by the ServiceEmptyServerResponse MethodEmptyServerResponse
// endpoint. restoreBody controls whether the response body should be restored
// after having been read.
func DecodeMethodEmptyServerResponseResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) {
    return func(resp *http.Response) (interface{}, error) {
        if restoreBody {
            b, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                return nil, err
            }
            resp.Body = ioutil.NopCloser(bytes.NewBuffer(b))
            defer func() {
                resp.Body = ioutil.NopCloser(bytes.NewBuffer(b))
            }()
        } else {
            defer resp.Body.Close()
        }
        switch resp.StatusCode {
        case http.StatusOK:
            return NewMethodEmptyServerResponseResultOK(), nil
        default:
            body, _ := ioutil.ReadAll(resp.Body)
            return nil, goahttp.ErrInvalidResponse("ServiceEmptyServerResponse", "MethodEmptyServerResponse", resp.StatusCode, string(body))
        }
    }
}
`
var EmptyServerResponseEncodeCode = `// EncodeMethodEmptyServerResponseResponse returns an encoder for responses
// returned by the ServiceEmptyServerResponse MethodEmptyServerResponse
// endpoint.
func EncodeMethodEmptyServerResponseResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
    return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
        w.WriteHeader(http.StatusOK)
        return nil
    }
}
`
var ExplicitBodyPrimitiveResultMultipleViewsDSL = func() {
    var ResultType = ResultType("ResultTypeMultipleViews", func() {
        Attribute("a", String)
        Attribute("b", String)
        Attribute("c", String)
        View("default", func() {
            Attribute("a")
            Attribute("b")
            Attribute("c")
        })
        View("tiny", func() {
            Attribute("a")
            Attribute("c")
        })
    })
    Service("ServiceExplicitBodyPrimitiveResultMultipleView", func() {
        Method("MethodExplicitBodyPrimitiveResultMultipleView", func() {
            Result(ResultType)
            HTTP(func() {
                POST("/")
                Response(StatusOK, func() {
                    Header("c:Location")
                    Body("a")
                })
            })
        })
    })
}
var ExplicitBodyPrimitiveResultMultipleViewsEncodeCode = `// EncodeMethodExplicitBodyPrimitiveResultMultipleViewResponse returns an
// encoder for responses returned by the
// ServiceExplicitBodyPrimitiveResultMultipleView
// MethodExplicitBodyPrimitiveResultMultipleView endpoint.
func EncodeMethodExplicitBodyPrimitiveResultMultipleViewResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
    return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
        res := v.(*serviceexplicitbodyprimitiveresultmultipleviewviews.Resulttypemultipleviews)
        w.Header().Set("goa-view", res.View)
        enc := encoder(ctx, w)
        body := res.Projected.A
        if res.Projected.C != nil {
            w.Header().Set("Location", *res.Projected.C)
        }
        w.WriteHeader(http.StatusOK)
        return enc.Encode(body)
    }
}
`
var ExplicitBodyUserResultMultipleViewsDSL = func() {
    var UserType = Type("UserType", func() {
        Attribute("x", String)
        Attribute("y", Int)
    })
    var ResultType = ResultType("ResultTypeMultipleViews", func() {
        Attribute("a", UserType)
        Attribute("b", String)
        Attribute("c", String)
        View("default", func() {
            Attribute("a")
            Attribute("b")
            Attribute("c")
        })
        View("tiny", func() {
            Attribute("a")
            Attribute("c")
        })
    })
    Service("ServiceExplicitBodyUserResultMultipleView", func() {
        Method("MethodExplicitBodyUserResultMultipleView", func() {
            Result(ResultType)
            HTTP(func() {
                POST("/")
                Response(StatusOK, func() {
                    Header("c:Location")
                    Body("a")
                })
            })
        })
    })
}
var ExplicitBodyUserResultMultipleViewsDecodeCode = `// DecodeMethodExplicitBodyUserResultMultipleViewResponse returns a decoder for
// responses returned by the ServiceExplicitBodyUserResultMultipleView
// MethodExplicitBodyUserResultMultipleView endpoint. restoreBody controls
// whether the response body should be restored after having been read.
func DecodeMethodExplicitBodyUserResultMultipleViewResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) {
    return func(resp *http.Response) (interface{}, error) {
        if restoreBody {
            b, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                return nil, err
            }
            resp.Body = ioutil.NopCloser(bytes.NewBuffer(b))
            defer func() {
                resp.Body = ioutil.NopCloser(bytes.NewBuffer(b))
            }()
        } else {
            defer resp.Body.Close()
        }
        switch resp.StatusCode {
        case http.StatusOK:
            var (
                body UserType
                err  error
            )
            err = decoder(resp).Decode(&body)
            if err != nil {
                return nil, goahttp.ErrDecodingError("ServiceExplicitBodyUserResultMultipleView", "MethodExplicitBodyUserResultMultipleView", err)
            }
            var (
                c *string
            )
            cRaw := resp.Header.Get("Location")
            if cRaw != "" {
                c = &cRaw
            }
            p := NewMethodExplicitBodyUserResultMultipleViewResulttypemultipleviewsOK(&body, c)
            view := resp.Header.Get("goa-view")
            vres := &serviceexplicitbodyuserresultmultipleviewviews.Resulttypemultipleviews{p, view}
            if err = vres.Validate(); err != nil {
                return nil, goahttp.ErrValidationError("ServiceExplicitBodyUserResultMultipleView", "MethodExplicitBodyUserResultMultipleView", err)
            }
            return serviceexplicitbodyuserresultmultipleview.NewResulttypemultipleviews(vres), nil
        default:
            body, _ := ioutil.ReadAll(resp.Body)
            return nil, goahttp.ErrInvalidResponse("ServiceExplicitBodyUserResultMultipleView", "MethodExplicitBodyUserResultMultipleView", resp.StatusCode, string(body))
        }
    }
}
`
var ExplicitBodyUserResultMultipleViewsEncodeCode = `// EncodeMethodExplicitBodyUserResultMultipleViewResponse returns an encoder
// for responses returned by the ServiceExplicitBodyUserResultMultipleView
// MethodExplicitBodyUserResultMultipleView endpoint.
func EncodeMethodExplicitBodyUserResultMultipleViewResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
    return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
        res := v.(*serviceexplicitbodyuserresultmultipleviewviews.Resulttypemultipleviews)
        w.Header().Set("goa-view", res.View)
        enc := encoder(ctx, w)
        body := NewUserType(res.Projected)
        if res.Projected.C != nil {
            w.Header().Set("Location", *res.Projected.C)
        }
        w.WriteHeader(http.StatusOK)
        return enc.Encode(body)
    }
}
`
var MapQueryObjectBuildCode = `// BuildMethodMapQueryObjectPayload builds the payload for the
// ServiceMapQueryObject MethodMapQueryObject endpoint from CLI flags.
func BuildMethodMapQueryObjectPayload(serviceMapQueryObjectMethodMapQueryObjectBody string, serviceMapQueryObjectMethodMapQueryObjectA string, serviceMapQueryObjectMethodMapQueryObjectC string) (*servicemapqueryobject.PayloadType, error) {
    var err error
    var body MethodMapQueryObjectRequestBody
    {
        err = json.Unmarshal([]byte(serviceMapQueryObjectMethodMapQueryObjectBody), &body)
        if err != nil {
            return nil, fmt.Errorf("invalid JSON for body, example of valid JSON:\n%s", "'{\n      \"b\": \"patternb\"\n   }'")
        }
        if body.B != nil {
            err = goa.MergeErrors(err, goa.ValidatePattern("body.b", *body.B, "patternb"))
        }
        if err != nil {
            return nil, err
        }
    }
    var a string
    {
        a = serviceMapQueryObjectMethodMapQueryObjectA
    }
    var c map[int][]string
    {
        err = json.Unmarshal([]byte(serviceMapQueryObjectMethodMapQueryObjectC), &c)
        if err != nil {
            return nil, fmt.Errorf("invalid JSON for c, example of valid JSON:\n%s", "'{\n      \"1484745265794365762\": [\n         \"Similique aspernatur.\",\n         \"Error explicabo.\",\n         \"Minima cumque voluptatem et distinctio aliquam.\",\n         \"Blanditiis ut eaque.\"\n      ],\n      \"4925854623691091547\": [\n         \"Eos aut ipsam.\",\n         \"Aliquam tempora.\"\n      ],\n      \"7174751143827362498\": [\n         \"Facilis minus explicabo nemo eos vel repellat.\",\n         \"Voluptatum magni aperiam qui.\"\n      ]\n   }'")
        }
        err = goa.MergeErrors(err, goa.ValidatePattern("c.a", c.A, "patterna"))
        if c.B != nil {
            err = goa.MergeErrors(err, goa.ValidatePattern("c.b", *c.B, "patternb"))
        }
        if err != nil {
            return nil, err
        }
    }
    if err != nil {
        return nil, err
    }
    v := &servicemapqueryobject.PayloadType{
        B: body.B,
    }
    v.A = a
    v.C = c
    return v, nil
}
`
var MapQueryParseCode = `// ParseEndpoint returns the endpoint and payload as specified on the command
// line.
func ParseEndpoint(
    scheme, host string,
    doer goahttp.Doer,
    enc func(*http.Request) goahttp.Encoder,
    dec func(*http.Response) goahttp.Decoder,
    restore bool,
) (goa.Endpoint, interface{}, error) {
    var (
        serviceMapQueryPrimitiveArrayFlags = flag.NewFlagSet("service-map-query-primitive-array", flag.ContinueOnError)

        serviceMapQueryPrimitiveArrayMapQueryPrimitiveArrayFlags = flag.NewFlagSet("map-query-primitive-array", flag.ExitOnError)
        serviceMapQueryPrimitiveArrayMapQueryPrimitiveArrayPFlag = serviceMapQueryPrimitiveArrayMapQueryPrimitiveArrayFlags.String("p", "REQUIRED", "map[string][]uint is the payload type of the ServiceMapQueryPrimitiveArray service MapQueryPrimitiveArray method.")
    )
    serviceMapQueryPrimitiveArrayFlags.Usage = serviceMapQueryPrimitiveArrayUsage
    serviceMapQueryPrimitiveArrayMapQueryPrimitiveArrayFlags.Usage = serviceMapQueryPrimitiveArrayMapQueryPrimitiveArrayUsage

    if err := flag.CommandLine.Parse(os.Args[1:]); err != nil {
        return nil, nil, err
    }

    if len(os.Args) < flag.NFlag()+3 {
        return nil, nil, fmt.Errorf("not enough arguments")
    }

    var (
        svcn string
        svcf *flag.FlagSet
    )
    {
        svcn = os.Args[1+flag.NFlag()]
        switch svcn {
        case "service-map-query-primitive-array":
            svcf = serviceMapQueryPrimitiveArrayFlags
        default:
            return nil, nil, fmt.Errorf("unknown service %q", svcn)
        }
    }
    if err := svcf.Parse(os.Args[2+flag.NFlag():]); err != nil {
        return nil, nil, err
    }

    var (
        epn string
        epf *flag.FlagSet
    )
    {
        epn = os.Args[2+flag.NFlag()+svcf.NFlag()]
        switch svcn {
        case "service-map-query-primitive-array":
            switch epn {
            case "map-query-primitive-array":
                epf = serviceMapQueryPrimitiveArrayMapQueryPrimitiveArrayFlags

            }

        }
    }
    if epf == nil {
        return nil, nil, fmt.Errorf("unknown %q endpoint %q", svcn, epn)
    }

    // Parse endpoint flags if any
    if len(os.Args) > 2+flag.NFlag()+svcf.NFlag() {
        if err := epf.Parse(os.Args[3+flag.NFlag()+svcf.NFlag():]); err != nil {
            return nil, nil, err
        }
    }

    var (
        data     interface{}
        endpoint goa.Endpoint
        err      error
    )
    {
        switch svcn {
        case "service-map-query-primitive-array":
            c := servicemapqueryprimitivearrayc.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "map-query-primitive-array":
                endpoint = c.MapQueryPrimitiveArray()
                var err error
                var val map[string][]uint
                err = json.Unmarshal([]byte(*serviceMapQueryPrimitiveArrayMapQueryPrimitiveArrayPFlag), &val)
                data = val
                if err != nil {
                    return nil, nil, fmt.Errorf("invalid JSON for serviceMapQueryPrimitiveArrayMapQueryPrimitiveArrayPFlag, example of valid JSON:\n%s", "'{\n      \"Iste perspiciatis.\": [\n         567408540461384614,\n         5721637919286150856\n      ],\n      \"Itaque inventore optio.\": [\n         944964629895926327,\n         593430823343775997\n      ],\n      \"Molestias recusandae doloribus qui quia.\": [\n         6921210467234244263,\n         3742304935485895874,\n         4170793618430505438,\n         7388093990298529880\n      ]\n   }'")
                }
            }
        }
    }
    if err != nil {
        return nil, nil, err
    }

    return endpoint, data, nil
}
`
var MultiBuildCode = `// BuildMethodMultiPayloadPayload builds the payload for the ServiceMulti
// MethodMultiPayload endpoint from CLI flags.
func BuildMethodMultiPayloadPayload(serviceMultiMethodMultiPayloadBody string, serviceMultiMethodMultiPayloadB string, serviceMultiMethodMultiPayloadA string) (*servicemulti.MethodMultiPayloadPayload, error) {
    var err error
    var body MethodMultiPayloadRequestBody
    {
        err = json.Unmarshal([]byte(serviceMultiMethodMultiPayloadBody), &body)
        if err != nil {
            return nil, fmt.Errorf("invalid JSON for body, example of valid JSON:\n%s", "'{\n      \"c\": {\n         \"att\": false,\n         \"att10\": \"Aspernatur quo error explicabo pariatur.\",\n         \"att11\": \"Q3VtcXVlIHZvbHVwdGF0ZW0u\",\n         \"att12\": \"Distinctio aliquam nihil blanditiis ut.\",\n         \"att13\": [\n            \"Nihil excepturi deserunt quasi omnis sed.\",\n            \"Sit maiores aperiam autem non ea rem.\"\n         ],\n         \"att14\": {\n            \"Excepturi totam.\": \"Ut aut facilis vel ipsam.\",\n            \"Minima et aut non sunt consequuntur.\": \"Et consequuntur porro quasi.\",\n            \"Quis voluptates quaerat et temporibus facere.\": \"Ipsam eaque sunt maxime suscipit.\"\n         },\n         \"att15\": {\n            \"inline\": \"Ea alias repellat nobis veritatis.\"\n         },\n         \"att2\": 3504438334001971349,\n         \"att3\": 2005839040,\n         \"att4\": 5845720715558772393,\n         \"att5\": 2900634008447043830,\n         \"att6\": 1865618013,\n         \"att7\": 1484745265794365762,\n         \"att8\": 0.11815318,\n         \"att9\": 0.30907290919538355\n      }\n   }'")
        }
    }
    var b *string
    {
        if serviceMultiMethodMultiPayloadB != "" {
            b = &serviceMultiMethodMultiPayloadB
        }
    }
    var a *bool
    {
        if serviceMultiMethodMultiPayloadA != "" {
            val, err := strconv.ParseBool(serviceMultiMethodMultiPayloadA)
            a = &val
            if err != nil {
                err = fmt.Errorf("invalid value for a, must be BOOL")
            }
        }
    }
    if err != nil {
        return nil, err
    }
    v := &servicemulti.MethodMultiPayloadPayload{}
    if body.C != nil {
        v.C = marshalUserTypeRequestBodyToUserType(body.C)
    }
    v.B = b
    v.A = a
    return v, nil
}
`
var MultiDSL = func() {
    var UserType = Type("UserType", func() {
        Attribute("att", Boolean)
        Attribute("att2", Int)
        Attribute("att3", Int32)
        Attribute("att4", Int64)
        Attribute("att5", UInt)
        Attribute("att6", UInt32)
        Attribute("att7", UInt64)
        Attribute("att8", Float32)
        Attribute("att9", Float64)
        Attribute("att10", String)
        Attribute("att11", Bytes)
        Attribute("att12", Any)
        Attribute("att13", ArrayOf(String))
        Attribute("att14", MapOf(String, String))
        Attribute("att15", func() {
            Attribute("inline")
        })
        Attribute("att16", "UserType")
    })

    Service("ServiceMulti", func() {
        Method("MethodMultiNoPayload", func() {
            HTTP(func() {
                GET("/")
            })
        })
        Method("MethodMultiPayload", func() {
            Payload(func() {
                Attribute("a", Boolean)
                Attribute("b", String)
                Attribute("c", UserType)
            })
            HTTP(func() {
                Header("a")
                Param("b")
                POST("/")
            })
        })
    })
}
var MultiNoPayloadDSL = func() {
    Service("ServiceMultiNoPayload1", func() {
        Method("MethodServiceNoPayload11", func() {
            HTTP(func() {
                GET("/11")
            })
        })
        Method("MethodServiceNoPayload12", func() {
            HTTP(func() {
                GET("/12")
            })
        })
    })
    Service("ServiceMultiNoPayload2", func() {
        Method("MethodServiceNoPayload21", func() {
            HTTP(func() {
                GET("/21")
            })
        })
        Method("MethodServiceNoPayload22", func() {
            HTTP(func() {
                GET("/22")
            })
        })
    })
}
var MultiNoPayloadParseCode = `// ParseEndpoint returns the endpoint and payload as specified on the command
// line.
func ParseEndpoint(
    scheme, host string,
    doer goahttp.Doer,
    enc func(*http.Request) goahttp.Encoder,
    dec func(*http.Response) goahttp.Decoder,
    restore bool,
) (goa.Endpoint, interface{}, error) {
    var (
        serviceMultiNoPayload1Flags = flag.NewFlagSet("service-multi-no-payload1", flag.ContinueOnError)

        serviceMultiNoPayload1MethodServiceNoPayload11Flags = flag.NewFlagSet("method-service-no-payload11", flag.ExitOnError)

        serviceMultiNoPayload1MethodServiceNoPayload12Flags = flag.NewFlagSet("method-service-no-payload12", flag.ExitOnError)

        serviceMultiNoPayload2Flags = flag.NewFlagSet("service-multi-no-payload2", flag.ContinueOnError)

        serviceMultiNoPayload2MethodServiceNoPayload21Flags = flag.NewFlagSet("method-service-no-payload21", flag.ExitOnError)

        serviceMultiNoPayload2MethodServiceNoPayload22Flags = flag.NewFlagSet("method-service-no-payload22", flag.ExitOnError)
    )
    serviceMultiNoPayload1Flags.Usage = serviceMultiNoPayload1Usage
    serviceMultiNoPayload1MethodServiceNoPayload11Flags.Usage = serviceMultiNoPayload1MethodServiceNoPayload11Usage
    serviceMultiNoPayload1MethodServiceNoPayload12Flags.Usage = serviceMultiNoPayload1MethodServiceNoPayload12Usage

    serviceMultiNoPayload2Flags.Usage = serviceMultiNoPayload2Usage
    serviceMultiNoPayload2MethodServiceNoPayload21Flags.Usage = serviceMultiNoPayload2MethodServiceNoPayload21Usage
    serviceMultiNoPayload2MethodServiceNoPayload22Flags.Usage = serviceMultiNoPayload2MethodServiceNoPayload22Usage

    if err := flag.CommandLine.Parse(os.Args[1:]); err != nil {
        return nil, nil, err
    }

    if len(os.Args) < flag.NFlag()+3 {
        return nil, nil, fmt.Errorf("not enough arguments")
    }

    var (
        svcn string
        svcf *flag.FlagSet
    )
    {
        svcn = os.Args[1+flag.NFlag()]
        switch svcn {
        case "service-multi-no-payload1":
            svcf = serviceMultiNoPayload1Flags
        case "service-multi-no-payload2":
            svcf = serviceMultiNoPayload2Flags
        default:
            return nil, nil, fmt.Errorf("unknown service %q", svcn)
        }
    }
    if err := svcf.Parse(os.Args[2+flag.NFlag():]); err != nil {
        return nil, nil, err
    }

    var (
        epn string
        epf *flag.FlagSet
    )
    {
        epn = os.Args[2+flag.NFlag()+svcf.NFlag()]
        switch svcn {
        case "service-multi-no-payload1":
            switch epn {
            case "method-service-no-payload11":
                epf = serviceMultiNoPayload1MethodServiceNoPayload11Flags

            case "method-service-no-payload12":
                epf = serviceMultiNoPayload1MethodServiceNoPayload12Flags

            }

        case "service-multi-no-payload2":
            switch epn {
            case "method-service-no-payload21":
                epf = serviceMultiNoPayload2MethodServiceNoPayload21Flags

            case "method-service-no-payload22":
                epf = serviceMultiNoPayload2MethodServiceNoPayload22Flags

            }

        }
    }
    if epf == nil {
        return nil, nil, fmt.Errorf("unknown %q endpoint %q", svcn, epn)
    }

    // Parse endpoint flags if any
    if len(os.Args) > 2+flag.NFlag()+svcf.NFlag() {
        if err := epf.Parse(os.Args[3+flag.NFlag()+svcf.NFlag():]); err != nil {
            return nil, nil, err
        }
    }

    var (
        data     interface{}
        endpoint goa.Endpoint
        err      error
    )
    {
        switch svcn {
        case "service-multi-no-payload1":
            c := servicemultinopayload1c.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "method-service-no-payload11":
                endpoint = c.MethodServiceNoPayload11()
                data = nil
            case "method-service-no-payload12":
                endpoint = c.MethodServiceNoPayload12()
                data = nil
            }
        case "service-multi-no-payload2":
            c := servicemultinopayload2c.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "method-service-no-payload21":
                endpoint = c.MethodServiceNoPayload21()
                data = nil
            case "method-service-no-payload22":
                endpoint = c.MethodServiceNoPayload22()
                data = nil
            }
        }
    }
    if err != nil {
        return nil, nil, err
    }

    return endpoint, data, nil
}
`
var MultiParseCode = `// ParseEndpoint returns the endpoint and payload as specified on the command
// line.
func ParseEndpoint(
    scheme, host string,
    doer goahttp.Doer,
    enc func(*http.Request) goahttp.Encoder,
    dec func(*http.Response) goahttp.Decoder,
    restore bool,
) (goa.Endpoint, interface{}, error) {
    var (
        serviceMultiFlags = flag.NewFlagSet("service-multi", flag.ContinueOnError)

        serviceMultiMethodMultiNoPayloadFlags = flag.NewFlagSet("method-multi-no-payload", flag.ExitOnError)

        serviceMultiMethodMultiPayloadFlags    = flag.NewFlagSet("method-multi-payload", flag.ExitOnError)
        serviceMultiMethodMultiPayloadBodyFlag = serviceMultiMethodMultiPayloadFlags.String("body", "REQUIRED", "")
        serviceMultiMethodMultiPayloadBFlag    = serviceMultiMethodMultiPayloadFlags.String("b", "", "")
        serviceMultiMethodMultiPayloadAFlag    = serviceMultiMethodMultiPayloadFlags.String("a", "", "")
    )
    serviceMultiFlags.Usage = serviceMultiUsage
    serviceMultiMethodMultiNoPayloadFlags.Usage = serviceMultiMethodMultiNoPayloadUsage
    serviceMultiMethodMultiPayloadFlags.Usage = serviceMultiMethodMultiPayloadUsage

    if err := flag.CommandLine.Parse(os.Args[1:]); err != nil {
        return nil, nil, err
    }

    if len(os.Args) < flag.NFlag()+3 {
        return nil, nil, fmt.Errorf("not enough arguments")
    }

    var (
        svcn string
        svcf *flag.FlagSet
    )
    {
        svcn = os.Args[1+flag.NFlag()]
        switch svcn {
        case "service-multi":
            svcf = serviceMultiFlags
        default:
            return nil, nil, fmt.Errorf("unknown service %q", svcn)
        }
    }
    if err := svcf.Parse(os.Args[2+flag.NFlag():]); err != nil {
        return nil, nil, err
    }

    var (
        epn string
        epf *flag.FlagSet
    )
    {
        epn = os.Args[2+flag.NFlag()+svcf.NFlag()]
        switch svcn {
        case "service-multi":
            switch epn {
            case "method-multi-no-payload":
                epf = serviceMultiMethodMultiNoPayloadFlags

            case "method-multi-payload":
                epf = serviceMultiMethodMultiPayloadFlags

            }

        }
    }
    if epf == nil {
        return nil, nil, fmt.Errorf("unknown %q endpoint %q", svcn, epn)
    }

    // Parse endpoint flags if any
    if len(os.Args) > 2+flag.NFlag()+svcf.NFlag() {
        if err := epf.Parse(os.Args[3+flag.NFlag()+svcf.NFlag():]); err != nil {
            return nil, nil, err
        }
    }

    var (
        data     interface{}
        endpoint goa.Endpoint
        err      error
    )
    {
        switch svcn {
        case "service-multi":
            c := servicemultic.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "method-multi-no-payload":
                endpoint = c.MethodMultiNoPayload()
                data = nil
            case "method-multi-payload":
                endpoint = c.MethodMultiPayload()
                data, err = servicemultic.BuildMethodMultiPayloadPayload(*serviceMultiMethodMultiPayloadBodyFlag, *serviceMultiMethodMultiPayloadBFlag, *serviceMultiMethodMultiPayloadAFlag)
            }
        }
    }
    if err != nil {
        return nil, nil, err
    }

    return endpoint, data, nil
}
`
var MultiRequiredPayloadDSL = func() {
    Service("ServiceMultiRequired1", func() {
        Method("MethodMultiRequiredPayload", func() {
            Payload(func() {
                Attribute("a", Boolean)
                Required("a")
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
    Service("ServiceMultiRequired2", func() {
        Method("MethodMultiRequiredNoPayload", func() {
            HTTP(func() {
                GET("/2")
            })
        })
        Method("MethodMultiRequiredPayload", func() {
            Payload(func() {
                Attribute("a", Boolean)
                Required("a")
            })
            HTTP(func() {
                POST("/2")
                Param("a")
            })
        })
    })
}
var MultiRequiredPayloadParseCode = `// ParseEndpoint returns the endpoint and payload as specified on the command
// line.
func ParseEndpoint(
    scheme, host string,
    doer goahttp.Doer,
    enc func(*http.Request) goahttp.Encoder,
    dec func(*http.Response) goahttp.Decoder,
    restore bool,
) (goa.Endpoint, interface{}, error) {
    var (
        serviceMultiRequired1Flags = flag.NewFlagSet("service-multi-required1", flag.ContinueOnError)

        serviceMultiRequired1MethodMultiRequiredPayloadFlags    = flag.NewFlagSet("method-multi-required-payload", flag.ExitOnError)
        serviceMultiRequired1MethodMultiRequiredPayloadBodyFlag = serviceMultiRequired1MethodMultiRequiredPayloadFlags.String("body", "REQUIRED", "")

        serviceMultiRequired2Flags = flag.NewFlagSet("service-multi-required2", flag.ContinueOnError)

        serviceMultiRequired2MethodMultiRequiredNoPayloadFlags = flag.NewFlagSet("method-multi-required-no-payload", flag.ExitOnError)

        serviceMultiRequired2MethodMultiRequiredPayloadFlags = flag.NewFlagSet("method-multi-required-payload", flag.ExitOnError)
        serviceMultiRequired2MethodMultiRequiredPayloadAFlag = serviceMultiRequired2MethodMultiRequiredPayloadFlags.String("a", "REQUIRED", "")
    )
    serviceMultiRequired1Flags.Usage = serviceMultiRequired1Usage
    serviceMultiRequired1MethodMultiRequiredPayloadFlags.Usage = serviceMultiRequired1MethodMultiRequiredPayloadUsage

    serviceMultiRequired2Flags.Usage = serviceMultiRequired2Usage
    serviceMultiRequired2MethodMultiRequiredNoPayloadFlags.Usage = serviceMultiRequired2MethodMultiRequiredNoPayloadUsage
    serviceMultiRequired2MethodMultiRequiredPayloadFlags.Usage = serviceMultiRequired2MethodMultiRequiredPayloadUsage

    if err := flag.CommandLine.Parse(os.Args[1:]); err != nil {
        return nil, nil, err
    }

    if len(os.Args) < flag.NFlag()+3 {
        return nil, nil, fmt.Errorf("not enough arguments")
    }

    var (
        svcn string
        svcf *flag.FlagSet
    )
    {
        svcn = os.Args[1+flag.NFlag()]
        switch svcn {
        case "service-multi-required1":
            svcf = serviceMultiRequired1Flags
        case "service-multi-required2":
            svcf = serviceMultiRequired2Flags
        default:
            return nil, nil, fmt.Errorf("unknown service %q", svcn)
        }
    }
    if err := svcf.Parse(os.Args[2+flag.NFlag():]); err != nil {
        return nil, nil, err
    }

    var (
        epn string
        epf *flag.FlagSet
    )
    {
        epn = os.Args[2+flag.NFlag()+svcf.NFlag()]
        switch svcn {
        case "service-multi-required1":
            switch epn {
            case "method-multi-required-payload":
                epf = serviceMultiRequired1MethodMultiRequiredPayloadFlags

            }

        case "service-multi-required2":
            switch epn {
            case "method-multi-required-no-payload":
                epf = serviceMultiRequired2MethodMultiRequiredNoPayloadFlags

            case "method-multi-required-payload":
                epf = serviceMultiRequired2MethodMultiRequiredPayloadFlags

            }

        }
    }
    if epf == nil {
        return nil, nil, fmt.Errorf("unknown %q endpoint %q", svcn, epn)
    }

    // Parse endpoint flags if any
    if len(os.Args) > 2+flag.NFlag()+svcf.NFlag() {
        if err := epf.Parse(os.Args[3+flag.NFlag()+svcf.NFlag():]); err != nil {
            return nil, nil, err
        }
    }

    var (
        data     interface{}
        endpoint goa.Endpoint
        err      error
    )
    {
        switch svcn {
        case "service-multi-required1":
            c := servicemultirequired1c.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "method-multi-required-payload":
                endpoint = c.MethodMultiRequiredPayload()
                data, err = servicemultirequired1c.BuildMethodMultiRequiredPayloadPayload(*serviceMultiRequired1MethodMultiRequiredPayloadBodyFlag)
            }
        case "service-multi-required2":
            c := servicemultirequired2c.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "method-multi-required-no-payload":
                endpoint = c.MethodMultiRequiredNoPayload()
                data = nil
            case "method-multi-required-payload":
                endpoint = c.MethodMultiRequiredPayload()
                data, err = servicemultirequired2c.BuildMethodMultiRequiredPayloadPayload(*serviceMultiRequired2MethodMultiRequiredPayloadAFlag)
            }
        }
    }
    if err != nil {
        return nil, nil, err
    }

    return endpoint, data, nil
}
`
var MultiSimpleBuildCode = `// BuildMethodMultiSimplePayloadPayload builds the payload for the
// ServiceMultiSimple1 MethodMultiSimplePayload endpoint from CLI flags.
func BuildMethodMultiSimplePayloadPayload(serviceMultiSimple1MethodMultiSimplePayloadBody string) (*servicemultisimple1.MethodMultiSimplePayloadPayload, error) {
    var err error
    var body MethodMultiSimplePayloadRequestBody
    {
        err = json.Unmarshal([]byte(serviceMultiSimple1MethodMultiSimplePayloadBody), &body)
        if err != nil {
            return nil, fmt.Errorf("invalid JSON for body, example of valid JSON:\n%s", "'{\n      \"a\": false\n   }'")
        }
    }
    if err != nil {
        return nil, err
    }
    v := &servicemultisimple1.MethodMultiSimplePayloadPayload{
        A: body.A,
    }
    return v, nil
}
`
var MultiSimpleDSL = func() {
    Service("ServiceMultiSimple1", func() {
        Method("MethodMultiSimpleNoPayload", func() {
            HTTP(func() {
                GET("/")
            })
        })
        Method("MethodMultiSimplePayload", func() {
            Payload(func() {
                Attribute("a", Boolean)
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
    Service("ServiceMultiSimple2", func() {
        Method("MethodMultiSimpleNoPayload", func() {
            HTTP(func() {
                GET("/2")
            })
        })
        Method("MethodMultiSimplePayload", func() {
            Payload(func() {
                Attribute("a", Boolean)
            })
            HTTP(func() {
                POST("/2")
            })
        })
    })
}
var MultiSimpleParseCode = `// ParseEndpoint returns the endpoint and payload as specified on the command
// line.
func ParseEndpoint(
    scheme, host string,
    doer goahttp.Doer,
    enc func(*http.Request) goahttp.Encoder,
    dec func(*http.Response) goahttp.Decoder,
    restore bool,
) (goa.Endpoint, interface{}, error) {
    var (
        serviceMultiSimple1Flags = flag.NewFlagSet("service-multi-simple1", flag.ContinueOnError)

        serviceMultiSimple1MethodMultiSimpleNoPayloadFlags = flag.NewFlagSet("method-multi-simple-no-payload", flag.ExitOnError)

        serviceMultiSimple1MethodMultiSimplePayloadFlags    = flag.NewFlagSet("method-multi-simple-payload", flag.ExitOnError)
        serviceMultiSimple1MethodMultiSimplePayloadBodyFlag = serviceMultiSimple1MethodMultiSimplePayloadFlags.String("body", "REQUIRED", "")

        serviceMultiSimple2Flags = flag.NewFlagSet("service-multi-simple2", flag.ContinueOnError)

        serviceMultiSimple2MethodMultiSimpleNoPayloadFlags = flag.NewFlagSet("method-multi-simple-no-payload", flag.ExitOnError)

        serviceMultiSimple2MethodMultiSimplePayloadFlags    = flag.NewFlagSet("method-multi-simple-payload", flag.ExitOnError)
        serviceMultiSimple2MethodMultiSimplePayloadBodyFlag = serviceMultiSimple2MethodMultiSimplePayloadFlags.String("body", "REQUIRED", "")
    )
    serviceMultiSimple1Flags.Usage = serviceMultiSimple1Usage
    serviceMultiSimple1MethodMultiSimpleNoPayloadFlags.Usage = serviceMultiSimple1MethodMultiSimpleNoPayloadUsage
    serviceMultiSimple1MethodMultiSimplePayloadFlags.Usage = serviceMultiSimple1MethodMultiSimplePayloadUsage

    serviceMultiSimple2Flags.Usage = serviceMultiSimple2Usage
    serviceMultiSimple2MethodMultiSimpleNoPayloadFlags.Usage = serviceMultiSimple2MethodMultiSimpleNoPayloadUsage
    serviceMultiSimple2MethodMultiSimplePayloadFlags.Usage = serviceMultiSimple2MethodMultiSimplePayloadUsage

    if err := flag.CommandLine.Parse(os.Args[1:]); err != nil {
        return nil, nil, err
    }

    if len(os.Args) < flag.NFlag()+3 {
        return nil, nil, fmt.Errorf("not enough arguments")
    }

    var (
        svcn string
        svcf *flag.FlagSet
    )
    {
        svcn = os.Args[1+flag.NFlag()]
        switch svcn {
        case "service-multi-simple1":
            svcf = serviceMultiSimple1Flags
        case "service-multi-simple2":
            svcf = serviceMultiSimple2Flags
        default:
            return nil, nil, fmt.Errorf("unknown service %q", svcn)
        }
    }
    if err := svcf.Parse(os.Args[2+flag.NFlag():]); err != nil {
        return nil, nil, err
    }

    var (
        epn string
        epf *flag.FlagSet
    )
    {
        epn = os.Args[2+flag.NFlag()+svcf.NFlag()]
        switch svcn {
        case "service-multi-simple1":
            switch epn {
            case "method-multi-simple-no-payload":
                epf = serviceMultiSimple1MethodMultiSimpleNoPayloadFlags

            case "method-multi-simple-payload":
                epf = serviceMultiSimple1MethodMultiSimplePayloadFlags

            }

        case "service-multi-simple2":
            switch epn {
            case "method-multi-simple-no-payload":
                epf = serviceMultiSimple2MethodMultiSimpleNoPayloadFlags

            case "method-multi-simple-payload":
                epf = serviceMultiSimple2MethodMultiSimplePayloadFlags

            }

        }
    }
    if epf == nil {
        return nil, nil, fmt.Errorf("unknown %q endpoint %q", svcn, epn)
    }

    // Parse endpoint flags if any
    if len(os.Args) > 2+flag.NFlag()+svcf.NFlag() {
        if err := epf.Parse(os.Args[3+flag.NFlag()+svcf.NFlag():]); err != nil {
            return nil, nil, err
        }
    }

    var (
        data     interface{}
        endpoint goa.Endpoint
        err      error
    )
    {
        switch svcn {
        case "service-multi-simple1":
            c := servicemultisimple1c.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "method-multi-simple-no-payload":
                endpoint = c.MethodMultiSimpleNoPayload()
                data = nil
            case "method-multi-simple-payload":
                endpoint = c.MethodMultiSimplePayload()
                data, err = servicemultisimple1c.BuildMethodMultiSimplePayloadPayload(*serviceMultiSimple1MethodMultiSimplePayloadBodyFlag)
            }
        case "service-multi-simple2":
            c := servicemultisimple2c.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "method-multi-simple-no-payload":
                endpoint = c.MethodMultiSimpleNoPayload()
                data = nil
            case "method-multi-simple-payload":
                endpoint = c.MethodMultiSimplePayload()
                data, err = servicemultisimple2c.BuildMethodMultiSimplePayloadPayload(*serviceMultiSimple2MethodMultiSimplePayloadBodyFlag)
            }
        }
    }
    if err != nil {
        return nil, nil, err
    }

    return endpoint, data, nil
}
`
var MultipartArrayTypeDecoderFuncCode = `// NewServiceMultipartArrayTypeMethodMultipartArrayTypeDecoder returns a
// decoder to decode the multipart request for the "ServiceMultipartArrayType"
// service "MethodMultipartArrayType" endpoint.
func NewServiceMultipartArrayTypeMethodMultipartArrayTypeDecoder(mux goahttp.Muxer, ServiceMultipartArrayTypeMethodMultipartArrayTypeDecoderFn ServiceMultipartArrayTypeMethodMultipartArrayTypeDecoderFunc) func(r *http.Request) goahttp.Decoder {
    return func(r *http.Request) goahttp.Decoder {
        return goahttp.EncodingFunc(func(v interface{}) error {
            mr, merr := r.MultipartReader()
            if merr != nil {
                return merr
            }
            p := v.(*[]*servicemultipartarraytype.PayloadType)
            if err := ServiceMultipartArrayTypeMethodMultipartArrayTypeDecoderFn(mr, p); err != nil {
                return err
            }
            return nil
        })
    }
}
`
var MultipartArrayTypeDecoderFuncTypeCode = `// ServiceMultipartArrayTypeMethodMultipartArrayTypeDecoderFunc is the type to
// decode multipart request for the "ServiceMultipartArrayType" service
// "MethodMultipartArrayType" endpoint.
type ServiceMultipartArrayTypeMethodMultipartArrayTypeDecoderFunc func(*multipart.Reader, *[]*servicemultipartarraytype.PayloadType) error
`
var MultipartArrayTypeEncoderFuncCode = `// NewServiceMultipartArrayTypeMethodMultipartArrayTypeEncoder returns an
// encoder to encode the multipart request for the "ServiceMultipartArrayType"
// service "MethodMultipartArrayType" endpoint.
func NewServiceMultipartArrayTypeMethodMultipartArrayTypeEncoder(encoderFn ServiceMultipartArrayTypeMethodMultipartArrayTypeEncoderFunc) func(r *http.Request) goahttp.Encoder {
    return func(r *http.Request) goahttp.Encoder {
        body := &bytes.Buffer{}
        mw := multipart.NewWriter(body)
        return goahttp.EncodingFunc(func(v interface{}) error {
            p := v.([]*servicemultipartarraytype.PayloadType)
            if err := encoderFn(mw, p); err != nil {
                return err
            }
            r.Body = ioutil.NopCloser(body)
            r.Header.Set("Content-Type", mw.FormDataContentType())
            return mw.Close()
        })
    }
}
`
var MultipartArrayTypeEncoderFuncTypeCode = `// ServiceMultipartArrayTypeMethodMultipartArrayTypeEncoderFunc is the type to
// encode multipart request for the "ServiceMultipartArrayType" service
// "MethodMultipartArrayType" endpoint.
type ServiceMultipartArrayTypeMethodMultipartArrayTypeEncoderFunc func(*multipart.Writer, []*servicemultipartarraytype.PayloadType) error
`
var MultipartMapTypeDecoderFuncCode = `// NewServiceMultipartMapTypeMethodMultipartMapTypeDecoder returns a decoder to
// decode the multipart request for the "ServiceMultipartMapType" service
// "MethodMultipartMapType" endpoint.
func NewServiceMultipartMapTypeMethodMultipartMapTypeDecoder(mux goahttp.Muxer, ServiceMultipartMapTypeMethodMultipartMapTypeDecoderFn ServiceMultipartMapTypeMethodMultipartMapTypeDecoderFunc) func(r *http.Request) goahttp.Decoder {
    return func(r *http.Request) goahttp.Decoder {
        return goahttp.EncodingFunc(func(v interface{}) error {
            mr, merr := r.MultipartReader()
            if merr != nil {
                return merr
            }
            p := v.(*map[string]int)
            if err := ServiceMultipartMapTypeMethodMultipartMapTypeDecoderFn(mr, p); err != nil {
                return err
            }
            return nil
        })
    }
}
`
var MultipartMapTypeDecoderFuncTypeCode = `// ServiceMultipartMapTypeMethodMultipartMapTypeDecoderFunc is the type to
// decode multipart request for the "ServiceMultipartMapType" service
// "MethodMultipartMapType" endpoint.
type ServiceMultipartMapTypeMethodMultipartMapTypeDecoderFunc func(*multipart.Reader, *map[string]int) error
`
var MultipartMapTypeEncoderFuncCode = `// NewServiceMultipartMapTypeMethodMultipartMapTypeEncoder returns an encoder
// to encode the multipart request for the "ServiceMultipartMapType" service
// "MethodMultipartMapType" endpoint.
func NewServiceMultipartMapTypeMethodMultipartMapTypeEncoder(encoderFn ServiceMultipartMapTypeMethodMultipartMapTypeEncoderFunc) func(r *http.Request) goahttp.Encoder {
    return func(r *http.Request) goahttp.Encoder {
        body := &bytes.Buffer{}
        mw := multipart.NewWriter(body)
        return goahttp.EncodingFunc(func(v interface{}) error {
            p := v.(map[string]int)
            if err := encoderFn(mw, p); err != nil {
                return err
            }
            r.Body = ioutil.NopCloser(body)
            r.Header.Set("Content-Type", mw.FormDataContentType())
            return mw.Close()
        })
    }
}
`
var MultipartMapTypeEncoderFuncTypeCode = `// ServiceMultipartMapTypeMethodMultipartMapTypeEncoderFunc is the type to
// encode multipart request for the "ServiceMultipartMapType" service
// "MethodMultipartMapType" endpoint.
type ServiceMultipartMapTypeMethodMultipartMapTypeEncoderFunc func(*multipart.Writer, map[string]int) error
`
var MultipartPrimitiveDecoderFuncCode = `// NewServiceMultipartPrimitiveMethodMultipartPrimitiveDecoder returns a
// decoder to decode the multipart request for the "ServiceMultipartPrimitive"
// service "MethodMultipartPrimitive" endpoint.
func NewServiceMultipartPrimitiveMethodMultipartPrimitiveDecoder(mux goahttp.Muxer, ServiceMultipartPrimitiveMethodMultipartPrimitiveDecoderFn ServiceMultipartPrimitiveMethodMultipartPrimitiveDecoderFunc) func(r *http.Request) goahttp.Decoder {
    return func(r *http.Request) goahttp.Decoder {
        return goahttp.EncodingFunc(func(v interface{}) error {
            mr, merr := r.MultipartReader()
            if merr != nil {
                return merr
            }
            p := v.(*string)
            if err := ServiceMultipartPrimitiveMethodMultipartPrimitiveDecoderFn(mr, p); err != nil {
                return err
            }
            return nil
        })
    }
}
`
var MultipartPrimitiveDecoderFuncTypeCode = `// ServiceMultipartPrimitiveMethodMultipartPrimitiveDecoderFunc is the type to
// decode multipart request for the "ServiceMultipartPrimitive" service
// "MethodMultipartPrimitive" endpoint.
type ServiceMultipartPrimitiveMethodMultipartPrimitiveDecoderFunc func(*multipart.Reader, *string) error
`
var MultipartPrimitiveEncoderFuncCode = `// NewServiceMultipartPrimitiveMethodMultipartPrimitiveEncoder returns an
// encoder to encode the multipart request for the "ServiceMultipartPrimitive"
// service "MethodMultipartPrimitive" endpoint.
func NewServiceMultipartPrimitiveMethodMultipartPrimitiveEncoder(encoderFn ServiceMultipartPrimitiveMethodMultipartPrimitiveEncoderFunc) func(r *http.Request) goahttp.Encoder {
    return func(r *http.Request) goahttp.Encoder {
        body := &bytes.Buffer{}
        mw := multipart.NewWriter(body)
        return goahttp.EncodingFunc(func(v interface{}) error {
            p := v.(string)
            if err := encoderFn(mw, p); err != nil {
                return err
            }
            r.Body = ioutil.NopCloser(body)
            r.Header.Set("Content-Type", mw.FormDataContentType())
            return mw.Close()
        })
    }
}
`
var MultipartPrimitiveEncoderFuncTypeCode = `// ServiceMultipartPrimitiveMethodMultipartPrimitiveEncoderFunc is the type to
// encode multipart request for the "ServiceMultipartPrimitive" service
// "MethodMultipartPrimitive" endpoint.
type ServiceMultipartPrimitiveMethodMultipartPrimitiveEncoderFunc func(*multipart.Writer, string) error
`
var MultipartUserTypeDecoderFuncCode = `// NewServiceMultipartUserTypeMethodMultipartUserTypeDecoder returns a decoder
// to decode the multipart request for the "ServiceMultipartUserType" service
// "MethodMultipartUserType" endpoint.
func NewServiceMultipartUserTypeMethodMultipartUserTypeDecoder(mux goahttp.Muxer, ServiceMultipartUserTypeMethodMultipartUserTypeDecoderFn ServiceMultipartUserTypeMethodMultipartUserTypeDecoderFunc) func(r *http.Request) goahttp.Decoder {
    return func(r *http.Request) goahttp.Decoder {
        return goahttp.EncodingFunc(func(v interface{}) error {
            mr, merr := r.MultipartReader()
            if merr != nil {
                return merr
            }
            p := v.(**servicemultipartusertype.MethodMultipartUserTypePayload)
            if err := ServiceMultipartUserTypeMethodMultipartUserTypeDecoderFn(mr, p); err != nil {
                return err
            }
            return nil
        })
    }
}
`
var MultipartUserTypeDecoderFuncTypeCode = `// ServiceMultipartUserTypeMethodMultipartUserTypeDecoderFunc is the type to
// decode multipart request for the "ServiceMultipartUserType" service
// "MethodMultipartUserType" endpoint.
type ServiceMultipartUserTypeMethodMultipartUserTypeDecoderFunc func(*multipart.Reader, **servicemultipartusertype.MethodMultipartUserTypePayload) error
`
var MultipartUserTypeEncoderFuncCode = `// NewServiceMultipartUserTypeMethodMultipartUserTypeEncoder returns an encoder
// to encode the multipart request for the "ServiceMultipartUserType" service
// "MethodMultipartUserType" endpoint.
func NewServiceMultipartUserTypeMethodMultipartUserTypeEncoder(encoderFn ServiceMultipartUserTypeMethodMultipartUserTypeEncoderFunc) func(r *http.Request) goahttp.Encoder {
    return func(r *http.Request) goahttp.Encoder {
        body := &bytes.Buffer{}
        mw := multipart.NewWriter(body)
        return goahttp.EncodingFunc(func(v interface{}) error {
            p := v.(*servicemultipartusertype.MethodMultipartUserTypePayload)
            if err := encoderFn(mw, p); err != nil {
                return err
            }
            r.Body = ioutil.NopCloser(body)
            r.Header.Set("Content-Type", mw.FormDataContentType())
            return mw.Close()
        })
    }
}
`
var MultipartUserTypeEncoderFuncTypeCode = `// ServiceMultipartUserTypeMethodMultipartUserTypeEncoderFunc is the type to
// encode multipart request for the "ServiceMultipartUserType" service
// "MethodMultipartUserType" endpoint.
type ServiceMultipartUserTypeMethodMultipartUserTypeEncoderFunc func(*multipart.Writer, *servicemultipartusertype.MethodMultipartUserTypePayload) error
`
var MultipartWithParamDecoderFuncCode = `// NewServiceMultipartWithParamMethodMultipartWithParamDecoder returns a
// decoder to decode the multipart request for the "ServiceMultipartWithParam"
// service "MethodMultipartWithParam" endpoint.
func NewServiceMultipartWithParamMethodMultipartWithParamDecoder(mux goahttp.Muxer, ServiceMultipartWithParamMethodMultipartWithParamDecoderFn ServiceMultipartWithParamMethodMultipartWithParamDecoderFunc) func(r *http.Request) goahttp.Decoder {
    return func(r *http.Request) goahttp.Decoder {
        return goahttp.EncodingFunc(func(v interface{}) error {
            mr, merr := r.MultipartReader()
            if merr != nil {
                return merr
            }
            p := v.(**servicemultipartwithparam.PayloadType)
            if err := ServiceMultipartWithParamMethodMultipartWithParamDecoderFn(mr, p); err != nil {
                return err
            }

            var (
                c   map[int][]string
                err error
            )
            {
                cRaw := r.URL.Query()
                if len(cRaw) == 0 {
                    err = goa.MergeErrors(err, goa.MissingFieldError("c", "query string"))
                }
                c = make(map[int][]string, len(cRaw))
                for keyRaw, val := range cRaw {
                    var key int
                    {
                        v, err2 := strconv.ParseInt(keyRaw, 10, strconv.IntSize)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "integer"))
                        }
                        key = int(v)
                    }
                    c[key] = val
                }
            }
            if err != nil {
                return err
            }
            (*p).C = c
            return nil
        })
    }
}
`
var MultipartWithParamEncoderFuncCode = `// NewServiceMultipartWithParamMethodMultipartWithParamEncoder returns an
// encoder to encode the multipart request for the "ServiceMultipartWithParam"
// service "MethodMultipartWithParam" endpoint.
func NewServiceMultipartWithParamMethodMultipartWithParamEncoder(encoderFn ServiceMultipartWithParamMethodMultipartWithParamEncoderFunc) func(r *http.Request) goahttp.Encoder {
    return func(r *http.Request) goahttp.Encoder {
        body := &bytes.Buffer{}
        mw := multipart.NewWriter(body)
        return goahttp.EncodingFunc(func(v interface{}) error {
            p := v.(*servicemultipartwithparam.PayloadType)
            if err := encoderFn(mw, p); err != nil {
                return err
            }
            r.Body = ioutil.NopCloser(body)
            r.Header.Set("Content-Type", mw.FormDataContentType())
            return mw.Close()
        })
    }
}
`
var MultipartWithParamsAndHeadersDecoderFuncCode = `// NewServiceMultipartWithParamsAndHeadersMethodMultipartWithParamsAndHeadersDecoder
// returns a decoder to decode the multipart request for the
// "ServiceMultipartWithParamsAndHeaders" service
// "MethodMultipartWithParamsAndHeaders" endpoint.
func NewServiceMultipartWithParamsAndHeadersMethodMultipartWithParamsAndHeadersDecoder(mux goahttp.Muxer, ServiceMultipartWithParamsAndHeadersMethodMultipartWithParamsAndHeadersDecoderFn ServiceMultipartWithParamsAndHeadersMethodMultipartWithParamsAndHeadersDecoderFunc) func(r *http.Request) goahttp.Decoder {
    return func(r *http.Request) goahttp.Decoder {
        return goahttp.EncodingFunc(func(v interface{}) error {
            mr, merr := r.MultipartReader()
            if merr != nil {
                return merr
            }
            p := v.(**servicemultipartwithparamsandheaders.PayloadType)
            if err := ServiceMultipartWithParamsAndHeadersMethodMultipartWithParamsAndHeadersDecoderFn(mr, p); err != nil {
                return err
            }
            var (
                a   string
                c   map[int][]string
                b   *string
                err error

                params = mux.Vars(r)
            )
            a = params["a"]
            err = goa.MergeErrors(err, goa.ValidatePattern("a", a, "patterna"))
            {
                cRaw := r.URL.Query()
                if len(cRaw) == 0 {
                    err = goa.MergeErrors(err, goa.MissingFieldError("c", "query string"))
                }
                c = make(map[int][]string, len(cRaw))
                for keyRaw, val := range cRaw {
                    var key int
                    {
                        v, err2 := strconv.ParseInt(keyRaw, 10, strconv.IntSize)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "integer"))
                        }
                        key = int(v)
                    }
                    c[key] = val
                }
            }
            bRaw := r.Header.Get("Authorization")
            if bRaw != "" {
                b = &bRaw
            }
            if b != nil {
                err = goa.MergeErrors(err, goa.ValidatePattern("b", *b, "patternb"))
            }
            if err != nil {
                return err
            }
            (*p).A = a
            (*p).C = c
            (*p).B = b
            return nil
        })
    }
}
`
var MultipartWithParamsAndHeadersEncoderFuncCode = `// NewServiceMultipartWithParamsAndHeadersMethodMultipartWithParamsAndHeadersEncoder
// returns an encoder to encode the multipart request for the
// "ServiceMultipartWithParamsAndHeaders" service
// "MethodMultipartWithParamsAndHeaders" endpoint.
func NewServiceMultipartWithParamsAndHeadersMethodMultipartWithParamsAndHeadersEncoder(encoderFn ServiceMultipartWithParamsAndHeadersMethodMultipartWithParamsAndHeadersEncoderFunc) func(r *http.Request) goahttp.Encoder {
    return func(r *http.Request) goahttp.Encoder {
        body := &bytes.Buffer{}
        mw := multipart.NewWriter(body)
        return goahttp.EncodingFunc(func(v interface{}) error {
            p := v.(*servicemultipartwithparamsandheaders.PayloadType)
            if err := encoderFn(mw, p); err != nil {
                return err
            }
            r.Body = ioutil.NopCloser(body)
            r.Header.Set("Content-Type", mw.FormDataContentType())
            return mw.Close()
        })
    }
}
`
var PathAlternativesCode = `// MethodPathAlternativesServicePathAlternativesPath returns the URL path to the ServicePathAlternatives service MethodPathAlternatives HTTP endpoint.
func MethodPathAlternativesServicePathAlternativesPath(a string, b string) string {
    return fmt.Sprintf("/one/%v/two/%v/three", a, b)
}

// MethodPathAlternativesServicePathAlternativesPath2 returns the URL path to the ServicePathAlternatives service MethodPathAlternatives HTTP endpoint.
func MethodPathAlternativesServicePathAlternativesPath2(b string, a string) string {
    return fmt.Sprintf("/one/two/%v/three/%v", b, a)
}
`
var PathAlternativesDSL = func() {
    Service("ServicePathAlternatives", func() {
        Method("MethodPathAlternatives", func() {
            Payload(func() {
                Attribute("a", String)
                Attribute("b", String)
            })
            HTTP(func() {
                GET("one/{a}/two/{b}/three")
                POST("one/two/{b}/three/{a}")
            })
        })
    })
}
var PathBoolSliceParamCode = `// MethodPathBoolSliceParamServicePathBoolSliceParamPath returns the URL path to the ServicePathBoolSliceParam service MethodPathBoolSliceParam HTTP endpoint.
func MethodPathBoolSliceParamServicePathBoolSliceParamPath(a []bool) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = strconv.FormatBool(v)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathBoolSliceParamDSL = func() {
    Service("ServicePathBoolSliceParam", func() {
        Method("MethodPathBoolSliceParam", func() {
            Payload(ArrayOf(Boolean))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathFloat32SliceParamCode = `// MethodPathFloat32SliceParamServicePathFloat32SliceParamPath returns the URL path to the ServicePathFloat32SliceParam service MethodPathFloat32SliceParam HTTP endpoint.
func MethodPathFloat32SliceParamServicePathFloat32SliceParamPath(a []float32) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = strconv.FormatFloat(float64(v), 'f', -1, 32)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathFloat32SliceParamDSL = func() {
    Service("ServicePathFloat32SliceParam", func() {
        Method("MethodPathFloat32SliceParam", func() {
            Payload(ArrayOf(Float32))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathFloat64SliceParamCode = `// MethodPathFloat64SliceParamServicePathFloat64SliceParamPath returns the URL path to the ServicePathFloat64SliceParam service MethodPathFloat64SliceParam HTTP endpoint.
func MethodPathFloat64SliceParamServicePathFloat64SliceParamPath(a []float64) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = strconv.FormatFloat(v, 'f', -1, 64)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathFloat64SliceParamDSL = func() {
    Service("ServicePathFloat64SliceParam", func() {
        Method("MethodPathFloat64SliceParam", func() {
            Payload(ArrayOf(Float64))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathInt32SliceParamCode = `// MethodPathInt32SliceParamServicePathInt32SliceParamPath returns the URL path to the ServicePathInt32SliceParam service MethodPathInt32SliceParam HTTP endpoint.
func MethodPathInt32SliceParamServicePathInt32SliceParamPath(a []int32) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = strconv.FormatInt(int64(v), 10)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathInt32SliceParamDSL = func() {
    Service("ServicePathInt32SliceParam", func() {
        Method("MethodPathInt32SliceParam", func() {
            Payload(ArrayOf(Int32))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathInt64SliceParamCode = `// MethodPathInt64SliceParamServicePathInt64SliceParamPath returns the URL path to the ServicePathInt64SliceParam service MethodPathInt64SliceParam HTTP endpoint.
func MethodPathInt64SliceParamServicePathInt64SliceParamPath(a []int64) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = strconv.FormatInt(v, 10)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathInt64SliceParamDSL = func() {
    Service("ServicePathInt64SliceParam", func() {
        Method("MethodPathInt64SliceParam", func() {
            Payload(ArrayOf(Int64))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathIntSliceParamCode = `// MethodPathIntSliceParamServicePathIntSliceParamPath returns the URL path to the ServicePathIntSliceParam service MethodPathIntSliceParam HTTP endpoint.
func MethodPathIntSliceParamServicePathIntSliceParamPath(a []int) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = strconv.FormatInt(int64(v), 10)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathIntSliceParamDSL = func() {
    Service("ServicePathIntSliceParam", func() {
        Method("MethodPathIntSliceParam", func() {
            Payload(ArrayOf(Int))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathInterfaceSliceParamCode = `// MethodPathInterfaceSliceParamServicePathInterfaceSliceParamPath returns the URL path to the ServicePathInterfaceSliceParam service MethodPathInterfaceSliceParam HTTP endpoint.
func MethodPathInterfaceSliceParamServicePathInterfaceSliceParamPath(a []interface{}) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = url.QueryEscape(fmt.Sprintf("%v", v))
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathInterfaceSliceParamDSL = func() {
    Service("ServicePathInterfaceSliceParam", func() {
        Method("MethodPathInterfaceSliceParam", func() {
            Payload(ArrayOf(Any))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathMultipleParamsCode = `// MethodPathMultipleParamServicePathMultipleParamPath returns the URL path to the ServicePathMultipleParam service MethodPathMultipleParam HTTP endpoint.
func MethodPathMultipleParamServicePathMultipleParamPath(a string, b string) string {
    return fmt.Sprintf("/one/%v/two/%v/three", a, b)
}
`
var PathMultipleParamsDSL = func() {
    Service("ServicePathMultipleParam", func() {
        Method("MethodPathMultipleParam", func() {
            Payload(func() {
                Attribute("a", String)
                Attribute("b", String)
            })
            HTTP(func() {
                GET("one/{a}/two/{b}/three")
            })
        })
    })
}
var PathNoParamCode = `// MethodPathNoParamServicePathNoParamPath returns the URL path to the ServicePathNoParam service MethodPathNoParam HTTP endpoint.
func MethodPathNoParamServicePathNoParamPath() string {
    return "/one/two"
}
`
var PathNoParamDSL = func() {
    Service("ServicePathNoParam", func() {
        Method("MethodPathNoParam", func() {
            HTTP(func() {
                GET("/one/two")
            })
        })
    })
}
var PathOneParamCode = `// MethodPathOneParamServicePathOneParamPath returns the URL path to the ServicePathOneParam service MethodPathOneParam HTTP endpoint.
func MethodPathOneParamServicePathOneParamPath(a string) string {
    return fmt.Sprintf("/one/%v/two", a)
}
`
var PathOneParamDSL = func() {
    Service("ServicePathOneParam", func() {
        Method("MethodPathOneParam", func() {
            Payload(String)
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathStringSliceParamCode = `// MethodPathStringSliceParamServicePathStringSliceParamPath returns the URL path to the ServicePathStringSliceParam service MethodPathStringSliceParam HTTP endpoint.
func MethodPathStringSliceParamServicePathStringSliceParamPath(a []string) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = url.QueryEscape(v)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathStringSliceParamDSL = func() {
    Service("ServicePathStringSliceParam", func() {
        Method("MethodPathStringSliceParam", func() {
            Payload(ArrayOf(String))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathUint32SliceParamCode = `// MethodPathUint32SliceParamServicePathUint32SliceParamPath returns the URL path to the ServicePathUint32SliceParam service MethodPathUint32SliceParam HTTP endpoint.
func MethodPathUint32SliceParamServicePathUint32SliceParamPath(a []uint32) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = strconv.FormatUint(uint64(v), 10)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathUint32SliceParamDSL = func() {
    Service("ServicePathUint32SliceParam", func() {
        Method("MethodPathUint32SliceParam", func() {
            Payload(ArrayOf(UInt32))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathUint64SliceParamCode = `// MethodPathUint64SliceParamServicePathUint64SliceParamPath returns the URL path to the ServicePathUint64SliceParam service MethodPathUint64SliceParam HTTP endpoint.
func MethodPathUint64SliceParamServicePathUint64SliceParamPath(a []uint64) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = strconv.FormatUint(v, 10)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathUint64SliceParamDSL = func() {
    Service("ServicePathUint64SliceParam", func() {
        Method("MethodPathUint64SliceParam", func() {
            Payload(ArrayOf(UInt64))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PathUintSliceParamCode = `// MethodPathUintSliceParamServicePathUintSliceParamPath returns the URL path to the ServicePathUintSliceParam service MethodPathUintSliceParam HTTP endpoint.
func MethodPathUintSliceParamServicePathUintSliceParamPath(a []uint) string {
    aSlice := make([]string, len(a))
    for i, v := range a {
        aSlice[i] = strconv.FormatUint(uint64(v), 10)
    }
    return fmt.Sprintf("/one/%v/two", strings.Join(aSlice, ", "))
}
`
var PathUintSliceParamDSL = func() {
    Service("ServicePathUintSliceParam", func() {
        Method("MethodPathUintSliceParam", func() {
            Payload(ArrayOf(UInt))
            HTTP(func() {
                GET("one/{a}/two")
            })
        })
    })
}
var PayloadArrayPrimitiveTypeParseCode = `// ParseEndpoint returns the endpoint and payload as specified on the command
// line.
func ParseEndpoint(
    scheme, host string,
    doer goahttp.Doer,
    enc func(*http.Request) goahttp.Encoder,
    dec func(*http.Response) goahttp.Decoder,
    restore bool,
) (goa.Endpoint, interface{}, error) {
    var (
        serviceBodyPrimitiveArrayStringValidateFlags = flag.NewFlagSet("service-body-primitive-array-string-validate", flag.ContinueOnError)

        serviceBodyPrimitiveArrayStringValidateMethodBodyPrimitiveArrayStringValidateFlags = flag.NewFlagSet("method-body-primitive-array-string-validate", flag.ExitOnError)
        serviceBodyPrimitiveArrayStringValidateMethodBodyPrimitiveArrayStringValidatePFlag = serviceBodyPrimitiveArrayStringValidateMethodBodyPrimitiveArrayStringValidateFlags.String("p", "REQUIRED", "[]string is the payload type of the ServiceBodyPrimitiveArrayStringValidate service MethodBodyPrimitiveArrayStringValidate method.")
    )
    serviceBodyPrimitiveArrayStringValidateFlags.Usage = serviceBodyPrimitiveArrayStringValidateUsage
    serviceBodyPrimitiveArrayStringValidateMethodBodyPrimitiveArrayStringValidateFlags.Usage = serviceBodyPrimitiveArrayStringValidateMethodBodyPrimitiveArrayStringValidateUsage

    if err := flag.CommandLine.Parse(os.Args[1:]); err != nil {
        return nil, nil, err
    }

    if len(os.Args) < flag.NFlag()+3 {
        return nil, nil, fmt.Errorf("not enough arguments")
    }

    var (
        svcn string
        svcf *flag.FlagSet
    )
    {
        svcn = os.Args[1+flag.NFlag()]
        switch svcn {
        case "service-body-primitive-array-string-validate":
            svcf = serviceBodyPrimitiveArrayStringValidateFlags
        default:
            return nil, nil, fmt.Errorf("unknown service %q", svcn)
        }
    }
    if err := svcf.Parse(os.Args[2+flag.NFlag():]); err != nil {
        return nil, nil, err
    }

    var (
        epn string
        epf *flag.FlagSet
    )
    {
        epn = os.Args[2+flag.NFlag()+svcf.NFlag()]
        switch svcn {
        case "service-body-primitive-array-string-validate":
            switch epn {
            case "method-body-primitive-array-string-validate":
                epf = serviceBodyPrimitiveArrayStringValidateMethodBodyPrimitiveArrayStringValidateFlags

            }

        }
    }
    if epf == nil {
        return nil, nil, fmt.Errorf("unknown %q endpoint %q", svcn, epn)
    }

    // Parse endpoint flags if any
    if len(os.Args) > 2+flag.NFlag()+svcf.NFlag() {
        if err := epf.Parse(os.Args[3+flag.NFlag()+svcf.NFlag():]); err != nil {
            return nil, nil, err
        }
    }

    var (
        data     interface{}
        endpoint goa.Endpoint
        err      error
    )
    {
        switch svcn {
        case "service-body-primitive-array-string-validate":
            c := servicebodyprimitivearraystringvalidatec.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "method-body-primitive-array-string-validate":
                endpoint = c.MethodBodyPrimitiveArrayStringValidate()
                var err error
                var val []string
                err = json.Unmarshal([]byte(*serviceBodyPrimitiveArrayStringValidateMethodBodyPrimitiveArrayStringValidatePFlag), &val)
                data = val
                if err != nil {
                    return nil, nil, fmt.Errorf("invalid JSON for serviceBodyPrimitiveArrayStringValidateMethodBodyPrimitiveArrayStringValidatePFlag, example of valid JSON:\n%s", "'[\n      \"val\",\n      \"val\",\n      \"val\"\n   ]'")
                }
            }
        }
    }
    if err != nil {
        return nil, nil, err
    }

    return endpoint, data, nil
}
`
var PayloadArrayUserTypeBuildCode = `// BuildMethodBodyInlineArrayUserPayload builds the payload for the
// ServiceBodyInlineArrayUser MethodBodyInlineArrayUser endpoint from CLI flags.
func BuildMethodBodyInlineArrayUserPayload(serviceBodyInlineArrayUserMethodBodyInlineArrayUserBody string) ([]*servicebodyinlinearrayuser.ElemType, error) {
    var err error
    var body []*ElemTypeRequestBody
    {
        err = json.Unmarshal([]byte(serviceBodyInlineArrayUserMethodBodyInlineArrayUserBody), &body)
        if err != nil {
            return nil, fmt.Errorf("invalid JSON for body, example of valid JSON:\n%s", "'[\n      {\n         \"a\": \"patterna\",\n         \"b\": \"patternb\"\n      },\n      {\n         \"a\": \"patterna\",\n         \"b\": \"patternb\"\n      }\n   ]'")
        }
    }
    if err != nil {
        return nil, err
    }
    v := make([]*servicebodyinlinearrayuser.ElemType, len(body))
    for i, val := range body {
        v[i] = &servicebodyinlinearrayuser.ElemType{
            A: val.A,
            B: val.B,
        }
    }
    return v, nil
}
`
var PayloadBodyArrayStringDSL = func() {
    Service("ServiceBodyArrayString", func() {
        Method("MethodBodyArrayString", func() {
            Payload(func() {
                Attribute("b", ArrayOf(String))
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyArrayStringDecodeCode = `// DecodeMethodBodyArrayStringRequest returns a decoder for requests sent to
// the ServiceBodyArrayString MethodBodyArrayString endpoint.
func DecodeMethodBodyArrayStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyArrayStringRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        payload := NewMethodBodyArrayStringPayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyArrayStringEncodeCode = `// EncodeMethodBodyArrayStringRequest returns an encoder for requests sent to
// the ServiceBodyArrayString MethodBodyArrayString server.
func EncodeMethodBodyArrayStringRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyarraystring.MethodBodyArrayStringPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyArrayString", "MethodBodyArrayString", "*servicebodyarraystring.MethodBodyArrayStringPayload", v)
        }
        body := NewMethodBodyArrayStringRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyArrayString", "MethodBodyArrayString", err)
        }
        return nil
    }
}
`
var PayloadBodyArrayStringValidateDSL = func() {
    Service("ServiceBodyArrayStringValidate", func() {
        Method("MethodBodyArrayStringValidate", func() {
            Payload(func() {
                Attribute("b", ArrayOf(String), func() {
                    MinLength(2)
                    Elem(func() {
                        MinLength(3)
                    })
                })
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyArrayStringValidateDecodeCode = `// DecodeMethodBodyArrayStringValidateRequest returns a decoder for requests
// sent to the ServiceBodyArrayStringValidate MethodBodyArrayStringValidate
// endpoint.
func DecodeMethodBodyArrayStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyArrayStringValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyArrayStringValidatePayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyArrayStringValidateEncodeCode = `// EncodeMethodBodyArrayStringValidateRequest returns an encoder for requests
// sent to the ServiceBodyArrayStringValidate MethodBodyArrayStringValidate
// server.
func EncodeMethodBodyArrayStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyarraystringvalidate.MethodBodyArrayStringValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyArrayStringValidate", "MethodBodyArrayStringValidate", "*servicebodyarraystringvalidate.MethodBodyArrayStringValidatePayload", v)
        }
        body := NewMethodBodyArrayStringValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyArrayStringValidate", "MethodBodyArrayStringValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyArrayUserDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("apattern")
        })
    })
    Service("ServiceBodyArrayUser", func() {
        Method("MethodBodyArrayUser", func() {
            Payload(func() {
                Attribute("b", ArrayOf(PayloadType))
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyArrayUserDecodeCode = `// DecodeMethodBodyArrayUserRequest returns a decoder for requests sent to the
// ServiceBodyArrayUser MethodBodyArrayUser endpoint.
func DecodeMethodBodyArrayUserRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyArrayUserRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyArrayUserPayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyArrayUserEncodeCode = `// EncodeMethodBodyArrayUserRequest returns an encoder for requests sent to the
// ServiceBodyArrayUser MethodBodyArrayUser server.
func EncodeMethodBodyArrayUserRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyarrayuser.MethodBodyArrayUserPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyArrayUser", "MethodBodyArrayUser", "*servicebodyarrayuser.MethodBodyArrayUserPayload", v)
        }
        body := NewMethodBodyArrayUserRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyArrayUser", "MethodBodyArrayUser", err)
        }
        return nil
    }
}
`
var PayloadBodyArrayUserValidateDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("apattern")
        })
    })
    Service("ServiceBodyArrayUserValidate", func() {
        Method("MethodBodyArrayUserValidate", func() {
            Payload(func() {
                Attribute("b", ArrayOf(PayloadType), func() {
                    MinLength(2)
                })
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyArrayUserValidateDecodeCode = `// DecodeMethodBodyArrayUserValidateRequest returns a decoder for requests sent
// to the ServiceBodyArrayUserValidate MethodBodyArrayUserValidate endpoint.
func DecodeMethodBodyArrayUserValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyArrayUserValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyArrayUserValidatePayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyArrayUserValidateEncodeCode = `// EncodeMethodBodyArrayUserValidateRequest returns an encoder for requests
// sent to the ServiceBodyArrayUserValidate MethodBodyArrayUserValidate server.
func EncodeMethodBodyArrayUserValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyarrayuservalidate.MethodBodyArrayUserValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyArrayUserValidate", "MethodBodyArrayUserValidate", "*servicebodyarrayuservalidate.MethodBodyArrayUserValidatePayload", v)
        }
        body := NewMethodBodyArrayUserValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyArrayUserValidate", "MethodBodyArrayUserValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyInlineArrayUserConstructorCode = `// NewMethodBodyInlineArrayUserElemType builds a ServiceBodyInlineArrayUser
// service MethodBodyInlineArrayUser endpoint payload.
func NewMethodBodyInlineArrayUserElemType(body []*ElemTypeRequestBody) []*servicebodyinlinearrayuser.ElemType {
    v := make([]*servicebodyinlinearrayuser.ElemType, len(body))
    for i, val := range body {
        v[i] = &servicebodyinlinearrayuser.ElemType{
            A: *val.A,
            B: val.B,
        }
    }
    return v
}
`
var PayloadBodyInlineArrayUserDSL = func() {
    var ElemType = Type("ElemType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Required("a")
    })
    Service("ServiceBodyInlineArrayUser", func() {
        Method("MethodBodyInlineArrayUser", func() {
            Payload(ArrayOf(ElemType))
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyInlineMapUserConstructorCode = `// NewMethodBodyInlineMapUserMapKeyTypeElemType builds a
// ServiceBodyInlineMapUser service MethodBodyInlineMapUser endpoint payload.
func NewMethodBodyInlineMapUserMapKeyTypeElemType(body map[*KeyTypeRequestBody]*ElemTypeRequestBody) map[*servicebodyinlinemapuser.KeyType]*servicebodyinlinemapuser.ElemType {
    v := make(map[*servicebodyinlinemapuser.KeyType]*servicebodyinlinemapuser.ElemType, len(body))
    for key, val := range body {
        tk := &servicebodyinlinemapuser.KeyType{
            A: *key.A,
            B: key.B,
        }
        tv := &servicebodyinlinemapuser.ElemType{
            A: *val.A,
            B: val.B,
        }
        v[tk] = tv
    }
    return v
}
`
var PayloadBodyInlineMapUserDSL = func() {
    var KeyType = Type("KeyType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Required("a")
    })
    var ElemType = Type("ElemType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Required("a")
    })
    Service("ServiceBodyInlineMapUser", func() {
        Method("MethodBodyInlineMapUser", func() {
            Payload(MapOf(KeyType, ElemType))
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyInlineRecursiveUserConstructorCode = `// NewMethodBodyInlineRecursiveUserPayloadType builds a
// ServiceBodyInlineRecursiveUser service MethodBodyInlineRecursiveUser
// endpoint payload.
func NewMethodBodyInlineRecursiveUserPayloadType(body *MethodBodyInlineRecursiveUserRequestBody, a string, b *string) *servicebodyinlinerecursiveuser.PayloadType {
    v := &servicebodyinlinerecursiveuser.PayloadType{}
    v.C = unmarshalPayloadTypeRequestBodyToPayloadType(body.C)
    v.A = a
    v.B = b
    return v
}
`
var PayloadBodyInlineRecursiveUserDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Attribute("c", "PayloadType")
        Required("a", "c")
    })

    Service("ServiceBodyInlineRecursiveUser", func() {
        Method("MethodBodyInlineRecursiveUser", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/{a}")
                Param("b")
            })
        })
    })
}
var PayloadBodyInlineRecursiveUserTransformCode1 = `// unmarshalPayloadTypeRequestBodyToPayloadType builds a value of type
// *servicebodyinlinerecursiveuser.PayloadType from a value of type
// *PayloadTypeRequestBody.
func unmarshalPayloadTypeRequestBodyToPayloadType(v *PayloadTypeRequestBody) *servicebodyinlinerecursiveuser.PayloadType {
    res := &servicebodyinlinerecursiveuser.PayloadType{
        A: *v.A,
        B: v.B,
    }
    res.C = unmarshalPayloadTypeRequestBodyToPayloadType(v.C)

    return res
}
`
var PayloadBodyInlineRecursiveUserTransformCode2 = `// unmarshalPayloadTypeRequestBodyToPayloadType builds a value of type
// *servicebodyinlinerecursiveuser.PayloadType from a value of type
// *PayloadTypeRequestBody.
func unmarshalPayloadTypeRequestBodyToPayloadType(v *PayloadTypeRequestBody) *servicebodyinlinerecursiveuser.PayloadType {
    res := &servicebodyinlinerecursiveuser.PayloadType{
        A: *v.A,
        B: v.B,
    }
    res.C = unmarshalPayloadTypeRequestBodyToPayloadType(v.C)

    return res
}
`
var PayloadBodyInlineRecursiveUserTransformCodeCLI1 = `// marshalPayloadTypeRequestBodyToPayloadType builds a value of type
// *servicebodyinlinerecursiveuser.PayloadType from a value of type
// *PayloadTypeRequestBody.
func marshalPayloadTypeRequestBodyToPayloadType(v *PayloadTypeRequestBody) *servicebodyinlinerecursiveuser.PayloadType {
    res := &servicebodyinlinerecursiveuser.PayloadType{
        A: v.A,
        B: v.B,
    }
    if v.C != nil {
        res.C = marshalPayloadTypeRequestBodyToPayloadType(v.C)
    }

    return res
}
`
var PayloadBodyInlineRecursiveUserTransformCodeCLI2 = `// marshalPayloadTypeToPayloadTypeRequestBody builds a value of type
// *PayloadTypeRequestBody from a value of type
// *servicebodyinlinerecursiveuser.PayloadType.
func marshalPayloadTypeToPayloadTypeRequestBody(v *servicebodyinlinerecursiveuser.PayloadType) *PayloadTypeRequestBody {
    res := &PayloadTypeRequestBody{
        A: v.A,
        B: v.B,
    }
    if v.C != nil {
        res.C = marshalPayloadTypeToPayloadTypeRequestBody(v.C)
    }

    return res
}
`
var PayloadBodyMapStringDSL = func() {
    Service("ServiceBodyMapString", func() {
        Method("MethodBodyMapString", func() {
            Payload(func() {
                Attribute("b", MapOf(String, String))
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyMapStringDecodeCode = `// DecodeMethodBodyMapStringRequest returns a decoder for requests sent to the
// ServiceBodyMapString MethodBodyMapString endpoint.
func DecodeMethodBodyMapStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyMapStringRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        payload := NewMethodBodyMapStringPayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyMapStringEncodeCode = `// EncodeMethodBodyMapStringRequest returns an encoder for requests sent to the
// ServiceBodyMapString MethodBodyMapString server.
func EncodeMethodBodyMapStringRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodymapstring.MethodBodyMapStringPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyMapString", "MethodBodyMapString", "*servicebodymapstring.MethodBodyMapStringPayload", v)
        }
        body := NewMethodBodyMapStringRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyMapString", "MethodBodyMapString", err)
        }
        return nil
    }
}
`
var PayloadBodyMapStringValidateDSL = func() {
    Service("ServiceBodyMapStringValidate", func() {
        Method("MethodBodyMapStringValidate", func() {
            Payload(func() {
                Attribute("b", MapOf(String, String), func() {
                    Elem(func() {
                        MinLength(2)
                    })
                })
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyMapStringValidateDecodeCode = `// DecodeMethodBodyMapStringValidateRequest returns a decoder for requests sent
// to the ServiceBodyMapStringValidate MethodBodyMapStringValidate endpoint.
func DecodeMethodBodyMapStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyMapStringValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyMapStringValidatePayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyMapStringValidateEncodeCode = `// EncodeMethodBodyMapStringValidateRequest returns an encoder for requests
// sent to the ServiceBodyMapStringValidate MethodBodyMapStringValidate server.
func EncodeMethodBodyMapStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodymapstringvalidate.MethodBodyMapStringValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyMapStringValidate", "MethodBodyMapStringValidate", "*servicebodymapstringvalidate.MethodBodyMapStringValidatePayload", v)
        }
        body := NewMethodBodyMapStringValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyMapStringValidate", "MethodBodyMapStringValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyMapUserDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("apattern")
        })
    })
    Service("ServiceBodyMapUser", func() {
        Method("MethodBodyMapUser", func() {
            Payload(func() {
                Attribute("b", MapOf(String, PayloadType))
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyMapUserDecodeCode = `// DecodeMethodBodyMapUserRequest returns a decoder for requests sent to the
// ServiceBodyMapUser MethodBodyMapUser endpoint.
func DecodeMethodBodyMapUserRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyMapUserRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyMapUserPayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyMapUserEncodeCode = `// EncodeMethodBodyMapUserRequest returns an encoder for requests sent to the
// ServiceBodyMapUser MethodBodyMapUser server.
func EncodeMethodBodyMapUserRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodymapuser.MethodBodyMapUserPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyMapUser", "MethodBodyMapUser", "*servicebodymapuser.MethodBodyMapUserPayload", v)
        }
        body := NewMethodBodyMapUserRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyMapUser", "MethodBodyMapUser", err)
        }
        return nil
    }
}
`
var PayloadBodyMapUserValidateDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("apattern")
        })
    })
    Service("ServiceBodyMapUserValidate", func() {
        Method("MethodBodyMapUserValidate", func() {
            Payload(func() {
                Attribute("b", MapOf(String, PayloadType), func() {
                    Key(func() {
                        MinLength(2)
                    })
                })
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyMapUserValidateDecodeCode = `// DecodeMethodBodyMapUserValidateRequest returns a decoder for requests sent
// to the ServiceBodyMapUserValidate MethodBodyMapUserValidate endpoint.
func DecodeMethodBodyMapUserValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyMapUserValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyMapUserValidatePayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyMapUserValidateEncodeCode = `// EncodeMethodBodyMapUserValidateRequest returns an encoder for requests sent
// to the ServiceBodyMapUserValidate MethodBodyMapUserValidate server.
func EncodeMethodBodyMapUserValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodymapuservalidate.MethodBodyMapUserValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyMapUserValidate", "MethodBodyMapUserValidate", "*servicebodymapuservalidate.MethodBodyMapUserValidatePayload", v)
        }
        body := NewMethodBodyMapUserValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyMapUserValidate", "MethodBodyMapUserValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyPathObjectConstructorCode = `// NewMethodBodyPathObjectPayload builds a ServiceBodyPathObject service
// MethodBodyPathObject endpoint payload.
func NewMethodBodyPathObjectPayload(body *MethodBodyPathObjectRequestBody, b string) *servicebodypathobject.MethodBodyPathObjectPayload {
    v := &servicebodypathobject.MethodBodyPathObjectPayload{
        A: body.A,
    }
    v.B = &b
    return v
}
`
var PayloadBodyPathObjectDSL = func() {
    Service("ServiceBodyPathObject", func() {
        Method("MethodBodyPathObject", func() {
            Payload(func() {
                Attribute("a", String)
                Attribute("b", String)
            })
            HTTP(func() {
                POST("/{b}")
            })
        })
    })
}
var PayloadBodyPathObjectDecodeCode = `// DecodeMethodBodyPathObjectRequest returns a decoder for requests sent to the
// ServiceBodyPathObject MethodBodyPathObject endpoint.
func DecodeMethodBodyPathObjectRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyPathObjectRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }

        var (
            b string

            params = mux.Vars(r)
        )
        b = params["b"]
        payload := NewMethodBodyPathObjectPayload(&body, b)

        return payload, nil
    }
}
`
var PayloadBodyPathObjectEncodeCode = `// EncodeMethodBodyPathObjectRequest returns an encoder for requests sent to
// the ServiceBodyPathObject MethodBodyPathObject server.
func EncodeMethodBodyPathObjectRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodypathobject.MethodBodyPathObjectPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPathObject", "MethodBodyPathObject", "*servicebodypathobject.MethodBodyPathObjectPayload", v)
        }
        body := NewMethodBodyPathObjectRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPathObject", "MethodBodyPathObject", err)
        }
        return nil
    }
}
`
var PayloadBodyPathObjectValidateConstructorCode = `// NewMethodBodyPathObjectValidatePayload builds a
// ServiceBodyPathObjectValidate service MethodBodyPathObjectValidate endpoint
// payload.
func NewMethodBodyPathObjectValidatePayload(body *MethodBodyPathObjectValidateRequestBody, b string) *servicebodypathobjectvalidate.MethodBodyPathObjectValidatePayload {
    v := &servicebodypathobjectvalidate.MethodBodyPathObjectValidatePayload{
        A: *body.A,
    }
    v.B = b
    return v
}
`
var PayloadBodyPathObjectValidateDSL = func() {
    Service("ServiceBodyPathObjectValidate", func() {
        Method("MethodBodyPathObjectValidate", func() {
            Payload(func() {
                Attribute("a", String, func() {
                    Pattern("patterna")
                })
                Attribute("b", String, func() {
                    Pattern("patternb")
                })
                Required("a", "b")
            })
            HTTP(func() {
                POST("/{b}")
            })
        })
    })
}
var PayloadBodyPathObjectValidateDecodeCode = `// DecodeMethodBodyPathObjectValidateRequest returns a decoder for requests
// sent to the ServiceBodyPathObjectValidate MethodBodyPathObjectValidate
// endpoint.
func DecodeMethodBodyPathObjectValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyPathObjectValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }

        var (
            b string

            params = mux.Vars(r)
        )
        b = params["b"]
        err = goa.MergeErrors(err, goa.ValidatePattern("b", b, "patternb"))
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyPathObjectValidatePayload(&body, b)

        return payload, nil
    }
}
`
var PayloadBodyPathObjectValidateEncodeCode = `// EncodeMethodBodyPathObjectValidateRequest returns an encoder for requests
// sent to the ServiceBodyPathObjectValidate MethodBodyPathObjectValidate
// server.
func EncodeMethodBodyPathObjectValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodypathobjectvalidate.MethodBodyPathObjectValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPathObjectValidate", "MethodBodyPathObjectValidate", "*servicebodypathobjectvalidate.MethodBodyPathObjectValidatePayload", v)
        }
        body := NewMethodBodyPathObjectValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPathObjectValidate", "MethodBodyPathObjectValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyPathUserConstructorCode = `// NewMethodBodyPathUserPayloadType builds a ServiceBodyPathUser service
// MethodBodyPathUser endpoint payload.
func NewMethodBodyPathUserPayloadType(body *MethodBodyPathUserRequestBody, b string) *servicebodypathuser.PayloadType {
    v := &servicebodypathuser.PayloadType{
        A: body.A,
    }
    v.B = &b
    return v
}
`
var PayloadBodyPathUserDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String)
        Attribute("b", String)
    })
    Service("ServiceBodyPathUser", func() {
        Method("MethodBodyPathUser", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/{b}")
            })
        })
    })
}
var PayloadBodyPathUserDecodeCode = `// DecodeMethodBodyPathUserRequest returns a decoder for requests sent to the
// ServiceBodyPathUser MethodBodyPathUser endpoint.
func DecodeMethodBodyPathUserRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyPathUserRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }

        var (
            b string

            params = mux.Vars(r)
        )
        b = params["b"]
        payload := NewMethodBodyPathUserPayloadType(&body, b)

        return payload, nil
    }
}
`
var PayloadBodyPathUserEncodeCode = `// EncodeMethodBodyPathUserRequest returns an encoder for requests sent to the
// ServiceBodyPathUser MethodBodyPathUser server.
func EncodeMethodBodyPathUserRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodypathuser.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPathUser", "MethodBodyPathUser", "*servicebodypathuser.PayloadType", v)
        }
        body := NewMethodBodyPathUserRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPathUser", "MethodBodyPathUser", err)
        }
        return nil
    }
}
`
var PayloadBodyPathUserValidateConstructorCode = `// NewMethodUserBodyPathValidatePayloadType builds a
// ServiceBodyPathUserValidate service MethodUserBodyPathValidate endpoint
// payload.
func NewMethodUserBodyPathValidatePayloadType(body *MethodUserBodyPathValidateRequestBody, b string) *servicebodypathuservalidate.PayloadType {
    v := &servicebodypathuservalidate.PayloadType{
        A: *body.A,
    }
    v.B = b
    return v
}
`
var PayloadBodyPathUserValidateDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Required("a", "b")
    })
    Service("ServiceBodyPathUserValidate", func() {
        Method("MethodUserBodyPathValidate", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/{b}")
            })
        })
    })
}
var PayloadBodyPathUserValidateDecodeCode = `// DecodeMethodUserBodyPathValidateRequest returns a decoder for requests sent
// to the ServiceBodyPathUserValidate MethodUserBodyPathValidate endpoint.
func DecodeMethodUserBodyPathValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodUserBodyPathValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }

        var (
            b string

            params = mux.Vars(r)
        )
        b = params["b"]
        err = goa.MergeErrors(err, goa.ValidatePattern("b", b, "patternb"))
        if err != nil {
            return nil, err
        }
        payload := NewMethodUserBodyPathValidatePayloadType(&body, b)

        return payload, nil
    }
}
`
var PayloadBodyPathUserValidateEncodeCode = `// EncodeMethodUserBodyPathValidateRequest returns an encoder for requests sent
// to the ServiceBodyPathUserValidate MethodUserBodyPathValidate server.
func EncodeMethodUserBodyPathValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodypathuservalidate.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPathUserValidate", "MethodUserBodyPathValidate", "*servicebodypathuservalidate.PayloadType", v)
        }
        body := NewMethodUserBodyPathValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPathUserValidate", "MethodUserBodyPathValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyPrimitiveArrayBoolValidateDSL = func() {
    Service("ServiceBodyPrimitiveArrayBoolValidate", func() {
        Method("MethodBodyPrimitiveArrayBoolValidate", func() {
            Payload(ArrayOf(Boolean), func() {
                MinLength(1)
                Elem(func() {
                    Enum(true)
                })
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyPrimitiveArrayBoolValidateDecodeCode = `// DecodeMethodBodyPrimitiveArrayBoolValidateRequest returns a decoder for
// requests sent to the ServiceBodyPrimitiveArrayBoolValidate
// MethodBodyPrimitiveArrayBoolValidate endpoint.
func DecodeMethodBodyPrimitiveArrayBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body []bool
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        if len(body) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("body", body, len(body), 1, true))
        }
        for _, e := range body {
            if !(e == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("body[*]", e, []interface{}{true}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := body

        return payload, nil
    }
}
`
var PayloadBodyPrimitiveArrayBoolValidateEncodeCode = `// EncodeMethodBodyPrimitiveArrayBoolValidateRequest returns an encoder for
// requests sent to the ServiceBodyPrimitiveArrayBoolValidate
// MethodBodyPrimitiveArrayBoolValidate server.
func EncodeMethodBodyPrimitiveArrayBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.([]bool)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPrimitiveArrayBoolValidate", "MethodBodyPrimitiveArrayBoolValidate", "[]bool", v)
        }
        body := p
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPrimitiveArrayBoolValidate", "MethodBodyPrimitiveArrayBoolValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyPrimitiveArrayStringValidateDSL = func() {
    Service("ServiceBodyPrimitiveArrayStringValidate", func() {
        Method("MethodBodyPrimitiveArrayStringValidate", func() {
            Payload(ArrayOf(String), func() {
                MinLength(1)
                Elem(func() {
                    Enum("val")
                })
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyPrimitiveArrayStringValidateDecodeCode = `// DecodeMethodBodyPrimitiveArrayStringValidateRequest returns a decoder for
// requests sent to the ServiceBodyPrimitiveArrayStringValidate
// MethodBodyPrimitiveArrayStringValidate endpoint.
func DecodeMethodBodyPrimitiveArrayStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body []string
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        if len(body) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("body", body, len(body), 1, true))
        }
        for _, e := range body {
            if !(e == "val") {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("body[*]", e, []interface{}{"val"}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := body

        return payload, nil
    }
}
`
var PayloadBodyPrimitiveArrayStringValidateEncodeCode = `// EncodeMethodBodyPrimitiveArrayStringValidateRequest returns an encoder for
// requests sent to the ServiceBodyPrimitiveArrayStringValidate
// MethodBodyPrimitiveArrayStringValidate server.
func EncodeMethodBodyPrimitiveArrayStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.([]string)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPrimitiveArrayStringValidate", "MethodBodyPrimitiveArrayStringValidate", "[]string", v)
        }
        body := p
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPrimitiveArrayStringValidate", "MethodBodyPrimitiveArrayStringValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyPrimitiveArrayUserValidateDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("pattern")
        })
        Required("a")
    })
    Service("ServiceBodyPrimitiveArrayUserValidate", func() {
        Method("MethodBodyPrimitiveArrayUserValidate", func() {
            Payload(ArrayOf(PayloadType), func() {
                MinLength(1)
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyPrimitiveArrayUserValidateDecodeCode = `// DecodeMethodBodyPrimitiveArrayUserValidateRequest returns a decoder for
// requests sent to the ServiceBodyPrimitiveArrayUserValidate
// MethodBodyPrimitiveArrayUserValidate endpoint.
func DecodeMethodBodyPrimitiveArrayUserValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body []*PayloadTypeRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        if len(body) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("body", body, len(body), 1, true))
        }
        for _, e := range body {
            if e != nil {
                if err2 := e.Validate(); err2 != nil {
                    err = goa.MergeErrors(err, err2)
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyPrimitiveArrayUserValidatePayloadType(body)

        return payload, nil
    }
}
`
var PayloadBodyPrimitiveArrayUserValidateEncodeCode = `// EncodeMethodBodyPrimitiveArrayUserValidateRequest returns an encoder for
// requests sent to the ServiceBodyPrimitiveArrayUserValidate
// MethodBodyPrimitiveArrayUserValidate server.
func EncodeMethodBodyPrimitiveArrayUserValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.([]*servicebodyprimitivearrayuservalidate.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPrimitiveArrayUserValidate", "MethodBodyPrimitiveArrayUserValidate", "[]*servicebodyprimitivearrayuservalidate.PayloadType", v)
        }
        body := NewPayloadTypeRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPrimitiveArrayUserValidate", "MethodBodyPrimitiveArrayUserValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyPrimitiveBoolValidateDSL = func() {
    Service("ServiceBodyPrimitiveBoolValidate", func() {
        Method("MethodBodyPrimitiveBoolValidate", func() {
            Payload(Boolean, func() {
                Enum(true)
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyPrimitiveBoolValidateDecodeCode = `// DecodeMethodBodyPrimitiveBoolValidateRequest returns a decoder for requests
// sent to the ServiceBodyPrimitiveBoolValidate MethodBodyPrimitiveBoolValidate
// endpoint.
func DecodeMethodBodyPrimitiveBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body bool
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        if body != nil {
            if !(*body == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("body", *body, []interface{}{true}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := body

        return payload, nil
    }
}
`
var PayloadBodyPrimitiveBoolValidateEncodeCode = `// EncodeMethodBodyPrimitiveBoolValidateRequest returns an encoder for requests
// sent to the ServiceBodyPrimitiveBoolValidate MethodBodyPrimitiveBoolValidate
// server.
func EncodeMethodBodyPrimitiveBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(bool)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPrimitiveBoolValidate", "MethodBodyPrimitiveBoolValidate", "bool", v)
        }
        body := p
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPrimitiveBoolValidate", "MethodBodyPrimitiveBoolValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyPrimitiveFieldArrayUserDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", ArrayOf(String))
    })
    Service("ServiceBodyPrimitiveArrayUser", func() {
        Method("MethodBodyPrimitiveArrayUser", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/")
                Body("a")
            })
        })
    })
}
var PayloadBodyPrimitiveFieldArrayUserDecodeCode = `// DecodeMethodBodyPrimitiveArrayUserRequest returns a decoder for requests
// sent to the ServiceBodyPrimitiveArrayUser MethodBodyPrimitiveArrayUser
// endpoint.
func DecodeMethodBodyPrimitiveArrayUserRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body []string
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        payload := NewMethodBodyPrimitiveArrayUserPayloadType(body)

        return payload, nil
    }
}
`
var PayloadBodyPrimitiveFieldArrayUserEncodeCode = `// EncodeMethodBodyPrimitiveArrayUserRequest returns an encoder for requests
// sent to the ServiceBodyPrimitiveArrayUser MethodBodyPrimitiveArrayUser
// server.
func EncodeMethodBodyPrimitiveArrayUserRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyprimitivearrayuser.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPrimitiveArrayUser", "MethodBodyPrimitiveArrayUser", "*servicebodyprimitivearrayuser.PayloadType", v)
        }
        body := p
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPrimitiveArrayUser", "MethodBodyPrimitiveArrayUser", err)
        }
        return nil
    }
}
`
var PayloadBodyPrimitiveFieldArrayUserValidateDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", ArrayOf(String), func() {
            MinLength(1)
            Elem(func() {
                Pattern("pattern")
            })
        })
        Required("a")
    })
    Service("ServiceBodyPrimitiveArrayUserValidate", func() {
        Method("MethodBodyPrimitiveArrayUserValidate", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/")
                Body("a")
            })
        })
    })
}
var PayloadBodyPrimitiveFieldArrayUserValidateDecodeCode = `// DecodeMethodBodyPrimitiveArrayUserValidateRequest returns a decoder for
// requests sent to the ServiceBodyPrimitiveArrayUserValidate
// MethodBodyPrimitiveArrayUserValidate endpoint.
func DecodeMethodBodyPrimitiveArrayUserValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body []string
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        if len(body) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("body", body, len(body), 1, true))
        }
        for _, e := range body {
            err = goa.MergeErrors(err, goa.ValidatePattern("body[*]", e, "pattern"))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyPrimitiveArrayUserValidatePayloadType(body)

        return payload, nil
    }
}
`
var PayloadBodyPrimitiveFieldArrayUserValidateEncodeCode = `// EncodeMethodBodyPrimitiveArrayUserValidateRequest returns an encoder for
// requests sent to the ServiceBodyPrimitiveArrayUserValidate
// MethodBodyPrimitiveArrayUserValidate server.
func EncodeMethodBodyPrimitiveArrayUserValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyprimitivearrayuservalidate.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPrimitiveArrayUserValidate", "MethodBodyPrimitiveArrayUserValidate", "*servicebodyprimitivearrayuservalidate.PayloadType", v)
        }
        body := p
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPrimitiveArrayUserValidate", "MethodBodyPrimitiveArrayUserValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyPrimitiveFieldEmptyDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", ArrayOf(String))
    })
    Service("ServiceBodyPrimitiveArrayUser", func() {
        Method("MethodBodyPrimitiveArrayUser", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/")
                Param("a")
                Body(Empty)
            })
        })
    })
}
var PayloadBodyPrimitiveStringValidateDSL = func() {
    Service("ServiceBodyPrimitiveStringValidate", func() {
        Method("MethodBodyPrimitiveStringValidate", func() {
            Payload(String, func() {
                Enum("val")
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyPrimitiveStringValidateDecodeCode = `// DecodeMethodBodyPrimitiveStringValidateRequest returns a decoder for
// requests sent to the ServiceBodyPrimitiveStringValidate
// MethodBodyPrimitiveStringValidate endpoint.
func DecodeMethodBodyPrimitiveStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body string
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        if body != nil {
            if !(*body == "val") {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("body", *body, []interface{}{"val"}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := body

        return payload, nil
    }
}
`
var PayloadBodyPrimitiveStringValidateEncodeCode = `// EncodeMethodBodyPrimitiveStringValidateRequest returns an encoder for
// requests sent to the ServiceBodyPrimitiveStringValidate
// MethodBodyPrimitiveStringValidate server.
func EncodeMethodBodyPrimitiveStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(string)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyPrimitiveStringValidate", "MethodBodyPrimitiveStringValidate", "string", v)
        }
        body := p
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyPrimitiveStringValidate", "MethodBodyPrimitiveStringValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyQueryObjectConstructorCode = `// NewMethodBodyQueryObjectPayload builds a ServiceBodyQueryObject service
// MethodBodyQueryObject endpoint payload.
func NewMethodBodyQueryObjectPayload(body *MethodBodyQueryObjectRequestBody, b *string) *servicebodyqueryobject.MethodBodyQueryObjectPayload {
    v := &servicebodyqueryobject.MethodBodyQueryObjectPayload{
        A: body.A,
    }
    v.B = b
    return v
}
`
var PayloadBodyQueryObjectDSL = func() {
    Service("ServiceBodyQueryObject", func() {
        Method("MethodBodyQueryObject", func() {
            Payload(func() {
                Attribute("a", String)
                Attribute("b", String)
            })
            HTTP(func() {
                POST("/")
                Param("b")
            })
        })
    })
}
var PayloadBodyQueryObjectDecodeCode = `// DecodeMethodBodyQueryObjectRequest returns a decoder for requests sent to
// the ServiceBodyQueryObject MethodBodyQueryObject endpoint.
func DecodeMethodBodyQueryObjectRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyQueryObjectRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }

        var (
            b *string
        )
        bRaw := r.URL.Query().Get("b")
        if bRaw != "" {
            b = &bRaw
        }
        payload := NewMethodBodyQueryObjectPayload(&body, b)

        return payload, nil
    }
}
`
var PayloadBodyQueryObjectEncodeCode = `// EncodeMethodBodyQueryObjectRequest returns an encoder for requests sent to
// the ServiceBodyQueryObject MethodBodyQueryObject server.
func EncodeMethodBodyQueryObjectRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyqueryobject.MethodBodyQueryObjectPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyQueryObject", "MethodBodyQueryObject", "*servicebodyqueryobject.MethodBodyQueryObjectPayload", v)
        }
        values := req.URL.Query()
        if p.B != nil {
            values.Add("b", *p.B)
        }
        req.URL.RawQuery = values.Encode()
        body := NewMethodBodyQueryObjectRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyQueryObject", "MethodBodyQueryObject", err)
        }
        return nil
    }
}
`
var PayloadBodyQueryObjectValidateConstructorCode = `// NewMethodBodyQueryObjectValidatePayload builds a
// ServiceBodyQueryObjectValidate service MethodBodyQueryObjectValidate
// endpoint payload.
func NewMethodBodyQueryObjectValidatePayload(body *MethodBodyQueryObjectValidateRequestBody, b string) *servicebodyqueryobjectvalidate.MethodBodyQueryObjectValidatePayload {
    v := &servicebodyqueryobjectvalidate.MethodBodyQueryObjectValidatePayload{
        A: *body.A,
    }
    v.B = b
    return v
}
`
var PayloadBodyQueryObjectValidateDSL = func() {
    Service("ServiceBodyQueryObjectValidate", func() {
        Method("MethodBodyQueryObjectValidate", func() {
            Payload(func() {
                Attribute("a", String, func() {
                    Pattern("patterna")
                })
                Attribute("b", String, func() {
                    Pattern("patternb")
                })
                Required("a", "b")
            })
            HTTP(func() {
                POST("/")
                Param("b")
            })
        })
    })
}
var PayloadBodyQueryObjectValidateDecodeCode = `// DecodeMethodBodyQueryObjectValidateRequest returns a decoder for requests
// sent to the ServiceBodyQueryObjectValidate MethodBodyQueryObjectValidate
// endpoint.
func DecodeMethodBodyQueryObjectValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyQueryObjectValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }

        var (
            b string
        )
        b = r.URL.Query().Get("b")
        if b == "" {
            err = goa.MergeErrors(err, goa.MissingFieldError("b", "query string"))
        }
        err = goa.MergeErrors(err, goa.ValidatePattern("b", b, "patternb"))
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyQueryObjectValidatePayload(&body, b)

        return payload, nil
    }
}
`
var PayloadBodyQueryObjectValidateEncodeCode = `// EncodeMethodBodyQueryObjectValidateRequest returns an encoder for requests
// sent to the ServiceBodyQueryObjectValidate MethodBodyQueryObjectValidate
// server.
func EncodeMethodBodyQueryObjectValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyqueryobjectvalidate.MethodBodyQueryObjectValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyQueryObjectValidate", "MethodBodyQueryObjectValidate", "*servicebodyqueryobjectvalidate.MethodBodyQueryObjectValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("b", p.B)
        req.URL.RawQuery = values.Encode()
        body := NewMethodBodyQueryObjectValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyQueryObjectValidate", "MethodBodyQueryObjectValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyQueryPathObjectConstructorCode = `// NewMethodBodyQueryPathObjectPayload builds a ServiceBodyQueryPathObject
// service MethodBodyQueryPathObject endpoint payload.
func NewMethodBodyQueryPathObjectPayload(body *MethodBodyQueryPathObjectRequestBody, c string, b *string) *servicebodyquerypathobject.MethodBodyQueryPathObjectPayload {
    v := &servicebodyquerypathobject.MethodBodyQueryPathObjectPayload{
        A: body.A,
    }
    v.C = &c
    v.B = b
    return v
}
`
var PayloadBodyQueryPathObjectDSL = func() {
    Service("ServiceBodyQueryPathObject", func() {
        Method("MethodBodyQueryPathObject", func() {
            Payload(func() {
                Attribute("a", String)
                Attribute("b", String)
                Attribute("c", String)
            })
            HTTP(func() {
                POST("/{c}")
                Param("b")
            })
        })
    })
}
var PayloadBodyQueryPathObjectDecodeCode = `// DecodeMethodBodyQueryPathObjectRequest returns a decoder for requests sent
// to the ServiceBodyQueryPathObject MethodBodyQueryPathObject endpoint.
func DecodeMethodBodyQueryPathObjectRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyQueryPathObjectRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }

        var (
            c string
            b *string

            params = mux.Vars(r)
        )
        c = params["c"]
        bRaw := r.URL.Query().Get("b")
        if bRaw != "" {
            b = &bRaw
        }
        payload := NewMethodBodyQueryPathObjectPayload(&body, c, b)

        return payload, nil
    }
}
`
var PayloadBodyQueryPathObjectEncodeCode = `// EncodeMethodBodyQueryPathObjectRequest returns an encoder for requests sent
// to the ServiceBodyQueryPathObject MethodBodyQueryPathObject server.
func EncodeMethodBodyQueryPathObjectRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyquerypathobject.MethodBodyQueryPathObjectPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyQueryPathObject", "MethodBodyQueryPathObject", "*servicebodyquerypathobject.MethodBodyQueryPathObjectPayload", v)
        }
        values := req.URL.Query()
        if p.B != nil {
            values.Add("b", *p.B)
        }
        req.URL.RawQuery = values.Encode()
        body := NewMethodBodyQueryPathObjectRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyQueryPathObject", "MethodBodyQueryPathObject", err)
        }
        return nil
    }
}
`
var PayloadBodyQueryPathObjectValidateConstructorCode = `// NewMethodBodyQueryPathObjectValidatePayload builds a
// ServiceBodyQueryPathObjectValidate service MethodBodyQueryPathObjectValidate
// endpoint payload.
func NewMethodBodyQueryPathObjectValidatePayload(body *MethodBodyQueryPathObjectValidateRequestBody, c string, b string) *servicebodyquerypathobjectvalidate.MethodBodyQueryPathObjectValidatePayload {
    v := &servicebodyquerypathobjectvalidate.MethodBodyQueryPathObjectValidatePayload{
        A: *body.A,
    }
    v.C = c
    v.B = b
    return v
}
`
var PayloadBodyQueryPathObjectValidateDSL = func() {
    Service("ServiceBodyQueryPathObjectValidate", func() {
        Method("MethodBodyQueryPathObjectValidate", func() {
            Payload(func() {
                Attribute("a", String, func() {
                    Pattern("patterna")
                })
                Attribute("b", String, func() {
                    Pattern("patternb")
                })
                Attribute("c", String, func() {
                    Pattern("patternc")
                })
                Required("a", "b", "c")
            })
            HTTP(func() {
                POST("/{c}")
                Param("b")
            })
        })
    })
}
var PayloadBodyQueryPathObjectValidateDecodeCode = `// DecodeMethodBodyQueryPathObjectValidateRequest returns a decoder for
// requests sent to the ServiceBodyQueryPathObjectValidate
// MethodBodyQueryPathObjectValidate endpoint.
func DecodeMethodBodyQueryPathObjectValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyQueryPathObjectValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }

        var (
            c string
            b string

            params = mux.Vars(r)
        )
        c = params["c"]
        err = goa.MergeErrors(err, goa.ValidatePattern("c", c, "patternc"))
        b = r.URL.Query().Get("b")
        if b == "" {
            err = goa.MergeErrors(err, goa.MissingFieldError("b", "query string"))
        }
        err = goa.MergeErrors(err, goa.ValidatePattern("b", b, "patternb"))
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyQueryPathObjectValidatePayload(&body, c, b)

        return payload, nil
    }
}
`
var PayloadBodyQueryPathObjectValidateEncodeCode = `// EncodeMethodBodyQueryPathObjectValidateRequest returns an encoder for
// requests sent to the ServiceBodyQueryPathObjectValidate
// MethodBodyQueryPathObjectValidate server.
func EncodeMethodBodyQueryPathObjectValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyquerypathobjectvalidate.MethodBodyQueryPathObjectValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyQueryPathObjectValidate", "MethodBodyQueryPathObjectValidate", "*servicebodyquerypathobjectvalidate.MethodBodyQueryPathObjectValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("b", p.B)
        req.URL.RawQuery = values.Encode()
        body := NewMethodBodyQueryPathObjectValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyQueryPathObjectValidate", "MethodBodyQueryPathObjectValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyQueryPathUserConstructorCode = `// NewMethodBodyQueryPathUserPayloadType builds a ServiceBodyQueryPathUser
// service MethodBodyQueryPathUser endpoint payload.
func NewMethodBodyQueryPathUserPayloadType(body *MethodBodyQueryPathUserRequestBody, c string, b *string) *servicebodyquerypathuser.PayloadType {
    v := &servicebodyquerypathuser.PayloadType{
        A: body.A,
    }
    v.C = &c
    v.B = b
    return v
}
`
var PayloadBodyQueryPathUserDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String)
        Attribute("b", String)
        Attribute("c", String)
    })
    Service("ServiceBodyQueryPathUser", func() {
        Method("MethodBodyQueryPathUser", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/{c}")
                Param("b")
            })
        })
    })
}
var PayloadBodyQueryPathUserDecodeCode = `// DecodeMethodBodyQueryPathUserRequest returns a decoder for requests sent to
// the ServiceBodyQueryPathUser MethodBodyQueryPathUser endpoint.
func DecodeMethodBodyQueryPathUserRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyQueryPathUserRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }

        var (
            c string
            b *string

            params = mux.Vars(r)
        )
        c = params["c"]
        bRaw := r.URL.Query().Get("b")
        if bRaw != "" {
            b = &bRaw
        }
        payload := NewMethodBodyQueryPathUserPayloadType(&body, c, b)

        return payload, nil
    }
}
`
var PayloadBodyQueryPathUserEncodeCode = `// EncodeMethodBodyQueryPathUserRequest returns an encoder for requests sent to
// the ServiceBodyQueryPathUser MethodBodyQueryPathUser server.
func EncodeMethodBodyQueryPathUserRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyquerypathuser.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyQueryPathUser", "MethodBodyQueryPathUser", "*servicebodyquerypathuser.PayloadType", v)
        }
        values := req.URL.Query()
        if p.B != nil {
            values.Add("b", *p.B)
        }
        req.URL.RawQuery = values.Encode()
        body := NewMethodBodyQueryPathUserRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyQueryPathUser", "MethodBodyQueryPathUser", err)
        }
        return nil
    }
}
`
var PayloadBodyQueryPathUserValidateConstructorCode = `// NewMethodBodyQueryPathUserValidatePayloadType builds a
// ServiceBodyQueryPathUserValidate service MethodBodyQueryPathUserValidate
// endpoint payload.
func NewMethodBodyQueryPathUserValidatePayloadType(body *MethodBodyQueryPathUserValidateRequestBody, c string, b string) *servicebodyquerypathuservalidate.PayloadType {
    v := &servicebodyquerypathuservalidate.PayloadType{
        A: *body.A,
    }
    v.C = c
    v.B = b
    return v
}
`
var PayloadBodyQueryPathUserValidateDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Attribute("c", String, func() {
            Pattern("patternc")
        })
        Required("a", "b", "c")
    })
    Service("ServiceBodyQueryPathUserValidate", func() {
        Method("MethodBodyQueryPathUserValidate", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/{c}")
                Param("b")
            })
        })
    })
}
var PayloadBodyQueryPathUserValidateDecodeCode = `// DecodeMethodBodyQueryPathUserValidateRequest returns a decoder for requests
// sent to the ServiceBodyQueryPathUserValidate MethodBodyQueryPathUserValidate
// endpoint.
func DecodeMethodBodyQueryPathUserValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyQueryPathUserValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }

        var (
            c string
            b string

            params = mux.Vars(r)
        )
        c = params["c"]
        err = goa.MergeErrors(err, goa.ValidatePattern("c", c, "patternc"))
        b = r.URL.Query().Get("b")
        if b == "" {
            err = goa.MergeErrors(err, goa.MissingFieldError("b", "query string"))
        }
        err = goa.MergeErrors(err, goa.ValidatePattern("b", b, "patternb"))
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyQueryPathUserValidatePayloadType(&body, c, b)

        return payload, nil
    }
}
`
var PayloadBodyQueryPathUserValidateEncodeCode = `// EncodeMethodBodyQueryPathUserValidateRequest returns an encoder for requests
// sent to the ServiceBodyQueryPathUserValidate MethodBodyQueryPathUserValidate
// server.
func EncodeMethodBodyQueryPathUserValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyquerypathuservalidate.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyQueryPathUserValidate", "MethodBodyQueryPathUserValidate", "*servicebodyquerypathuservalidate.PayloadType", v)
        }
        values := req.URL.Query()
        values.Add("b", p.B)
        req.URL.RawQuery = values.Encode()
        body := NewMethodBodyQueryPathUserValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyQueryPathUserValidate", "MethodBodyQueryPathUserValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyQueryUserConstructorCode = `// NewMethodBodyQueryUserPayloadType builds a ServiceBodyQueryUser service
// MethodBodyQueryUser endpoint payload.
func NewMethodBodyQueryUserPayloadType(body *MethodBodyQueryUserRequestBody, b *string) *servicebodyqueryuser.PayloadType {
    v := &servicebodyqueryuser.PayloadType{
        A: body.A,
    }
    v.B = b
    return v
}
`
var PayloadBodyQueryUserDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String)
        Attribute("b", String)
    })
    Service("ServiceBodyQueryUser", func() {
        Method("MethodBodyQueryUser", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/")
                Param("b")
            })
        })
    })
}
var PayloadBodyQueryUserDecodeCode = `// DecodeMethodBodyQueryUserRequest returns a decoder for requests sent to the
// ServiceBodyQueryUser MethodBodyQueryUser endpoint.
func DecodeMethodBodyQueryUserRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyQueryUserRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }

        var (
            b *string
        )
        bRaw := r.URL.Query().Get("b")
        if bRaw != "" {
            b = &bRaw
        }
        payload := NewMethodBodyQueryUserPayloadType(&body, b)

        return payload, nil
    }
}
`
var PayloadBodyQueryUserEncodeCode = `// EncodeMethodBodyQueryUserRequest returns an encoder for requests sent to the
// ServiceBodyQueryUser MethodBodyQueryUser server.
func EncodeMethodBodyQueryUserRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyqueryuser.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyQueryUser", "MethodBodyQueryUser", "*servicebodyqueryuser.PayloadType", v)
        }
        values := req.URL.Query()
        if p.B != nil {
            values.Add("b", *p.B)
        }
        req.URL.RawQuery = values.Encode()
        body := NewMethodBodyQueryUserRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyQueryUser", "MethodBodyQueryUser", err)
        }
        return nil
    }
}
`
var PayloadBodyQueryUserValidateConstructorCode = `// NewMethodBodyQueryUserValidatePayloadType builds a
// ServiceBodyQueryUserValidate service MethodBodyQueryUserValidate endpoint
// payload.
func NewMethodBodyQueryUserValidatePayloadType(body *MethodBodyQueryUserValidateRequestBody, b string) *servicebodyqueryuservalidate.PayloadType {
    v := &servicebodyqueryuservalidate.PayloadType{
        A: *body.A,
    }
    v.B = b
    return v
}
`
var PayloadBodyQueryUserValidateDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Required("a", "b")
    })
    Service("ServiceBodyQueryUserValidate", func() {
        Method("MethodBodyQueryUserValidate", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/")
                Param("b")
            })
        })
    })
}
var PayloadBodyQueryUserValidateDecodeCode = `// DecodeMethodBodyQueryUserValidateRequest returns a decoder for requests sent
// to the ServiceBodyQueryUserValidate MethodBodyQueryUserValidate endpoint.
func DecodeMethodBodyQueryUserValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyQueryUserValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }

        var (
            b string
        )
        b = r.URL.Query().Get("b")
        if b == "" {
            err = goa.MergeErrors(err, goa.MissingFieldError("b", "query string"))
        }
        err = goa.MergeErrors(err, goa.ValidatePattern("b", b, "patternb"))
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyQueryUserValidatePayloadType(&body, b)

        return payload, nil
    }
}
`
var PayloadBodyQueryUserValidateEncodeCode = `// EncodeMethodBodyQueryUserValidateRequest returns an encoder for requests
// sent to the ServiceBodyQueryUserValidate MethodBodyQueryUserValidate server.
func EncodeMethodBodyQueryUserValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyqueryuservalidate.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyQueryUserValidate", "MethodBodyQueryUserValidate", "*servicebodyqueryuservalidate.PayloadType", v)
        }
        values := req.URL.Query()
        values.Add("b", p.B)
        req.URL.RawQuery = values.Encode()
        body := NewMethodBodyQueryUserValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyQueryUserValidate", "MethodBodyQueryUserValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyStringDSL = func() {
    Service("ServiceBodyString", func() {
        Method("MethodBodyString", func() {
            Payload(func() {
                Attribute("b", String)
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyStringDecodeCode = `// DecodeMethodBodyStringRequest returns a decoder for requests sent to the
// ServiceBodyString MethodBodyString endpoint.
func DecodeMethodBodyStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyStringRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        payload := NewMethodBodyStringPayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyStringEncodeCode = `// EncodeMethodBodyStringRequest returns an encoder for requests sent to the
// ServiceBodyString MethodBodyString server.
func EncodeMethodBodyStringRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodystring.MethodBodyStringPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyString", "MethodBodyString", "*servicebodystring.MethodBodyStringPayload", v)
        }
        body := NewMethodBodyStringRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyString", "MethodBodyString", err)
        }
        return nil
    }
}
`
var PayloadBodyStringValidateDSL = func() {
    Service("ServiceBodyStringValidate", func() {
        Method("MethodBodyStringValidate", func() {
            Payload(func() {
                Attribute("b", String, func() {
                    Pattern("pattern")
                })
                Required("b")
            })
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyStringValidateDecodeCode = `// DecodeMethodBodyStringValidateRequest returns a decoder for requests sent to
// the ServiceBodyStringValidate MethodBodyStringValidate endpoint.
func DecodeMethodBodyStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyStringValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyStringValidatePayload(&body)

        return payload, nil
    }
}
`
var PayloadBodyStringValidateEncodeCode = `// EncodeMethodBodyStringValidateRequest returns an encoder for requests sent
// to the ServiceBodyStringValidate MethodBodyStringValidate server.
func EncodeMethodBodyStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodystringvalidate.MethodBodyStringValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyStringValidate", "MethodBodyStringValidate", "*servicebodystringvalidate.MethodBodyStringValidatePayload", v)
        }
        body := NewMethodBodyStringValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyStringValidate", "MethodBodyStringValidate", err)
        }
        return nil
    }
}
`
var PayloadBodyUserDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String)
    })
    Service("ServiceBodyUser", func() {
        Method("MethodBodyUser", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyUserDecodeCode = `// DecodeMethodBodyUserRequest returns a decoder for requests sent to the
// ServiceBodyUser MethodBodyUser endpoint.
func DecodeMethodBodyUserRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyUserRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        payload := NewMethodBodyUserPayloadType(&body)

        return payload, nil
    }
}
`
var PayloadBodyUserEncodeCode = `// EncodeMethodBodyUserRequest returns an encoder for requests sent to the
// ServiceBodyUser MethodBodyUser server.
func EncodeMethodBodyUserRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyuser.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyUser", "MethodBodyUser", "*servicebodyuser.PayloadType", v)
        }
        body := NewMethodBodyUserRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyUser", "MethodBodyUser", err)
        }
        return nil
    }
}
`
var PayloadBodyUserInnerConstructorCode = `// NewMethodBodyUserInnerPayloadType builds a ServiceBodyUserInner service
// MethodBodyUserInner endpoint payload.
func NewMethodBodyUserInnerPayloadType(body *MethodBodyUserInnerRequestBody) *servicebodyuserinner.PayloadType {
    v := &servicebodyuserinner.PayloadType{}
    if body.Inner != nil {
        v.Inner = unmarshalInnerTypeRequestBodyToInnerType(body.Inner)
    }
    return v
}
`
var PayloadBodyUserInnerDSL = func() {
    var InnerType = Type("InnerType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Required("a")
    })
    var PayloadType = Type("PayloadType", func() {
        Attribute("inner", InnerType)
    })
    Service("ServiceBodyUserInner", func() {
        Method("MethodBodyUserInner", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyUserInnerDefaultConstructorCode = `// NewMethodBodyUserInnerDefaultPayloadType builds a
// ServiceBodyUserInnerDefault service MethodBodyUserInnerDefault endpoint
// payload.
func NewMethodBodyUserInnerDefaultPayloadType(body *MethodBodyUserInnerDefaultRequestBody) *servicebodyuserinnerdefault.PayloadType {
    v := &servicebodyuserinnerdefault.PayloadType{}
    if body.Inner != nil {
        v.Inner = unmarshalInnerTypeRequestBodyToInnerType(body.Inner)
    }
    return v
}
`
var PayloadBodyUserInnerDefaultDSL = func() {
    var InnerType = Type("InnerType", func() {
        Attribute("a", String, func() {
            Default("defaulta")
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Default("defaultb")
            Pattern("patternb")
        })
        Required("a")
    })
    var PayloadType = Type("PayloadType", func() {
        Attribute("inner", InnerType)
    })
    Service("ServiceBodyUserInnerDefault", func() {
        Method("MethodBodyUserInnerDefault", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyUserInnerDefaultTransformCode1 = `// unmarshalInnerTypeRequestBodyToInnerType builds a value of type
// *servicebodyuserinnerdefault.InnerType from a value of type
// *InnerTypeRequestBody.
func unmarshalInnerTypeRequestBodyToInnerType(v *InnerTypeRequestBody) *servicebodyuserinnerdefault.InnerType {
    if v == nil {
        return nil
    }
    res := &servicebodyuserinnerdefault.InnerType{
        A: *v.A,
    }
    if v.B != nil {
        res.B = *v.B
    }
    if v.A == nil {
        res.A = "defaulta"
    }
    if v.B == nil {
        res.B = "defaultb"
    }

    return res
}
`
var PayloadBodyUserInnerDefaultTransformCode2 = `// unmarshalInnerTypeRequestBodyToInnerType builds a value of type
// *servicebodyuserinnerdefault.InnerType from a value of type
// *InnerTypeRequestBody.
func unmarshalInnerTypeRequestBodyToInnerType(v *InnerTypeRequestBody) *servicebodyuserinnerdefault.InnerType {
    if v == nil {
        return nil
    }
    res := &servicebodyuserinnerdefault.InnerType{
        A: *v.A,
    }
    if v.B != nil {
        res.B = *v.B
    }
    if v.A == nil {
        res.A = "defaulta"
    }
    if v.B == nil {
        res.B = "defaultb"
    }

    return res
}
`
var PayloadBodyUserInnerDefaultTransformCodeCLI1 = `// marshalInnerTypeRequestBodyToInnerType builds a value of type
// *servicebodyuserinnerdefault.InnerType from a value of type
// *InnerTypeRequestBody.
func marshalInnerTypeRequestBodyToInnerType(v *InnerTypeRequestBody) *servicebodyuserinnerdefault.InnerType {
    if v == nil {
        return nil
    }
    res := &servicebodyuserinnerdefault.InnerType{
        A: v.A,
        B: v.B,
    }

    return res
}
`
var PayloadBodyUserInnerDefaultTransformCodeCLI2 = `// marshalInnerTypeToInnerTypeRequestBody builds a value of type
// *InnerTypeRequestBody from a value of type
// *servicebodyuserinnerdefault.InnerType.
func marshalInnerTypeToInnerTypeRequestBody(v *servicebodyuserinnerdefault.InnerType) *InnerTypeRequestBody {
    if v == nil {
        return nil
    }
    res := &InnerTypeRequestBody{
        A: v.A,
        B: v.B,
    }

    return res
}
`
var PayloadBodyUserValidateDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("apattern")
        })
    })
    Service("ServiceBodyUserValidate", func() {
        Method("MethodBodyUserValidate", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/")
            })
        })
    })
}
var PayloadBodyUserValidateDecodeCode = `// DecodeMethodBodyUserValidateRequest returns a decoder for requests sent to
// the ServiceBodyUserValidate MethodBodyUserValidate endpoint.
func DecodeMethodBodyUserValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodBodyUserValidateRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }
        payload := NewMethodBodyUserValidatePayloadType(&body)

        return payload, nil
    }
}
`
var PayloadBodyUserValidateEncodeCode = `// EncodeMethodBodyUserValidateRequest returns an encoder for requests sent to
// the ServiceBodyUserValidate MethodBodyUserValidate server.
func EncodeMethodBodyUserValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicebodyuservalidate.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceBodyUserValidate", "MethodBodyUserValidate", "*servicebodyuservalidate.PayloadType", v)
        }
        body := NewMethodBodyUserValidateRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceBodyUserValidate", "MethodBodyUserValidate", err)
        }
        return nil
    }
}
`
var PayloadHeaderArrayStringConstructorCode = `// NewMethodHeaderArrayStringPayload builds a ServiceHeaderArrayString service
// MethodHeaderArrayString endpoint payload.
func NewMethodHeaderArrayStringPayload(h []string) *serviceheaderarraystring.MethodHeaderArrayStringPayload {
    return &serviceheaderarraystring.MethodHeaderArrayStringPayload{
        H: h,
    }
}
`
var PayloadHeaderArrayStringDSL = func() {
    Service("ServiceHeaderArrayString", func() {
        Method("MethodHeaderArrayString", func() {
            Payload(func() {
                Attribute("h", ArrayOf(String))
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderArrayStringDecodeCode = `// DecodeMethodHeaderArrayStringRequest returns a decoder for requests sent to
// the ServiceHeaderArrayString MethodHeaderArrayString endpoint.
func DecodeMethodHeaderArrayStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h []string
        )
        h = r.Header["H"]
        payload := NewMethodHeaderArrayStringPayload(h)

        return payload, nil
    }
}
`
var PayloadHeaderArrayStringEncodeCode = `// EncodeMethodHeaderArrayStringRequest returns an encoder for requests sent to
// the ServiceHeaderArrayString MethodHeaderArrayString server.
func EncodeMethodHeaderArrayStringRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*serviceheaderarraystring.MethodHeaderArrayStringPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderArrayString", "MethodHeaderArrayString", "*serviceheaderarraystring.MethodHeaderArrayStringPayload", v)
        }
        req.Header.Set("h", p.H)
        return nil
    }
}
`
var PayloadHeaderArrayStringValidateConstructorCode = `// NewMethodHeaderArrayStringValidatePayload builds a
// ServiceHeaderArrayStringValidate service MethodHeaderArrayStringValidate
// endpoint payload.
func NewMethodHeaderArrayStringValidatePayload(h []string) *serviceheaderarraystringvalidate.MethodHeaderArrayStringValidatePayload {
    return &serviceheaderarraystringvalidate.MethodHeaderArrayStringValidatePayload{
        H: h,
    }
}
`
var PayloadHeaderArrayStringValidateDSL = func() {
    Service("ServiceHeaderArrayStringValidate", func() {
        Method("MethodHeaderArrayStringValidate", func() {
            Payload(func() {
                Attribute("h", ArrayOf(String, func() {
                    Enum("val")
                }))
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderArrayStringValidateDecodeCode = `// DecodeMethodHeaderArrayStringValidateRequest returns a decoder for requests
// sent to the ServiceHeaderArrayStringValidate MethodHeaderArrayStringValidate
// endpoint.
func DecodeMethodHeaderArrayStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h   []string
            err error
        )
        h = r.Header["H"]
        for _, e := range h {
            if !(e == "val") {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("h[*]", e, []interface{}{"val"}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodHeaderArrayStringValidatePayload(h)

        return payload, nil
    }
}
`
var PayloadHeaderArrayStringValidateEncodeCode = `// EncodeMethodHeaderArrayStringValidateRequest returns an encoder for requests
// sent to the ServiceHeaderArrayStringValidate MethodHeaderArrayStringValidate
// server.
func EncodeMethodHeaderArrayStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*serviceheaderarraystringvalidate.MethodHeaderArrayStringValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderArrayStringValidate", "MethodHeaderArrayStringValidate", "*serviceheaderarraystringvalidate.MethodHeaderArrayStringValidatePayload", v)
        }
        req.Header.Set("h", p.H)
        return nil
    }
}
`
var PayloadHeaderPrimitiveArrayBoolValidateDSL = func() {
    Service("ServiceHeaderPrimitiveArrayBoolValidate", func() {
        Method("MethodHeaderPrimitiveArrayBoolValidate", func() {
            Payload(ArrayOf(Boolean), func() {
                MinLength(1)
                Elem(func() {
                    Enum(true)
                })
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderPrimitiveArrayBoolValidateDecodeCode = `// DecodeMethodHeaderPrimitiveArrayBoolValidateRequest returns a decoder for
// requests sent to the ServiceHeaderPrimitiveArrayBoolValidate
// MethodHeaderPrimitiveArrayBoolValidate endpoint.
func DecodeMethodHeaderPrimitiveArrayBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h   []bool
            err error
        )
        {
            hRaw := r.Header["H"]
            if hRaw == nil {
                err = goa.MergeErrors(err, goa.MissingFieldError("h", "header"))
            }
            h = make([]bool, len(hRaw))
            for i, rv := range hRaw {
                v, err2 := strconv.ParseBool(rv)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("h", hRaw, "array of booleans"))
                }
                h[i] = v
            }
        }
        if len(h) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("h", h, len(h), 1, true))
        }
        for _, e := range h {
            if !(e == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("h[*]", e, []interface{}{true}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := h

        return payload, nil
    }
}
`
var PayloadHeaderPrimitiveArrayBoolValidateEncodeCode = `// EncodeMethodHeaderPrimitiveArrayBoolValidateRequest returns an encoder for
// requests sent to the ServiceHeaderPrimitiveArrayBoolValidate
// MethodHeaderPrimitiveArrayBoolValidate server.
func EncodeMethodHeaderPrimitiveArrayBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.([]bool)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderPrimitiveArrayBoolValidate", "MethodHeaderPrimitiveArrayBoolValidate", "[]bool", v)
        }
        return nil
    }
}
`
var PayloadHeaderPrimitiveArrayStringValidateDSL = func() {
    Service("ServiceHeaderPrimitiveArrayStringValidate", func() {
        Method("MethodHeaderPrimitiveArrayStringValidate", func() {
            Payload(ArrayOf(String), func() {
                MinLength(1)
                Elem(func() {
                    Pattern("val")
                })
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderPrimitiveArrayStringValidateDecodeCode = `// DecodeMethodHeaderPrimitiveArrayStringValidateRequest returns a decoder for
// requests sent to the ServiceHeaderPrimitiveArrayStringValidate
// MethodHeaderPrimitiveArrayStringValidate endpoint.
func DecodeMethodHeaderPrimitiveArrayStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h   []string
            err error
        )
        h = r.Header["H"]
        if h == nil {
            err = goa.MergeErrors(err, goa.MissingFieldError("h", "header"))
        }
        if len(h) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("h", h, len(h), 1, true))
        }
        for _, e := range h {
            err = goa.MergeErrors(err, goa.ValidatePattern("h[*]", e, "val"))
        }
        if err != nil {
            return nil, err
        }
        payload := h

        return payload, nil
    }
}
`
var PayloadHeaderPrimitiveArrayStringValidateEncodeCode = `// EncodeMethodHeaderPrimitiveArrayStringValidateRequest returns an encoder for
// requests sent to the ServiceHeaderPrimitiveArrayStringValidate
// MethodHeaderPrimitiveArrayStringValidate server.
func EncodeMethodHeaderPrimitiveArrayStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.([]string)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderPrimitiveArrayStringValidate", "MethodHeaderPrimitiveArrayStringValidate", "[]string", v)
        }
        return nil
    }
}
`
var PayloadHeaderPrimitiveBoolValidateDSL = func() {
    Service("ServiceHeaderPrimitiveBoolValidate", func() {
        Method("MethodHeaderPrimitiveBoolValidate", func() {
            Payload(Boolean, func() {
                Enum(true)
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderPrimitiveBoolValidateDecodeCode = `// DecodeMethodHeaderPrimitiveBoolValidateRequest returns a decoder for
// requests sent to the ServiceHeaderPrimitiveBoolValidate
// MethodHeaderPrimitiveBoolValidate endpoint.
func DecodeMethodHeaderPrimitiveBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h   bool
            err error
        )
        {
            hRaw := r.Header.Get("h")
            if hRaw == "" {
                err = goa.MergeErrors(err, goa.MissingFieldError("h", "header"))
            }
            v, err2 := strconv.ParseBool(hRaw)
            if err2 != nil {
                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("h", hRaw, "boolean"))
            }
            h = v
        }
        if !(h == true) {
            err = goa.MergeErrors(err, goa.InvalidEnumValueError("h", h, []interface{}{true}))
        }
        if err != nil {
            return nil, err
        }
        payload := h

        return payload, nil
    }
}
`
var PayloadHeaderPrimitiveBoolValidateEncodeCode = `// EncodeMethodHeaderPrimitiveBoolValidateRequest returns an encoder for
// requests sent to the ServiceHeaderPrimitiveBoolValidate
// MethodHeaderPrimitiveBoolValidate server.
func EncodeMethodHeaderPrimitiveBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(bool)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderPrimitiveBoolValidate", "MethodHeaderPrimitiveBoolValidate", "bool", v)
        }
        return nil
    }
}
`
var PayloadHeaderPrimitiveStringDefaultDSL = func() {
    Service("ServiceHeaderPrimitiveStringDefault", func() {
        Method("MethodHeaderPrimitiveStringDefault", func() {
            Payload(String, func() {
                Default("def")
            })
            HTTP(func() {
                GET("")
                Header("h")
            })
        })
    })
}
var PayloadHeaderPrimitiveStringDefaultDecodeCode = `// DecodeMethodHeaderPrimitiveStringDefaultRequest returns a decoder for
// requests sent to the ServiceHeaderPrimitiveStringDefault
// MethodHeaderPrimitiveStringDefault endpoint.
func DecodeMethodHeaderPrimitiveStringDefaultRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h   string
            err error
        )
        h = r.Header.Get("h")
        if h == "" {
            err = goa.MergeErrors(err, goa.MissingFieldError("h", "header"))
        }
        if err != nil {
            return nil, err
        }
        payload := h

        return payload, nil
    }
}
`
var PayloadHeaderPrimitiveStringDefaultEncodeCode = `// EncodeMethodHeaderPrimitiveStringDefaultRequest returns an encoder for
// requests sent to the ServiceHeaderPrimitiveStringDefault
// MethodHeaderPrimitiveStringDefault server.
func EncodeMethodHeaderPrimitiveStringDefaultRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(string)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderPrimitiveStringDefault", "MethodHeaderPrimitiveStringDefault", "string", v)
        }
        return nil
    }
}
`
var PayloadHeaderPrimitiveStringValidateDSL = func() {
    Service("ServiceHeaderPrimitiveStringValidate", func() {
        Method("MethodHeaderPrimitiveStringValidate", func() {
            Payload(String, func() {
                Enum("val")
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderPrimitiveStringValidateDecodeCode = `// DecodeMethodHeaderPrimitiveStringValidateRequest returns a decoder for
// requests sent to the ServiceHeaderPrimitiveStringValidate
// MethodHeaderPrimitiveStringValidate endpoint.
func DecodeMethodHeaderPrimitiveStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h   string
            err error
        )
        h = r.Header.Get("h")
        if h == "" {
            err = goa.MergeErrors(err, goa.MissingFieldError("h", "header"))
        }
        if !(h == "val") {
            err = goa.MergeErrors(err, goa.InvalidEnumValueError("h", h, []interface{}{"val"}))
        }
        if err != nil {
            return nil, err
        }
        payload := h

        return payload, nil
    }
}
`
var PayloadHeaderPrimitiveStringValidateEncodeCode = `// EncodeMethodHeaderPrimitiveStringValidateRequest returns an encoder for
// requests sent to the ServiceHeaderPrimitiveStringValidate
// MethodHeaderPrimitiveStringValidate server.
func EncodeMethodHeaderPrimitiveStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(string)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderPrimitiveStringValidate", "MethodHeaderPrimitiveStringValidate", "string", v)
        }
        return nil
    }
}
`
var PayloadHeaderStringConstructorCode = `// NewMethodHeaderStringPayload builds a ServiceHeaderString service
// MethodHeaderString endpoint payload.
func NewMethodHeaderStringPayload(h *string) *serviceheaderstring.MethodHeaderStringPayload {
    return &serviceheaderstring.MethodHeaderStringPayload{
        H: h,
    }
}
`
var PayloadHeaderStringDSL = func() {
    Service("ServiceHeaderString", func() {
        Method("MethodHeaderString", func() {
            Payload(func() {
                Attribute("h", String)
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderStringDecodeCode = `// DecodeMethodHeaderStringRequest returns a decoder for requests sent to the
// ServiceHeaderString MethodHeaderString endpoint.
func DecodeMethodHeaderStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h *string
        )
        hRaw := r.Header.Get("h")
        if hRaw != "" {
            h = &hRaw
        }
        payload := NewMethodHeaderStringPayload(h)

        return payload, nil
    }
}
`
var PayloadHeaderStringDefaultDSL = func() {
    Service("ServiceHeaderStringDefault", func() {
        Method("MethodHeaderStringDefault", func() {
            Payload(func() {
                Attribute("h", String, func() {
                    Default("def")
                })
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderStringDefaultDecodeCode = `// DecodeMethodHeaderStringDefaultRequest returns a decoder for requests sent
// to the ServiceHeaderStringDefault MethodHeaderStringDefault endpoint.
func DecodeMethodHeaderStringDefaultRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h string
        )
        hRaw := r.Header.Get("h")
        if hRaw != "" {
            h = hRaw
        } else {
            h = "def"
        }
        payload := NewMethodHeaderStringDefaultPayload(h)

        return payload, nil
    }
}
`
var PayloadHeaderStringDefaultEncodeCode = `// EncodeMethodHeaderStringDefaultRequest returns an encoder for requests sent
// to the ServiceHeaderStringDefault MethodHeaderStringDefault server.
func EncodeMethodHeaderStringDefaultRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*serviceheaderstringdefault.MethodHeaderStringDefaultPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderStringDefault", "MethodHeaderStringDefault", "*serviceheaderstringdefault.MethodHeaderStringDefaultPayload", v)
        }
        req.Header.Set("h", p.H)
        return nil
    }
}
`
var PayloadHeaderStringDefaultValidateDSL = func() {
    Service("ServiceHeaderStringDefaultValidate", func() {
        Method("MethodHeaderStringDefaultValidate", func() {
            Payload(func() {
                Attribute("h", String, func() {
                    Default("def")
                    Enum("def")
                })
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderStringDefaultValidateDecodeCode = `// DecodeMethodHeaderStringDefaultValidateRequest returns a decoder for
// requests sent to the ServiceHeaderStringDefaultValidate
// MethodHeaderStringDefaultValidate endpoint.
func DecodeMethodHeaderStringDefaultValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h   string
            err error
        )
        hRaw := r.Header.Get("h")
        if hRaw != "" {
            h = hRaw
        } else {
            h = "def"
        }
        if !(h == "def") {
            err = goa.MergeErrors(err, goa.InvalidEnumValueError("h", h, []interface{}{"def"}))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodHeaderStringDefaultValidatePayload(h)

        return payload, nil
    }
}
`
var PayloadHeaderStringEncodeCode = `// EncodeMethodHeaderStringRequest returns an encoder for requests sent to the
// ServiceHeaderString MethodHeaderString server.
func EncodeMethodHeaderStringRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*serviceheaderstring.MethodHeaderStringPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderString", "MethodHeaderString", "*serviceheaderstring.MethodHeaderStringPayload", v)
        }
        if p.H != nil {
            req.Header.Set("h", *p.H)
        }
        return nil
    }
}
`
var PayloadHeaderStringValidateConstructorCode = `// NewMethodHeaderStringValidatePayload builds a ServiceHeaderStringValidate
// service MethodHeaderStringValidate endpoint payload.
func NewMethodHeaderStringValidatePayload(h *string) *serviceheaderstringvalidate.MethodHeaderStringValidatePayload {
    return &serviceheaderstringvalidate.MethodHeaderStringValidatePayload{
        H: h,
    }
}
`
var PayloadHeaderStringValidateDSL = func() {
    Service("ServiceHeaderStringValidate", func() {
        Method("MethodHeaderStringValidate", func() {
            Payload(func() {
                Attribute("h", String, func() {
                    Pattern("header")
                })
            })
            HTTP(func() {
                GET("/")
                Header("h")
            })
        })
    })
}
var PayloadHeaderStringValidateDecodeCode = `// DecodeMethodHeaderStringValidateRequest returns a decoder for requests sent
// to the ServiceHeaderStringValidate MethodHeaderStringValidate endpoint.
func DecodeMethodHeaderStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            h   *string
            err error
        )
        hRaw := r.Header.Get("h")
        if hRaw != "" {
            h = &hRaw
        }
        if h != nil {
            err = goa.MergeErrors(err, goa.ValidatePattern("h", *h, "header"))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodHeaderStringValidatePayload(h)

        return payload, nil
    }
}
`
var PayloadHeaderStringValidateEncodeCode = `// EncodeMethodHeaderStringValidateRequest returns an encoder for requests sent
// to the ServiceHeaderStringValidate MethodHeaderStringValidate server.
func EncodeMethodHeaderStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*serviceheaderstringvalidate.MethodHeaderStringValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceHeaderStringValidate", "MethodHeaderStringValidate", "*serviceheaderstringvalidate.MethodHeaderStringValidatePayload", v)
        }
        if p.H != nil {
            req.Header.Set("h", *p.H)
        }
        return nil
    }
}
`
var PayloadMapQueryObjectDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Attribute("c", MapOf(Int, ArrayOf(String)))
        Required("a", "c")
    })

    Service("ServiceMapQueryObject", func() {
        Method("MethodMapQueryObject", func() {
            Payload(PayloadType)
            HTTP(func() {
                POST("/{a}")
                MapParams("c")
            })
        })
    })
}
var PayloadMapQueryObjectDecodeCode = `// DecodeMethodMapQueryObjectRequest returns a decoder for requests sent to the
// ServiceMapQueryObject MethodMapQueryObject endpoint.
func DecodeMethodMapQueryObjectRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            body MethodMapQueryObjectRequestBody
            err  error
        )
        err = decoder(r).Decode(&body)
        if err != nil {
            if err == io.EOF {
                return nil, goa.MissingPayloadError()
            }
            return nil, goa.DecodePayloadError(err.Error())
        }
        err = body.Validate()
        if err != nil {
            return nil, err
        }

        var (
            a string
            c map[int][]string

            params = mux.Vars(r)
        )
        a = params["a"]
        err = goa.MergeErrors(err, goa.ValidatePattern("a", a, "patterna"))
        {
            cRaw := r.URL.Query()
            if len(cRaw) == 0 {
                err = goa.MergeErrors(err, goa.MissingFieldError("c", "query string"))
            }
            c = make(map[int][]string, len(cRaw))
            for keyRaw, val := range cRaw {
                var key int
                {
                    v, err2 := strconv.ParseInt(keyRaw, 10, strconv.IntSize)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "integer"))
                    }
                    key = int(v)
                }
                c[key] = val
            }
        }
        err = goa.MergeErrors(err, goa.ValidatePattern("c.a", c.A, "patterna"))
        if c.B != nil {
            err = goa.MergeErrors(err, goa.ValidatePattern("c.b", *c.B, "patternb"))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodMapQueryObjectPayloadType(&body, a, c)

        return payload, nil
    }
}
`
var PayloadMapQueryObjectEncodeCode = `// EncodeMethodMapQueryObjectRequest returns an encoder for requests sent to
// the ServiceMapQueryObject MethodMapQueryObject server.
func EncodeMethodMapQueryObjectRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicemapqueryobject.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceMapQueryObject", "MethodMapQueryObject", "*servicemapqueryobject.PayloadType", v)
        }
        values := req.URL.Query()
        for key, value := range p.C {
            keyStr := strconv.Itoa(key)
            for _, val := range value {
                valStr := val
                values.Add(keyStr, valStr)
            }
        }
        req.URL.RawQuery = values.Encode()
        body := NewMethodMapQueryObjectRequestBody(p)
        if err := encoder(req).Encode(&body); err != nil {
            return goahttp.ErrEncodingError("ServiceMapQueryObject", "MethodMapQueryObject", err)
        }
        return nil
    }
}
`
var PayloadMapQueryPrimitiveArrayDSL = func() {
    Service("ServiceMapQueryPrimitiveArray", func() {
        Method("MapQueryPrimitiveArray", func() {
            Payload(MapOf(String, ArrayOf(UInt)))
            HTTP(func() {
                POST("/")
                MapParams()
            })
        })
    })
}
var PayloadMapQueryPrimitiveArrayDecodeCode = `// DecodeMapQueryPrimitiveArrayRequest returns a decoder for requests sent to
// the ServiceMapQueryPrimitiveArray MapQueryPrimitiveArray endpoint.
func DecodeMapQueryPrimitiveArrayRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            query map[string][]uint
            err   error
        )
        {
            queryRaw := r.URL.Query()
            if len(queryRaw) != 0 {
                query = make(map[string][]uint, len(queryRaw))
                for key, valRaw := range queryRaw {
                    var val []uint
                    {
                        val = make([]uint, len(valRaw))
                        for i, rv := range valRaw {
                            v, err2 := strconv.ParseUint(rv, 10, strconv.IntSize)
                            if err2 != nil {
                                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("val", valRaw, "array of unsigned integers"))
                            }
                            val[i] = uint(v)
                        }
                    }
                    query[key] = val
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := query

        return payload, nil
    }
}
`
var PayloadMapQueryPrimitiveArrayEncodeCode = `// EncodeMapQueryPrimitiveArrayRequest returns an encoder for requests sent to
// the ServiceMapQueryPrimitiveArray MapQueryPrimitiveArray server.
func EncodeMapQueryPrimitiveArrayRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(map[string][]uint)
        if !ok {
            return goahttp.ErrInvalidType("ServiceMapQueryPrimitiveArray", "MapQueryPrimitiveArray", "map[string][]uint", v)
        }
        values := req.URL.Query()
        for key, value := range p {
            keyStr := key
            for _, val := range value {
                valStr := strconv.FormatUint(uint64(val), 10)
                values.Add(keyStr, valStr)
            }
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadMapQueryPrimitivePrimitiveDSL = func() {
    Service("ServiceMapQueryPrimitivePrimitive", func() {
        Method("MapQueryPrimitivePrimitive", func() {
            Payload(MapOf(String, String))
            HTTP(func() {
                POST("/")
                MapParams()
            })
        })
    })
}
var PayloadMapQueryPrimitivePrimitiveDecodeCode = `// DecodeMapQueryPrimitivePrimitiveRequest returns a decoder for requests sent
// to the ServiceMapQueryPrimitivePrimitive MapQueryPrimitivePrimitive endpoint.
func DecodeMapQueryPrimitivePrimitiveRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            query map[string]string
        )
        {
            queryRaw := r.URL.Query()
            if len(queryRaw) != 0 {
                query = make(map[string]string, len(queryRaw))
                for key, va := range queryRaw {
                    var val string
                    {
                        val = va[0]
                    }
                    query[key] = val
                }
            }
        }
        payload := query

        return payload, nil
    }
}
`
var PayloadMapQueryPrimitivePrimitiveEncodeCode = `// EncodeMapQueryPrimitivePrimitiveRequest returns an encoder for requests sent
// to the ServiceMapQueryPrimitivePrimitive MapQueryPrimitivePrimitive server.
func EncodeMapQueryPrimitivePrimitiveRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(map[string]string)
        if !ok {
            return goahttp.ErrInvalidType("ServiceMapQueryPrimitivePrimitive", "MapQueryPrimitivePrimitive", "map[string]string", v)
        }
        values := req.URL.Query()
        for key, value := range p {
            keyStr := key
            valueStr := value
            values.Add(keyStr, valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadMapUserTypeBuildCode = `// BuildMethodBodyInlineMapUserPayload builds the payload for the
// ServiceBodyInlineMapUser MethodBodyInlineMapUser endpoint from CLI flags.
func BuildMethodBodyInlineMapUserPayload(serviceBodyInlineMapUserMethodBodyInlineMapUserBody string) (map[*servicebodyinlinemapuser.KeyType]*servicebodyinlinemapuser.ElemType, error) {
    var err error
    var body map[*KeyTypeRequestBody]*ElemTypeRequestBody
    {
        err = json.Unmarshal([]byte(serviceBodyInlineMapUserMethodBodyInlineMapUserBody), &body)
        if err != nil {
            return nil, fmt.Errorf("invalid JSON for body, example of valid JSON:\n%s", "null")
        }
    }
    if err != nil {
        return nil, err
    }
    v := make(map[*servicebodyinlinemapuser.KeyType]*servicebodyinlinemapuser.ElemType, len(body))
    for key, val := range body {
        tk := &servicebodyinlinemapuser.KeyType{
            A: key.A,
            B: key.B,
        }
        tv := &servicebodyinlinemapuser.ElemType{
            A: val.A,
            B: val.B,
        }
        v[tk] = tv
    }
    return v, nil
}
`
var PayloadMultipartArrayTypeDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Attribute("c", MapOf(Int, ArrayOf(String)))
        Required("a", "c")
    })
    Service("ServiceMultipartArrayType", func() {
        Method("MethodMultipartArrayType", func() {
            Payload(ArrayOf(PayloadType))
            HTTP(func() {
                POST("/")
                MultipartRequest()
            })
        })
    })
}
var PayloadMultipartArrayTypeDecodeCode = `// DecodeMethodMultipartArrayTypeRequest returns a decoder for requests sent to
// the ServiceMultipartArrayType MethodMultipartArrayType endpoint.
func DecodeMethodMultipartArrayTypeRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var payload []*servicemultipartarraytype.PayloadType
        if err := decoder(r).Decode(&payload); err != nil {
            return nil, goa.DecodePayloadError(err.Error())
        }

        return payload, nil
    }
}
`
var PayloadMultipartBodyArrayTypeEncodeCode = `// EncodeMethodMultipartArrayTypeRequest returns an encoder for requests sent
// to the ServiceMultipartArrayType MethodMultipartArrayType server.
func EncodeMethodMultipartArrayTypeRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.([]*servicemultipartarraytype.PayloadType)
        if !ok {
            return goahttp.ErrInvalidType("ServiceMultipartArrayType", "MethodMultipartArrayType", "[]*servicemultipartarraytype.PayloadType", v)
        }
        if err := encoder(req).Encode(p); err != nil {
            return goahttp.ErrEncodingError("ServiceMultipartArrayType", "MethodMultipartArrayType", err)
        }
        return nil
    }
}
`
var PayloadMultipartBodyMapTypeEncodeCode = `// EncodeMethodMultipartMapTypeRequest returns an encoder for requests sent to
// the ServiceMultipartMapType MethodMultipartMapType server.
func EncodeMethodMultipartMapTypeRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(map[string]int)
        if !ok {
            return goahttp.ErrInvalidType("ServiceMultipartMapType", "MethodMultipartMapType", "map[string]int", v)
        }
        if err := encoder(req).Encode(p); err != nil {
            return goahttp.ErrEncodingError("ServiceMultipartMapType", "MethodMultipartMapType", err)
        }
        return nil
    }
}
`
var PayloadMultipartBodyPrimitiveEncodeCode = `// EncodeMethodMultipartPrimitiveRequest returns an encoder for requests sent
// to the ServiceMultipartPrimitive MethodMultipartPrimitive server.
func EncodeMethodMultipartPrimitiveRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(string)
        if !ok {
            return goahttp.ErrInvalidType("ServiceMultipartPrimitive", "MethodMultipartPrimitive", "string", v)
        }
        if err := encoder(req).Encode(p); err != nil {
            return goahttp.ErrEncodingError("ServiceMultipartPrimitive", "MethodMultipartPrimitive", err)
        }
        return nil
    }
}
`
var PayloadMultipartBodyUserTypeEncodeCode = `// EncodeMethodMultipartUserTypeRequest returns an encoder for requests sent to
// the ServiceMultipartUserType MethodMultipartUserType server.
func EncodeMethodMultipartUserTypeRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicemultipartusertype.MethodMultipartUserTypePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceMultipartUserType", "MethodMultipartUserType", "*servicemultipartusertype.MethodMultipartUserTypePayload", v)
        }
        if err := encoder(req).Encode(p); err != nil {
            return goahttp.ErrEncodingError("ServiceMultipartUserType", "MethodMultipartUserType", err)
        }
        return nil
    }
}
`
var PayloadMultipartMapTypeDSL = func() {
    Service("ServiceMultipartMapType", func() {
        Method("MethodMultipartMapType", func() {
            Payload(MapOf(String, Int))
            HTTP(func() {
                POST("/")
                MultipartRequest()
            })
        })
    })
}
var PayloadMultipartMapTypeDecodeCode = `// DecodeMethodMultipartMapTypeRequest returns a decoder for requests sent to
// the ServiceMultipartMapType MethodMultipartMapType endpoint.
func DecodeMethodMultipartMapTypeRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var payload map[string]int
        if err := decoder(r).Decode(&payload); err != nil {
            return nil, goa.DecodePayloadError(err.Error())
        }

        return payload, nil
    }
}
`
var PayloadMultipartPrimitiveDSL = func() {
    Service("ServiceMultipartPrimitive", func() {
        Method("MethodMultipartPrimitive", func() {
            Payload(String)
            HTTP(func() {
                POST("/")
                MultipartRequest()
            })
        })
    })
}
var PayloadMultipartPrimitiveDecodeCode = `// DecodeMethodMultipartPrimitiveRequest returns a decoder for requests sent to
// the ServiceMultipartPrimitive MethodMultipartPrimitive endpoint.
func DecodeMethodMultipartPrimitiveRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var payload string
        if err := decoder(r).Decode(&payload); err != nil {
            return nil, goa.DecodePayloadError(err.Error())
        }

        return payload, nil
    }
}
`
var PayloadMultipartUserTypeDSL = func() {
    Service("ServiceMultipartUserType", func() {
        Method("MethodMultipartUserType", func() {
            Payload(func() {
                Attribute("b", String, func() {
                    Pattern("patternb")
                })
                Attribute("c", MapOf(Int, ArrayOf(String)))
                Required("b", "c")
            })
            HTTP(func() {
                POST("/")
                MultipartRequest()
            })
        })
    })
}
var PayloadMultipartUserTypeDecodeCode = `// DecodeMethodMultipartUserTypeRequest returns a decoder for requests sent to
// the ServiceMultipartUserType MethodMultipartUserType endpoint.
func DecodeMethodMultipartUserTypeRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var payload *servicemultipartusertype.MethodMultipartUserTypePayload
        if err := decoder(r).Decode(&payload); err != nil {
            return nil, goa.DecodePayloadError(err.Error())
        }

        return payload, nil
    }
}
`
var PayloadMultipartWithParamDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Attribute("c", MapOf(Int, ArrayOf(String)))
        Required("a", "c")
    })
    Service("ServiceMultipartWithParam", func() {
        Method("MethodMultipartWithParam", func() {
            Payload(PayloadType)
            Result(String)
            HTTP(func() {
                POST("/")
                Param("c")
                MultipartRequest()
            })
        })
    })
}
var PayloadMultipartWithParamsAndHeadersDSL = func() {
    var PayloadType = Type("PayloadType", func() {
        Attribute("a", String, func() {
            Pattern("patterna")
        })
        Attribute("b", String, func() {
            Pattern("patternb")
        })
        Attribute("c", MapOf(Int, ArrayOf(String)))
        Required("a", "c")
    })
    Service("ServiceMultipartWithParamsAndHeaders", func() {
        Method("MethodMultipartWithParamsAndHeaders", func() {
            Payload(PayloadType)
            Result(String)
            HTTP(func() {
                POST("/{a}")
                Param("c")
                Header("b:Authorization", String)
                MultipartRequest()
            })
        })
    })
}
var PayloadPathArrayStringConstructorCode = `// NewMethodPathArrayStringPayload builds a ServicePathArrayString service
// MethodPathArrayString endpoint payload.
func NewMethodPathArrayStringPayload(p []string) *servicepatharraystring.MethodPathArrayStringPayload {
    return &servicepatharraystring.MethodPathArrayStringPayload{
        P: p,
    }
}
`
var PayloadPathArrayStringDSL = func() {
    Service("ServicePathArrayString", func() {
        Method("MethodPathArrayString", func() {
            Payload(func() {
                Attribute("p", ArrayOf(String))
            })
            HTTP(func() {
                GET("/{p}")
            })
        })
    })
}
var PayloadPathArrayStringDecodeCode = `// DecodeMethodPathArrayStringRequest returns a decoder for requests sent to
// the ServicePathArrayString MethodPathArrayString endpoint.
func DecodeMethodPathArrayStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            p []string

            params = mux.Vars(r)
        )
        {
            pRaw := params["p"]
            pRawSlice := strings.Split(pRaw, ",")
            p = make([]string, len(pRawSlice))
            for i, rv := range pRawSlice {
                p[i] = rv
            }
        }
        payload := NewMethodPathArrayStringPayload(p)

        return payload, nil
    }
}
`
var PayloadPathArrayStringValidateConstructorCode = `// NewMethodPathArrayStringValidatePayload builds a
// ServicePathArrayStringValidate service MethodPathArrayStringValidate
// endpoint payload.
func NewMethodPathArrayStringValidatePayload(p []string) *servicepatharraystringvalidate.MethodPathArrayStringValidatePayload {
    return &servicepatharraystringvalidate.MethodPathArrayStringValidatePayload{
        P: p,
    }
}
`
var PayloadPathArrayStringValidateDSL = func() {
    Service("ServicePathArrayStringValidate", func() {
        Method("MethodPathArrayStringValidate", func() {
            Payload(func() {
                Attribute("p", ArrayOf(String), func() {
                    Enum([]string{"val"})
                })
            })
            HTTP(func() {
                GET("/{p}")
            })
        })
    })
}
var PayloadPathArrayStringValidateDecodeCode = `// DecodeMethodPathArrayStringValidateRequest returns a decoder for requests
// sent to the ServicePathArrayStringValidate MethodPathArrayStringValidate
// endpoint.
func DecodeMethodPathArrayStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            p   []string
            err error

            params = mux.Vars(r)
        )
        {
            pRaw := params["p"]
            pRawSlice := strings.Split(pRaw, ",")
            p = make([]string, len(pRawSlice))
            for i, rv := range pRawSlice {
                p[i] = rv
            }
        }
        if !(p == []string{"val"}) {
            err = goa.MergeErrors(err, goa.InvalidEnumValueError("p", p, []interface{}{[]string{"val"}}))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodPathArrayStringValidatePayload(p)

        return payload, nil
    }
}
`
var PayloadPathPrimitiveArrayBoolValidateDSL = func() {
    Service("ServicePathPrimitiveArrayBoolValidate", func() {
        Method("MethodPathPrimitiveArrayBoolValidate", func() {
            Payload(ArrayOf(Boolean), func() {
                MinLength(1)
                Elem(func() {
                    Enum(true)
                })
            })
            HTTP(func() {
                GET("/{p}")
            })
        })
    })
}
var PayloadPathPrimitiveArrayBoolValidateDecodeCode = `// DecodeMethodPathPrimitiveArrayBoolValidateRequest returns a decoder for
// requests sent to the ServicePathPrimitiveArrayBoolValidate
// MethodPathPrimitiveArrayBoolValidate endpoint.
func DecodeMethodPathPrimitiveArrayBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            p   []bool
            err error

            params = mux.Vars(r)
        )
        {
            pRaw := params["p"]
            pRawSlice := strings.Split(pRaw, ",")
            p = make([]bool, len(pRawSlice))
            for i, rv := range pRawSlice {
                v, err2 := strconv.ParseBool(rv)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("p", pRaw, "array of booleans"))
                }
                p[i] = v
            }
        }
        if len(p) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("p", p, len(p), 1, true))
        }
        for _, e := range p {
            if !(e == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("p[*]", e, []interface{}{true}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := p

        return payload, nil
    }
}
`
var PayloadPathPrimitiveArrayStringValidateDSL = func() {
    Service("ServicePathPrimitiveArrayStringValidate", func() {
        Method("MethodPathPrimitiveArrayStringValidate", func() {
            Payload(ArrayOf(String), func() {
                MinLength(1)
                Elem(func() {
                    Enum("val")
                })
            })
            HTTP(func() {
                GET("/{p}")
            })
        })
    })
}
var PayloadPathPrimitiveArrayStringValidateDecodeCode = `// DecodeMethodPathPrimitiveArrayStringValidateRequest returns a decoder for
// requests sent to the ServicePathPrimitiveArrayStringValidate
// MethodPathPrimitiveArrayStringValidate endpoint.
func DecodeMethodPathPrimitiveArrayStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            p   []string
            err error

            params = mux.Vars(r)
        )
        {
            pRaw := params["p"]
            pRawSlice := strings.Split(pRaw, ",")
            p = make([]string, len(pRawSlice))
            for i, rv := range pRawSlice {
                p[i] = rv
            }
        }
        if len(p) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("p", p, len(p), 1, true))
        }
        for _, e := range p {
            if !(e == "val") {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("p[*]", e, []interface{}{"val"}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := p

        return payload, nil
    }
}
`
var PayloadPathPrimitiveBoolValidateDSL = func() {
    Service("ServicePathPrimitiveBoolValidate", func() {
        Method("MethodPathPrimitiveBoolValidate", func() {
            Payload(Boolean, func() {
                Enum(true)
            })
            HTTP(func() {
                GET("/{p}")
            })
        })
    })
}
var PayloadPathPrimitiveBoolValidateDecodeCode = `// DecodeMethodPathPrimitiveBoolValidateRequest returns a decoder for requests
// sent to the ServicePathPrimitiveBoolValidate MethodPathPrimitiveBoolValidate
// endpoint.
func DecodeMethodPathPrimitiveBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            p   bool
            err error

            params = mux.Vars(r)
        )
        {
            pRaw := params["p"]
            v, err2 := strconv.ParseBool(pRaw)
            if err2 != nil {
                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("p", pRaw, "boolean"))
            }
            p = v
        }
        if !(p == true) {
            err = goa.MergeErrors(err, goa.InvalidEnumValueError("p", p, []interface{}{true}))
        }
        if err != nil {
            return nil, err
        }
        payload := p

        return payload, nil
    }
}
`
var PayloadPathPrimitiveStringValidateDSL = func() {
    Service("ServicePathPrimitiveStringValidate", func() {
        Method("MethodPathPrimitiveStringValidate", func() {
            Payload(String, func() {
                Enum("val")
            })
            HTTP(func() {
                GET("/{p}")
            })
        })
    })
}
var PayloadPathPrimitiveStringValidateDecodeCode = `// DecodeMethodPathPrimitiveStringValidateRequest returns a decoder for
// requests sent to the ServicePathPrimitiveStringValidate
// MethodPathPrimitiveStringValidate endpoint.
func DecodeMethodPathPrimitiveStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            p   string
            err error

            params = mux.Vars(r)
        )
        p = params["p"]
        if !(p == "val") {
            err = goa.MergeErrors(err, goa.InvalidEnumValueError("p", p, []interface{}{"val"}))
        }
        if err != nil {
            return nil, err
        }
        payload := p

        return payload, nil
    }
}
`
var PayloadPathStringConstructorCode = `// NewMethodPathStringPayload builds a ServicePathString service
// MethodPathString endpoint payload.
func NewMethodPathStringPayload(p string) *servicepathstring.MethodPathStringPayload {
    return &servicepathstring.MethodPathStringPayload{
        P: &p,
    }
}
`
var PayloadPathStringDSL = func() {
    Service("ServicePathString", func() {
        Method("MethodPathString", func() {
            Payload(func() {
                Attribute("p", String)
            })
            HTTP(func() {
                GET("/{p}")
            })
        })
    })
}
var PayloadPathStringDecodeCode = `// DecodeMethodPathStringRequest returns a decoder for requests sent to the
// ServicePathString MethodPathString endpoint.
func DecodeMethodPathStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            p string

            params = mux.Vars(r)
        )
        p = params["p"]
        payload := NewMethodPathStringPayload(p)

        return payload, nil
    }
}
`
var PayloadPathStringValidateConstructorCode = `// NewMethodPathStringValidatePayload builds a ServicePathStringValidate
// service MethodPathStringValidate endpoint payload.
func NewMethodPathStringValidatePayload(p string) *servicepathstringvalidate.MethodPathStringValidatePayload {
    return &servicepathstringvalidate.MethodPathStringValidatePayload{
        P: p,
    }
}
`
var PayloadPathStringValidateDSL = func() {
    Service("ServicePathStringValidate", func() {
        Method("MethodPathStringValidate", func() {
            Payload(func() {
                Attribute("p", String, func() {
                    Enum("val")
                })
                Required("p")
            })
            HTTP(func() {
                GET("/{p}")
            })
        })
    })
}
var PayloadPathStringValidateDecodeCode = `// DecodeMethodPathStringValidateRequest returns a decoder for requests sent to
// the ServicePathStringValidate MethodPathStringValidate endpoint.
func DecodeMethodPathStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            p   string
            err error

            params = mux.Vars(r)
        )
        p = params["p"]
        if !(p == "val") {
            err = goa.MergeErrors(err, goa.InvalidEnumValueError("p", p, []interface{}{"val"}))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodPathStringValidatePayload(p)

        return payload, nil
    }
}
`
var PayloadPrimitiveTypeParseCode = `// ParseEndpoint returns the endpoint and payload as specified on the command
// line.
func ParseEndpoint(
    scheme, host string,
    doer goahttp.Doer,
    enc func(*http.Request) goahttp.Encoder,
    dec func(*http.Response) goahttp.Decoder,
    restore bool,
) (goa.Endpoint, interface{}, error) {
    var (
        serviceBodyPrimitiveBoolValidateFlags = flag.NewFlagSet("service-body-primitive-bool-validate", flag.ContinueOnError)

        serviceBodyPrimitiveBoolValidateMethodBodyPrimitiveBoolValidateFlags = flag.NewFlagSet("method-body-primitive-bool-validate", flag.ExitOnError)
        serviceBodyPrimitiveBoolValidateMethodBodyPrimitiveBoolValidatePFlag = serviceBodyPrimitiveBoolValidateMethodBodyPrimitiveBoolValidateFlags.String("p", "REQUIRED", "bool is the payload type of the ServiceBodyPrimitiveBoolValidate service MethodBodyPrimitiveBoolValidate method.")
    )
    serviceBodyPrimitiveBoolValidateFlags.Usage = serviceBodyPrimitiveBoolValidateUsage
    serviceBodyPrimitiveBoolValidateMethodBodyPrimitiveBoolValidateFlags.Usage = serviceBodyPrimitiveBoolValidateMethodBodyPrimitiveBoolValidateUsage

    if err := flag.CommandLine.Parse(os.Args[1:]); err != nil {
        return nil, nil, err
    }

    if len(os.Args) < flag.NFlag()+3 {
        return nil, nil, fmt.Errorf("not enough arguments")
    }

    var (
        svcn string
        svcf *flag.FlagSet
    )
    {
        svcn = os.Args[1+flag.NFlag()]
        switch svcn {
        case "service-body-primitive-bool-validate":
            svcf = serviceBodyPrimitiveBoolValidateFlags
        default:
            return nil, nil, fmt.Errorf("unknown service %q", svcn)
        }
    }
    if err := svcf.Parse(os.Args[2+flag.NFlag():]); err != nil {
        return nil, nil, err
    }

    var (
        epn string
        epf *flag.FlagSet
    )
    {
        epn = os.Args[2+flag.NFlag()+svcf.NFlag()]
        switch svcn {
        case "service-body-primitive-bool-validate":
            switch epn {
            case "method-body-primitive-bool-validate":
                epf = serviceBodyPrimitiveBoolValidateMethodBodyPrimitiveBoolValidateFlags

            }

        }
    }
    if epf == nil {
        return nil, nil, fmt.Errorf("unknown %q endpoint %q", svcn, epn)
    }

    // Parse endpoint flags if any
    if len(os.Args) > 2+flag.NFlag()+svcf.NFlag() {
        if err := epf.Parse(os.Args[3+flag.NFlag()+svcf.NFlag():]); err != nil {
            return nil, nil, err
        }
    }

    var (
        data     interface{}
        endpoint goa.Endpoint
        err      error
    )
    {
        switch svcn {
        case "service-body-primitive-bool-validate":
            c := servicebodyprimitiveboolvalidatec.NewClient(scheme, host, doer, enc, dec, restore)
            switch epn {
            case "method-body-primitive-bool-validate":
                endpoint = c.MethodBodyPrimitiveBoolValidate()
                var err error
                data, err = strconv.ParseBool(*serviceBodyPrimitiveBoolValidateMethodBodyPrimitiveBoolValidatePFlag)
                if err != nil {
                    return nil, nil, fmt.Errorf("invalid value for serviceBodyPrimitiveBoolValidateMethodBodyPrimitiveBoolValidatePFlag, must be BOOL")
                }
            }
        }
    }
    if err != nil {
        return nil, nil, err
    }

    return endpoint, data, nil
}
`
var PayloadQueryAnyConstructorCode = `// NewMethodQueryAnyPayload builds a ServiceQueryAny service MethodQueryAny
// endpoint payload.
func NewMethodQueryAnyPayload(q interface{}) *servicequeryany.MethodQueryAnyPayload {
    return &servicequeryany.MethodQueryAnyPayload{
        Q: q,
    }
}
`
var PayloadQueryAnyDSL = func() {
    Service("ServiceQueryAny", func() {
        Method("MethodQueryAny", func() {
            Payload(func() {
                Attribute("q", Any)
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryAnyDecodeCode = `// DecodeMethodQueryAnyRequest returns a decoder for requests sent to the
// ServiceQueryAny MethodQueryAny endpoint.
func DecodeMethodQueryAnyRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q interface{}
        )
        qRaw := r.URL.Query().Get("q")
        if qRaw != "" {
            q = qRaw
        }
        payload := NewMethodQueryAnyPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryAnyEncodeCode = `// EncodeMethodQueryAnyRequest returns an encoder for requests sent to the
// ServiceQueryAny MethodQueryAny server.
func EncodeMethodQueryAnyRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryany.MethodQueryAnyPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryAny", "MethodQueryAny", "*servicequeryany.MethodQueryAnyPayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryAnyValidateConstructorCode = `// NewMethodQueryAnyValidatePayload builds a ServiceQueryAnyValidate service
// MethodQueryAnyValidate endpoint payload.
func NewMethodQueryAnyValidatePayload(q interface{}) *servicequeryanyvalidate.MethodQueryAnyValidatePayload {
    return &servicequeryanyvalidate.MethodQueryAnyValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryAnyValidateDSL = func() {
    Service("ServiceQueryAnyValidate", func() {
        Method("MethodQueryAnyValidate", func() {
            Payload(func() {
                Attribute("q", Any, func() {
                    Enum("val", 1)
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryAnyValidateDecodeCode = `// DecodeMethodQueryAnyValidateRequest returns a decoder for requests sent to
// the ServiceQueryAnyValidate MethodQueryAnyValidate endpoint.
func DecodeMethodQueryAnyValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   interface{}
            err error
        )
        q = r.URL.Query().Get("q")
        if q == "" {
            err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
        }
        if !(q == "val" || q == 1) {
            err = goa.MergeErrors(err, goa.InvalidEnumValueError("q", q, []interface{}{"val", 1}))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryAnyValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryAnyValidateEncodeCode = `// EncodeMethodQueryAnyValidateRequest returns an encoder for requests sent to
// the ServiceQueryAnyValidate MethodQueryAnyValidate server.
func EncodeMethodQueryAnyValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryanyvalidate.MethodQueryAnyValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryAnyValidate", "MethodQueryAnyValidate", "*servicequeryanyvalidate.MethodQueryAnyValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayAnyConstructorCode = `// NewMethodQueryArrayAnyPayload builds a ServiceQueryArrayAny service
// MethodQueryArrayAny endpoint payload.
func NewMethodQueryArrayAnyPayload(q []interface{}) *servicequeryarrayany.MethodQueryArrayAnyPayload {
    return &servicequeryarrayany.MethodQueryArrayAnyPayload{
        Q: q,
    }
}
`
var PayloadQueryArrayAnyDSL = func() {
    Service("ServiceQueryArrayAny", func() {
        Method("MethodQueryArrayAny", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Any))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayAnyDecodeCode = `// DecodeMethodQueryArrayAnyRequest returns a decoder for requests sent to the
// ServiceQueryArrayAny MethodQueryArrayAny endpoint.
func DecodeMethodQueryArrayAnyRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q []interface{}
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]interface{}, len(qRaw))
                for i, rv := range qRaw {
                    q[i] = rv
                }
            }
        }
        payload := NewMethodQueryArrayAnyPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayAnyEncodeCode = `// EncodeMethodQueryArrayAnyRequest returns an encoder for requests sent to the
// ServiceQueryArrayAny MethodQueryArrayAny server.
func EncodeMethodQueryArrayAnyRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayany.MethodQueryArrayAnyPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayAny", "MethodQueryArrayAny", "*servicequeryarrayany.MethodQueryArrayAnyPayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := fmt.Sprintf("%v", value)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayAnyValidateConstructorCode = `// NewMethodQueryArrayAnyValidatePayload builds a ServiceQueryArrayAnyValidate
// service MethodQueryArrayAnyValidate endpoint payload.
func NewMethodQueryArrayAnyValidatePayload(q []interface{}) *servicequeryarrayanyvalidate.MethodQueryArrayAnyValidatePayload {
    return &servicequeryarrayanyvalidate.MethodQueryArrayAnyValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayAnyValidateDSL = func() {
    Service("ServiceQueryArrayAnyValidate", func() {
        Method("MethodQueryArrayAnyValidate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Any), func() {
                    MinLength(1)
                    Elem(func() {
                        Enum("val", 1)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayAnyValidateDecodeCode = `// DecodeMethodQueryArrayAnyValidateRequest returns a decoder for requests sent
// to the ServiceQueryArrayAnyValidate MethodQueryArrayAnyValidate endpoint.
func DecodeMethodQueryArrayAnyValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []interface{}
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]interface{}, len(qRaw))
            for i, rv := range qRaw {
                q[i] = rv
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if !(e == "val" || e == 1) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q[*]", e, []interface{}{"val", 1}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayAnyValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayAnyValidateEncodeCode = `// EncodeMethodQueryArrayAnyValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayAnyValidate MethodQueryArrayAnyValidate server.
func EncodeMethodQueryArrayAnyValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayanyvalidate.MethodQueryArrayAnyValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayAnyValidate", "MethodQueryArrayAnyValidate", "*servicequeryarrayanyvalidate.MethodQueryArrayAnyValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := fmt.Sprintf("%v", value)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayBoolConstructorCode = `// NewMethodQueryArrayBoolPayload builds a ServiceQueryArrayBool service
// MethodQueryArrayBool endpoint payload.
func NewMethodQueryArrayBoolPayload(q []bool) *servicequeryarraybool.MethodQueryArrayBoolPayload {
    return &servicequeryarraybool.MethodQueryArrayBoolPayload{
        Q: q,
    }
}
`
var PayloadQueryArrayBoolDSL = func() {
    Service("ServiceQueryArrayBool", func() {
        Method("MethodQueryArrayBool", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Boolean))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayBoolDecodeCode = `// DecodeMethodQueryArrayBoolRequest returns a decoder for requests sent to the
// ServiceQueryArrayBool MethodQueryArrayBool endpoint.
func DecodeMethodQueryArrayBoolRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []bool
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]bool, len(qRaw))
                for i, rv := range qRaw {
                    v, err2 := strconv.ParseBool(rv)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of booleans"))
                    }
                    q[i] = v
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayBoolPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayBoolEncodeCode = `// EncodeMethodQueryArrayBoolRequest returns an encoder for requests sent to
// the ServiceQueryArrayBool MethodQueryArrayBool server.
func EncodeMethodQueryArrayBoolRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarraybool.MethodQueryArrayBoolPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayBool", "MethodQueryArrayBool", "*servicequeryarraybool.MethodQueryArrayBoolPayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatBool(value)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayBoolValidateConstructorCode = `// NewMethodQueryArrayBoolValidatePayload builds a
// ServiceQueryArrayBoolValidate service MethodQueryArrayBoolValidate endpoint
// payload.
func NewMethodQueryArrayBoolValidatePayload(q []bool) *servicequeryarrayboolvalidate.MethodQueryArrayBoolValidatePayload {
    return &servicequeryarrayboolvalidate.MethodQueryArrayBoolValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayBoolValidateDSL = func() {
    Service("ServiceQueryArrayBoolValidate", func() {
        Method("MethodQueryArrayBoolValidate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Boolean), func() {
                    MinLength(1)
                    Elem(func() {
                        Enum(true)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayBoolValidateDecodeCode = `// DecodeMethodQueryArrayBoolValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayBoolValidate MethodQueryArrayBoolValidate
// endpoint.
func DecodeMethodQueryArrayBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []bool
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]bool, len(qRaw))
            for i, rv := range qRaw {
                v, err2 := strconv.ParseBool(rv)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of booleans"))
                }
                q[i] = v
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if !(e == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q[*]", e, []interface{}{true}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayBoolValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayBoolValidateEncodeCode = `// EncodeMethodQueryArrayBoolValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayBoolValidate MethodQueryArrayBoolValidate
// server.
func EncodeMethodQueryArrayBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayboolvalidate.MethodQueryArrayBoolValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayBoolValidate", "MethodQueryArrayBoolValidate", "*servicequeryarrayboolvalidate.MethodQueryArrayBoolValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatBool(value)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayBytesConstructorCode = `// NewMethodQueryArrayBytesPayload builds a ServiceQueryArrayBytes service
// MethodQueryArrayBytes endpoint payload.
func NewMethodQueryArrayBytesPayload(q [][]byte) *servicequeryarraybytes.MethodQueryArrayBytesPayload {
    return &servicequeryarraybytes.MethodQueryArrayBytesPayload{
        Q: q,
    }
}
`
var PayloadQueryArrayBytesDSL = func() {
    Service("ServiceQueryArrayBytes", func() {
        Method("MethodQueryArrayBytes", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Bytes))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayBytesDecodeCode = `// DecodeMethodQueryArrayBytesRequest returns a decoder for requests sent to
// the ServiceQueryArrayBytes MethodQueryArrayBytes endpoint.
func DecodeMethodQueryArrayBytesRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q [][]byte
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([][]byte, len(qRaw))
                for i, rv := range qRaw {
                    q[i] = []byte(rv)
                }
            }
        }
        payload := NewMethodQueryArrayBytesPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayBytesEncodeCode = `// EncodeMethodQueryArrayBytesRequest returns an encoder for requests sent to
// the ServiceQueryArrayBytes MethodQueryArrayBytes server.
func EncodeMethodQueryArrayBytesRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarraybytes.MethodQueryArrayBytesPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayBytes", "MethodQueryArrayBytes", "*servicequeryarraybytes.MethodQueryArrayBytesPayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := string(value)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayBytesValidateConstructorCode = `// NewMethodQueryArrayBytesValidatePayload builds a
// ServiceQueryArrayBytesValidate service MethodQueryArrayBytesValidate
// endpoint payload.
func NewMethodQueryArrayBytesValidatePayload(q [][]byte) *servicequeryarraybytesvalidate.MethodQueryArrayBytesValidatePayload {
    return &servicequeryarraybytesvalidate.MethodQueryArrayBytesValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayBytesValidateDSL = func() {
    Service("ServiceQueryArrayBytesValidate", func() {
        Method("MethodQueryArrayBytesValidate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Bytes), func() {
                    MinLength(1)
                    Elem(func() {
                        MinLength(2)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayBytesValidateDecodeCode = `// DecodeMethodQueryArrayBytesValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayBytesValidate MethodQueryArrayBytesValidate
// endpoint.
func DecodeMethodQueryArrayBytesValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   [][]byte
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([][]byte, len(qRaw))
            for i, rv := range qRaw {
                q[i] = []byte(rv)
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if len(e) < 2 {
                err = goa.MergeErrors(err, goa.InvalidLengthError("q[*]", e, len(e), 2, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayBytesValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayBytesValidateEncodeCode = `// EncodeMethodQueryArrayBytesValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayBytesValidate MethodQueryArrayBytesValidate
// server.
func EncodeMethodQueryArrayBytesValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarraybytesvalidate.MethodQueryArrayBytesValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayBytesValidate", "MethodQueryArrayBytesValidate", "*servicequeryarraybytesvalidate.MethodQueryArrayBytesValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := string(value)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayFloat32ConstructorCode = `// NewMethodQueryArrayFloat32Payload builds a ServiceQueryArrayFloat32 service
// MethodQueryArrayFloat32 endpoint payload.
func NewMethodQueryArrayFloat32Payload(q []float32) *servicequeryarrayfloat32.MethodQueryArrayFloat32Payload {
    return &servicequeryarrayfloat32.MethodQueryArrayFloat32Payload{
        Q: q,
    }
}
`
var PayloadQueryArrayFloat32DSL = func() {
    Service("ServiceQueryArrayFloat32", func() {
        Method("MethodQueryArrayFloat32", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Float32))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayFloat32DecodeCode = `// DecodeMethodQueryArrayFloat32Request returns a decoder for requests sent to
// the ServiceQueryArrayFloat32 MethodQueryArrayFloat32 endpoint.
func DecodeMethodQueryArrayFloat32Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []float32
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]float32, len(qRaw))
                for i, rv := range qRaw {
                    v, err2 := strconv.ParseFloat(rv, 32)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of floats"))
                    }
                    q[i] = float32(v)
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayFloat32Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayFloat32EncodeCode = `// EncodeMethodQueryArrayFloat32Request returns an encoder for requests sent to
// the ServiceQueryArrayFloat32 MethodQueryArrayFloat32 server.
func EncodeMethodQueryArrayFloat32Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayfloat32.MethodQueryArrayFloat32Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayFloat32", "MethodQueryArrayFloat32", "*servicequeryarrayfloat32.MethodQueryArrayFloat32Payload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatFloat(float64(value), 'f', -1, 32)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayFloat32ValidateConstructorCode = `// NewMethodQueryArrayFloat32ValidatePayload builds a
// ServiceQueryArrayFloat32Validate service MethodQueryArrayFloat32Validate
// endpoint payload.
func NewMethodQueryArrayFloat32ValidatePayload(q []float32) *servicequeryarrayfloat32validate.MethodQueryArrayFloat32ValidatePayload {
    return &servicequeryarrayfloat32validate.MethodQueryArrayFloat32ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayFloat32ValidateDSL = func() {
    Service("ServiceQueryArrayFloat32Validate", func() {
        Method("MethodQueryArrayFloat32Validate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Float32), func() {
                    MinLength(1)
                    Elem(func() {
                        Minimum(1)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayFloat32ValidateDecodeCode = `// DecodeMethodQueryArrayFloat32ValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayFloat32Validate MethodQueryArrayFloat32Validate
// endpoint.
func DecodeMethodQueryArrayFloat32ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []float32
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]float32, len(qRaw))
            for i, rv := range qRaw {
                v, err2 := strconv.ParseFloat(rv, 32)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of floats"))
                }
                q[i] = float32(v)
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if e < 1 {
                err = goa.MergeErrors(err, goa.InvalidRangeError("q[*]", e, 1, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayFloat32ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayFloat32ValidateEncodeCode = `// EncodeMethodQueryArrayFloat32ValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayFloat32Validate MethodQueryArrayFloat32Validate
// server.
func EncodeMethodQueryArrayFloat32ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayfloat32validate.MethodQueryArrayFloat32ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayFloat32Validate", "MethodQueryArrayFloat32Validate", "*servicequeryarrayfloat32validate.MethodQueryArrayFloat32ValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatFloat(float64(value), 'f', -1, 32)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayFloat64ConstructorCode = `// NewMethodQueryArrayFloat64Payload builds a ServiceQueryArrayFloat64 service
// MethodQueryArrayFloat64 endpoint payload.
func NewMethodQueryArrayFloat64Payload(q []float64) *servicequeryarrayfloat64.MethodQueryArrayFloat64Payload {
    return &servicequeryarrayfloat64.MethodQueryArrayFloat64Payload{
        Q: q,
    }
}
`
var PayloadQueryArrayFloat64DSL = func() {
    Service("ServiceQueryArrayFloat64", func() {
        Method("MethodQueryArrayFloat64", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Float64))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayFloat64DecodeCode = `// DecodeMethodQueryArrayFloat64Request returns a decoder for requests sent to
// the ServiceQueryArrayFloat64 MethodQueryArrayFloat64 endpoint.
func DecodeMethodQueryArrayFloat64Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []float64
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]float64, len(qRaw))
                for i, rv := range qRaw {
                    v, err2 := strconv.ParseFloat(rv, 64)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of floats"))
                    }
                    q[i] = v
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayFloat64Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayFloat64EncodeCode = `// EncodeMethodQueryArrayFloat64Request returns an encoder for requests sent to
// the ServiceQueryArrayFloat64 MethodQueryArrayFloat64 server.
func EncodeMethodQueryArrayFloat64Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayfloat64.MethodQueryArrayFloat64Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayFloat64", "MethodQueryArrayFloat64", "*servicequeryarrayfloat64.MethodQueryArrayFloat64Payload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatFloat(value, 'f', -1, 64)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayFloat64ValidateConstructorCode = `// NewMethodQueryArrayFloat64ValidatePayload builds a
// ServiceQueryArrayFloat64Validate service MethodQueryArrayFloat64Validate
// endpoint payload.
func NewMethodQueryArrayFloat64ValidatePayload(q []float64) *servicequeryarrayfloat64validate.MethodQueryArrayFloat64ValidatePayload {
    return &servicequeryarrayfloat64validate.MethodQueryArrayFloat64ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayFloat64ValidateDSL = func() {
    Service("ServiceQueryArrayFloat64Validate", func() {
        Method("MethodQueryArrayFloat64Validate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Float64), func() {
                    MinLength(1)
                    Elem(func() {
                        Minimum(1)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayFloat64ValidateDecodeCode = `// DecodeMethodQueryArrayFloat64ValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayFloat64Validate MethodQueryArrayFloat64Validate
// endpoint.
func DecodeMethodQueryArrayFloat64ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []float64
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]float64, len(qRaw))
            for i, rv := range qRaw {
                v, err2 := strconv.ParseFloat(rv, 64)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of floats"))
                }
                q[i] = v
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if e < 1 {
                err = goa.MergeErrors(err, goa.InvalidRangeError("q[*]", e, 1, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayFloat64ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayFloat64ValidateEncodeCode = `// EncodeMethodQueryArrayFloat64ValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayFloat64Validate MethodQueryArrayFloat64Validate
// server.
func EncodeMethodQueryArrayFloat64ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayfloat64validate.MethodQueryArrayFloat64ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayFloat64Validate", "MethodQueryArrayFloat64Validate", "*servicequeryarrayfloat64validate.MethodQueryArrayFloat64ValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatFloat(value, 'f', -1, 64)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayInt32ConstructorCode = `// NewMethodQueryArrayInt32Payload builds a ServiceQueryArrayInt32 service
// MethodQueryArrayInt32 endpoint payload.
func NewMethodQueryArrayInt32Payload(q []int32) *servicequeryarrayint32.MethodQueryArrayInt32Payload {
    return &servicequeryarrayint32.MethodQueryArrayInt32Payload{
        Q: q,
    }
}
`
var PayloadQueryArrayInt32DSL = func() {
    Service("ServiceQueryArrayInt32", func() {
        Method("MethodQueryArrayInt32", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Int32))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayInt32DecodeCode = `// DecodeMethodQueryArrayInt32Request returns a decoder for requests sent to
// the ServiceQueryArrayInt32 MethodQueryArrayInt32 endpoint.
func DecodeMethodQueryArrayInt32Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []int32
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]int32, len(qRaw))
                for i, rv := range qRaw {
                    v, err2 := strconv.ParseInt(rv, 10, 32)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of integers"))
                    }
                    q[i] = int32(v)
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayInt32Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayInt32EncodeCode = `// EncodeMethodQueryArrayInt32Request returns an encoder for requests sent to
// the ServiceQueryArrayInt32 MethodQueryArrayInt32 server.
func EncodeMethodQueryArrayInt32Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayint32.MethodQueryArrayInt32Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayInt32", "MethodQueryArrayInt32", "*servicequeryarrayint32.MethodQueryArrayInt32Payload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatInt(int64(value), 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayInt32ValidateConstructorCode = `// NewMethodQueryArrayInt32ValidatePayload builds a
// ServiceQueryArrayInt32Validate service MethodQueryArrayInt32Validate
// endpoint payload.
func NewMethodQueryArrayInt32ValidatePayload(q []int32) *servicequeryarrayint32validate.MethodQueryArrayInt32ValidatePayload {
    return &servicequeryarrayint32validate.MethodQueryArrayInt32ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayInt32ValidateDSL = func() {
    Service("ServiceQueryArrayInt32Validate", func() {
        Method("MethodQueryArrayInt32Validate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Int32), func() {
                    MinLength(1)
                    Elem(func() {
                        Minimum(1)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayInt32ValidateDecodeCode = `// DecodeMethodQueryArrayInt32ValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayInt32Validate MethodQueryArrayInt32Validate
// endpoint.
func DecodeMethodQueryArrayInt32ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []int32
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]int32, len(qRaw))
            for i, rv := range qRaw {
                v, err2 := strconv.ParseInt(rv, 10, 32)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of integers"))
                }
                q[i] = int32(v)
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if e < 1 {
                err = goa.MergeErrors(err, goa.InvalidRangeError("q[*]", e, 1, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayInt32ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayInt32ValidateEncodeCode = `// EncodeMethodQueryArrayInt32ValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayInt32Validate MethodQueryArrayInt32Validate
// server.
func EncodeMethodQueryArrayInt32ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayint32validate.MethodQueryArrayInt32ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayInt32Validate", "MethodQueryArrayInt32Validate", "*servicequeryarrayint32validate.MethodQueryArrayInt32ValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatInt(int64(value), 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayInt64ConstructorCode = `// NewMethodQueryArrayInt64Payload builds a ServiceQueryArrayInt64 service
// MethodQueryArrayInt64 endpoint payload.
func NewMethodQueryArrayInt64Payload(q []int64) *servicequeryarrayint64.MethodQueryArrayInt64Payload {
    return &servicequeryarrayint64.MethodQueryArrayInt64Payload{
        Q: q,
    }
}
`
var PayloadQueryArrayInt64DSL = func() {
    Service("ServiceQueryArrayInt64", func() {
        Method("MethodQueryArrayInt64", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Int64))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayInt64DecodeCode = `// DecodeMethodQueryArrayInt64Request returns a decoder for requests sent to
// the ServiceQueryArrayInt64 MethodQueryArrayInt64 endpoint.
func DecodeMethodQueryArrayInt64Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []int64
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]int64, len(qRaw))
                for i, rv := range qRaw {
                    v, err2 := strconv.ParseInt(rv, 10, 64)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of integers"))
                    }
                    q[i] = v
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayInt64Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayInt64EncodeCode = `// EncodeMethodQueryArrayInt64Request returns an encoder for requests sent to
// the ServiceQueryArrayInt64 MethodQueryArrayInt64 server.
func EncodeMethodQueryArrayInt64Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayint64.MethodQueryArrayInt64Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayInt64", "MethodQueryArrayInt64", "*servicequeryarrayint64.MethodQueryArrayInt64Payload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatInt(value, 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayInt64ValidateConstructorCode = `// NewMethodQueryArrayInt64ValidatePayload builds a
// ServiceQueryArrayInt64Validate service MethodQueryArrayInt64Validate
// endpoint payload.
func NewMethodQueryArrayInt64ValidatePayload(q []int64) *servicequeryarrayint64validate.MethodQueryArrayInt64ValidatePayload {
    return &servicequeryarrayint64validate.MethodQueryArrayInt64ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayInt64ValidateDSL = func() {
    Service("ServiceQueryArrayInt64Validate", func() {
        Method("MethodQueryArrayInt64Validate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Int64), func() {
                    MinLength(1)
                    Elem(func() {
                        Minimum(1)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayInt64ValidateDecodeCode = `// DecodeMethodQueryArrayInt64ValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayInt64Validate MethodQueryArrayInt64Validate
// endpoint.
func DecodeMethodQueryArrayInt64ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []int64
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]int64, len(qRaw))
            for i, rv := range qRaw {
                v, err2 := strconv.ParseInt(rv, 10, 64)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of integers"))
                }
                q[i] = v
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if e < 1 {
                err = goa.MergeErrors(err, goa.InvalidRangeError("q[*]", e, 1, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayInt64ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayInt64ValidateEncodeCode = `// EncodeMethodQueryArrayInt64ValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayInt64Validate MethodQueryArrayInt64Validate
// server.
func EncodeMethodQueryArrayInt64ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayint64validate.MethodQueryArrayInt64ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayInt64Validate", "MethodQueryArrayInt64Validate", "*servicequeryarrayint64validate.MethodQueryArrayInt64ValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatInt(value, 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayIntConstructorCode = `// NewMethodQueryArrayIntPayload builds a ServiceQueryArrayInt service
// MethodQueryArrayInt endpoint payload.
func NewMethodQueryArrayIntPayload(q []int) *servicequeryarrayint.MethodQueryArrayIntPayload {
    return &servicequeryarrayint.MethodQueryArrayIntPayload{
        Q: q,
    }
}
`
var PayloadQueryArrayIntDSL = func() {
    Service("ServiceQueryArrayInt", func() {
        Method("MethodQueryArrayInt", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Int))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayIntDecodeCode = `// DecodeMethodQueryArrayIntRequest returns a decoder for requests sent to the
// ServiceQueryArrayInt MethodQueryArrayInt endpoint.
func DecodeMethodQueryArrayIntRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []int
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]int, len(qRaw))
                for i, rv := range qRaw {
                    v, err2 := strconv.ParseInt(rv, 10, strconv.IntSize)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of integers"))
                    }
                    q[i] = int(v)
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayIntPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayIntEncodeCode = `// EncodeMethodQueryArrayIntRequest returns an encoder for requests sent to the
// ServiceQueryArrayInt MethodQueryArrayInt server.
func EncodeMethodQueryArrayIntRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayint.MethodQueryArrayIntPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayInt", "MethodQueryArrayInt", "*servicequeryarrayint.MethodQueryArrayIntPayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.Itoa(value)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayIntValidateConstructorCode = `// NewMethodQueryArrayIntValidatePayload builds a ServiceQueryArrayIntValidate
// service MethodQueryArrayIntValidate endpoint payload.
func NewMethodQueryArrayIntValidatePayload(q []int) *servicequeryarrayintvalidate.MethodQueryArrayIntValidatePayload {
    return &servicequeryarrayintvalidate.MethodQueryArrayIntValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayIntValidateDSL = func() {
    Service("ServiceQueryArrayIntValidate", func() {
        Method("MethodQueryArrayIntValidate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(Int), func() {
                    MinLength(1)
                    Elem(func() {
                        Minimum(1)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayIntValidateDecodeCode = `// DecodeMethodQueryArrayIntValidateRequest returns a decoder for requests sent
// to the ServiceQueryArrayIntValidate MethodQueryArrayIntValidate endpoint.
func DecodeMethodQueryArrayIntValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []int
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]int, len(qRaw))
            for i, rv := range qRaw {
                v, err2 := strconv.ParseInt(rv, 10, strconv.IntSize)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of integers"))
                }
                q[i] = int(v)
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if e < 1 {
                err = goa.MergeErrors(err, goa.InvalidRangeError("q[*]", e, 1, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayIntValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayIntValidateEncodeCode = `// EncodeMethodQueryArrayIntValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayIntValidate MethodQueryArrayIntValidate server.
func EncodeMethodQueryArrayIntValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayintvalidate.MethodQueryArrayIntValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayIntValidate", "MethodQueryArrayIntValidate", "*servicequeryarrayintvalidate.MethodQueryArrayIntValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.Itoa(value)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayStringConstructorCode = `// NewMethodQueryArrayStringPayload builds a ServiceQueryArrayString service
// MethodQueryArrayString endpoint payload.
func NewMethodQueryArrayStringPayload(q []string) *servicequeryarraystring.MethodQueryArrayStringPayload {
    return &servicequeryarraystring.MethodQueryArrayStringPayload{
        Q: q,
    }
}
`
var PayloadQueryArrayStringDSL = func() {
    Service("ServiceQueryArrayString", func() {
        Method("MethodQueryArrayString", func() {
            Payload(func() {
                Attribute("q", ArrayOf(String))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayStringDecodeCode = `// DecodeMethodQueryArrayStringRequest returns a decoder for requests sent to
// the ServiceQueryArrayString MethodQueryArrayString endpoint.
func DecodeMethodQueryArrayStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q []string
        )
        q = r.URL.Query()["q"]
        payload := NewMethodQueryArrayStringPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayStringEncodeCode = `// EncodeMethodQueryArrayStringRequest returns an encoder for requests sent to
// the ServiceQueryArrayString MethodQueryArrayString server.
func EncodeMethodQueryArrayStringRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarraystring.MethodQueryArrayStringPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayString", "MethodQueryArrayString", "*servicequeryarraystring.MethodQueryArrayStringPayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            values.Add("q", value)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayStringValidateConstructorCode = `// NewMethodQueryArrayStringValidatePayload builds a
// ServiceQueryArrayStringValidate service MethodQueryArrayStringValidate
// endpoint payload.
func NewMethodQueryArrayStringValidatePayload(q []string) *servicequeryarraystringvalidate.MethodQueryArrayStringValidatePayload {
    return &servicequeryarraystringvalidate.MethodQueryArrayStringValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayStringValidateDSL = func() {
    Service("ServiceQueryArrayStringValidate", func() {
        Method("MethodQueryArrayStringValidate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(String), func() {
                    MinLength(1)
                    Elem(func() {
                        Enum("val")
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayStringValidateDecodeCode = `// DecodeMethodQueryArrayStringValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayStringValidate MethodQueryArrayStringValidate
// endpoint.
func DecodeMethodQueryArrayStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []string
            err error
        )
        q = r.URL.Query()["q"]
        if q == nil {
            err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if !(e == "val") {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q[*]", e, []interface{}{"val"}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayStringValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayStringValidateEncodeCode = `// EncodeMethodQueryArrayStringValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayStringValidate MethodQueryArrayStringValidate
// server.
func EncodeMethodQueryArrayStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarraystringvalidate.MethodQueryArrayStringValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayStringValidate", "MethodQueryArrayStringValidate", "*servicequeryarraystringvalidate.MethodQueryArrayStringValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            values.Add("q", value)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayUInt32ConstructorCode = `// NewMethodQueryArrayUInt32Payload builds a ServiceQueryArrayUInt32 service
// MethodQueryArrayUInt32 endpoint payload.
func NewMethodQueryArrayUInt32Payload(q []uint32) *servicequeryarrayuint32.MethodQueryArrayUInt32Payload {
    return &servicequeryarrayuint32.MethodQueryArrayUInt32Payload{
        Q: q,
    }
}
`
var PayloadQueryArrayUInt32DSL = func() {
    Service("ServiceQueryArrayUInt32", func() {
        Method("MethodQueryArrayUInt32", func() {
            Payload(func() {
                Attribute("q", ArrayOf(UInt32))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayUInt32DecodeCode = `// DecodeMethodQueryArrayUInt32Request returns a decoder for requests sent to
// the ServiceQueryArrayUInt32 MethodQueryArrayUInt32 endpoint.
func DecodeMethodQueryArrayUInt32Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []uint32
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]uint32, len(qRaw))
                for i, rv := range qRaw {
                    v, err2 := strconv.ParseUint(rv, 10, 32)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of unsigned integers"))
                    }
                    q[i] = int32(v)
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayUInt32Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayUInt32EncodeCode = `// EncodeMethodQueryArrayUInt32Request returns an encoder for requests sent to
// the ServiceQueryArrayUInt32 MethodQueryArrayUInt32 server.
func EncodeMethodQueryArrayUInt32Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayuint32.MethodQueryArrayUInt32Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayUInt32", "MethodQueryArrayUInt32", "*servicequeryarrayuint32.MethodQueryArrayUInt32Payload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatUint(uint64(value), 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayUInt32ValidateConstructorCode = `// NewMethodQueryArrayUInt32ValidatePayload builds a
// ServiceQueryArrayUInt32Validate service MethodQueryArrayUInt32Validate
// endpoint payload.
func NewMethodQueryArrayUInt32ValidatePayload(q []uint32) *servicequeryarrayuint32validate.MethodQueryArrayUInt32ValidatePayload {
    return &servicequeryarrayuint32validate.MethodQueryArrayUInt32ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayUInt32ValidateDSL = func() {
    Service("ServiceQueryArrayUInt32Validate", func() {
        Method("MethodQueryArrayUInt32Validate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(UInt32), func() {
                    MinLength(1)
                    Elem(func() {
                        Minimum(1)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayUInt32ValidateDecodeCode = `// DecodeMethodQueryArrayUInt32ValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayUInt32Validate MethodQueryArrayUInt32Validate
// endpoint.
func DecodeMethodQueryArrayUInt32ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []uint32
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]uint32, len(qRaw))
            for i, rv := range qRaw {
                v, err2 := strconv.ParseUint(rv, 10, 32)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of unsigned integers"))
                }
                q[i] = int32(v)
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if e < 1 {
                err = goa.MergeErrors(err, goa.InvalidRangeError("q[*]", e, 1, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayUInt32ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayUInt32ValidateEncodeCode = `// EncodeMethodQueryArrayUInt32ValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayUInt32Validate MethodQueryArrayUInt32Validate
// server.
func EncodeMethodQueryArrayUInt32ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayuint32validate.MethodQueryArrayUInt32ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayUInt32Validate", "MethodQueryArrayUInt32Validate", "*servicequeryarrayuint32validate.MethodQueryArrayUInt32ValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatUint(uint64(value), 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayUInt64ConstructorCode = `// NewMethodQueryArrayUInt64Payload builds a ServiceQueryArrayUInt64 service
// MethodQueryArrayUInt64 endpoint payload.
func NewMethodQueryArrayUInt64Payload(q []uint64) *servicequeryarrayuint64.MethodQueryArrayUInt64Payload {
    return &servicequeryarrayuint64.MethodQueryArrayUInt64Payload{
        Q: q,
    }
}
`
var PayloadQueryArrayUInt64DSL = func() {
    Service("ServiceQueryArrayUInt64", func() {
        Method("MethodQueryArrayUInt64", func() {
            Payload(func() {
                Attribute("q", ArrayOf(UInt64))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayUInt64DecodeCode = `// DecodeMethodQueryArrayUInt64Request returns a decoder for requests sent to
// the ServiceQueryArrayUInt64 MethodQueryArrayUInt64 endpoint.
func DecodeMethodQueryArrayUInt64Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []uint64
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]uint64, len(qRaw))
                for i, rv := range qRaw {
                    v, err2 := strconv.ParseUint(rv, 10, 64)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of unsigned integers"))
                    }
                    q[i] = v
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayUInt64Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayUInt64EncodeCode = `// EncodeMethodQueryArrayUInt64Request returns an encoder for requests sent to
// the ServiceQueryArrayUInt64 MethodQueryArrayUInt64 server.
func EncodeMethodQueryArrayUInt64Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayuint64.MethodQueryArrayUInt64Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayUInt64", "MethodQueryArrayUInt64", "*servicequeryarrayuint64.MethodQueryArrayUInt64Payload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatUint(value, 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayUInt64ValidateConstructorCode = `// NewMethodQueryArrayUInt64ValidatePayload builds a
// ServiceQueryArrayUInt64Validate service MethodQueryArrayUInt64Validate
// endpoint payload.
func NewMethodQueryArrayUInt64ValidatePayload(q []uint64) *servicequeryarrayuint64validate.MethodQueryArrayUInt64ValidatePayload {
    return &servicequeryarrayuint64validate.MethodQueryArrayUInt64ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayUInt64ValidateDSL = func() {
    Service("ServiceQueryArrayUInt64Validate", func() {
        Method("MethodQueryArrayUInt64Validate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(UInt64), func() {
                    MinLength(1)
                    Elem(func() {
                        Minimum(1)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayUInt64ValidateDecodeCode = `// DecodeMethodQueryArrayUInt64ValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayUInt64Validate MethodQueryArrayUInt64Validate
// endpoint.
func DecodeMethodQueryArrayUInt64ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []uint64
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]uint64, len(qRaw))
            for i, rv := range qRaw {
                v, err2 := strconv.ParseUint(rv, 10, 64)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of unsigned integers"))
                }
                q[i] = v
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if e < 1 {
                err = goa.MergeErrors(err, goa.InvalidRangeError("q[*]", e, 1, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayUInt64ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayUInt64ValidateEncodeCode = `// EncodeMethodQueryArrayUInt64ValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayUInt64Validate MethodQueryArrayUInt64Validate
// server.
func EncodeMethodQueryArrayUInt64ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayuint64validate.MethodQueryArrayUInt64ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayUInt64Validate", "MethodQueryArrayUInt64Validate", "*servicequeryarrayuint64validate.MethodQueryArrayUInt64ValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatUint(value, 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayUIntConstructorCode = `// NewMethodQueryArrayUIntPayload builds a ServiceQueryArrayUInt service
// MethodQueryArrayUInt endpoint payload.
func NewMethodQueryArrayUIntPayload(q []uint) *servicequeryarrayuint.MethodQueryArrayUIntPayload {
    return &servicequeryarrayuint.MethodQueryArrayUIntPayload{
        Q: q,
    }
}
`
var PayloadQueryArrayUIntDSL = func() {
    Service("ServiceQueryArrayUInt", func() {
        Method("MethodQueryArrayUInt", func() {
            Payload(func() {
                Attribute("q", ArrayOf(UInt))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayUIntDecodeCode = `// DecodeMethodQueryArrayUIntRequest returns a decoder for requests sent to the
// ServiceQueryArrayUInt MethodQueryArrayUInt endpoint.
func DecodeMethodQueryArrayUIntRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []uint
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw != nil {
                q = make([]uint, len(qRaw))
                for i, rv := range qRaw {
                    v, err2 := strconv.ParseUint(rv, 10, strconv.IntSize)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of unsigned integers"))
                    }
                    q[i] = uint(v)
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayUIntPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayUIntEncodeCode = `// EncodeMethodQueryArrayUIntRequest returns an encoder for requests sent to
// the ServiceQueryArrayUInt MethodQueryArrayUInt server.
func EncodeMethodQueryArrayUIntRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayuint.MethodQueryArrayUIntPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayUInt", "MethodQueryArrayUInt", "*servicequeryarrayuint.MethodQueryArrayUIntPayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatUint(uint64(value), 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryArrayUIntValidateConstructorCode = `// NewMethodQueryArrayUIntValidatePayload builds a
// ServiceQueryArrayUIntValidate service MethodQueryArrayUIntValidate endpoint
// payload.
func NewMethodQueryArrayUIntValidatePayload(q []uint) *servicequeryarrayuintvalidate.MethodQueryArrayUIntValidatePayload {
    return &servicequeryarrayuintvalidate.MethodQueryArrayUIntValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryArrayUIntValidateDSL = func() {
    Service("ServiceQueryArrayUIntValidate", func() {
        Method("MethodQueryArrayUIntValidate", func() {
            Payload(func() {
                Attribute("q", ArrayOf(UInt), func() {
                    MinLength(1)
                    Elem(func() {
                        Minimum(1)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryArrayUIntValidateDecodeCode = `// DecodeMethodQueryArrayUIntValidateRequest returns a decoder for requests
// sent to the ServiceQueryArrayUIntValidate MethodQueryArrayUIntValidate
// endpoint.
func DecodeMethodQueryArrayUIntValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []uint
            err error
        )
        {
            qRaw := r.URL.Query()["q"]
            if qRaw == nil {
                return goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make([]uint, len(qRaw))
            for i, rv := range qRaw {
                v, err2 := strconv.ParseUint(rv, 10, strconv.IntSize)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "array of unsigned integers"))
                }
                q[i] = uint(v)
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for _, e := range q {
            if e < 1 {
                err = goa.MergeErrors(err, goa.InvalidRangeError("q[*]", e, 1, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryArrayUIntValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryArrayUIntValidateEncodeCode = `// EncodeMethodQueryArrayUIntValidateRequest returns an encoder for requests
// sent to the ServiceQueryArrayUIntValidate MethodQueryArrayUIntValidate
// server.
func EncodeMethodQueryArrayUIntValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryarrayuintvalidate.MethodQueryArrayUIntValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryArrayUIntValidate", "MethodQueryArrayUIntValidate", "*servicequeryarrayuintvalidate.MethodQueryArrayUIntValidatePayload", v)
        }
        values := req.URL.Query()
        for _, value := range p.Q {
            valueStr := strconv.FormatUint(uint64(value), 10)
            values.Add("q", valueStr)
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryBoolConstructorCode = `// NewMethodQueryBoolPayload builds a ServiceQueryBool service MethodQueryBool
// endpoint payload.
func NewMethodQueryBoolPayload(q *bool) *servicequerybool.MethodQueryBoolPayload {
    return &servicequerybool.MethodQueryBoolPayload{
        Q: q,
    }
}
`
var PayloadQueryBoolDSL = func() {
    Service("ServiceQueryBool", func() {
        Method("MethodQueryBool", func() {
            Payload(func() {
                Attribute("q", Boolean)
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryBoolDecodeCode = `// DecodeMethodQueryBoolRequest returns a decoder for requests sent to the
// ServiceQueryBool MethodQueryBool endpoint.
func DecodeMethodQueryBoolRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   *bool
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw != "" {
                v, err2 := strconv.ParseBool(qRaw)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "boolean"))
                }
                q = &v
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryBoolPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryBoolEncodeCode = `// EncodeMethodQueryBoolRequest returns an encoder for requests sent to the
// ServiceQueryBool MethodQueryBool server.
func EncodeMethodQueryBoolRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerybool.MethodQueryBoolPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryBool", "MethodQueryBool", "*servicequerybool.MethodQueryBoolPayload", v)
        }
        values := req.URL.Query()
        if p.Q != nil {
            values.Add("q", fmt.Sprintf("%v", *p.Q))
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryBoolValidateConstructorCode = `// NewMethodQueryBoolValidatePayload builds a ServiceQueryBoolValidate service
// MethodQueryBoolValidate endpoint payload.
func NewMethodQueryBoolValidatePayload(q bool) *servicequeryboolvalidate.MethodQueryBoolValidatePayload {
    return &servicequeryboolvalidate.MethodQueryBoolValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryBoolValidateDSL = func() {
    Service("ServiceQueryBoolValidate", func() {
        Method("MethodQueryBoolValidate", func() {
            Payload(func() {
                Attribute("q", Boolean, func() {
                    Enum(true)
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryBoolValidateDecodeCode = `// DecodeMethodQueryBoolValidateRequest returns a decoder for requests sent to
// the ServiceQueryBoolValidate MethodQueryBoolValidate endpoint.
func DecodeMethodQueryBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   bool
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw == "" {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            v, err2 := strconv.ParseBool(qRaw)
            if err2 != nil {
                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "boolean"))
            }
            q = v
        }
        if !(q == true) {
            err = goa.MergeErrors(err, goa.InvalidEnumValueError("q", q, []interface{}{true}))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryBoolValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryBoolValidateEncodeCode = `// EncodeMethodQueryBoolValidateRequest returns an encoder for requests sent to
// the ServiceQueryBoolValidate MethodQueryBoolValidate server.
func EncodeMethodQueryBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryboolvalidate.MethodQueryBoolValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryBoolValidate", "MethodQueryBoolValidate", "*servicequeryboolvalidate.MethodQueryBoolValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryBytesConstructorCode = `// NewMethodQueryBytesPayload builds a ServiceQueryBytes service
// MethodQueryBytes endpoint payload.
func NewMethodQueryBytesPayload(q []byte) *servicequerybytes.MethodQueryBytesPayload {
    return &servicequerybytes.MethodQueryBytesPayload{
        Q: q,
    }
}
`
var PayloadQueryBytesDSL = func() {
    Service("ServiceQueryBytes", func() {
        Method("MethodQueryBytes", func() {
            Payload(func() {
                Attribute("q", Bytes)
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryBytesDecodeCode = `// DecodeMethodQueryBytesRequest returns a decoder for requests sent to the
// ServiceQueryBytes MethodQueryBytes endpoint.
func DecodeMethodQueryBytesRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q []byte
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw != "" {
                q = []byte(qRaw)
            }
        }
        payload := NewMethodQueryBytesPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryBytesEncodeCode = `// EncodeMethodQueryBytesRequest returns an encoder for requests sent to the
// ServiceQueryBytes MethodQueryBytes server.
func EncodeMethodQueryBytesRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerybytes.MethodQueryBytesPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryBytes", "MethodQueryBytes", "*servicequerybytes.MethodQueryBytesPayload", v)
        }
        values := req.URL.Query()
        values.Add("q", string(p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryBytesValidateConstructorCode = `// NewMethodQueryBytesValidatePayload builds a ServiceQueryBytesValidate
// service MethodQueryBytesValidate endpoint payload.
func NewMethodQueryBytesValidatePayload(q []byte) *servicequerybytesvalidate.MethodQueryBytesValidatePayload {
    return &servicequerybytesvalidate.MethodQueryBytesValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryBytesValidateDSL = func() {
    Service("ServiceQueryBytesValidate", func() {
        Method("MethodQueryBytesValidate", func() {
            Payload(func() {
                Attribute("q", Bytes, func() {
                    MinLength(1)
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryBytesValidateDecodeCode = `// DecodeMethodQueryBytesValidateRequest returns a decoder for requests sent to
// the ServiceQueryBytesValidate MethodQueryBytesValidate endpoint.
func DecodeMethodQueryBytesValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   []byte
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw == "" {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = []byte(qRaw)
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryBytesValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryBytesValidateEncodeCode = `// EncodeMethodQueryBytesValidateRequest returns an encoder for requests sent
// to the ServiceQueryBytesValidate MethodQueryBytesValidate server.
func EncodeMethodQueryBytesValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerybytesvalidate.MethodQueryBytesValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryBytesValidate", "MethodQueryBytesValidate", "*servicequerybytesvalidate.MethodQueryBytesValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", string(p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryFloat32ConstructorCode = `// NewMethodQueryFloat32Payload builds a ServiceQueryFloat32 service
// MethodQueryFloat32 endpoint payload.
func NewMethodQueryFloat32Payload(q *float32) *servicequeryfloat32.MethodQueryFloat32Payload {
    return &servicequeryfloat32.MethodQueryFloat32Payload{
        Q: q,
    }
}
`
var PayloadQueryFloat32DSL = func() {
    Service("ServiceQueryFloat32", func() {
        Method("MethodQueryFloat32", func() {
            Payload(func() {
                Attribute("q", Float32)
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryFloat32DecodeCode = `// DecodeMethodQueryFloat32Request returns a decoder for requests sent to the
// ServiceQueryFloat32 MethodQueryFloat32 endpoint.
func DecodeMethodQueryFloat32Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   *float32
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw != "" {
                v, err2 := strconv.ParseFloat(qRaw, 32)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "float"))
                }
                pv := float32(v)
                q = &pv
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryFloat32Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryFloat32EncodeCode = `// EncodeMethodQueryFloat32Request returns an encoder for requests sent to the
// ServiceQueryFloat32 MethodQueryFloat32 server.
func EncodeMethodQueryFloat32Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryfloat32.MethodQueryFloat32Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryFloat32", "MethodQueryFloat32", "*servicequeryfloat32.MethodQueryFloat32Payload", v)
        }
        values := req.URL.Query()
        if p.Q != nil {
            values.Add("q", fmt.Sprintf("%v", *p.Q))
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryFloat32ValidateConstructorCode = `// NewMethodQueryFloat32ValidatePayload builds a ServiceQueryFloat32Validate
// service MethodQueryFloat32Validate endpoint payload.
func NewMethodQueryFloat32ValidatePayload(q float32) *servicequeryfloat32validate.MethodQueryFloat32ValidatePayload {
    return &servicequeryfloat32validate.MethodQueryFloat32ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryFloat32ValidateDSL = func() {
    Service("ServiceQueryFloat32Validate", func() {
        Method("MethodQueryFloat32Validate", func() {
            Payload(func() {
                Attribute("q", Float32, func() {
                    Minimum(1)
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryFloat32ValidateDecodeCode = `// DecodeMethodQueryFloat32ValidateRequest returns a decoder for requests sent
// to the ServiceQueryFloat32Validate MethodQueryFloat32Validate endpoint.
func DecodeMethodQueryFloat32ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   float32
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw == "" {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            v, err2 := strconv.ParseFloat(qRaw, 32)
            if err2 != nil {
                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "float"))
            }
            q = float32(v)
        }
        if q < 1 {
            err = goa.MergeErrors(err, goa.InvalidRangeError("q", q, 1, true))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryFloat32ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryFloat32ValidateEncodeCode = `// EncodeMethodQueryFloat32ValidateRequest returns an encoder for requests sent
// to the ServiceQueryFloat32Validate MethodQueryFloat32Validate server.
func EncodeMethodQueryFloat32ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryfloat32validate.MethodQueryFloat32ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryFloat32Validate", "MethodQueryFloat32Validate", "*servicequeryfloat32validate.MethodQueryFloat32ValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryFloat64ConstructorCode = `// NewMethodQueryFloat64Payload builds a ServiceQueryFloat64 service
// MethodQueryFloat64 endpoint payload.
func NewMethodQueryFloat64Payload(q *float64) *servicequeryfloat64.MethodQueryFloat64Payload {
    return &servicequeryfloat64.MethodQueryFloat64Payload{
        Q: q,
    }
}
`
var PayloadQueryFloat64DSL = func() {
    Service("ServiceQueryFloat64", func() {
        Method("MethodQueryFloat64", func() {
            Payload(func() {
                Attribute("q", Float64)
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryFloat64DecodeCode = `// DecodeMethodQueryFloat64Request returns a decoder for requests sent to the
// ServiceQueryFloat64 MethodQueryFloat64 endpoint.
func DecodeMethodQueryFloat64Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   *float64
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw != "" {
                v, err2 := strconv.ParseFloat(qRaw, 64)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "float"))
                }
                q = &v
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryFloat64Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryFloat64EncodeCode = `// EncodeMethodQueryFloat64Request returns an encoder for requests sent to the
// ServiceQueryFloat64 MethodQueryFloat64 server.
func EncodeMethodQueryFloat64Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryfloat64.MethodQueryFloat64Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryFloat64", "MethodQueryFloat64", "*servicequeryfloat64.MethodQueryFloat64Payload", v)
        }
        values := req.URL.Query()
        if p.Q != nil {
            values.Add("q", fmt.Sprintf("%v", *p.Q))
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryFloat64ValidateConstructorCode = `// NewMethodQueryFloat64ValidatePayload builds a ServiceQueryFloat64Validate
// service MethodQueryFloat64Validate endpoint payload.
func NewMethodQueryFloat64ValidatePayload(q float64) *servicequeryfloat64validate.MethodQueryFloat64ValidatePayload {
    return &servicequeryfloat64validate.MethodQueryFloat64ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryFloat64ValidateDSL = func() {
    Service("ServiceQueryFloat64Validate", func() {
        Method("MethodQueryFloat64Validate", func() {
            Payload(func() {
                Attribute("q", Float64, func() {
                    Minimum(1)
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryFloat64ValidateDecodeCode = `// DecodeMethodQueryFloat64ValidateRequest returns a decoder for requests sent
// to the ServiceQueryFloat64Validate MethodQueryFloat64Validate endpoint.
func DecodeMethodQueryFloat64ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   float64
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw == "" {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            v, err2 := strconv.ParseFloat(qRaw, 64)
            if err2 != nil {
                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "float"))
            }
            q = v
        }
        if q < 1 {
            err = goa.MergeErrors(err, goa.InvalidRangeError("q", q, 1, true))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryFloat64ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryFloat64ValidateEncodeCode = `// EncodeMethodQueryFloat64ValidateRequest returns an encoder for requests sent
// to the ServiceQueryFloat64Validate MethodQueryFloat64Validate server.
func EncodeMethodQueryFloat64ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryfloat64validate.MethodQueryFloat64ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryFloat64Validate", "MethodQueryFloat64Validate", "*servicequeryfloat64validate.MethodQueryFloat64ValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryInt32ConstructorCode = `// NewMethodQueryInt32Payload builds a ServiceQueryInt32 service
// MethodQueryInt32 endpoint payload.
func NewMethodQueryInt32Payload(q *int32) *servicequeryint32.MethodQueryInt32Payload {
    return &servicequeryint32.MethodQueryInt32Payload{
        Q: q,
    }
}
`
var PayloadQueryInt32DSL = func() {
    Service("ServiceQueryInt32", func() {
        Method("MethodQueryInt32", func() {
            Payload(func() {
                Attribute("q", Int32)
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryInt32DecodeCode = `// DecodeMethodQueryInt32Request returns a decoder for requests sent to the
// ServiceQueryInt32 MethodQueryInt32 endpoint.
func DecodeMethodQueryInt32Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   *int32
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw != "" {
                v, err2 := strconv.ParseInt(qRaw, 10, 32)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "integer"))
                }
                pv := int32(v)
                q = &pv
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryInt32Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryInt32EncodeCode = `// EncodeMethodQueryInt32Request returns an encoder for requests sent to the
// ServiceQueryInt32 MethodQueryInt32 server.
func EncodeMethodQueryInt32Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryint32.MethodQueryInt32Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryInt32", "MethodQueryInt32", "*servicequeryint32.MethodQueryInt32Payload", v)
        }
        values := req.URL.Query()
        if p.Q != nil {
            values.Add("q", fmt.Sprintf("%v", *p.Q))
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryInt32ValidateConstructorCode = `// NewMethodQueryInt32ValidatePayload builds a ServiceQueryInt32Validate
// service MethodQueryInt32Validate endpoint payload.
func NewMethodQueryInt32ValidatePayload(q int32) *servicequeryint32validate.MethodQueryInt32ValidatePayload {
    return &servicequeryint32validate.MethodQueryInt32ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryInt32ValidateDSL = func() {
    Service("ServiceQueryInt32Validate", func() {
        Method("MethodQueryInt32Validate", func() {
            Payload(func() {
                Attribute("q", Int32, func() {
                    Minimum(1)
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryInt32ValidateDecodeCode = `// DecodeMethodQueryInt32ValidateRequest returns a decoder for requests sent to
// the ServiceQueryInt32Validate MethodQueryInt32Validate endpoint.
func DecodeMethodQueryInt32ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   int32
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw == "" {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            v, err2 := strconv.ParseInt(qRaw, 10, 32)
            if err2 != nil {
                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "integer"))
            }
            q = int32(v)
        }
        if q < 1 {
            err = goa.MergeErrors(err, goa.InvalidRangeError("q", q, 1, true))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryInt32ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryInt32ValidateEncodeCode = `// EncodeMethodQueryInt32ValidateRequest returns an encoder for requests sent
// to the ServiceQueryInt32Validate MethodQueryInt32Validate server.
func EncodeMethodQueryInt32ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryint32validate.MethodQueryInt32ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryInt32Validate", "MethodQueryInt32Validate", "*servicequeryint32validate.MethodQueryInt32ValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryInt64ConstructorCode = `// NewMethodQueryInt64Payload builds a ServiceQueryInt64 service
// MethodQueryInt64 endpoint payload.
func NewMethodQueryInt64Payload(q *int64) *servicequeryint64.MethodQueryInt64Payload {
    return &servicequeryint64.MethodQueryInt64Payload{
        Q: q,
    }
}
`
var PayloadQueryInt64DSL = func() {
    Service("ServiceQueryInt64", func() {
        Method("MethodQueryInt64", func() {
            Payload(func() {
                Attribute("q", Int64)
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryInt64DecodeCode = `// DecodeMethodQueryInt64Request returns a decoder for requests sent to the
// ServiceQueryInt64 MethodQueryInt64 endpoint.
func DecodeMethodQueryInt64Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   *int64
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw != "" {
                v, err2 := strconv.ParseInt(qRaw, 10, 64)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "integer"))
                }
                q = &v
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryInt64Payload(q)

        return payload, nil
    }
}
`
var PayloadQueryInt64EncodeCode = `// EncodeMethodQueryInt64Request returns an encoder for requests sent to the
// ServiceQueryInt64 MethodQueryInt64 server.
func EncodeMethodQueryInt64Request(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryint64.MethodQueryInt64Payload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryInt64", "MethodQueryInt64", "*servicequeryint64.MethodQueryInt64Payload", v)
        }
        values := req.URL.Query()
        if p.Q != nil {
            values.Add("q", fmt.Sprintf("%v", *p.Q))
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryInt64ValidateConstructorCode = `// NewMethodQueryInt64ValidatePayload builds a ServiceQueryInt64Validate
// service MethodQueryInt64Validate endpoint payload.
func NewMethodQueryInt64ValidatePayload(q int64) *servicequeryint64validate.MethodQueryInt64ValidatePayload {
    return &servicequeryint64validate.MethodQueryInt64ValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryInt64ValidateDSL = func() {
    Service("ServiceQueryInt64Validate", func() {
        Method("MethodQueryInt64Validate", func() {
            Payload(func() {
                Attribute("q", Int64, func() {
                    Minimum(1)
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryInt64ValidateDecodeCode = `// DecodeMethodQueryInt64ValidateRequest returns a decoder for requests sent to
// the ServiceQueryInt64Validate MethodQueryInt64Validate endpoint.
func DecodeMethodQueryInt64ValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   int64
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw == "" {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            v, err2 := strconv.ParseInt(qRaw, 10, 64)
            if err2 != nil {
                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "integer"))
            }
            q = v
        }
        if q < 1 {
            err = goa.MergeErrors(err, goa.InvalidRangeError("q", q, 1, true))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryInt64ValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryInt64ValidateEncodeCode = `// EncodeMethodQueryInt64ValidateRequest returns an encoder for requests sent
// to the ServiceQueryInt64Validate MethodQueryInt64Validate server.
func EncodeMethodQueryInt64ValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryint64validate.MethodQueryInt64ValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryInt64Validate", "MethodQueryInt64Validate", "*servicequeryint64validate.MethodQueryInt64ValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryIntConstructorCode = `// NewMethodQueryIntPayload builds a ServiceQueryInt service MethodQueryInt
// endpoint payload.
func NewMethodQueryIntPayload(q *int) *servicequeryint.MethodQueryIntPayload {
    return &servicequeryint.MethodQueryIntPayload{
        Q: q,
    }
}
`
var PayloadQueryIntDSL = func() {
    Service("ServiceQueryInt", func() {
        Method("MethodQueryInt", func() {
            Payload(func() {
                Attribute("q", Int)
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryIntDecodeCode = `// DecodeMethodQueryIntRequest returns a decoder for requests sent to the
// ServiceQueryInt MethodQueryInt endpoint.
func DecodeMethodQueryIntRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   *int
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw != "" {
                v, err2 := strconv.ParseInt(qRaw, 10, strconv.IntSize)
                if err2 != nil {
                    err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "integer"))
                }
                pv := int(v)
                q = &pv
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryIntPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryIntEncodeCode = `// EncodeMethodQueryIntRequest returns an encoder for requests sent to the
// ServiceQueryInt MethodQueryInt server.
func EncodeMethodQueryIntRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryint.MethodQueryIntPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryInt", "MethodQueryInt", "*servicequeryint.MethodQueryIntPayload", v)
        }
        values := req.URL.Query()
        if p.Q != nil {
            values.Add("q", fmt.Sprintf("%v", *p.Q))
        }
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryIntValidateConstructorCode = `// NewMethodQueryIntValidatePayload builds a ServiceQueryIntValidate service
// MethodQueryIntValidate endpoint payload.
func NewMethodQueryIntValidatePayload(q int) *servicequeryintvalidate.MethodQueryIntValidatePayload {
    return &servicequeryintvalidate.MethodQueryIntValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryIntValidateDSL = func() {
    Service("ServiceQueryIntValidate", func() {
        Method("MethodQueryIntValidate", func() {
            Payload(func() {
                Attribute("q", Int, func() {
                    Minimum(1)
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryIntValidateDecodeCode = `// DecodeMethodQueryIntValidateRequest returns a decoder for requests sent to
// the ServiceQueryIntValidate MethodQueryIntValidate endpoint.
func DecodeMethodQueryIntValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   int
            err error
        )
        {
            qRaw := r.URL.Query().Get("q")
            if qRaw == "" {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            v, err2 := strconv.ParseInt(qRaw, 10, strconv.IntSize)
            if err2 != nil {
                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("q", qRaw, "integer"))
            }
            q = int(v)
        }
        if q < 1 {
            err = goa.MergeErrors(err, goa.InvalidRangeError("q", q, 1, true))
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryIntValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryIntValidateEncodeCode = `// EncodeMethodQueryIntValidateRequest returns an encoder for requests sent to
// the ServiceQueryIntValidate MethodQueryIntValidate server.
func EncodeMethodQueryIntValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequeryintvalidate.MethodQueryIntValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryIntValidate", "MethodQueryIntValidate", "*servicequeryintvalidate.MethodQueryIntValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapBoolArrayBoolConstructorCode = `// NewMethodQueryMapBoolArrayBoolPayload builds a ServiceQueryMapBoolArrayBool
// service MethodQueryMapBoolArrayBool endpoint payload.
func NewMethodQueryMapBoolArrayBoolPayload(q map[bool][]bool) *servicequerymapboolarraybool.MethodQueryMapBoolArrayBoolPayload {
    return &servicequerymapboolarraybool.MethodQueryMapBoolArrayBoolPayload{
        Q: q,
    }
}
`
var PayloadQueryMapBoolArrayBoolDSL = func() {
    Service("ServiceQueryMapBoolArrayBool", func() {
        Method("MethodQueryMapBoolArrayBool", func() {
            Payload(func() {
                Attribute("q", MapOf(Boolean, ArrayOf(Boolean)))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapBoolArrayBoolDecodeCode = `// DecodeMethodQueryMapBoolArrayBoolRequest returns a decoder for requests sent
// to the ServiceQueryMapBoolArrayBool MethodQueryMapBoolArrayBool endpoint.
func DecodeMethodQueryMapBoolArrayBoolRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[bool][]bool
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) != 0 {
                q = make(map[bool][]bool, len(qRaw))
                for keyRaw, valRaw := range qRaw {
                    var key bool
                    {
                        v, err2 := strconv.ParseBool(keyRaw)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "boolean"))
                        }
                        key = v
                    }
                    var val []bool
                    {
                        val = make([]bool, len(valRaw))
                        for i, rv := range valRaw {
                            v, err2 := strconv.ParseBool(rv)
                            if err2 != nil {
                                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("val", valRaw, "array of booleans"))
                            }
                            val[i] = v
                        }
                    }
                    q[key] = val
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapBoolArrayBoolPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapBoolArrayBoolEncodeCode = `// EncodeMethodQueryMapBoolArrayBoolRequest returns an encoder for requests
// sent to the ServiceQueryMapBoolArrayBool MethodQueryMapBoolArrayBool server.
func EncodeMethodQueryMapBoolArrayBoolRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapboolarraybool.MethodQueryMapBoolArrayBoolPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapBoolArrayBool", "MethodQueryMapBoolArrayBool", "*servicequerymapboolarraybool.MethodQueryMapBoolArrayBoolPayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapBoolArrayBoolValidateConstructorCode = `// NewMethodQueryMapBoolArrayBoolValidatePayload builds a
// ServiceQueryMapBoolArrayBoolValidate service
// MethodQueryMapBoolArrayBoolValidate endpoint payload.
func NewMethodQueryMapBoolArrayBoolValidatePayload(q map[bool][]bool) *servicequerymapboolarrayboolvalidate.MethodQueryMapBoolArrayBoolValidatePayload {
    return &servicequerymapboolarrayboolvalidate.MethodQueryMapBoolArrayBoolValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryMapBoolArrayBoolValidateDSL = func() {
    Service("ServiceQueryMapBoolArrayBoolValidate", func() {
        Method("MethodQueryMapBoolArrayBoolValidate", func() {
            Payload(func() {
                Attribute("q", MapOf(Boolean, ArrayOf(Boolean)), func() {
                    MinLength(1)
                    Key(func() {
                        Enum(true)
                    })
                    Elem(func() {
                        MinLength(2)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapBoolArrayBoolValidateDecodeCode = `// DecodeMethodQueryMapBoolArrayBoolValidateRequest returns a decoder for
// requests sent to the ServiceQueryMapBoolArrayBoolValidate
// MethodQueryMapBoolArrayBoolValidate endpoint.
func DecodeMethodQueryMapBoolArrayBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[bool][]bool
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) == 0 {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make(map[bool][]bool, len(qRaw))
            for keyRaw, valRaw := range qRaw {
                var key bool
                {
                    v, err2 := strconv.ParseBool(keyRaw)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "boolean"))
                    }
                    key = v
                }
                var val []bool
                {
                    val = make([]bool, len(valRaw))
                    for i, rv := range valRaw {
                        v, err2 := strconv.ParseBool(rv)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("val", valRaw, "array of booleans"))
                        }
                        val[i] = v
                    }
                }
                q[key] = val
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for k, v := range q {
            if !(k == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q.key", k, []interface{}{true}))
            }
            if len(v) < 2 {
                err = goa.MergeErrors(err, goa.InvalidLengthError("q[key]", v, len(v), 2, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapBoolArrayBoolValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapBoolArrayBoolValidateEncodeCode = `// EncodeMethodQueryMapBoolArrayBoolValidateRequest returns an encoder for
// requests sent to the ServiceQueryMapBoolArrayBoolValidate
// MethodQueryMapBoolArrayBoolValidate server.
func EncodeMethodQueryMapBoolArrayBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapboolarrayboolvalidate.MethodQueryMapBoolArrayBoolValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapBoolArrayBoolValidate", "MethodQueryMapBoolArrayBoolValidate", "*servicequerymapboolarrayboolvalidate.MethodQueryMapBoolArrayBoolValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapBoolArrayStringConstructorCode = `// NewMethodQueryMapBoolArrayStringPayload builds a
// ServiceQueryMapBoolArrayString service MethodQueryMapBoolArrayString
// endpoint payload.
func NewMethodQueryMapBoolArrayStringPayload(q map[bool][]string) *servicequerymapboolarraystring.MethodQueryMapBoolArrayStringPayload {
    return &servicequerymapboolarraystring.MethodQueryMapBoolArrayStringPayload{
        Q: q,
    }
}
`
var PayloadQueryMapBoolArrayStringDSL = func() {
    Service("ServiceQueryMapBoolArrayString", func() {
        Method("MethodQueryMapBoolArrayString", func() {
            Payload(func() {
                Attribute("q", MapOf(Boolean, ArrayOf(String)))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapBoolArrayStringDecodeCode = `// DecodeMethodQueryMapBoolArrayStringRequest returns a decoder for requests
// sent to the ServiceQueryMapBoolArrayString MethodQueryMapBoolArrayString
// endpoint.
func DecodeMethodQueryMapBoolArrayStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[bool][]string
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) != 0 {
                q = make(map[bool][]string, len(qRaw))
                for keyRaw, val := range qRaw {
                    var key bool
                    {
                        v, err2 := strconv.ParseBool(keyRaw)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "boolean"))
                        }
                        key = v
                    }
                    q[key] = val
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapBoolArrayStringPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapBoolArrayStringEncodeCode = `// EncodeMethodQueryMapBoolArrayStringRequest returns an encoder for requests
// sent to the ServiceQueryMapBoolArrayString MethodQueryMapBoolArrayString
// server.
func EncodeMethodQueryMapBoolArrayStringRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapboolarraystring.MethodQueryMapBoolArrayStringPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapBoolArrayString", "MethodQueryMapBoolArrayString", "*servicequerymapboolarraystring.MethodQueryMapBoolArrayStringPayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapBoolArrayStringValidateConstructorCode = `// NewMethodQueryMapBoolArrayStringValidatePayload builds a
// ServiceQueryMapBoolArrayStringValidate service
// MethodQueryMapBoolArrayStringValidate endpoint payload.
func NewMethodQueryMapBoolArrayStringValidatePayload(q map[bool][]string) *servicequerymapboolarraystringvalidate.MethodQueryMapBoolArrayStringValidatePayload {
    return &servicequerymapboolarraystringvalidate.MethodQueryMapBoolArrayStringValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryMapBoolArrayStringValidateDSL = func() {
    Service("ServiceQueryMapBoolArrayStringValidate", func() {
        Method("MethodQueryMapBoolArrayStringValidate", func() {
            Payload(func() {
                Attribute("q", MapOf(Boolean, ArrayOf(String)), func() {
                    MinLength(1)
                    Key(func() {
                        Enum(true)
                    })
                    Elem(func() {
                        MinLength(2)
                    })
                })
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapBoolArrayStringValidateDecodeCode = `// DecodeMethodQueryMapBoolArrayStringValidateRequest returns a decoder for
// requests sent to the ServiceQueryMapBoolArrayStringValidate
// MethodQueryMapBoolArrayStringValidate endpoint.
func DecodeMethodQueryMapBoolArrayStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[bool][]string
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) != 0 {
                q = make(map[bool][]string, len(qRaw))
                for keyRaw, val := range qRaw {
                    var key bool
                    {
                        v, err2 := strconv.ParseBool(keyRaw)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "boolean"))
                        }
                        key = v
                    }
                    q[key] = val
                }
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for k, v := range q {
            if !(k == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q.key", k, []interface{}{true}))
            }
            if len(v) < 2 {
                err = goa.MergeErrors(err, goa.InvalidLengthError("q[key]", v, len(v), 2, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapBoolArrayStringValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapBoolArrayStringValidateEncodeCode = `// EncodeMethodQueryMapBoolArrayStringValidateRequest returns an encoder for
// requests sent to the ServiceQueryMapBoolArrayStringValidate
// MethodQueryMapBoolArrayStringValidate server.
func EncodeMethodQueryMapBoolArrayStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapboolarraystringvalidate.MethodQueryMapBoolArrayStringValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapBoolArrayStringValidate", "MethodQueryMapBoolArrayStringValidate", "*servicequerymapboolarraystringvalidate.MethodQueryMapBoolArrayStringValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapBoolBoolConstructorCode = `// NewMethodQueryMapBoolBoolPayload builds a ServiceQueryMapBoolBool service
// MethodQueryMapBoolBool endpoint payload.
func NewMethodQueryMapBoolBoolPayload(q map[bool]bool) *servicequerymapboolbool.MethodQueryMapBoolBoolPayload {
    return &servicequerymapboolbool.MethodQueryMapBoolBoolPayload{
        Q: q,
    }
}
`
var PayloadQueryMapBoolBoolDSL = func() {
    Service("ServiceQueryMapBoolBool", func() {
        Method("MethodQueryMapBoolBool", func() {
            Payload(func() {
                Attribute("q", MapOf(Boolean, Boolean))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapBoolBoolDecodeCode = `// DecodeMethodQueryMapBoolBoolRequest returns a decoder for requests sent to
// the ServiceQueryMapBoolBool MethodQueryMapBoolBool endpoint.
func DecodeMethodQueryMapBoolBoolRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[bool]bool
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) != 0 {
                q = make(map[bool]bool, len(qRaw))
                for keyRaw, va := range qRaw {
                    var key bool
                    {
                        v, err2 := strconv.ParseBool(keyRaw)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "boolean"))
                        }
                        key = v
                    }
                    var val bool
                    {
                        valRaw := va[0]
                        v, err2 := strconv.ParseBool(valRaw)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("val", valRaw, "boolean"))
                        }
                        val = v
                    }
                    q[key] = val
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapBoolBoolPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapBoolBoolEncodeCode = `// EncodeMethodQueryMapBoolBoolRequest returns an encoder for requests sent to
// the ServiceQueryMapBoolBool MethodQueryMapBoolBool server.
func EncodeMethodQueryMapBoolBoolRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapboolbool.MethodQueryMapBoolBoolPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapBoolBool", "MethodQueryMapBoolBool", "*servicequerymapboolbool.MethodQueryMapBoolBoolPayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapBoolBoolValidateConstructorCode = `// NewMethodQueryMapBoolBoolValidatePayload builds a
// ServiceQueryMapBoolBoolValidate service MethodQueryMapBoolBoolValidate
// endpoint payload.
func NewMethodQueryMapBoolBoolValidatePayload(q map[bool]bool) *servicequerymapboolboolvalidate.MethodQueryMapBoolBoolValidatePayload {
    return &servicequerymapboolboolvalidate.MethodQueryMapBoolBoolValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryMapBoolBoolValidateDSL = func() {
    Service("ServiceQueryMapBoolBoolValidate", func() {
        Method("MethodQueryMapBoolBoolValidate", func() {
            Payload(func() {
                Attribute("q", MapOf(Boolean, Boolean), func() {
                    MinLength(1)
                    Key(func() {
                        Enum(false)
                    })
                    Elem(func() {
                        Enum(true)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapBoolBoolValidateDecodeCode = `// DecodeMethodQueryMapBoolBoolValidateRequest returns a decoder for requests
// sent to the ServiceQueryMapBoolBoolValidate MethodQueryMapBoolBoolValidate
// endpoint.
func DecodeMethodQueryMapBoolBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[bool]bool
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) == 0 {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make(map[bool]bool, len(qRaw))
            for keyRaw, va := range qRaw {
                var key bool
                {
                    v, err2 := strconv.ParseBool(keyRaw)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "boolean"))
                    }
                    key = v
                }
                var val bool
                {
                    valRaw := va[0]
                    v, err2 := strconv.ParseBool(valRaw)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("val", valRaw, "boolean"))
                    }
                    val = v
                }
                q[key] = val
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for k, v := range q {
            if !(k == false) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q.key", k, []interface{}{false}))
            }
            if !(v == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q[key]", v, []interface{}{true}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapBoolBoolValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapBoolBoolValidateEncodeCode = `// EncodeMethodQueryMapBoolBoolValidateRequest returns an encoder for requests
// sent to the ServiceQueryMapBoolBoolValidate MethodQueryMapBoolBoolValidate
// server.
func EncodeMethodQueryMapBoolBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapboolboolvalidate.MethodQueryMapBoolBoolValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapBoolBoolValidate", "MethodQueryMapBoolBoolValidate", "*servicequerymapboolboolvalidate.MethodQueryMapBoolBoolValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapBoolStringConstructorCode = `// NewMethodQueryMapBoolStringPayload builds a ServiceQueryMapBoolString
// service MethodQueryMapBoolString endpoint payload.
func NewMethodQueryMapBoolStringPayload(q map[bool]string) *servicequerymapboolstring.MethodQueryMapBoolStringPayload {
    return &servicequerymapboolstring.MethodQueryMapBoolStringPayload{
        Q: q,
    }
}
`
var PayloadQueryMapBoolStringDSL = func() {
    Service("ServiceQueryMapBoolString", func() {
        Method("MethodQueryMapBoolString", func() {
            Payload(func() {
                Attribute("q", MapOf(Boolean, String))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapBoolStringDecodeCode = `// DecodeMethodQueryMapBoolStringRequest returns a decoder for requests sent to
// the ServiceQueryMapBoolString MethodQueryMapBoolString endpoint.
func DecodeMethodQueryMapBoolStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[bool]string
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) != 0 {
                q = make(map[bool]string, len(qRaw))
                for keyRaw, va := range qRaw {
                    var key bool
                    {
                        v, err2 := strconv.ParseBool(keyRaw)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "boolean"))
                        }
                        key = v
                    }
                    var val string
                    {
                        val = va[0]
                    }
                    q[key] = val
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapBoolStringPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapBoolStringEncodeCode = `// EncodeMethodQueryMapBoolStringRequest returns an encoder for requests sent
// to the ServiceQueryMapBoolString MethodQueryMapBoolString server.
func EncodeMethodQueryMapBoolStringRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapboolstring.MethodQueryMapBoolStringPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapBoolString", "MethodQueryMapBoolString", "*servicequerymapboolstring.MethodQueryMapBoolStringPayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapBoolStringValidateConstructorCode = `// NewMethodQueryMapBoolStringValidatePayload builds a
// ServiceQueryMapBoolStringValidate service MethodQueryMapBoolStringValidate
// endpoint payload.
func NewMethodQueryMapBoolStringValidatePayload(q map[bool]string) *servicequerymapboolstringvalidate.MethodQueryMapBoolStringValidatePayload {
    return &servicequerymapboolstringvalidate.MethodQueryMapBoolStringValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryMapBoolStringValidateDSL = func() {
    Service("ServiceQueryMapBoolStringValidate", func() {
        Method("MethodQueryMapBoolStringValidate", func() {
            Payload(func() {
                Attribute("q", MapOf(Boolean, String), func() {
                    MinLength(1)
                    Key(func() {
                        Enum(true)
                    })
                    Elem(func() {
                        Enum("val")
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapBoolStringValidateDecodeCode = `// DecodeMethodQueryMapBoolStringValidateRequest returns a decoder for requests
// sent to the ServiceQueryMapBoolStringValidate
// MethodQueryMapBoolStringValidate endpoint.
func DecodeMethodQueryMapBoolStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[bool]string
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) == 0 {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make(map[bool]string, len(qRaw))
            for keyRaw, va := range qRaw {
                var key bool
                {
                    v, err2 := strconv.ParseBool(keyRaw)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("key", keyRaw, "boolean"))
                    }
                    key = v
                }
                var val string
                {
                    val = va[0]
                }
                q[key] = val
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for k, v := range q {
            if !(k == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q.key", k, []interface{}{true}))
            }
            if !(v == "val") {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q[key]", v, []interface{}{"val"}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapBoolStringValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapBoolStringValidateEncodeCode = `// EncodeMethodQueryMapBoolStringValidateRequest returns an encoder for
// requests sent to the ServiceQueryMapBoolStringValidate
// MethodQueryMapBoolStringValidate server.
func EncodeMethodQueryMapBoolStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapboolstringvalidate.MethodQueryMapBoolStringValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapBoolStringValidate", "MethodQueryMapBoolStringValidate", "*servicequerymapboolstringvalidate.MethodQueryMapBoolStringValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapStringArrayBoolConstructorCode = `// NewMethodQueryMapStringArrayBoolPayload builds a
// ServiceQueryMapStringArrayBool service MethodQueryMapStringArrayBool
// endpoint payload.
func NewMethodQueryMapStringArrayBoolPayload(q map[string][]bool) *servicequerymapstringarraybool.MethodQueryMapStringArrayBoolPayload {
    return &servicequerymapstringarraybool.MethodQueryMapStringArrayBoolPayload{
        Q: q,
    }
}
`
var PayloadQueryMapStringArrayBoolDSL = func() {
    Service("ServiceQueryMapStringArrayBool", func() {
        Method("MethodQueryMapStringArrayBool", func() {
            Payload(func() {
                Attribute("q", MapOf(String, ArrayOf(Boolean)))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapStringArrayBoolDecodeCode = `// DecodeMethodQueryMapStringArrayBoolRequest returns a decoder for requests
// sent to the ServiceQueryMapStringArrayBool MethodQueryMapStringArrayBool
// endpoint.
func DecodeMethodQueryMapStringArrayBoolRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[string][]bool
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) != 0 {
                q = make(map[string][]bool, len(qRaw))
                for key, valRaw := range qRaw {
                    var val []bool
                    {
                        val = make([]bool, len(valRaw))
                        for i, rv := range valRaw {
                            v, err2 := strconv.ParseBool(rv)
                            if err2 != nil {
                                err = goa.MergeErrors(err, goa.InvalidFieldTypeError("val", valRaw, "array of booleans"))
                            }
                            val[i] = v
                        }
                    }
                    q[key] = val
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapStringArrayBoolPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapStringArrayBoolEncodeCode = `// EncodeMethodQueryMapStringArrayBoolRequest returns an encoder for requests
// sent to the ServiceQueryMapStringArrayBool MethodQueryMapStringArrayBool
// server.
func EncodeMethodQueryMapStringArrayBoolRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapstringarraybool.MethodQueryMapStringArrayBoolPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapStringArrayBool", "MethodQueryMapStringArrayBool", "*servicequerymapstringarraybool.MethodQueryMapStringArrayBoolPayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapStringArrayBoolValidateConstructorCode = `// NewMethodQueryMapStringArrayBoolValidatePayload builds a
// ServiceQueryMapStringArrayBoolValidate service
// MethodQueryMapStringArrayBoolValidate endpoint payload.
func NewMethodQueryMapStringArrayBoolValidatePayload(q map[string][]bool) *servicequerymapstringarrayboolvalidate.MethodQueryMapStringArrayBoolValidatePayload {
    return &servicequerymapstringarrayboolvalidate.MethodQueryMapStringArrayBoolValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryMapStringArrayBoolValidateDSL = func() {
    Service("ServiceQueryMapStringArrayBoolValidate", func() {
        Method("MethodQueryMapStringArrayBoolValidate", func() {
            Payload(func() {
                Attribute("q", MapOf(String, ArrayOf(Boolean)), func() {
                    MinLength(1)
                    Key(func() {
                        Enum("key")
                    })
                    Elem(func() {
                        MinLength(2)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapStringArrayBoolValidateDecodeCode = `// DecodeMethodQueryMapStringArrayBoolValidateRequest returns a decoder for
// requests sent to the ServiceQueryMapStringArrayBoolValidate
// MethodQueryMapStringArrayBoolValidate endpoint.
func DecodeMethodQueryMapStringArrayBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[string][]bool
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) == 0 {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make(map[string][]bool, len(qRaw))
            for key, valRaw := range qRaw {
                var val []bool
                {
                    val = make([]bool, len(valRaw))
                    for i, rv := range valRaw {
                        v, err2 := strconv.ParseBool(rv)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("val", valRaw, "array of booleans"))
                        }
                        val[i] = v
                    }
                }
                q[key] = val
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for k, v := range q {
            if !(k == "key") {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q.key", k, []interface{}{"key"}))
            }
            if len(v) < 2 {
                err = goa.MergeErrors(err, goa.InvalidLengthError("q[key]", v, len(v), 2, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapStringArrayBoolValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapStringArrayBoolValidateEncodeCode = `// EncodeMethodQueryMapStringArrayBoolValidateRequest returns an encoder for
// requests sent to the ServiceQueryMapStringArrayBoolValidate
// MethodQueryMapStringArrayBoolValidate server.
func EncodeMethodQueryMapStringArrayBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapstringarrayboolvalidate.MethodQueryMapStringArrayBoolValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapStringArrayBoolValidate", "MethodQueryMapStringArrayBoolValidate", "*servicequerymapstringarrayboolvalidate.MethodQueryMapStringArrayBoolValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapStringArrayStringConstructorCode = `// NewMethodQueryMapStringArrayStringPayload builds a
// ServiceQueryMapStringArrayString service MethodQueryMapStringArrayString
// endpoint payload.
func NewMethodQueryMapStringArrayStringPayload(q map[string][]string) *servicequerymapstringarraystring.MethodQueryMapStringArrayStringPayload {
    return &servicequerymapstringarraystring.MethodQueryMapStringArrayStringPayload{
        Q: q,
    }
}
`
var PayloadQueryMapStringArrayStringDSL = func() {
    Service("ServiceQueryMapStringArrayString", func() {
        Method("MethodQueryMapStringArrayString", func() {
            Payload(func() {
                Attribute("q", MapOf(String, ArrayOf(String)))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapStringArrayStringDecodeCode = `// DecodeMethodQueryMapStringArrayStringRequest returns a decoder for requests
// sent to the ServiceQueryMapStringArrayString MethodQueryMapStringArrayString
// endpoint.
func DecodeMethodQueryMapStringArrayStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q map[string][]string
        )
        q = r.URL.Query()
        payload := NewMethodQueryMapStringArrayStringPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapStringArrayStringEncodeCode = `// EncodeMethodQueryMapStringArrayStringRequest returns an encoder for requests
// sent to the ServiceQueryMapStringArrayString MethodQueryMapStringArrayString
// server.
func EncodeMethodQueryMapStringArrayStringRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapstringarraystring.MethodQueryMapStringArrayStringPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapStringArrayString", "MethodQueryMapStringArrayString", "*servicequerymapstringarraystring.MethodQueryMapStringArrayStringPayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapStringArrayStringValidateConstructorCode = `// NewMethodQueryMapStringArrayStringValidatePayload builds a
// ServiceQueryMapStringArrayStringValidate service
// MethodQueryMapStringArrayStringValidate endpoint payload.
func NewMethodQueryMapStringArrayStringValidatePayload(q map[string][]string) *servicequerymapstringarraystringvalidate.MethodQueryMapStringArrayStringValidatePayload {
    return &servicequerymapstringarraystringvalidate.MethodQueryMapStringArrayStringValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryMapStringArrayStringValidateDSL = func() {
    Service("ServiceQueryMapStringArrayStringValidate", func() {
        Method("MethodQueryMapStringArrayStringValidate", func() {
            Payload(func() {
                Attribute("q", MapOf(String, ArrayOf(String)), func() {
                    MinLength(1)
                    Key(func() {
                        Enum("key")
                    })
                    Elem(func() {
                        MinLength(2)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapStringArrayStringValidateDecodeCode = `// DecodeMethodQueryMapStringArrayStringValidateRequest returns a decoder for
// requests sent to the ServiceQueryMapStringArrayStringValidate
// MethodQueryMapStringArrayStringValidate endpoint.
func DecodeMethodQueryMapStringArrayStringValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[string][]string
            err error
        )
        q = r.URL.Query()
        if len(q) == 0 {
            err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for k, v := range q {
            if !(k == "key") {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q.key", k, []interface{}{"key"}))
            }
            if len(v) < 2 {
                err = goa.MergeErrors(err, goa.InvalidLengthError("q[key]", v, len(v), 2, true))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapStringArrayStringValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapStringArrayStringValidateEncodeCode = `// EncodeMethodQueryMapStringArrayStringValidateRequest returns an encoder for
// requests sent to the ServiceQueryMapStringArrayStringValidate
// MethodQueryMapStringArrayStringValidate server.
func EncodeMethodQueryMapStringArrayStringValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapstringarraystringvalidate.MethodQueryMapStringArrayStringValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapStringArrayStringValidate", "MethodQueryMapStringArrayStringValidate", "*servicequerymapstringarraystringvalidate.MethodQueryMapStringArrayStringValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapStringBoolConstructorCode = `// NewMethodQueryMapStringBoolPayload builds a ServiceQueryMapStringBool
// service MethodQueryMapStringBool endpoint payload.
func NewMethodQueryMapStringBoolPayload(q map[string]bool) *servicequerymapstringbool.MethodQueryMapStringBoolPayload {
    return &servicequerymapstringbool.MethodQueryMapStringBoolPayload{
        Q: q,
    }
}
`
var PayloadQueryMapStringBoolDSL = func() {
    Service("ServiceQueryMapStringBool", func() {
        Method("MethodQueryMapStringBool", func() {
            Payload(func() {
                Attribute("q", MapOf(String, Boolean))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapStringBoolDecodeCode = `// DecodeMethodQueryMapStringBoolRequest returns a decoder for requests sent to
// the ServiceQueryMapStringBool MethodQueryMapStringBool endpoint.
func DecodeMethodQueryMapStringBoolRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[string]bool
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) != 0 {
                q = make(map[string]bool, len(qRaw))
                for key, va := range qRaw {
                    var val bool
                    {
                        valRaw := va[0]
                        v, err2 := strconv.ParseBool(valRaw)
                        if err2 != nil {
                            err = goa.MergeErrors(err, goa.InvalidFieldTypeError("val", valRaw, "boolean"))
                        }
                        val = v
                    }
                    q[key] = val
                }
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapStringBoolPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapStringBoolEncodeCode = `// EncodeMethodQueryMapStringBoolRequest returns an encoder for requests sent
// to the ServiceQueryMapStringBool MethodQueryMapStringBool server.
func EncodeMethodQueryMapStringBoolRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapstringbool.MethodQueryMapStringBoolPayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapStringBool", "MethodQueryMapStringBool", "*servicequerymapstringbool.MethodQueryMapStringBoolPayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapStringBoolValidateConstructorCode = `// NewMethodQueryMapStringBoolValidatePayload builds a
// ServiceQueryMapStringBoolValidate service MethodQueryMapStringBoolValidate
// endpoint payload.
func NewMethodQueryMapStringBoolValidatePayload(q map[string]bool) *servicequerymapstringboolvalidate.MethodQueryMapStringBoolValidatePayload {
    return &servicequerymapstringboolvalidate.MethodQueryMapStringBoolValidatePayload{
        Q: q,
    }
}
`
var PayloadQueryMapStringBoolValidateDSL = func() {
    Service("ServiceQueryMapStringBoolValidate", func() {
        Method("MethodQueryMapStringBoolValidate", func() {
            Payload(func() {
                Attribute("q", MapOf(String, Boolean), func() {
                    MinLength(1)
                    Key(func() {
                        Enum("key")
                    })
                    Elem(func() {
                        Enum(true)
                    })
                })
                Required("q")
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapStringBoolValidateDecodeCode = `// DecodeMethodQueryMapStringBoolValidateRequest returns a decoder for requests
// sent to the ServiceQueryMapStringBoolValidate
// MethodQueryMapStringBoolValidate endpoint.
func DecodeMethodQueryMapStringBoolValidateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q   map[string]bool
            err error
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) == 0 {
                err = goa.MergeErrors(err, goa.MissingFieldError("q", "query string"))
            }
            q = make(map[string]bool, len(qRaw))
            for key, va := range qRaw {
                var val bool
                {
                    valRaw := va[0]
                    v, err2 := strconv.ParseBool(valRaw)
                    if err2 != nil {
                        err = goa.MergeErrors(err, goa.InvalidFieldTypeError("val", valRaw, "boolean"))
                    }
                    val = v
                }
                q[key] = val
            }
        }
        if len(q) < 1 {
            err = goa.MergeErrors(err, goa.InvalidLengthError("q", q, len(q), 1, true))
        }
        for k, v := range q {
            if !(k == "key") {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q.key", k, []interface{}{"key"}))
            }
            if !(v == true) {
                err = goa.MergeErrors(err, goa.InvalidEnumValueError("q[key]", v, []interface{}{true}))
            }
        }
        if err != nil {
            return nil, err
        }
        payload := NewMethodQueryMapStringBoolValidatePayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapStringBoolValidateEncodeCode = `// EncodeMethodQueryMapStringBoolValidateRequest returns an encoder for
// requests sent to the ServiceQueryMapStringBoolValidate
// MethodQueryMapStringBoolValidate server.
func EncodeMethodQueryMapStringBoolValidateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
    return func(req *http.Request, v interface{}) error {
        p, ok := v.(*servicequerymapstringboolvalidate.MethodQueryMapStringBoolValidatePayload)
        if !ok {
            return goahttp.ErrInvalidType("ServiceQueryMapStringBoolValidate", "MethodQueryMapStringBoolValidate", "*servicequerymapstringboolvalidate.MethodQueryMapStringBoolValidatePayload", v)
        }
        values := req.URL.Query()
        values.Add("q", fmt.Sprintf("%v", p.Q))
        req.URL.RawQuery = values.Encode()
        return nil
    }
}
`
var PayloadQueryMapStringStringConstructorCode = `// NewMethodQueryMapStringStringPayload builds a ServiceQueryMapStringString
// service MethodQueryMapStringString endpoint payload.
func NewMethodQueryMapStringStringPayload(q map[string]string) *servicequerymapstringstring.MethodQueryMapStringStringPayload {
    return &servicequerymapstringstring.MethodQueryMapStringStringPayload{
        Q: q,
    }
}
`
var PayloadQueryMapStringStringDSL = func() {
    Service("ServiceQueryMapStringString", func() {
        Method("MethodQueryMapStringString", func() {
            Payload(func() {
                Attribute("q", MapOf(String, String))
            })
            HTTP(func() {
                GET("/")
                Param("q")
            })
        })
    })
}
var PayloadQueryMapStringStringDecodeCode = `// DecodeMethodQueryMapStringStringRequest returns a decoder for requests sent
// to the ServiceQueryMapStringString MethodQueryMapStringString endpoint.
func DecodeMethodQueryMapStringStringRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
    return func(r *http.Request) (interface{}, error) {
        var (
            q map[string]string
        )
        {
            qRaw := r.URL.Query()
            if len(qRaw) != 0 {
                q = make(map[string]string, len(qRaw))
                for key, va := range qRaw {
                    var val string
                    {
                        val = va[0]
                    }
                    q[key] = val
                }
            }
        }
        payload := NewMethodQueryMapStringStringPayload(q)

        return payload, nil
    }
}
`
var PayloadQueryMapS