func (e *ErrParamFormat) Format() string {
	return e.format
}
Format returns the field's required format.
package request
import (
	"bytes"
	"fmt"
	"github.com/aws/aws-sdk-go/aws/awserr"
)
const (
	InvalidParameterErrCode = "InvalidParameter"
	ParamRequiredErrCode = "ParamRequiredError"
	ParamMinValueErrCode = "ParamMinValueError"
	ParamMinLenErrCode = "ParamMinLenError"
	ParamMaxLenErrCode = "ParamMaxLenError"
	ParamFormatErrCode = "ParamFormatInvalidError"
)
type Validator interface {
	Validate() error
}
type ErrInvalidParams struct {
	Context string
	errs    []ErrInvalidParam
}
func (e *ErrInvalidParams) Add(err ErrInvalidParam) {
	err.SetContext(e.Context)
	e.errs = append(e.errs, err)
}
func (e *ErrInvalidParams) AddNested(nestedCtx string, nested ErrInvalidParams) {
	for _, err := range nested.errs {
		err.SetContext(e.Context)
		err.AddNestedContext(nestedCtx)
		e.errs = append(e.errs, err)
	}
}
func (e ErrInvalidParams) Len() int {
	return len(e.errs)
}
func (e ErrInvalidParams) Code() string {
	return InvalidParameterErrCode
}
func (e ErrInvalidParams) Message() string {
	return fmt.Sprintf("%d validation error(s) found.", len(e.errs))
}
func (e ErrInvalidParams) Error() string {
	w := &bytes.Buffer{}
	fmt.Fprintf(w, "%s: %s\n", e.Code(), e.Message())
	for _, err := range e.errs {
		fmt.Fprintf(w, "- %s\n", err.Message())
	}
	return w.String()
}
func (e ErrInvalidParams) OrigErr() error {
	return awserr.NewBatchError(
		InvalidParameterErrCode, e.Message(), e.OrigErrs())
}
func (e ErrInvalidParams) OrigErrs() []error {
	errs := make([]error, len(e.errs))
	for i := 0; i < len(errs); i++ {
		errs[i] = e.errs[i]
	}
	return errs
}
type ErrInvalidParam interface {
	awserr.Error
	Field() string
	SetContext(string)
	AddNestedContext(string)
}
type errInvalidParam struct {
	context       string
	nestedContext string
	field         string
	code          string
	msg           string
}
func (e *errInvalidParam) Code() string {
	return e.code
}
func (e *errInvalidParam) Message() string {
	return fmt.Sprintf("%s, %s.", e.msg, e.Field())
}
func (e *errInvalidParam) Error() string {
	return fmt.Sprintf("%s: %s", e.code, e.Message())
}
func (e *errInvalidParam) OrigErr() error {
	return nil
}
func (e *errInvalidParam) Field() string {
	field := e.context
	if len(field) > 0 {
		field += "."
	}
	if len(e.nestedContext) > 0 {
		field += fmt.Sprintf("%s.", e.nestedContext)
	}
	field += e.field
	return field
}
func (e *errInvalidParam) SetContext(ctx string) {
	e.context = ctx
}
func (e *errInvalidParam) AddNestedContext(ctx string) {
	if len(e.nestedContext) == 0 {
		e.nestedContext = ctx
	} else {
		e.nestedContext = fmt.Sprintf("%s.%s", ctx, e.nestedContext)
	}
}
type ErrParamRequired struct {
	errInvalidParam
}
func NewErrParamRequired(field string) *ErrParamRequired {
	return &ErrParamRequired{
		errInvalidParam{
			code:  ParamRequiredErrCode,
			field: field,
			msg:   fmt.Sprintf("missing required field"),
		},
	}
}
type ErrParamMinValue struct {
	errInvalidParam
	min float64
}
func NewErrParamMinValue(field string, min float64) *ErrParamMinValue {
	return &ErrParamMinValue{
		errInvalidParam: errInvalidParam{
			code:  ParamMinValueErrCode,
			field: field,
			msg:   fmt.Sprintf("minimum field value of %v", min),
		},
		min: min,
	}
}
func (e *ErrParamMinValue) MinValue() float64 {
	return e.min
}
type ErrParamMinLen struct {
	errInvalidParam
	min int
}
func NewErrParamMinLen(field string, min int) *ErrParamMinLen {
	return &ErrParamMinLen{
		errInvalidParam: errInvalidParam{
			code:  ParamMinLenErrCode,
			field: field,
			msg:   fmt.Sprintf("minimum field size of %v", min),
		},
		min: min,
	}
}
func (e *ErrParamMinLen) MinLen() int {
	return e.min
}
type ErrParamMaxLen struct {
	errInvalidParam
	max int
}
func NewErrParamMaxLen(field string, max int, value string) *ErrParamMaxLen {
	return &ErrParamMaxLen{
		errInvalidParam: errInvalidParam{
			code:  ParamMaxLenErrCode,
			field: field,
			msg:   fmt.Sprintf("maximum size of %v, %v", max, value),
		},
		max: max,
	}
}
func (e *ErrParamMaxLen) MaxLen() int {
	return e.max
}
type ErrParamFormat struct {
	errInvalidParam
	format string
}
func NewErrParamFormat(field string, format, value string) *ErrParamFormat {
	return &ErrParamFormat{
		errInvalidParam: errInvalidParam{
			code:  ParamFormatErrCode,
			field: field,
			msg:   fmt.Sprintf("format %v, %v", format, value),
		},
		format: format,
	}
}