func Build(r *request.Request) {
	if m, ok := r.Params.(protocol.FieldMarshaler); ok {
		e := NewEncoder(r.HTTPRequest)
		m.MarshalFields(e)
		var body io.ReadSeeker
		var err error
		r.HTTPRequest, body, err = e.Encode()
		if err != nil {
			r.Error = awserr.New(request.ErrCodeSerialization, "failed to encode rest JSON request", err)
			return
		}
		if body != nil {
			r.SetReaderBody(body)
		}
		return
	}
	rest.Build(r)
	if t := rest.PayloadType(r.Params); t == "structure" || t == "" {
		jsonrpc.Build(r)
	}
}
Build builds a request for the REST JSON protocol.
package restjson
import (
	"encoding/json"
	"io"
	"io/ioutil"
	"strings"
	request "github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/aws/awserr"
	"github.com/aws/aws-sdk-go-v2/private/protocol"
	"github.com/aws/aws-sdk-go-v2/private/protocol/jsonrpc"
	"github.com/aws/aws-sdk-go-v2/private/protocol/rest"
)
var BuildHandler = request.NamedHandler{Name: "awssdk.restjson.Build", Fn: Build}
var UnmarshalHandler = request.NamedHandler{Name: "awssdk.restjson.Unmarshal", Fn: Unmarshal}
var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.restjson.UnmarshalMeta", Fn: UnmarshalMeta}
var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.restjson.UnmarshalError", Fn: UnmarshalError}